vcan_msg_status¶
Here is the definition:
typedef enum
{ VCAN_OK=0,
VCAN_ACCESS_ERR = 1,/* access error, see errorcode ! */
VCAN_TM_OUT = 2,/* timeout occured */
VCAN_LOST = 4,/* some data was lost */
VCAN_OLD = 8,/* the data was already read (no new data
present) */
VCAN_INCONSISTENT= 16,/* indicates that (due to overload or a missing
object-owner) there may be inconsistent data) */
VCAN_TX_ERR = 32,/* transmission error, the transmission was
cancelled due to an error, this concerns
writing and remote-transfers (see also
errorcode) */
VCAN_Q_OVERFLOW = 64,/* queue overflow, (vcan_queue_read), the object
data is valid but there was an internal
queue overflow*/
VCAN_Q_IGNORE =128,/* the result of the function vcan_queue_readnow
has to be ignored, actually there was no CAN
event although the user process received a
signal. */
VCAN_WAIT =256 /* vcan_writetimed: user has still to wait before
data can be sent */
} vcan_msg_status;
This is the status that is returned when an action is performed on a
message. Only the vcan_message
- structure has a field of this type.
The status-flags can be combined, since they are powers of 2. Testing for a
single status-flag is done as follows:
/* be 'status' a variable with several status-flags */
/* test for 'VCAN_LOST' : */
if (status & VCAN_LOST)
printf("data was lost!!!\n");
/* test for 'VCAN_OLD': */
if (status & VCAN_OLD)
printf("only old data was read!\n");
Explanation of the status-flags:
- VCAN_OK
There was no error.
- VCAN_ACCESS_ERR
There was an error, the error-code can be found in the message’s error-variable.
- VCAN_TM_OUT
A timeout occured. Note that for ordinary reads (not remote-reads) a timeout is not viewed as an error and there is no additional error-flag set or error-code returned. functions
- VCAN_LOST
A message (data from the CAN bus) was lost.
- VCAN_OLD
The data has already been read before, so OLD data was returned.
- VCAN_INCONSISTENT
Inconsistent data was returned. The data consists of old and new data from the CAN bus that are mixed up.
- VCAN_TX_ERR
A transmission error was recognized. The transmission was not performed correctly. This error can also be signalled on remote-transfers when remote-read is used (since there is a sending of a remote frame involved).
- VCAN_Q_OVERFLOW
There was an overflow in the internal event-queue. Events on some event-objects were lost.
- VCAN_Q_IGNORE
The result of the function
vcan_queue_readnow
has to be ignored. The user-process received a signal although there was no CAN event. This can sometimes happen in conjunction with signal-event objects.- VCAN_WAIT
This status can only be returned when VCAN_WRITETIMED is used. In this case the specified inhibit-time has not yet been passed, the user program has to wait.