From 2a6696bd3d0837c2e655a99000bcbcc759b40075 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 21:31:01 +0200 Subject: Add validator send frame --- serial_link/protocol/frame_validator.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'serial_link/protocol') diff --git a/serial_link/protocol/frame_validator.c b/serial_link/protocol/frame_validator.c index d3337f6e3..fdb3ef51c 100644 --- a/serial_link/protocol/frame_validator.c +++ b/serial_link/protocol/frame_validator.c @@ -24,6 +24,7 @@ SOFTWARE. #include "protocol/frame_validator.h" #include "protocol/frame_router.h" +#include "protocol/byte_stuffer.h" const uint32_t poly8_lookup[256] = { @@ -110,3 +111,9 @@ void recv_frame(uint8_t* data, uint16_t size) { } } } + +void validator_send_frame(uint8_t* data, uint16_t size) { + uint32_t* crc = (uint32_t*)(data + size); + *crc = crc32_byte(data, size); + send_frame(data, size + 4); +} -- cgit v1.2.3-24-g4f1b