summaryrefslogtreecommitdiffstats
path: root/serial_link/protocol/frame_validator.c
diff options
context:
space:
mode:
Diffstat (limited to 'serial_link/protocol/frame_validator.c')
-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);
+}