summaryrefslogtreecommitdiff
path: root/src/data.pb.h
diff options
context:
space:
mode:
authorAditya Naik2020-06-17 16:55:22 -0400
committerAditya Naik2020-06-18 16:13:36 -0400
commit0746618ebe57ba8d452ad5cc907ddd478b512898 (patch)
treee9a3599120fdafe1d779a07164f25eb4e6d53132 /src/data.pb.h
parent8883bdbccf223824935f36a77566d7af19ab4908 (diff)
This CL adds support for dataflow branch 2, which includes master processing of DOC 1, 2, 3 for SOR 1 and SOR 3, adding support for master command processing and routing. Slave command generators and receivers are also added for testing master command functionality. CL also adds minor changes to debug scripts and overall cleanup; changes to dataflow structures to support command functionality; dedicated function for handling CTS reception from slaves.
Task list: b1d2ba1914ab4621bd004ad0a636e09d 2c17aeea4e73433fa5a49d310c7526b1 5e15eda1eecb482a9bd4e6ec4ef2af0e 75b4f8b2792a4be69caf830c720d3e7c
Diffstat (limited to 'src/data.pb.h')
-rw-r--r--src/data.pb.h73
1 files changed, 23 insertions, 50 deletions
diff --git a/src/data.pb.h b/src/data.pb.h
index cc271a3..ce1395d 100644
--- a/src/data.pb.h
+++ b/src/data.pb.h
@@ -1,8 +1,8 @@
/* Automatically generated nanopb header */
/* Generated by nanopb-0.4.2-dev */
-#ifndef PB_DATA_PB_H_INCLUDED
-#define PB_DATA_PB_H_INCLUDED
+#ifndef PB_PROTO_DATA_PB_H_INCLUDED
+#define PB_PROTO_DATA_PB_H_INCLUDED
#include <pb.h>
#if PB_PROTO_HEADER_VERSION != 40
@@ -29,6 +29,13 @@ typedef struct __datapoint {
int32_t timestamp;
} _datapoint;
+typedef struct _command {
+ uint32_t source_module_id;
+ uint32_t dest_module_id;
+ pb_callback_t cmd_bytes;
+ pb_callback_t cmd_str;
+} command;
+
typedef struct _m2s_CTS {
uint32_t timeout;
} m2s_CTS;
@@ -39,42 +46,23 @@ typedef struct _m2s_SOR {
uint32_t rx_length;
} m2s_SOR;
-typedef struct _m2s_command {
- bool has_source_module_id;
- uint32_t source_module_id;
- bool has_source_i2c_address;
- uint32_t source_i2c_address;
- pb_callback_t cmd_bytes;
- pb_callback_t cmd_str;
-} m2s_command;
-
typedef struct _s2m_DOC {
uint32_t DOC_code;
uint32_t tx_length;
} s2m_DOC;
-typedef struct _s2m_command {
- bool has_dest_module_id;
- uint32_t dest_module_id;
- pb_callback_t dest_module_id_multicast;
- pb_callback_t cmd_bytes;
- pb_callback_t cmd_str;
-} s2m_command;
-
/* Initializer values for message structs */
#define m2s_SOR_init_default {1u, false, 0}
#define s2m_DOC_init_default {1u, 0u}
#define m2s_CTS_init_default {0}
-#define m2s_command_init_default {false, 1u, false, 1u, {{NULL}, NULL}, {{NULL}, NULL}}
-#define s2m_command_init_default {false, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
+#define command_init_default {0, 0, {{NULL}, NULL}, {{NULL}, NULL}}
#define _datapoint_init_default {0u, 0, false, 1u, false, 1u, false, 1}
#define s2m_data_init_default {{{NULL}, NULL}}
#define m2s_SOR_init_zero {0, false, 0}
#define s2m_DOC_init_zero {0, 0}
#define m2s_CTS_init_zero {0}
-#define m2s_command_init_zero {false, 0, false, 0, {{NULL}, NULL}, {{NULL}, NULL}}
-#define s2m_command_init_zero {false, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
+#define command_init_zero {0, 0, {{NULL}, NULL}, {{NULL}, NULL}}
#define _datapoint_init_zero {0, 0, false, 0, false, 0, false, 0}
#define s2m_data_init_zero {{{NULL}, NULL}}
@@ -85,19 +73,15 @@ typedef struct _s2m_command {
#define _datapoint_channel_id_tag 3
#define _datapoint_unit_id_tag 4
#define _datapoint_timestamp_tag 5
+#define command_source_module_id_tag 1
+#define command_dest_module_id_tag 2
+#define command_cmd_bytes_tag 3
+#define command_cmd_str_tag 4
#define m2s_CTS_timeout_tag 1
#define m2s_SOR_SOR_code_tag 1
#define m2s_SOR_rx_length_tag 2
-#define m2s_command_source_module_id_tag 1
-#define m2s_command_source_i2c_address_tag 2
-#define m2s_command_cmd_bytes_tag 3
-#define m2s_command_cmd_str_tag 4
#define s2m_DOC_DOC_code_tag 1
#define s2m_DOC_tx_length_tag 2
-#define s2m_command_dest_module_id_tag 1
-#define s2m_command_dest_module_id_multicast_tag 2
-#define s2m_command_cmd_bytes_tag 3
-#define s2m_command_cmd_str_tag 4
/* Struct field encoding specification for nanopb */
#define m2s_SOR_FIELDLIST(X, a) \
@@ -117,21 +101,13 @@ X(a, STATIC, REQUIRED, UINT32, timeout, 1)
#define m2s_CTS_CALLBACK NULL
#define m2s_CTS_DEFAULT NULL
-#define m2s_command_FIELDLIST(X, a) \
-X(a, STATIC, OPTIONAL, UINT32, source_module_id, 1) \
-X(a, STATIC, OPTIONAL, UINT32, source_i2c_address, 2) \
-X(a, CALLBACK, OPTIONAL, BYTES, cmd_bytes, 3) \
-X(a, CALLBACK, OPTIONAL, STRING, cmd_str, 4)
-#define m2s_command_CALLBACK pb_default_field_callback
-#define m2s_command_DEFAULT (const pb_byte_t*)"\x08\x01\x10\x01\x00"
-
-#define s2m_command_FIELDLIST(X, a) \
-X(a, STATIC, OPTIONAL, UINT32, dest_module_id, 1) \
-X(a, CALLBACK, REPEATED, UINT32, dest_module_id_multicast, 2) \
+#define command_FIELDLIST(X, a) \
+X(a, STATIC, REQUIRED, UINT32, source_module_id, 1) \
+X(a, STATIC, REQUIRED, UINT32, dest_module_id, 2) \
X(a, CALLBACK, OPTIONAL, BYTES, cmd_bytes, 3) \
X(a, CALLBACK, OPTIONAL, STRING, cmd_str, 4)
-#define s2m_command_CALLBACK pb_default_field_callback
-#define s2m_command_DEFAULT NULL
+#define command_CALLBACK pb_default_field_callback
+#define command_DEFAULT NULL
#define _datapoint_FIELDLIST(X, a) \
X(a, STATIC, REQUIRED, UINT32, entity_id, 1) \
@@ -151,8 +127,7 @@ X(a, CALLBACK, REPEATED, MESSAGE, datapoints, 1)
extern const pb_msgdesc_t m2s_SOR_msg;
extern const pb_msgdesc_t s2m_DOC_msg;
extern const pb_msgdesc_t m2s_CTS_msg;
-extern const pb_msgdesc_t m2s_command_msg;
-extern const pb_msgdesc_t s2m_command_msg;
+extern const pb_msgdesc_t command_msg;
extern const pb_msgdesc_t _datapoint_msg;
extern const pb_msgdesc_t s2m_data_msg;
@@ -160,8 +135,7 @@ extern const pb_msgdesc_t s2m_data_msg;
#define m2s_SOR_fields &m2s_SOR_msg
#define s2m_DOC_fields &s2m_DOC_msg
#define m2s_CTS_fields &m2s_CTS_msg
-#define m2s_command_fields &m2s_command_msg
-#define s2m_command_fields &s2m_command_msg
+#define command_fields &command_msg
#define _datapoint_fields &_datapoint_msg
#define s2m_data_fields &s2m_data_msg
@@ -169,8 +143,7 @@ extern const pb_msgdesc_t s2m_data_msg;
#define m2s_SOR_size 12
#define s2m_DOC_size 12
#define m2s_CTS_size 6
-/* m2s_command_size depends on runtime parameters */
-/* s2m_command_size depends on runtime parameters */
+/* command_size depends on runtime parameters */
#define _datapoint_size 38
/* s2m_data_size depends on runtime parameters */