Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/generate_protos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- master
- update_proto/**
- update_proto/*
paths:
- 'lib/wpc_proto/deps/nanopb/**'
- 'lib/wpc_proto/deps/backend-apis/**'
Expand Down Expand Up @@ -33,7 +33,11 @@ jobs:
python-version: '3.10'

- name: install requirements
run: pip install -r lib/wpc_proto/deps/nanopb/requirements.txt
run: |
pip install protobuf==3.20.3
pip install grpcio-tools==1.48.2
# Do not use direct requirements.txt as version are not specified
# pip install -r lib/wpc_proto/deps/nanopb/requirements.txt

- name: generate our proto files
run: lib/wpc_proto/tools/generate_proto_code.sh
Expand Down
20 changes: 19 additions & 1 deletion lib/wpc_proto/gen/generated_protos/config_message.pb.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ PB_BIND(wp_AppConfigData, wp_AppConfigData, AUTO)
PB_BIND(wp_NetworkKeys, wp_NetworkKeys, AUTO)


PB_BIND(wp_SecurityKeys, wp_SecurityKeys, AUTO)


PB_BIND(wp_ConfigurationDataItem, wp_ConfigurationDataItem, AUTO)


PB_BIND(wp_SinkReadConfig, wp_SinkReadConfig, 2)


PB_BIND(wp_SinkNewConfig, wp_SinkNewConfig, AUTO)
PB_BIND(wp_SinkNewConfig, wp_SinkNewConfig, 2)


PB_BIND(wp_GatewayInfo, wp_GatewayInfo, AUTO)
Expand All @@ -51,6 +57,18 @@ PB_BIND(wp_GetGwInfoReq, wp_GetGwInfoReq, AUTO)
PB_BIND(wp_GetGwInfoResp, wp_GetGwInfoResp, AUTO)


PB_BIND(wp_SetConfigurationDataItemReq, wp_SetConfigurationDataItemReq, AUTO)


PB_BIND(wp_SetConfigurationDataItemResp, wp_SetConfigurationDataItemResp, AUTO)


PB_BIND(wp_GetConfigurationDataItemReq, wp_GetConfigurationDataItemReq, AUTO)


PB_BIND(wp_GetConfigurationDataItemResp, wp_GetConfigurationDataItemResp, AUTO)





187 changes: 170 additions & 17 deletions lib/wpc_proto/gen/generated_protos/config_message.pb.h

Large diffs are not rendered by default.

26 changes: 23 additions & 3 deletions lib/wpc_proto/gen/generated_protos/generic_message.pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ typedef struct _wp_WirepasMessage {
struct _wp_GetGwInfoResp *get_gateway_info_resp;
struct _wp_SetScratchpadTargetAndActionReq *set_scratchpad_target_and_action_req;
struct _wp_SetScratchpadTargetAndActionResp *set_scratchpad_target_and_action_resp;
bool has_set_configuration_data_item_req;
wp_SetConfigurationDataItemReq set_configuration_data_item_req;
bool has_set_configuration_data_item_resp;
wp_SetConfigurationDataItemResp set_configuration_data_item_resp;
bool has_get_configuration_data_item_req;
wp_GetConfigurationDataItemReq get_configuration_data_item_req;
bool has_get_configuration_data_item_resp;
wp_GetConfigurationDataItemResp get_configuration_data_item_resp;
} wp_WirepasMessage;

typedef struct _wp_CustomerMessage {
Expand All @@ -50,10 +58,10 @@ extern "C" {
#endif

/* Initializer values for message structs */
#define wp_WirepasMessage_init_default {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
#define wp_WirepasMessage_init_default {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, wp_SetConfigurationDataItemReq_init_default, false, wp_SetConfigurationDataItemResp_init_default, false, wp_GetConfigurationDataItemReq_init_default, false, wp_GetConfigurationDataItemResp_init_default}
#define wp_CustomerMessage_init_default {""}
#define wp_GenericMessage_init_default {NULL, NULL}
#define wp_WirepasMessage_init_zero {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
#define wp_WirepasMessage_init_zero {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, wp_SetConfigurationDataItemReq_init_zero, false, wp_SetConfigurationDataItemResp_init_zero, false, wp_GetConfigurationDataItemReq_init_zero, false, wp_GetConfigurationDataItemResp_init_zero}
#define wp_CustomerMessage_init_zero {""}
#define wp_GenericMessage_init_zero {NULL, NULL}

Expand All @@ -76,6 +84,10 @@ extern "C" {
#define wp_WirepasMessage_get_gateway_info_resp_tag 16
#define wp_WirepasMessage_set_scratchpad_target_and_action_req_tag 17
#define wp_WirepasMessage_set_scratchpad_target_and_action_resp_tag 18
#define wp_WirepasMessage_set_configuration_data_item_req_tag 19
#define wp_WirepasMessage_set_configuration_data_item_resp_tag 20
#define wp_WirepasMessage_get_configuration_data_item_req_tag 21
#define wp_WirepasMessage_get_configuration_data_item_resp_tag 22
#define wp_CustomerMessage_customer_name_tag 1
#define wp_GenericMessage_wirepas_tag 1
#define wp_GenericMessage_customer_tag 2
Expand All @@ -99,7 +111,11 @@ X(a, POINTER, OPTIONAL, MESSAGE, process_scratchpad_resp, 14) \
X(a, POINTER, OPTIONAL, MESSAGE, get_gateway_info_req, 15) \
X(a, POINTER, OPTIONAL, MESSAGE, get_gateway_info_resp, 16) \
X(a, POINTER, OPTIONAL, MESSAGE, set_scratchpad_target_and_action_req, 17) \
X(a, POINTER, OPTIONAL, MESSAGE, set_scratchpad_target_and_action_resp, 18)
X(a, POINTER, OPTIONAL, MESSAGE, set_scratchpad_target_and_action_resp, 18) \
X(a, STATIC, OPTIONAL, MESSAGE, set_configuration_data_item_req, 19) \
X(a, STATIC, OPTIONAL, MESSAGE, set_configuration_data_item_resp, 20) \
X(a, STATIC, OPTIONAL, MESSAGE, get_configuration_data_item_req, 21) \
X(a, STATIC, OPTIONAL, MESSAGE, get_configuration_data_item_resp, 22)
#define wp_WirepasMessage_CALLBACK NULL
#define wp_WirepasMessage_DEFAULT NULL
#define wp_WirepasMessage_status_event_MSGTYPE wp_StatusEvent
Expand All @@ -120,6 +136,10 @@ X(a, POINTER, OPTIONAL, MESSAGE, set_scratchpad_target_and_action_resp, 18)
#define wp_WirepasMessage_get_gateway_info_resp_MSGTYPE wp_GetGwInfoResp
#define wp_WirepasMessage_set_scratchpad_target_and_action_req_MSGTYPE wp_SetScratchpadTargetAndActionReq
#define wp_WirepasMessage_set_scratchpad_target_and_action_resp_MSGTYPE wp_SetScratchpadTargetAndActionResp
#define wp_WirepasMessage_set_configuration_data_item_req_MSGTYPE wp_SetConfigurationDataItemReq
#define wp_WirepasMessage_set_configuration_data_item_resp_MSGTYPE wp_SetConfigurationDataItemResp
#define wp_WirepasMessage_get_configuration_data_item_req_MSGTYPE wp_GetConfigurationDataItemReq
#define wp_WirepasMessage_get_configuration_data_item_resp_MSGTYPE wp_GetConfigurationDataItemResp

#define wp_CustomerMessage_FIELDLIST(X, a) \
X(a, STATIC, REQUIRED, STRING, customer_name, 1)
Expand Down
1 change: 1 addition & 0 deletions lib/wpc_proto/gen/generated_protos/wp_global.pb.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ PB_BIND(wp_TargetScratchpadAndAction, wp_TargetScratchpadAndAction, AUTO)




18 changes: 18 additions & 0 deletions lib/wpc_proto/gen/generated_protos/wp_global.pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ typedef enum _wp_ProcessingDelay {
wp_ProcessingDelay_FIVE_DAYS = 7
} wp_ProcessingDelay;

typedef enum _wp_GatewayFeature {
wp_GatewayFeature_UNKNOWN = 0,
/* Support for uploading a scratchpad in chunks */
wp_GatewayFeature_SCRATCHPAD_CHUNK_V1 = 1,
/* Configuration Data Distribution API, allows modifying of the
configuration data content. */
wp_GatewayFeature_CONFIGURATION_DATA_V1 = 2,
/* Support for setting key management parameters of the sink */
wp_GatewayFeature_SINK_KEY_MANAGEMENT_V1 = 3,
/* Gateway has a virtualnode. This concept is present in some usecases
where the gateway code run the same logic as a normal mesh node */
wp_GatewayFeature_VIRTUAL_NODE_V1 = 4
} wp_GatewayFeature;

/* Struct definitions */
/* Global request header
NB: Gateway id is not present in header as gateway will only subscribe to their id */
Expand Down Expand Up @@ -148,6 +162,10 @@ extern "C" {
#define _wp_ProcessingDelay_MAX wp_ProcessingDelay_FIVE_DAYS
#define _wp_ProcessingDelay_ARRAYSIZE ((wp_ProcessingDelay)(wp_ProcessingDelay_FIVE_DAYS+1))

#define _wp_GatewayFeature_MIN wp_GatewayFeature_UNKNOWN
#define _wp_GatewayFeature_MAX wp_GatewayFeature_VIRTUAL_NODE_V1
#define _wp_GatewayFeature_ARRAYSIZE ((wp_GatewayFeature)(wp_GatewayFeature_VIRTUAL_NODE_V1+1))


#define wp_ResponseHeader_res_ENUMTYPE wp_ErrorCode

Expand Down
6 changes: 6 additions & 0 deletions lib/wpc_proto/proto_options/config_message.options
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ wp.AppConfigData.app_config_data max_size:80
wp.NetworkKeys.cipher max_size:16 fixed_length:true
wp.NetworkKeys.authentication max_size:16 fixed_length:true
wp.SinkReadConfig.sink_id max_size:16
wp.SinkReadConfig.configuration_data_content max_count:0 // No support yet for CDD_API
wp.SinkNewConfig.sink_id max_size:16
wp.GatewayInfo.gw_model max_size:64
wp.GatewayInfo.gw_version max_size:32
wp.GatewayInfo.gw_features max_count:2 // Only CHUNK + VIRTUAL_NODE
wp.StatusEvent.configs max_count:1 // only one sink
wp.StatusEvent.gw_model max_size:64
wp.StatusEvent.gw_version max_size:32
wp.StatusEvent.gw_features max_count:2
wp.GetConfigsResp.configs max_count:1 // only one sink
wp.ConfigurationDataItem.payload max_size:128 // Not used for now
wp.SecurityKeys.cipher max_size:16 fixed_length:true
wp.SecurityKeys.authentication max_size:16 fixed_length:true