Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use uint32_t for CAN IDs #12 #13

Merged
merged 2 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions iso14229.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -231,8 +231,8 @@ static int LinuxSockBind(const char *if_name, uint16_t rxid, uint16_t txid) {
return fd;
}

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) {
static int LinuxSockTpOpen(UDSTpHandle_t *hdl, const char *if_name, uint32_t phys_rxid,
uint32_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;
Expand Down
24 changes: 12 additions & 12 deletions iso14229.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down