Error codes in linux driver
Posted: Thu 19. May 2016, 09:11
Hello,
I have a question regarding the error handling in the peak-linux-driver with char devices:
The pcan-API defines certain error codes of length 2 bytes. However, the user manual states that:
"Depending on the kind of error detailed CAN_ERR_... information is
set in the DATA[3] field of the same structure."
Since DATA is an array of type BYTE this structure can however never reach the higher error codes. So if I would just be checking for the DATA[3] byte, I'd get a CAN_ERR_OK if there were a CAN_ERR_RESOURCE for example.
Is there a second byte assigned to the error codes or are those higher-level error codes not reachable in the linux driver?
I have a question regarding the error handling in the peak-linux-driver with char devices:
The pcan-API defines certain error codes of length 2 bytes. However, the user manual states that:
"Depending on the kind of error detailed CAN_ERR_... information is
set in the DATA[3] field of the same structure."
Since DATA is an array of type BYTE this structure can however never reach the higher error codes. So if I would just be checking for the DATA[3] byte, I'd get a CAN_ERR_OK if there were a CAN_ERR_RESOURCE for example.
Is there a second byte assigned to the error codes or are those higher-level error codes not reachable in the linux driver?