Skip to content

Commit 30c18c6

Browse files
authored
Merge pull request #2578 from particle-iot/feature/proto-defs-refactor
Protobuf defs refactor / fixes submessage encoding after nanopb 0.4.5 upgrade
2 parents e70917c + 20b1d8c commit 30c18c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+338
-1474
lines changed

.gitmodules

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[submodule "proto"]
2-
path = proto
3-
url = https://github.com/particle-iot/firmware-protobuf.git
4-
branch = master
51
[submodule "third_party/nrf5_sdk/nrf5_sdk"]
62
path = third_party/nrf5_sdk/nrf5_sdk
73
url = https://github.com/particle-iot/nrf5_sdk.git
@@ -54,3 +50,6 @@
5450
[submodule "third_party/coremark/coremark"]
5551
path = third_party/coremark/coremark
5652
url = https://github.com/particle-iot/coremark
53+
[submodule "proto_defs/shared"]
54+
path = proto_defs/shared
55+
url = https://github.com/particle-iot/device-os-protobuf.git

hal/makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ HAL_MODULE_PATH=.
66
TARGET_TYPE = a
77
BUILD_PATH_EXT = $(HAL_BUILD_PATH_EXT)
88

9-
DEPENDENCIES = newlib_nano platform services dynalib bootloader wiring crypto
9+
DEPENDENCIES = newlib_nano platform services dynalib bootloader wiring crypto proto_defs
1010

1111
# ensure PLATFORM_NAME is defined
1212
include ../build/platform-id.mk

hal/network/ncp/cellular/cellular_network_manager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
// FIXME: Move nanopb utilities to a common header file
2727
#include "../../../../system/src/control/common.h"
2828

29-
// FIXME: Build internal protocol files in a separate directory
30-
#include "../../../../system/src/control/proto/internal.pb.h"
29+
#include "network_config.pb.h"
3130

3231
#define PB(_name) particle_firmware_##_name
3332
#define PB_CELLULAR(_name) particle_ctrl_cellular_##_name

hal/network/ncp/wifi/wifi_network_manager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
// FIXME: Move nanopb utilities to a common header file
3232
#include "../../../system/src/control/common.h"
3333

34-
// FIXME: Build internal protocol files in a separate directory
35-
#include "../../../system/src/control/proto/internal.pb.h"
34+
#include "network_config.pb.h"
3635

3736
#define PB(_name) particle_firmware_##_name
3837
#define PB_WIFI(_name) particle_ctrl_wifi_##_name

main/makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ endif
8282

8383
# It's critical that user comes before wiring so that the setup()/loop() functions are linked in preference
8484
# to the weak functions from wiring
85-
MAKE_DEPENDENCIES = newlib_nano user wiring hal system services communication platform wiring_globals crypto
85+
MAKE_DEPENDENCIES = newlib_nano user wiring hal system services communication platform wiring_globals crypto proto_defs
8686
DEPENDENCIES = $(MAKE_DEPENDENCIES) dynalib
8787

8888
LIBS += $(MAKE_DEPENDENCIES)
89-
LIB_DEPS += $(USER_LIB_DEP) $(WIRING_LIB_DEP) $(SYSTEM_LIB_DEP) $(SERVICES_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(HAL_LIB_DEP) $(PLATFORM_LIB_DEP) $(WIRING_GLOBALS_LIB_DEP) $(CRYPTO_LIB_DEP)
89+
LIB_DEPS += $(USER_LIB_DEP) $(WIRING_LIB_DEP) $(SYSTEM_LIB_DEP) $(SERVICES_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(HAL_LIB_DEP) $(PLATFORM_LIB_DEP) $(WIRING_GLOBALS_LIB_DEP) $(CRYPTO_LIB_DEP) $(PROTO_DEFS_LIB_DEP)
9090
LIB_DIRS += $(dir $(LIB_DEPS))
9191

9292
# Target this makefile is building.

modules/argon/system-part1/makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ HAL_LINK :=
66
PLATFORM_DFU = 0x30000
77
NCP_FIRMWARE_MODULE_VERSION=4
88
# MODULE_DEPENDENCY2=7,0,$(NCP_FIRMWARE_MODULE_VERSION)
9-
DEPENDENCIES = newlib_nano modules/argon/user-part modules/argon/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto
10-
LIB_DEPENDENCIES = services system wiring communication hal platform crypto
9+
DEPENDENCIES = newlib_nano modules/argon/user-part modules/argon/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto proto_defs
10+
LIB_DEPENDENCIES = services system wiring communication hal platform crypto proto_defs
1111

1212
# newlib_nano is special in that it's linked automatically by the system, so no need to add it to the library path here
1313
MAKE_DEPENDENCIES = newlib_nano $(LIB_DEPENDENCIES)
1414
include ../modular.mk
1515
include $(PROJECT_ROOT)/build/platform-id.mk
1616

1717
LIBS += $(LIB_DEPENDENCIES)
18-
LIB_DEPS += $(SERVICES_LIB_DEP) $(PLATFORM_LIB_DEP) $(HAL_LIB_DEP) $(SYSTEM_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(WIRING_LIB_DEP) $(CRYPTO_LIB_DEP)
18+
LIB_DEPS += $(SERVICES_LIB_DEP) $(PLATFORM_LIB_DEP) $(HAL_LIB_DEP) $(SYSTEM_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(WIRING_LIB_DEP) $(CRYPTO_LIB_DEP) $(PROTO_DEFS_LIB_DEP)
1919

2020
DEPENDENCIES += wiring_globals
2121
LIB_DEPENDENCIES += wiring_globals

modules/b5som/system-part1/makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM)
55
HAL_LINK :=
66
PLATFORM_DFU = 0x30000
77

8-
DEPENDENCIES = newlib_nano modules/b5som/user-part modules/b5som/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto wiring_globals
9-
LIB_DEPENDENCIES = services system wiring communication hal platform crypto wiring_globals
8+
DEPENDENCIES = newlib_nano modules/b5som/user-part modules/b5som/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto proto_defs wiring_globals
9+
LIB_DEPENDENCIES = services system wiring communication hal platform crypto proto_defs wiring_globals
1010
# newlib_nano is special in that it's linked automatically by the system, so no need to add it to the library path here
1111
MAKE_DEPENDENCIES = newlib_nano $(LIB_DEPENDENCIES)
1212
include ../modular.mk
1313
include $(PROJECT_ROOT)/build/platform-id.mk
1414

1515
LIBS += $(LIB_DEPENDENCIES)
16-
LIB_DEPS += $(SERVICES_LIB_DEP) $(PLATFORM_LIB_DEP) $(HAL_LIB_DEP) $(SYSTEM_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(WIRING_LIB_DEP) $(CRYPTO_LIB_DEP) $(WIRING_GLOBALS_LIB_DEP)
16+
LIB_DEPS += $(SERVICES_LIB_DEP) $(PLATFORM_LIB_DEP) $(HAL_LIB_DEP) $(SYSTEM_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(WIRING_LIB_DEP) $(CRYPTO_LIB_DEP) $(PROTO_DEFS_LIB_DEP) $(WIRING_GLOBALS_LIB_DEP)
1717
LIB_DIRS += $(dir $(LIB_DEPS))
1818

1919
TARGET=elf bin lst hex size

modules/boron/system-part1/makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM)
55
HAL_LINK :=
66
PLATFORM_DFU = 0x30000
77

8-
DEPENDENCIES = newlib_nano modules/boron/user-part modules/boron/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto wiring_globals
9-
LIB_DEPENDENCIES = services system wiring communication hal platform crypto wiring_globals
8+
DEPENDENCIES = newlib_nano modules/boron/user-part modules/boron/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto proto_defs wiring_globals
9+
LIB_DEPENDENCIES = services system wiring communication hal platform crypto proto_defs wiring_globals
1010
# newlib_nano is special in that it's linked automatically by the system, so no need to add it to the library path here
1111
MAKE_DEPENDENCIES = newlib_nano $(LIB_DEPENDENCIES)
1212
include ../modular.mk
1313
include $(PROJECT_ROOT)/build/platform-id.mk
1414

1515
LIBS += $(LIB_DEPENDENCIES)
16-
LIB_DEPS += $(SERVICES_LIB_DEP) $(PLATFORM_LIB_DEP) $(HAL_LIB_DEP) $(SYSTEM_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(WIRING_LIB_DEP) $(CRYPTO_LIB_DEP) $(WIRING_GLOBALS_LIB_DEP)
16+
LIB_DEPS += $(SERVICES_LIB_DEP) $(PLATFORM_LIB_DEP) $(HAL_LIB_DEP) $(SYSTEM_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(WIRING_LIB_DEP) $(CRYPTO_LIB_DEP) $(WIRING_GLOBALS_LIB_DEP) $(PROTO_DEFS_LIB_DEP)
1717
LIB_DIRS += $(dir $(LIB_DEPS))
1818

1919
TARGET=elf bin lst hex size

modules/tracker/system-part1/makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM)
55
HAL_LINK :=
66
PLATFORM_DFU = 0x30000
77

8-
DEPENDENCIES = newlib_nano modules/tracker/user-part modules/tracker/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto wiring_globals
9-
LIB_DEPENDENCIES = services system wiring communication hal platform crypto wiring_globals
8+
DEPENDENCIES = newlib_nano modules/tracker/user-part modules/tracker/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto proto_defs wiring_globals
9+
LIB_DEPENDENCIES = services system wiring communication hal platform crypto proto_defs wiring_globals
1010
# newlib_nano is special in that it's linked automatically by the system, so no need to add it to the library path here
1111
MAKE_DEPENDENCIES = newlib_nano $(LIB_DEPENDENCIES)
1212
include ../modular.mk
1313
include $(PROJECT_ROOT)/build/platform-id.mk
1414

1515
LIBS += $(LIB_DEPENDENCIES)
16-
LIB_DEPS += $(SERVICES_LIB_DEP) $(PLATFORM_LIB_DEP) $(HAL_LIB_DEP) $(SYSTEM_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(WIRING_LIB_DEP) $(CRYPTO_LIB_DEP) $(WIRING_GLOBALS_LIB_DEP)
16+
LIB_DEPS += $(SERVICES_LIB_DEP) $(PLATFORM_LIB_DEP) $(HAL_LIB_DEP) $(SYSTEM_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(WIRING_LIB_DEP) $(CRYPTO_LIB_DEP) $(PROTO_DEFS_LIB_DEP) $(WIRING_GLOBALS_LIB_DEP)
1717
LIB_DIRS += $(dir $(LIB_DEPS))
1818

1919
TARGET=elf bin lst hex size

modules/trackerm/system-part1/makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ PROJECT_ROOT = ../../..
44
BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM)
55
HAL_LINK :=
66

7-
DEPENDENCIES = newlib_nano modules/trackerm/user-part modules/trackerm/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto wiring_globals
8-
LIB_DEPENDENCIES = services system wiring communication hal platform crypto wiring_globals
7+
DEPENDENCIES = newlib_nano modules/trackerm/user-part modules/trackerm/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto proto_defs wiring_globals
8+
LIB_DEPENDENCIES = services system wiring communication hal platform crypto proto_defs wiring_globals
99
# newlib_nano is special in that it's linked automatically by the system, so no need to add it to the library path here
1010
MAKE_DEPENDENCIES = newlib_nano $(LIB_DEPENDENCIES)
1111
include ../modular.mk
1212
include $(PROJECT_ROOT)/build/platform-id.mk
1313

1414
LIBS += $(LIB_DEPENDENCIES)
15-
LIB_DEPS += $(SERVICES_LIB_DEP) $(PLATFORM_LIB_DEP) $(HAL_LIB_DEP) $(SYSTEM_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(WIRING_LIB_DEP) $(CRYPTO_LIB_DEP) $(WIRING_GLOBALS_LIB_DEP)
15+
LIB_DEPS += $(SERVICES_LIB_DEP) $(PLATFORM_LIB_DEP) $(HAL_LIB_DEP) $(SYSTEM_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(WIRING_LIB_DEP) $(CRYPTO_LIB_DEP) $(PROTO_DEFS_LIB_DEP) $(WIRING_GLOBALS_LIB_DEP)
1616
LIB_DIRS += $(dir $(LIB_DEPS))
1717

1818
TARGET=elf bin lst hex size

modules/tron/system-part1/makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ PROJECT_ROOT = ../../..
44
BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM)
55
HAL_LINK :=
66

7-
DEPENDENCIES = newlib_nano modules/tron/user-part modules/tron/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto wiring_globals
8-
LIB_DEPENDENCIES = services system wiring communication hal platform crypto wiring_globals
7+
DEPENDENCIES = newlib_nano modules/tron/user-part modules/tron/system-part1 dynalib services hal platform system wiring communication rt-dynalib crypto proto_defs wiring_globals
8+
LIB_DEPENDENCIES = services system wiring communication hal platform crypto proto_defs wiring_globals
99
# newlib_nano is special in that it's linked automatically by the system, so no need to add it to the library path here
1010
MAKE_DEPENDENCIES = newlib_nano $(LIB_DEPENDENCIES)
1111
include ../modular.mk
1212
include $(PROJECT_ROOT)/build/platform-id.mk
1313

1414
LIBS += $(LIB_DEPENDENCIES)
15-
LIB_DEPS += $(SERVICES_LIB_DEP) $(PLATFORM_LIB_DEP) $(HAL_LIB_DEP) $(SYSTEM_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(WIRING_LIB_DEP) $(CRYPTO_LIB_DEP) $(WIRING_GLOBALS_LIB_DEP)
15+
LIB_DEPS += $(SERVICES_LIB_DEP) $(PLATFORM_LIB_DEP) $(HAL_LIB_DEP) $(SYSTEM_LIB_DEP) $(COMMUNICATION_LIB_DEP) $(WIRING_LIB_DEP) $(CRYPTO_LIB_DEP) $(PROTO_DEFS_LIB_DEP) $(WIRING_GLOBALS_LIB_DEP)
1616
LIB_DIRS += $(dir $(LIB_DEPS))
1717

1818
TARGET=elf bin lst hex size

proto

Lines changed: 0 additions & 1 deletion
This file was deleted.

proto_defs/build.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CPPSRC += $(call target_files,$(PROTO_DEFS_MODULE_PATH)/src,*.cpp)
2+
CSRC += $(call target_files,$(PROTO_DEFS_MODULE_PATH)/src,*.c)

proto_defs/gen_proto.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
# Note for macOS users:
4+
#
5+
# 1. The following dependencies are required to build the protocol files using the nanopb plugin:
6+
#
7+
# brew install protobuf python
8+
# pip2 install protobuf
9+
#
10+
# 2. Make sure your system Python can find Python modules installed via Homebrew:
11+
#
12+
# mkdir -p ~/Library/Python/2.7/lib/python/site-packages
13+
# echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
14+
15+
set -e
16+
17+
DEVICE_OS_DIR="$(cd "$(dirname "$0")/.." && pwd)"
18+
PROTO_DEFS_DIR="$DEVICE_OS_DIR/proto_defs"
19+
SHARED_DIR="$PROTO_DEFS_DIR/shared"
20+
INTERNAL_DIR="$PROTO_DEFS_DIR/internal"
21+
DEST_DIR="$PROTO_DEFS_DIR/src"
22+
23+
NANOPB_DIR="$DEVICE_OS_DIR/third_party/nanopb/nanopb"
24+
NANOPB_PLUGIN_DIR="$NANOPB_DIR/generator/protoc-gen-nanopb"
25+
26+
gen_proto() {
27+
echo "Compiling $1"
28+
protoc -I"$NANOPB_DIR/generator/proto" \
29+
-I"$SHARED_DIR" \
30+
-I"$(dirname "$1")" \
31+
--plugin="protoc-gen-nanopb=$NANOPB_PLUGIN_DIR" \
32+
--nanopb_out="${DEST_DIR}" "$1"
33+
}
34+
35+
# Control requests
36+
gen_proto "${SHARED_DIR}/control/extensions.proto"
37+
gen_proto "${SHARED_DIR}/control/common.proto"
38+
gen_proto "${SHARED_DIR}/control/config.proto"
39+
gen_proto "${SHARED_DIR}/control/wifi.proto"
40+
gen_proto "${SHARED_DIR}/control/wifi_new.proto"
41+
gen_proto "${SHARED_DIR}/control/cellular.proto"
42+
gen_proto "${SHARED_DIR}/control/network.proto"
43+
gen_proto "${SHARED_DIR}/control/storage.proto"
44+
gen_proto "${SHARED_DIR}/control/cloud.proto"
45+
46+
# Cloud protocol
47+
gen_proto "${SHARED_DIR}/cloud/cloud.proto"
48+
49+
# Internal definitions
50+
gen_proto "${INTERNAL_DIR}/network_config.proto"

proto_defs/import.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
PROTO_DEFS_MODULE_NAME = proto_defs
2+
PROTO_DEFS_MODULE_PATH ?= $(PROJECT_ROOT)/$(PROTO_DEFS_MODULE_NAME)
3+
include $(call rwildcard,$(PROTO_DEFS_MODULE_PATH)/,include.mk)
4+
5+
PROTO_DEFS_BUILD_PATH_EXT = $(BUILD_TARGET_PLATFORM)
6+
PROTO_DEFS_LIB_DIR = $(BUILD_PATH_BASE)/$(PROTO_DEFS_MODULE_NAME)/$(PROTO_DEFS_BUILD_PATH_EXT)
7+
PROTO_DEFS_LIB_DEP = $(PROTO_DEFS_LIB_DIR)/lib$(PROTO_DEFS_MODULE_NAME).a

proto_defs/include.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
INCLUDE_DIRS += $(PROTO_DEFS_MODULE_PATH)/src
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
syntax = "proto3";
2+
3+
package particle.firmware;
4+
5+
import "control/wifi_new.proto";
6+
import "control/cellular.proto";
7+
8+
import "nanopb.proto";
9+
10+
message WifiConfig {
11+
message Network {
12+
string ssid = 1;
13+
bytes bssid = 2 [(nanopb).max_size = 6];
14+
ctrl.wifi.Security security = 3;
15+
ctrl.wifi.Credentials credentials = 4;
16+
}
17+
18+
repeated Network networks = 1;
19+
}
20+
21+
message CellularConfig {
22+
ctrl.cellular.AccessPoint internal_sim = 1;
23+
ctrl.cellular.AccessPoint external_sim = 2;
24+
ctrl.cellular.SimType active_sim = 3;
25+
}

proto_defs/makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
MODULE = proto_defs
2+
PROTO_DEFS_MODULE_PATH = .
3+
4+
# Target this makefile is building.
5+
TARGET_TYPE = a
6+
7+
BUILD_PATH_EXT = $(PROTO_DEFS_BUILD_PATH_EXT)
8+
9+
DEPENDENCIES = third_party/nanopb
10+
MAKE_DEPENDENCIES = third_party/nanopb
11+
12+
include ../build/arm-tlm.mk

proto_defs/shared

Submodule shared added at fdae241

proto_defs/src/cloud/cloud.pb.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* Automatically generated nanopb constant definitions */
2+
/* Generated by nanopb-0.4.5 */
3+
4+
#include "cloud/cloud.pb.h"
5+
#if PB_PROTO_HEADER_VERSION != 40
6+
#error Regenerate this file with the current version of nanopb generator.
7+
#endif
8+
9+
PB_BIND(particle_cloud_ServerMovedPermanentlyRequest, particle_cloud_ServerMovedPermanentlyRequest, AUTO)
10+
11+
12+
PB_BIND(particle_cloud_ServerMovedPermanentlyResponse, particle_cloud_ServerMovedPermanentlyResponse, AUTO)
13+
14+
15+

proto_defs/src/cloud/cloud.pb.h

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/* Automatically generated nanopb header */
2+
/* Generated by nanopb-0.4.5 */
3+
4+
#ifndef PB_PARTICLE_CLOUD_CLOUD_CLOUD_PB_H_INCLUDED
5+
#define PB_PARTICLE_CLOUD_CLOUD_CLOUD_PB_H_INCLUDED
6+
#include <pb.h>
7+
8+
#if PB_PROTO_HEADER_VERSION != 40
9+
#error Regenerate this file with the current version of nanopb generator.
10+
#endif
11+
12+
/* Struct definitions */
13+
/* *
14+
A response for a ServerMovedPermanentlyRequest. */
15+
typedef struct _particle_cloud_ServerMovedPermanentlyResponse {
16+
char dummy_field;
17+
} particle_cloud_ServerMovedPermanentlyResponse;
18+
19+
/* *
20+
A request sent to the device to notify it that it must disconnect from the current server and
21+
use another server for further connections to the Cloud. */
22+
typedef struct _particle_cloud_ServerMovedPermanentlyRequest {
23+
/* *
24+
The address of the new server.
25+
26+
The address can be a domain name or IP address. A domain name may contain placeholder arguments
27+
such as `$id`. */
28+
pb_callback_t server_addr;
29+
/* *
30+
The port number of the new server. The default value is 5684. */
31+
uint32_t server_port;
32+
/* *
33+
The public key of the new server in DER format. */
34+
pb_callback_t server_pub_key;
35+
/* *
36+
The signature of the server details. */
37+
pb_callback_t sign;
38+
} particle_cloud_ServerMovedPermanentlyRequest;
39+
40+
41+
#ifdef __cplusplus
42+
extern "C" {
43+
#endif
44+
45+
/* Initializer values for message structs */
46+
#define particle_cloud_ServerMovedPermanentlyRequest_init_default {{{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}}
47+
#define particle_cloud_ServerMovedPermanentlyResponse_init_default {0}
48+
#define particle_cloud_ServerMovedPermanentlyRequest_init_zero {{{NULL}, NULL}, 0, {{NULL}, NULL}, {{NULL}, NULL}}
49+
#define particle_cloud_ServerMovedPermanentlyResponse_init_zero {0}
50+
51+
/* Field tags (for use in manual encoding/decoding) */
52+
#define particle_cloud_ServerMovedPermanentlyRequest_server_addr_tag 1
53+
#define particle_cloud_ServerMovedPermanentlyRequest_server_port_tag 2
54+
#define particle_cloud_ServerMovedPermanentlyRequest_server_pub_key_tag 3
55+
#define particle_cloud_ServerMovedPermanentlyRequest_sign_tag 4
56+
57+
/* Struct field encoding specification for nanopb */
58+
#define particle_cloud_ServerMovedPermanentlyRequest_FIELDLIST(X, a) \
59+
X(a, CALLBACK, SINGULAR, STRING, server_addr, 1) \
60+
X(a, STATIC, SINGULAR, UINT32, server_port, 2) \
61+
X(a, CALLBACK, SINGULAR, BYTES, server_pub_key, 3) \
62+
X(a, CALLBACK, SINGULAR, BYTES, sign, 4)
63+
#define particle_cloud_ServerMovedPermanentlyRequest_CALLBACK pb_default_field_callback
64+
#define particle_cloud_ServerMovedPermanentlyRequest_DEFAULT NULL
65+
66+
#define particle_cloud_ServerMovedPermanentlyResponse_FIELDLIST(X, a) \
67+
68+
#define particle_cloud_ServerMovedPermanentlyResponse_CALLBACK NULL
69+
#define particle_cloud_ServerMovedPermanentlyResponse_DEFAULT NULL
70+
71+
extern const pb_msgdesc_t particle_cloud_ServerMovedPermanentlyRequest_msg;
72+
extern const pb_msgdesc_t particle_cloud_ServerMovedPermanentlyResponse_msg;
73+
74+
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
75+
#define particle_cloud_ServerMovedPermanentlyRequest_fields &particle_cloud_ServerMovedPermanentlyRequest_msg
76+
#define particle_cloud_ServerMovedPermanentlyResponse_fields &particle_cloud_ServerMovedPermanentlyResponse_msg
77+
78+
/* Maximum encoded size of messages (where known) */
79+
/* particle_cloud_ServerMovedPermanentlyRequest_size depends on runtime parameters */
80+
#define particle_cloud_ServerMovedPermanentlyResponse_size 0
81+
82+
#ifdef __cplusplus
83+
} /* extern "C" */
84+
#endif
85+
86+
#endif

system/src/control/proto/cellular.pb.c renamed to proto_defs/src/control/cellular.pb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Automatically generated nanopb constant definitions */
22
/* Generated by nanopb-0.4.5 */
33

4-
#include "cellular.pb.h"
4+
#include "control/cellular.pb.h"
55
#if PB_PROTO_HEADER_VERSION != 40
66
#error Regenerate this file with the current version of nanopb generator.
77
#endif

0 commit comments

Comments
 (0)