Browse Source

repository structured as an arduino library

coap
giomba 3 years ago
parent
commit
cd37805f70
  1. 0
      examples/simple-udp-server/simple-udp-server.ino
  2. 9
      library.properties
  3. 0
      src/coppino.cpp
  4. 2
      src/coppino.h
  5. 0
      src/ipv6.cpp
  6. 3
      src/ipv6.h
  7. 6
      src/slip.cpp
  8. 2
      src/slip.h
  9. 0
      src/udp.cpp
  10. 5
      src/udp.h

0
coppino-main.ino → examples/simple-udp-server/simple-udp-server.ino

9
library.properties

@ -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=*

0
coppino.ino → src/coppino.cpp

2
coppino.h → src/coppino.h

@ -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;

0
ipv6.ino → src/ipv6.cpp

3
ipv6.h → src/ipv6.h

@ -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;

6
slip.ino → src/slip.cpp

@ -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;
}

2
slip.h → src/slip.h

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

0
udp.ino → src/udp.cpp

5
udp.h → src/udp.h

@ -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
Loading…
Cancel
Save