SLIP-Receive-CRC
Receives SLIP packages with a CRC checksum over Serial.
- Boards:
- AVR, AVR USB, Nano Every, Nano 33, Due, Teensy 3.x, ESP8266, ESP32
- See also
- SLIP-Send-CRC.ino
Written by PieterP, 2020-02-06
https://github.com/tttapa/Arduino-KVComm
#include <boost/crc.hpp>
using CRC = boost::crc_optimal<16, 0x1021, 0xFFFF, 0, false, false>;
uint8_t slipbuffer[256];
Serial,
CRC(),
slipbuffer,
CRC(),
};
void setup() {
Serial.begin(115200);
}
void loop() {
if (packetSize > 0) {
Serial.print("Received packet: ");
Serial.write(slipbuffer, packetSize);
Serial.println();
: "Size: OK");
Serial.println(slip.
checksum() != 0 ?
"Checksum: Mismatch"
: "Checksum: OK");
Serial.println();
}
}