From 28a3b546b2bb7bcce387e46a85adf4301c5bdbec Mon Sep 17 00:00:00 2001 From: Nick James Kirkby <20824939+driftregion@users.noreply.github.com> Date: Thu, 9 Mar 2023 18:23:43 +0800 Subject: [PATCH] use uint32_t for CAN IDs #12 --- iso14229.c | 4 ++-- iso14229.h | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/iso14229.c b/iso14229.c index 909ec65..06b4a95 100644 --- a/iso14229.c +++ b/iso14229.c @@ -195,7 +195,7 @@ static ssize_t tp_send(struct UDSTpHandle *hdl, const void *buf, size_t count, #endif #if UDS_TP == UDS_TP_LINUX_SOCKET -static int LinuxSockBind(const char *if_name, uint16_t rxid, uint16_t txid) { +static int LinuxSockBind(const char *if_name, uint32_t rxid, uint32_t txid) { int fd = 0; if ((fd = socket(AF_CAN, SOCK_DGRAM | SOCK_NONBLOCK, CAN_ISOTP)) < 0) { perror("Socket"); @@ -232,7 +232,7 @@ static int LinuxSockBind(const char *if_name, uint16_t rxid, uint16_t txid) { } static int LinuxSockTpOpen(UDSTpHandle_t *hdl, const char *if_name, uint16_t phys_rxid, - uint16_t phys_txid, uint16_t func_rxid, uint16_t func_txid) { + uint16_t phys_txid, uint32_t func_rxid, uint32_t func_txid) { assert(if_name); UDSTpLinuxIsoTp_t *impl = (UDSTpLinuxIsoTp_t *)hdl->impl; hdl->recv = tp_recv; diff --git a/iso14229.h b/iso14229.h index 8bac1cf..db403a0 100644 --- a/iso14229.h +++ b/iso14229.h @@ -335,14 +335,14 @@ typedef struct { #if UDS_TP == UDS_TP_CUSTOM UDSTpHandle_t *tp; #elif UDS_TP == UDS_TP_ISOTP_C - uint16_t phys_recv_id; - uint16_t phys_send_id; - uint16_t func_send_id; + uint32_t phys_recv_id; + uint32_t phys_send_id; + uint32_t func_send_id; #elif UDS_TP == UDS_TP_LINUX_SOCKET const char *if_name; - uint16_t phys_recv_id; - uint16_t phys_send_id; - uint16_t func_send_id; + uint32_t phys_recv_id; + uint32_t phys_send_id; + uint32_t func_send_id; #else #error "transport undefined" #endif @@ -651,14 +651,14 @@ typedef struct { #if UDS_TP == UDS_TP_CUSTOM UDSTpHandle_t *tp; #elif UDS_TP == UDS_TP_ISOTP_C - uint16_t phys_send_id; - uint16_t phys_recv_id; - uint16_t func_recv_id; + uint32_t phys_send_id; + uint32_t phys_recv_id; + uint32_t func_recv_id; #elif UDS_TP == UDS_TP_LINUX_SOCKET const char *if_name; - uint16_t phys_send_id; - uint16_t phys_recv_id; - uint16_t func_recv_id; + uint32_t phys_send_id; + uint32_t phys_recv_id; + uint32_t func_recv_id; #else #error "transport undefined" #endif