summaryrefslogtreecommitdiff
path: root/serial_link/protocol
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2016-02-14 21:31:01 +0200
committerFred Sundvik <fsundvik@gmail.com>2016-02-14 21:31:01 +0200
commit2a6696bd3d0837c2e655a99000bcbcc759b40075 (patch)
treec3e91dc448073e788b5f3559aa747ed01d3c29c1 /serial_link/protocol
parent62058329ff9000589ddba6454ff8ef8a551b7243 (diff)
Add validator send frame
Diffstat (limited to 'serial_link/protocol')
-rw-r--r--serial_link/protocol/frame_validator.c7
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);
+}