CAN – Ethernet Gateway
74 © SYS TEC electronic GmbH 2007 L-1032e_9
(RTR frames) in Standard or Extended-CAN frame format. The CAN
message’s message format corresponds to a bit combination that is
defined as follows:
//Standard CAN-Frame
#define ETHCAN_MSGTYPE_STANDARD 0x00
//Remote Frame (11 Bit and 29 Bit CAN-ID)
#define ETHCAN_MSGTYPE_RTR 0x01
//Extended CAN Frame 2.0 B Frame (29 Bit CAN-ID)
#define ETHCAN_MSGTYPE_EXTENDED 0x02
For a RTR frame in extended format, the values have to be combined
accordingly and entered as a message format into the CAN message
structure.
pRcvTime_p: Address to a Timestamp structure of a CAN
message. This address must not be NULL
The Timestamp structure is defined as follows:
typedef struct
{
DWORD m_dwMilliSec; //Milliseconds
WORD m_wMilliSec_Overflow; //Milliseconds-overflow
WORD m_wMicroSec; //Microseconds
}tCANTimestamp;
Figure 18: The CAN timestamp structure
The member variable m_dwMilliSec contains the number of
milliseconds that have passed since the system start of the CAN-
Ethernet Gateway hardware. The time between two CAN messages is
determined by the difference between the two values.
Note:
The Member variables m_wMilliSec_Overflow and m_wMicroSec of
the Timestamp structure are not used at this time and always contain
the value 0.