Ready for review
CanReadMessage
The function CanReadMessage reads one message from the driver’s receive-buffer.
BOOL CanReadMessage( PCAN_MESSAGE_EXT msg);
BOOL DCanReadMessage(int devno, PCAN_MESSAGE_EXT msg);
Parameters
devno
Index of SJA1000-controller to use (starting with 0).
msg
typedef struct _CAN_MESSAGE_EXT {
int frametype; // STANDARD or EXTENDED
UINT id; // Message Identifier (11 or 29 Bit)
BOOL rtr; // True: Remote Frame (ignore length)
USHORT length; // Message length (0-7)
USHORT place; // Message place
ULONG time_stamp; // (0 if not supported)
ULONG ErrorStatus; // != 0 -> this is an error frame
UCHAR data[8]; // Message data
} CAN_MESSAGE_EXT, *PCAN_MESSAGE_EXT;
Return Values
If this function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. Additional error-information is availlable through CanGetLastError
Remarks
Requirements
OS Versions: Windows CE 4.2 and later.
Header: gfcan32ce.h, canlib.h
Link Library: singlecan.lib (one sja1000-controller), dualcan.lib (two or more sja1000-controller)