-
Notifications
You must be signed in to change notification settings - Fork 4
/
frame.fbs
77 lines (62 loc) · 2.83 KB
/
frame.fbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//***************************************************************************
// Copyright (c) 2022 for information on the respective copyright owner
// see the NOTICE file and/or the following repository:
// https://github.com/boschglobal/automotive-bus-schema
//
// SPDX-License-Identifier: Apache-2.0
//***************************************************************************
/**
IDL for Automotive Bus - Stream Interface - Frames
==================================================
MIME Type : application/x-automotive-bus; interface=stream; type=frame; schema=fbs
Flatbuffers file identifier : SFRA
*/
namespace AutomotiveBus.Stream.Frame;
table Timing {
// All values are nanoseconds from simulation start time (i.e. from 0.0).
send:long; // Timestamp when a Frame is sent to the a Bus
// Interface for (later) transmission.
arbitration:long; // Timestamp when a Frame is transmitted over the
// Bus medium (i.e. message arbitration).
recv:long; // Timestamp when a Frame is received from a
// Bus Interface and consumed.
}
enum CanFrameType:byte{
BaseFrame = 0, // CAN Base Format (Classical):
// frame_id is 11-bits
ExtendedFrame = 1, // CAN Extended Format:
// frame_id is 29-bits
FdBaseFrame = 2, // CAN FD Base Format:
// frame_id is 11-bits
FdExtendedFrame = 3 // CAN FD Extended Format:
// frame_id is 29-bits
}
table CanFrame {
frame_id:uint; // CAN Message ID.
payload:[ubyte]; // Payload of the CAN frame, covered by DLC. The length
// of payload content should match values as defined by
// CAN DLC spec (for example):
// Standard/Base frame: 0...8
// Extended frame: 0...8,12,16,20,24,32,48,64
frame_type:CanFrameType = BaseFrame;
// CAN Frame Metadata
bus_id:ubyte; // CAN Bus ID (logical identifier).
node_id:ubyte; // ECU ID for the node _sending_ this Frame.
interface_id:ubyte; // Interface ID of the node interface _sending_ this Frame.
timing:Timing; // Timing of the frame.
}
union FrameTypes {
CanFrame:CanFrame,
}
table Frame {
f:FrameTypes; // Workaround as Vectors of Unions is not fully supported.
}
table Stream {
frames:[Frame]; // Vector of Frames.
node_uid:uint; // UID of the node which sends this Stream. The node can
// use this field to detect if it is receiving a Stream
// which it had previously sent (and take appropriate
// action).
}
root_type Stream;
file_identifier "SFRA"; // Stream of FRAmes.