26 lines
454 B
Arduino
26 lines
454 B
Arduino
|
#include "coppino.h"
|
||
|
|
||
|
namespace coppino {
|
||
|
ipv6::IPv6Addr address;
|
||
|
|
||
|
void handler() {
|
||
|
|
||
|
char buffer[LEN];
|
||
|
int r;
|
||
|
|
||
|
while ((r = slip::recv(buffer, LEN)) != -1) {
|
||
|
ipv6::IPv6Packet packet;
|
||
|
packet.deserialize(buffer, r);
|
||
|
packet.doAction();
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
void hexdump(const char* pointer, int len) {
|
||
|
for (int i = 0; i < len; ++i) {
|
||
|
Serial.print(pointer[i] & 0xff, HEX);
|
||
|
Serial.print('.');
|
||
|
}
|
||
|
}
|
||
|
}
|