diff options
author | Fred Sundvik <fsundvik@gmail.com> | 2016-02-14 21:31:01 +0200 |
---|---|---|
committer | Fred Sundvik <fsundvik@gmail.com> | 2016-02-14 21:31:01 +0200 |
commit | 2a6696bd3d0837c2e655a99000bcbcc759b40075 (patch) | |
tree | c3e91dc448073e788b5f3559aa747ed01d3c29c1 /serial_link/protocol | |
parent | 62058329ff9000589ddba6454ff8ef8a551b7243 (diff) |
Add validator send frame
Diffstat (limited to 'serial_link/protocol')
-rw-r--r-- | serial_link/protocol/frame_validator.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/serial_link/protocol/frame_validator.c b/serial_link/protocol/frame_validator.c index d3337f6e32..fdb3ef51c3 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); +} |