coppino/coppino-main.ino

35 lines
847 B
Arduino
Raw Normal View History

2019-12-23 13:13:13 +00:00
#include "coppino.h"
#include "ipv6.h"
#include "slip.h"
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600);
memcpy(&coppino::address, "\x20\x01\x04\x70\xc8\x44\x00\x31\x00\x00\x00\x00\x00\x00\xca\xfe", 16);
2019-12-23 13:13:13 +00:00
}
void loop() {
/* some UDP stuff, just to test */
char udp_packet[64];
memcpy(udp_packet, "\x00\x00\x77\x77\x00\x12\x00\x00helloworld", 18);
ipv6::IPv6Packet ip_packet;
ip_packet.setPayload(udp_packet, 18);
ip_packet.setSrcAddress(coppino::address);
// ipv6::IPv6Addr dst_addr("\x20\x01\x04\x70\xc8\x44\x00\x30\x53\x47\xde\x2d\x41\xb1\x5b\x8c");
ipv6::IPv6Addr dst_addr("\x20\x01\x04\x70\xc8\x44\x00\x31\x00\x00\x00\x00\x00\x00\x00\x01");
ip_packet.setDstAddress(dst_addr);
ip_packet.setNextHeader(17); // UDP
// slip::send(&ip_packet, 18 + 40); // ??
2019-12-23 13:13:13 +00:00
coppino::handler();
//delay(5000);
}