From ad7304de0c8c1ea0f54b9103b137b29c052830e4 Mon Sep 17 00:00:00 2001 From: mikisama Date: Mon, 23 Mar 2020 14:22:44 +0800 Subject: [PATCH 1/2] fix typos: *TSOTP* is now *ISOTP* --- isotp.c | 4 ++-- isotp_defines.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/isotp.c b/isotp.c index 6b5b825..2c621da 100644 --- a/isotp.c +++ b/isotp.c @@ -117,7 +117,7 @@ static int isotp_send_consecutive_frame(IsoTpLink* link) { assert(link->send_size > 7); /* setup message */ - message.as.consecutive_frame.type = TSOTP_PCI_TYPE_CONSECUTIVE_FRAME; + message.as.consecutive_frame.type = ISOTP_PCI_TYPE_CONSECUTIVE_FRAME; message.as.consecutive_frame.SN = link->send_sn; data_length = link->send_size - link->send_offset; if (data_length > sizeof(message.as.consecutive_frame.data)) { @@ -348,7 +348,7 @@ void isotp_on_can_message(IsoTpLink *link, uint8_t *data, uint8_t len) { break; } - case TSOTP_PCI_TYPE_CONSECUTIVE_FRAME: { + case ISOTP_PCI_TYPE_CONSECUTIVE_FRAME: { /* check if in receiving status */ if (ISOTP_RECEIVE_STATUS_INPROGRESS != link->receive_status) { link->receive_protocol_result = ISOTP_PROTOCOL_RESULT_UNEXP_PDU; diff --git a/isotp_defines.h b/isotp_defines.h index d8217ad..161e994 100644 --- a/isotp_defines.h +++ b/isotp_defines.h @@ -196,7 +196,7 @@ typedef struct { typedef enum { ISOTP_PCI_TYPE_SINGLE = 0x0, ISOTP_PCI_TYPE_FIRST_FRAME = 0x1, - TSOTP_PCI_TYPE_CONSECUTIVE_FRAME = 0x2, + ISOTP_PCI_TYPE_CONSECUTIVE_FRAME = 0x2, ISOTP_PCI_TYPE_FLOW_CONTROL_FRAME = 0x3 } IsoTpProtocolControlInformation; From a4db7098c5a1d2b1c419f5d54576e0d9742bae7e Mon Sep 17 00:00:00 2001 From: mikisama Date: Thu, 2 Apr 2020 19:36:12 +0800 Subject: [PATCH 2/2] uint8_t is 1 byte, it's no need swap. there is no such function named *_byteswap_uint8* --- isotp_defines.h | 1 - 1 file changed, 1 deletion(-) diff --git a/isotp_defines.h b/isotp_defines.h index 161e994..59918ef 100644 --- a/isotp_defines.h +++ b/isotp_defines.h @@ -22,7 +22,6 @@ #ifdef _WIN32 #define ISOTP_BYTE_ORDER_LITTLE_ENDIAN -#define __builtin_bswap8 _byteswap_uint8 #define __builtin_bswap16 _byteswap_uint16 #define __builtin_bswap32 _byteswap_uint32 #define __builtin_bswap64 _byteswap_uint64