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

Implementations of function static int LinuxSockBind() and static int LinuxSockTpOpen() do not allow uint32_t rxid and txid #12

Closed
muehlke opened this issue Mar 9, 2023 · 4 comments

Comments

@muehlke
Copy link

muehlke commented Mar 9, 2023

Thanks for the library. I appreciate your effort into this report @driftregion .

While trying to use your library to send/receive CAN frames with a 29 bit CAN ID, I realized that they would be casted to a unit16_t and this would then, off course, be a wrong address. I realized that it is because of how you implemented static int LinuxSockBind(const char *if_name, uint16_t rxid, uint16_t txid) and 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). The rxid and txid just allow for 16 bit IDs even though the physical and functional send and receive IDs of UDSClientConfig_t are uint32_t.

My question is: Is there a special reason for it? CAN allows for the EFF (Extended Frame Format) flag to be set on the MSB of the 32 bit CAN ID to allow 29 bits for the CAN ID of the CAN frame. I then changed the function definition to static int LinuxSockBind(const char *if_name, uint32_t rxid, uint32_t txid) and 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) and it worked as needed. I was wondering if that is something that could be changed in the repo for future users or if the rxid and txid are uint16_t for a specific reason that I'm not able to deduce.

Thanks in advance and great job implementing the ISO14229 standard! It's been of great help.

@muehlke muehlke changed the title Implementation of function static int LinuxSockBind() does not allow uint32_t rxid and txid Implementations of function static int LinuxSockBind() and static int LinuxSockTpOpen() do not allow uint32_t rxid and txid Mar 9, 2023
driftregion added a commit that referenced this issue Mar 9, 2023
@driftregion
Copy link
Owner

Hi @muehlke , no special reason. Let's use uint32_t!

Does this work? #13

@muehlke
Copy link
Author

muehlke commented Mar 9, 2023

This is perfect! Thanks a lot! So fast! You can merge it then.

@muehlke muehlke closed this as completed Mar 9, 2023
@muehlke muehlke reopened this Mar 9, 2023
@muehlke
Copy link
Author

muehlke commented Mar 9, 2023

Sorry, I realized something is still missing in the commit 28a3b54. Please check the comments on the commit.

@muehlke
Copy link
Author

muehlke commented Mar 10, 2023

thanks for the last modification!

@muehlke muehlke closed this as completed Mar 10, 2023
driftregion added a commit that referenced this issue Mar 10, 2023
driftregion added a commit that referenced this issue Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants