repository structured as an arduino library

This commit is contained in:
giomba 2019-12-31 10:42:25 +01:00
parent ac955647cf
commit cd37805f70
10 changed files with 24 additions and 3 deletions

9
library.properties Normal file
View File

@ -0,0 +1,9 @@
name=Coppino
version=2019.12
author=Giovan Battista Rolandi
maintainer=Giovan Battista Rolandi <giomba@glgprograms.it>
sentence=A simple minimalistic IPv6 stack to connect Arduino to the Internet via serial port.
paragraph=This library allows an Arduino board to act as an IPv6 host connected to the serial port. A global address can be used, allowing Arduino to act as an IoT server. IPv6 auto-configuration is supported, basic ICMP and UDP server.
category=Communication
url=https://git.golem.linux.it/giomba/coppino
architectures=*

View File

@ -1,7 +1,9 @@
#ifndef COPPINO_H
#define COPPINO_H
#include "Arduino.h"
#include "ipv6.h"
#include "slip.h"
namespace coppino {
const uint8_t LEN = 128;

View File

@ -1,6 +1,9 @@
#ifndef COPPINO_IPV6_H
#define COPPINO_IPV6_H
#include "Arduino.h"
#include "slip.h"
namespace ipv6 {
/* maximum length for an IPv6 packet */
const uint8_t LEN = 128;

View File

@ -1,7 +1,9 @@
#include "slip.h"
namespace slip {
void send(const char* buffer, int len) {
// Serial.write(END); /* frame-out any possible noise on the line */
// Serial.write(END); // frame-out any possible noise on the line
for (int i = 0; i < len; ++i) {
switch (buffer[i]) {
@ -49,7 +51,7 @@ namespace slip {
}
}
}
return i;
}

View File

@ -1,6 +1,8 @@
#ifndef COPPINO_SLIP_H
#define COPPINO_SLIP_H
#include "Arduino.h"
namespace slip {
const char END = 0xc0;

View File

@ -1,6 +1,9 @@
#ifndef COPPINO_UDP_H
#define COPPINO_UDP_H
#include "Arduino.h"
#include "ipv6.h"
namespace udp {
class UDPPacket {
private:
@ -22,6 +25,6 @@ namespace udp {
extern int(*server_handler) (char* output_buffer, const char* buffer, int size);
extern uint16_t server_port;
void set_handler(uint16_t port, int(* handler) (char* output_buffer, const char* input_buffer, int size));
}
}
#endif