diff --git a/include/hydrolink/hydrolink_msg_ack.h b/include/hydrolink/hydrolink_msg_ack.h index 88f53a2..88e7ad1 100644 --- a/include/hydrolink/hydrolink_msg_ack.h +++ b/include/hydrolink/hydrolink_msg_ack.h @@ -13,7 +13,7 @@ static inline void hydrolink_msg_ack_encode(uint8_t src_id, uint8_t dst_id, cons uint16_t crc; crc_xmodem_init(&crc); packet->id = HYDROLINK_MSG_ID_ACK; - packet->payload_length = HYDROLINK_MSG_1_LEN + HYDROLINK_NON_PAYLOAD_LEN; + packet->payload_length = HYDROLINK_MSG_ACK_LEN + HYDROLINK_NON_PAYLOAD_LEN; crc_xmodem_accumulate(packet->payload_length, &crc); crc_xmodem_accumulate(packet->id, &crc); packet->dst_id = dst_id; @@ -24,7 +24,7 @@ static inline void hydrolink_msg_ack_encode(uint8_t src_id, uint8_t dst_id, cons for(int i = 0; i < packet->payload_length; ++i) { crc_xmodem_accumulate(packet->payload[i], &crc); } - crc_xmodem_acumulate(HYDROLINK_MSG_ACK_CRC_EXTRA, &crc); + crc_xmodem_accumulate(HYDROLINK_MSG_ACK_CRC_EXTRA, &crc); packet->crc = crc; } diff --git a/include/hydrolink/hydrolink_msg_get_cmd.h b/include/hydrolink/hydrolink_msg_get_cmd.h index f60f112..c0937c4 100644 --- a/include/hydrolink/hydrolink_msg_get_cmd.h +++ b/include/hydrolink/hydrolink_msg_get_cmd.h @@ -14,7 +14,7 @@ static inline void hydrolink_msg_get_cmd_encode(uint8_t src_id, uint8_t dst_id, uint16_t crc; crc_xmodem_init(&crc); packet->id = HYDROLINK_MSG_ID_GET_CMD; - packet->payload_length = HYDROLINK_MSG_4_LEN + HYDROLINK_NON_PAYLOAD_LEN; + packet->payload_length = HYDROLINK_MSG_GET_CMD_LEN + HYDROLINK_NON_PAYLOAD_LEN; crc_xmodem_accumulate(packet->payload_length, &crc); crc_xmodem_accumulate(packet->id, &crc); packet->dst_id = dst_id; @@ -26,7 +26,7 @@ static inline void hydrolink_msg_get_cmd_encode(uint8_t src_id, uint8_t dst_id, for(int i = 0; i < packet->payload_length; ++i) { crc_xmodem_accumulate(packet->payload[i], &crc); } - crc_xmodem_acumulate(HYDROLINK_MSG_GET_CMD_CRC_EXTRA, &crc); + crc_xmodem_accumulate(HYDROLINK_MSG_GET_CMD_CRC_EXTRA, &crc); packet->crc = crc; } diff --git a/include/hydrolink/hydrolink_msg_get_response.h b/include/hydrolink/hydrolink_msg_get_response.h index 43505a4..7dfa4df 100644 --- a/include/hydrolink/hydrolink_msg_get_response.h +++ b/include/hydrolink/hydrolink_msg_get_response.h @@ -15,7 +15,7 @@ static inline void hydrolink_msg_get_response_encode(uint8_t src_id, uint8_t dst uint16_t crc; crc_xmodem_init(&crc); packet->id = HYDROLINK_MSG_ID_GET_RESPONSE; - packet->payload_length = HYDROLINK_MSG_5_LEN + HYDROLINK_NON_PAYLOAD_LEN; + packet->payload_length = HYDROLINK_MSG_GET_RESPONSE_LEN + HYDROLINK_NON_PAYLOAD_LEN; crc_xmodem_accumulate(packet->payload_length, &crc); crc_xmodem_accumulate(packet->id, &crc); packet->dst_id = dst_id; @@ -28,7 +28,7 @@ static inline void hydrolink_msg_get_response_encode(uint8_t src_id, uint8_t dst for(int i = 0; i < packet->payload_length; ++i) { crc_xmodem_accumulate(packet->payload[i], &crc); } - crc_xmodem_acumulate(HYDROLINK_MSG_GET_RESPONSE_CRC_EXTRA, &crc); + crc_xmodem_accumulate(HYDROLINK_MSG_GET_RESPONSE_CRC_EXTRA, &crc); packet->crc = crc; } diff --git a/include/hydrolink/hydrolink_msg_set_cmd.h b/include/hydrolink/hydrolink_msg_set_cmd.h index add39ea..1298f7c 100644 --- a/include/hydrolink/hydrolink_msg_set_cmd.h +++ b/include/hydrolink/hydrolink_msg_set_cmd.h @@ -15,7 +15,7 @@ static inline void hydrolink_msg_set_cmd_encode(uint8_t src_id, uint8_t dst_id, uint16_t crc; crc_xmodem_init(&crc); packet->id = HYDROLINK_MSG_ID_SET_CMD; - packet->payload_length = HYDROLINK_MSG_2_LEN + HYDROLINK_NON_PAYLOAD_LEN; + packet->payload_length = HYDROLINK_MSG_SET_CMD_LEN + HYDROLINK_NON_PAYLOAD_LEN; crc_xmodem_accumulate(packet->payload_length, &crc); crc_xmodem_accumulate(packet->id, &crc); packet->dst_id = dst_id; @@ -28,7 +28,7 @@ static inline void hydrolink_msg_set_cmd_encode(uint8_t src_id, uint8_t dst_id, for(int i = 0; i < packet->payload_length; ++i) { crc_xmodem_accumulate(packet->payload[i], &crc); } - crc_xmodem_acumulate(HYDROLINK_MSG_SET_CMD_CRC_EXTRA, &crc); + crc_xmodem_accumulate(HYDROLINK_MSG_SET_CMD_CRC_EXTRA, &crc); packet->crc = crc; } diff --git a/include/hydrolink/hydrolink_msg_set_response.h b/include/hydrolink/hydrolink_msg_set_response.h index 0fa8f09..fb36594 100644 --- a/include/hydrolink/hydrolink_msg_set_response.h +++ b/include/hydrolink/hydrolink_msg_set_response.h @@ -14,7 +14,7 @@ static inline void hydrolink_msg_set_response_encode(uint8_t src_id, uint8_t dst uint16_t crc; crc_xmodem_init(&crc); packet->id = HYDROLINK_MSG_ID_SET_RESPONSE; - packet->payload_length = HYDROLINK_MSG_3_LEN + HYDROLINK_NON_PAYLOAD_LEN; + packet->payload_length = HYDROLINK_MSG_SET_RESPONSE_LEN + HYDROLINK_NON_PAYLOAD_LEN; crc_xmodem_accumulate(packet->payload_length, &crc); crc_xmodem_accumulate(packet->id, &crc); packet->dst_id = dst_id; @@ -26,7 +26,7 @@ static inline void hydrolink_msg_set_response_encode(uint8_t src_id, uint8_t dst for(int i = 0; i < packet->payload_length; ++i) { crc_xmodem_accumulate(packet->payload[i], &crc); } - crc_xmodem_acumulate(HYDROLINK_MSG_SET_RESPONSE_CRC_EXTRA, &crc); + crc_xmodem_accumulate(HYDROLINK_MSG_SET_RESPONSE_CRC_EXTRA, &crc); packet->crc = crc; }