summaryrefslogtreecommitdiffstats
path: root/serial_link/protocol
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2016-02-14 21:33:14 +0200
committerFred Sundvik <fsundvik@gmail.com>2016-02-14 21:33:14 +0200
commit0eb62c4ce61e19cf7629bb74cf01d812c042ac57 (patch)
treeea73cd1a3816876f923fdfcd27120217c9061243 /serial_link/protocol
parent2a6696bd3d0837c2e655a99000bcbcc759b40075 (diff)
Rename recv_frame to validator_recv_frame
Diffstat (limited to 'serial_link/protocol')
-rw-r--r--serial_link/protocol/byte_stuffer.c2
-rw-r--r--serial_link/protocol/frame_validator.c2
-rw-r--r--serial_link/protocol/frame_validator.h4
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);