From 5f39f42098a467c63c061b2da40960264ca1756b Mon Sep 17 00:00:00 2001 From: Thies Lennart Alff Date: Tue, 25 Feb 2025 13:47:57 +0100 Subject: [PATCH] fixed wrong payload length --- include/hydrolink/hydrolink_msg_ack.h | 2 +- include/hydrolink/hydrolink_msg_get_cmd.h | 2 +- include/hydrolink/hydrolink_msg_get_response.h | 2 +- include/hydrolink/hydrolink_msg_set_cmd.h | 2 +- include/hydrolink/hydrolink_msg_set_response.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/hydrolink/hydrolink_msg_ack.h b/include/hydrolink/hydrolink_msg_ack.h index fe29a33..bc9d483 100644 --- a/include/hydrolink/hydrolink_msg_ack.h +++ b/include/hydrolink/hydrolink_msg_ack.h @@ -14,7 +14,7 @@ static inline void hydrolink_msg_ack_encode(uint8_t src_id, uint8_t dst_id, cons crc_xmodem_init(&crc); packet->id = HYDROLINK_MSG_ID_ACK; crc_xmodem_accumulate(packet->id, &crc); - packet->payload_length = HYDROLINK_MSG_ACK_LEN + HYDROLINK_NON_PAYLOAD_LEN; + packet->payload_length = HYDROLINK_MSG_ACK_LEN; crc_xmodem_accumulate(packet->payload_length, &crc); packet->dst_id = dst_id; crc_xmodem_accumulate(packet->dst_id, &crc); diff --git a/include/hydrolink/hydrolink_msg_get_cmd.h b/include/hydrolink/hydrolink_msg_get_cmd.h index 0fbfb1e..f888fc9 100644 --- a/include/hydrolink/hydrolink_msg_get_cmd.h +++ b/include/hydrolink/hydrolink_msg_get_cmd.h @@ -15,7 +15,7 @@ static inline void hydrolink_msg_get_cmd_encode(uint8_t src_id, uint8_t dst_id, crc_xmodem_init(&crc); packet->id = HYDROLINK_MSG_ID_GET_CMD; crc_xmodem_accumulate(packet->id, &crc); - packet->payload_length = HYDROLINK_MSG_GET_CMD_LEN + HYDROLINK_NON_PAYLOAD_LEN; + packet->payload_length = HYDROLINK_MSG_GET_CMD_LEN; crc_xmodem_accumulate(packet->payload_length, &crc); packet->dst_id = dst_id; crc_xmodem_accumulate(packet->dst_id, &crc); diff --git a/include/hydrolink/hydrolink_msg_get_response.h b/include/hydrolink/hydrolink_msg_get_response.h index 8e90a1c..8520e86 100644 --- a/include/hydrolink/hydrolink_msg_get_response.h +++ b/include/hydrolink/hydrolink_msg_get_response.h @@ -16,7 +16,7 @@ static inline void hydrolink_msg_get_response_encode(uint8_t src_id, uint8_t dst crc_xmodem_init(&crc); packet->id = HYDROLINK_MSG_ID_GET_RESPONSE; crc_xmodem_accumulate(packet->id, &crc); - packet->payload_length = HYDROLINK_MSG_GET_RESPONSE_LEN + HYDROLINK_NON_PAYLOAD_LEN; + packet->payload_length = HYDROLINK_MSG_GET_RESPONSE_LEN; crc_xmodem_accumulate(packet->payload_length, &crc); packet->dst_id = dst_id; crc_xmodem_accumulate(packet->dst_id, &crc); diff --git a/include/hydrolink/hydrolink_msg_set_cmd.h b/include/hydrolink/hydrolink_msg_set_cmd.h index 9b81280..5fe74e3 100644 --- a/include/hydrolink/hydrolink_msg_set_cmd.h +++ b/include/hydrolink/hydrolink_msg_set_cmd.h @@ -16,7 +16,7 @@ static inline void hydrolink_msg_set_cmd_encode(uint8_t src_id, uint8_t dst_id, crc_xmodem_init(&crc); packet->id = HYDROLINK_MSG_ID_SET_CMD; crc_xmodem_accumulate(packet->id, &crc); - packet->payload_length = HYDROLINK_MSG_SET_CMD_LEN + HYDROLINK_NON_PAYLOAD_LEN; + packet->payload_length = HYDROLINK_MSG_SET_CMD_LEN; crc_xmodem_accumulate(packet->payload_length, &crc); packet->dst_id = dst_id; crc_xmodem_accumulate(packet->dst_id, &crc); diff --git a/include/hydrolink/hydrolink_msg_set_response.h b/include/hydrolink/hydrolink_msg_set_response.h index 5dd22f5..3015f21 100644 --- a/include/hydrolink/hydrolink_msg_set_response.h +++ b/include/hydrolink/hydrolink_msg_set_response.h @@ -15,7 +15,7 @@ static inline void hydrolink_msg_set_response_encode(uint8_t src_id, uint8_t dst crc_xmodem_init(&crc); packet->id = HYDROLINK_MSG_ID_SET_RESPONSE; crc_xmodem_accumulate(packet->id, &crc); - packet->payload_length = HYDROLINK_MSG_SET_RESPONSE_LEN + HYDROLINK_NON_PAYLOAD_LEN; + packet->payload_length = HYDROLINK_MSG_SET_RESPONSE_LEN; crc_xmodem_accumulate(packet->payload_length, &crc); packet->dst_id = dst_id; crc_xmodem_accumulate(packet->dst_id, &crc);