summaryrefslogtreecommitdiff
path: root/serial_link/protocol/frame_validator.c
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2016-02-20 12:06:23 +0200
committerFred Sundvik <fsundvik@gmail.com>2016-02-20 12:06:23 +0200
commit5a1600e24f2ca0cf8e9d75e23691bc1971657934 (patch)
treec80ed5168cfc3bbe0abb56285a1d562ebe3f6c3c /serial_link/protocol/frame_validator.c
parent419908e5ef15481bd22dcd4173a25562f6153a5a (diff)
Add link parameter
Diffstat (limited to 'serial_link/protocol/frame_validator.c')
-rw-r--r--serial_link/protocol/frame_validator.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/serial_link/protocol/frame_validator.c b/serial_link/protocol/frame_validator.c
index f326097ffa..80e662b2e8 100644
--- a/serial_link/protocol/frame_validator.c
+++ b/serial_link/protocol/frame_validator.c
@@ -102,19 +102,19 @@ static uint32_t crc32_byte(uint8_t *p, uint32_t bytelength)
return (crc ^ 0xffffffff);
}
-void validator_recv_frame(uint8_t* data, uint16_t size) {
+void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size) {
if (size > 4) {
uint32_t frame_crc;
memcpy(&frame_crc, data + size -4, 4);
uint32_t expected_crc = crc32_byte(data, size - 4);
if (frame_crc == expected_crc) {
- route_incoming_frame(data, size-4);
+ route_incoming_frame(link, data, size-4);
}
}
}
-void validator_send_frame(uint8_t* data, uint16_t size) {
+void validator_send_frame(uint8_t link, uint8_t* data, uint16_t size) {
uint32_t crc = crc32_byte(data, size);
memcpy(data + size, &crc, 4);
- send_frame(data, size + 4);
+ send_frame(link, data, size + 4);
}