-
Notifications
You must be signed in to change notification settings - Fork 1
/
messages.pb.h
132 lines (109 loc) · 4.26 KB
/
messages.pb.h
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/* Automatically generated nanopb header */
/* Generated by nanopb-0.3.3 at Sun Aug 30 20:55:19 2015. */
#ifndef PB_MESSAGES_PB_H_INCLUDED
#define PB_MESSAGES_PB_H_INCLUDED
#include <pb.h>
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Enum definitions */
typedef enum _Sensor_SensorType {
Sensor_SensorType_ANALOG = 0,
Sensor_SensorType_DIGITAL = 1,
Sensor_SensorType_DIFFERENTIAL = 2,
Sensor_SensorType_STRAIN = 3,
Sensor_SensorType_TEMPERATURE = 4
} Sensor_SensorType;
typedef enum _DeviceControl_Action {
DeviceControl_Action_START = 0,
DeviceControl_Action_STOP = 1,
DeviceControl_Action_RESET = 2,
DeviceControl_Action_SET_CONFIG = 3,
DeviceControl_Action_GET_CONFIG = 4
} DeviceControl_Action;
/* Struct definitions */
typedef struct _DeviceConfiguration {
pb_callback_t sensors;
} DeviceConfiguration;
typedef struct _DeviceInfo {
pb_callback_t model;
pb_callback_t sensors;
} DeviceInfo;
typedef struct _Sensor {
int32_t id;
Sensor_SensorType type;
pb_callback_t name;
} Sensor;
typedef struct _SensorConfiguration {
int32_t id;
bool enabled;
int32_t frequency;
} SensorConfiguration;
typedef struct _SensorMessage {
uint32_t id;
uint32_t value;
} SensorMessage;
typedef struct _SensorUpdate {
uint32_t timestamp;
pb_callback_t messages;
} SensorUpdate;
typedef struct _DeviceControl {
DeviceControl_Action action;
bool has_config;
SensorConfiguration config;
} DeviceControl;
/* Default values for struct fields */
/* Initializer values for message structs */
#define Sensor_init_default {0, (Sensor_SensorType)0, {{NULL}, NULL}}
#define DeviceInfo_init_default {{{NULL}, NULL}, {{NULL}, NULL}}
#define SensorConfiguration_init_default {0, 0, 0}
#define DeviceConfiguration_init_default {{{NULL}, NULL}}
#define DeviceControl_init_default {(DeviceControl_Action)0, false, SensorConfiguration_init_default}
#define SensorMessage_init_default {0, 0}
#define SensorUpdate_init_default {0, {{NULL}, NULL}}
#define Sensor_init_zero {0, (Sensor_SensorType)0, {{NULL}, NULL}}
#define DeviceInfo_init_zero {{{NULL}, NULL}, {{NULL}, NULL}}
#define SensorConfiguration_init_zero {0, 0, 0}
#define DeviceConfiguration_init_zero {{{NULL}, NULL}}
#define DeviceControl_init_zero {(DeviceControl_Action)0, false, SensorConfiguration_init_zero}
#define SensorMessage_init_zero {0, 0}
#define SensorUpdate_init_zero {0, {{NULL}, NULL}}
/* Field tags (for use in manual encoding/decoding) */
#define DeviceConfiguration_sensors_tag 2
#define DeviceInfo_model_tag 1
#define DeviceInfo_sensors_tag 2
#define Sensor_id_tag 1
#define Sensor_type_tag 2
#define Sensor_name_tag 3
#define SensorConfiguration_id_tag 1
#define SensorConfiguration_enabled_tag 2
#define SensorConfiguration_frequency_tag 3
#define SensorMessage_id_tag 1
#define SensorMessage_value_tag 2
#define SensorUpdate_timestamp_tag 1
#define SensorUpdate_messages_tag 2
#define DeviceControl_action_tag 1
#define DeviceControl_config_tag 2
/* Struct field encoding specification for nanopb */
extern const pb_field_t Sensor_fields[4];
extern const pb_field_t DeviceInfo_fields[3];
extern const pb_field_t SensorConfiguration_fields[4];
extern const pb_field_t DeviceConfiguration_fields[2];
extern const pb_field_t DeviceControl_fields[3];
extern const pb_field_t SensorMessage_fields[3];
extern const pb_field_t SensorUpdate_fields[3];
/* Maximum encoded size of messages (where known) */
#define SensorConfiguration_size 24
#define DeviceControl_size 32
#define SensorMessage_size 12
/* Message IDs (where set with "msgid" option) */
#ifdef PB_MSGID
#define MESSAGES_MESSAGES \
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif