diff options
author | Fred Sundvik <fsundvik@gmail.com> | 2016-02-14 21:33:14 +0200 |
---|---|---|
committer | Fred Sundvik <fsundvik@gmail.com> | 2016-02-14 21:33:14 +0200 |
commit | 0eb62c4ce61e19cf7629bb74cf01d812c042ac57 (patch) | |
tree | ea73cd1a3816876f923fdfcd27120217c9061243 /serial_link/protocol | |
parent | 2a6696bd3d0837c2e655a99000bcbcc759b40075 (diff) |
Rename recv_frame to validator_recv_frame
Diffstat (limited to 'serial_link/protocol')
-rw-r--r-- | serial_link/protocol/byte_stuffer.c | 2 | ||||
-rw-r--r-- | serial_link/protocol/frame_validator.c | 2 | ||||
-rw-r--r-- | serial_link/protocol/frame_validator.h | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c index 69cfca3594..f9aa02a3f5 100644 --- a/serial_link/protocol/byte_stuffer.c +++ b/serial_link/protocol/byte_stuffer.c @@ -60,7 +60,7 @@ void recv_byte(byte_stuffer_state_t* state, uint8_t data) { if (state->next_zero == 0) { // The frame is completed if (state->data_pos > 0) { - recv_frame(state->data, state->data_pos); + validator_recv_frame(state->data, state->data_pos); } } else { diff --git a/serial_link/protocol/frame_validator.c b/serial_link/protocol/frame_validator.c index fdb3ef51c3..0ffcda0473 100644 --- a/serial_link/protocol/frame_validator.c +++ b/serial_link/protocol/frame_validator.c @@ -102,7 +102,7 @@ static uint32_t crc32_byte(uint8_t *p, uint32_t bytelength) return (crc ^ 0xffffffff); } -void recv_frame(uint8_t* data, uint16_t size) { +void validator_recv_frame(uint8_t* data, uint16_t size) { if (size > 4) { uint32_t frame_crc = *(uint32_t*)(data + size - 4); uint32_t expected_crc = crc32_byte(data, size - 4); diff --git a/serial_link/protocol/frame_validator.h b/serial_link/protocol/frame_validator.h index ee1f9a78ae..2e518894fb 100644 --- a/serial_link/protocol/frame_validator.h +++ b/serial_link/protocol/frame_validator.h @@ -22,4 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void recv_frame(uint8_t* data, uint16_t size); +void validator_recv_frame(uint8_t* data, uint16_t size); +// The buffer pointed to by the data needs 4 additional bytes +void validator_send_frame(uint8_t* data, uint16_t size); |