ADTF Device Toolbox SDK
Loading...
Searching...
No Matches
flexray_frame.h
Go to the documentation of this file.
1
16
17#pragma once
18
19#include "flexray_types.h"
20
24namespace adtf
25{
26
30namespace devicetb
31{
32
36namespace sdk
37{
38
42namespace flexray
43{
44
48namespace axle
49{
50
51#pragma pack(push, 1)
52#ifdef WIN32
53 #pragma warning(disable : 4200)
54#endif
55
60{
72
84
92
109
121
125 struct tSync
126 {
127 };
128
129 /*---- Structure member definition start ----*/
130 uint16_t nSize;
132 uint8_t nReserved;
133 int64_t nTimeStamp;
134
135 enum { HEADER_SIZE = sizeof(uint16_t) + sizeof(uint32_t) + sizeof(uint8_t) + sizeof(int64_t) };
136
137 union
138 {
139 tCycleStart sCycleStart; //<! ...
140 tFrame sFrame; //<! ...
141 tPDU sPDU; //<! ...
142 tSync sSync; //<! ...
143 };
144
145 /*---- Structure member definition end ----*/
146
154 static uint16_t GetStructureSize(tFR_TAG nTag, uint8_t nPayloadLength=0)
155 {
156 if (nTag == FR_TAG_CYCLESTART) { return HEADER_SIZE + sizeof(tCycleStart); }
157 else if (nTag == FR_TAG_FRAME) { return HEADER_SIZE + sizeof(tFrame) + nPayloadLength*sizeof(uint16_t); }
158 else if (nTag == FR_TAG_PDU) { return HEADER_SIZE + sizeof(tPDU) + nPayloadLength; }
159 else if (nTag == FR_TAG_SYNC) { return HEADER_SIZE + sizeof(tSync); }
160 else { return 0; }
161 }
162};
163
164#ifdef WIN32
165 #pragma warning(default : 4200)
166#endif
167#pragma pack(pop)
168
169} //namespace axle
171} //namespace flexray
172} //namespace sdk
173} // namespace devicetb
174} // namespace adtf
Namespace for functionality provided by V3.0.0.
Definition flexray_coder_intf.h:40
uint32_t tPDUID
FlexRay PDU (Protocol Data Unit) ID.
Definition flexray_types.h:98
uint8_t tChannelID
Definition flexray_types.h:94
uint16_t tSlotID
FlexRay slot ID (1..2047)
Definition flexray_types.h:96
uint8_t tCycleID
FlexRay cycle ID (0..63)
Definition flexray_types.h:95
uint32_t tECUID
FlexRay ECU (Electronic Communication Unit) ID.
Definition flexray_types.h:99
Namespace for FlexRay in ADTF-Devicetoolbox.
Definition flexray_coder_intf.h:34
axle::tFlexRayData tFlexRayData
Definition flexray_frame.h:170
Namespace for SDK of ADTF-Devicetoolbox.
Definition bus_database_intf.h:42
Devicetoolbox - Namespace.
Definition bus_database_intf.h:36
ADTF - Namespace.
Definition bus_database_intf.h:30
tCycleID nCycleCount
Cycle count 0..63.
Definition flexray_frame.h:90
uint8_t nFlags
Definition flexray_frame.h:98
uint8_t nPayloadLength
0..127 words == 0..254 bytes
Definition flexray_frame.h:106
uint8_t aData[0]
Start of variable sized payload.
Definition flexray_frame.h:107
tSlotID nSlot
Slot 1..2047.
Definition flexray_frame.h:104
tCycleID nCycleCount
Cycle count 0..63.
Definition flexray_frame.h:105
tChannelID nChannel
Definition flexray_frame.h:103
tECUID nECUID
Index of ECU.
Definition flexray_frame.h:117
uint8_t aData[0]
Start of variable sized payload.
Definition flexray_frame.h:119
tPDUID nPDUID
Index of PDU.
Definition flexray_frame.h:115
tChannelID nChannel
See defintion of values FR_FLAG_xxx.
Definition flexray_frame.h:116
uint8_t nPayloadLength
0..254 bytes
Definition flexray_frame.h:118
@ FR_FLAG_NFI
Null-Frame-Indicator.
Definition flexray_frame.h:80
@ FR_FLAG_STARTUP
Startup-Frame.
Definition flexray_frame.h:78
@ FR_FLAG_RESERVED
Reserved bit.
Definition flexray_frame.h:82
@ FR_FLAG_PAYLOADPREAMBLE
Payload Preamble.
Definition flexray_frame.h:81
@ FR_FLAG_SYNC
Sync-Frame.
Definition flexray_frame.h:79
uint16_t nSize
Total size in bytes of this structure.
Definition flexray_frame.h:130
tFR_TAG nTag
Tag of union (See tFR_TAG)
Definition flexray_frame.h:131
@ FR_TAG_INVALID
Tag for invalid data.
Definition flexray_frame.h:66
@ FR_TAG_FRAME
Tag for frame data.
Definition flexray_frame.h:68
@ FR_TAG_SYNC
Tag for sync data.
Definition flexray_frame.h:70
@ FR_TAG_PDU
tag for PDU data
Definition flexray_frame.h:69
@ FR_TAG_CYCLESTART
Tag for cycle start data.
Definition flexray_frame.h:67
int64_t nTimeStamp
Hardware timestamp in µs.
Definition flexray_frame.h:133
static uint16_t GetStructureSize(tFR_TAG nTag, uint8_t nPayloadLength=0)
Definition flexray_frame.h:154
uint8_t nReserved
Reserved for future use.
Definition flexray_frame.h:132