Skip to content

Commit

Permalink
use uint32_t for CAN IDs #12
Browse files Browse the repository at this point in the history
  • Loading branch information
driftregion committed Mar 11, 2023
1 parent 42b54f8 commit ee130e8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions iso14229.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ static ssize_t tp_send(UDSTpHandle_t *hdl, const void *buf, size_t count, UDSTpA
}
#endif

#if UDS_TP == UDS_TP_ISOTP_SOCKET
static int LinuxSockBind(const char *if_name, uint16_t rxid, uint16_t txid) {
#if UDS_TP == UDS_TP_LINUX_SOCKET
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");
Expand Down Expand Up @@ -255,7 +255,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;
hdl->recv = tp_recv;
Expand Down
28 changes: 14 additions & 14 deletions iso14229.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,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;
#elif UDS_TP == UDS_TP_ISOTP_SOCKET
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
Expand Down Expand Up @@ -598,14 +598,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;
#elif UDS_TP == UDS_TP_ISOTP_SOCKET
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
Expand Down

0 comments on commit ee130e8

Please sign in to comment.