CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/libraries/AP_CANManager/LogStructure.h
Views: 1798
1
#pragma once
2
/*
3
log structures for AP_CANManager
4
*/
5
6
#include <AP_Logger/LogStructure.h>
7
#include "AP_CANManager_config.h"
8
9
#define LOG_IDS_FROM_CANMANAGER \
10
LOG_CANF_MSG, \
11
LOG_CAFD_MSG
12
13
// @LoggerMessage: CANF
14
// @Description: CAN Frame
15
// @Field: TimeUS: Time since system startup
16
// @Field: Bus: bus number
17
// @Field: Id: frame identifier
18
// @Field: DLC: data length code
19
// @Field: B0: byte 0
20
// @Field: B1: byte 1
21
// @Field: B2: byte 2
22
// @Field: B3: byte 3
23
// @Field: B4: byte 4
24
// @Field: B5: byte 5
25
// @Field: B6: byte 6
26
// @Field: B7: byte 7
27
struct PACKED log_CANF {
28
LOG_PACKET_HEADER;
29
uint64_t time_us;
30
uint8_t bus;
31
uint32_t id;
32
uint8_t dlc;
33
uint8_t data[8];
34
};
35
36
// @LoggerMessage: CAFD
37
// @Description: CANFD Frame
38
// @Field: TimeUS: Time since system startup
39
// @Field: Bus: bus number
40
// @Field: Id: frame identifier
41
// @Field: DLC: data length code
42
// @Field: D0: data 0
43
// @Field: D1: data 1
44
// @Field: D2: data 2
45
// @Field: D3: data 3
46
// @Field: D4: data 4
47
// @Field: D5: data 5
48
// @Field: D6: data 6
49
// @Field: D7: data 7
50
struct PACKED log_CAFD {
51
LOG_PACKET_HEADER;
52
uint64_t time_us;
53
uint8_t bus;
54
uint32_t id;
55
uint8_t dlc;
56
uint64_t data[8];
57
};
58
59
#if AP_CAN_LOGGING_ENABLED
60
#define LOG_STRUCTURE_FROM_CANMANAGER \
61
{ LOG_CANF_MSG, sizeof(log_CANF), \
62
"CANF", \
63
"Q" "B" "I" "B" "B" "B" "B" "B" "B" "B" "B" "B", \
64
"TimeUS," "Bus," "Id," "DLC," "B0," "B1," "B2," "B3," "B4," "B5," "B6," "B7", \
65
"s" "#" "-" "-" "-" "-" "-" "-" "-" "-" "-" "-", \
66
"F" "-" "-" "-" "-" "-" "-" "-" "-" "-" "-" "-", \
67
false \
68
}, \
69
{ LOG_CAFD_MSG, sizeof(log_CAFD), \
70
"CAFD", \
71
"Q" "B" "I" "B" "Q" "Q" "Q" "Q" "Q" "Q" "Q" "Q", \
72
"TimeUS," "Bus," "Id," "DLC," "D0," "D1," "D2," "D3," "D4," "D5," "D6," "D7", \
73
"s" "#" "-" "-" "-" "-" "-" "-" "-" "-" "-" "-", \
74
"F" "-" "-" "-" "-" "-" "-" "-" "-" "-" "-" "-", \
75
false \
76
},
77
#else
78
#define LOG_STRUCTURE_FROM_CANMANAGER
79
#endif // AP_CAN_LOGGING_ENABLED
80
81