coppino/coppino-main.ino

26 lines
571 B
Arduino
Raw Normal View History

2019-12-23 13:13:13 +00:00
#include "coppino.h"
#include "ipv6.h"
#include "slip.h"
2019-12-24 15:54:16 +00:00
#include "udp.h"
int udp_server(char* output_buffer, const char* input_buffer, int len) {
const char msg[] = "HELLO-WORLD-UDP\n";
2019-12-24 15:54:16 +00:00
digitalWrite(13, !digitalRead(13));
memcpy(output_buffer, msg, strlen(msg));
return strlen(msg);
2019-12-24 15:54:16 +00:00
}
2019-12-23 13:13:13 +00:00
void setup() {
pinMode(13, OUTPUT);
Serial.begin(19200);
memcpy(&coppino::address, "\x20\x01\x04\x70\xc8\x44\x00\x31\x00\x00\x00\x00\x00\x00\xca\xfe", 16);
2019-12-24 15:54:16 +00:00
udp::set_handler(80, udp_server);
2019-12-23 13:13:13 +00:00
}
void loop() {
/* network service routing */
2019-12-23 13:13:13 +00:00
coppino::handler();
}