Skip to content

Commit ff73043

Browse files
[create-pull-request] automated change (#47)
1 parent d209d39 commit ff73043

18 files changed

+560
-83
lines changed

src/meshtastic/admin.pb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ PB_BIND(meshtastic_HamParameters, meshtastic_HamParameters, AUTO)
1515
PB_BIND(meshtastic_NodeRemoteHardwarePinsResponse, meshtastic_NodeRemoteHardwarePinsResponse, 2)
1616

1717

18+
PB_BIND(meshtastic_SharedContact, meshtastic_SharedContact, AUTO)
19+
20+
21+
22+
1823

1924

2025

src/meshtastic/admin.pb.h

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ typedef enum _meshtastic_AdminMessage_ConfigType {
3434
meshtastic_AdminMessage_ConfigType_BLUETOOTH_CONFIG = 6,
3535
/* TODO: REPLACE */
3636
meshtastic_AdminMessage_ConfigType_SECURITY_CONFIG = 7,
37-
/* */
37+
/* Session key config */
3838
meshtastic_AdminMessage_ConfigType_SESSIONKEY_CONFIG = 8,
3939
/* device-ui config */
4040
meshtastic_AdminMessage_ConfigType_DEVICEUI_CONFIG = 9
@@ -70,6 +70,13 @@ typedef enum _meshtastic_AdminMessage_ModuleConfigType {
7070
meshtastic_AdminMessage_ModuleConfigType_PAXCOUNTER_CONFIG = 12
7171
} meshtastic_AdminMessage_ModuleConfigType;
7272

73+
typedef enum _meshtastic_AdminMessage_BackupLocation {
74+
/* Backup to the internal flash */
75+
meshtastic_AdminMessage_BackupLocation_FLASH = 0,
76+
/* Backup to the SD card */
77+
meshtastic_AdminMessage_BackupLocation_SD = 1
78+
} meshtastic_AdminMessage_BackupLocation;
79+
7380
/* Struct definitions */
7481
/* Parameters for setting up Meshtastic for ameteur radio usage */
7582
typedef struct _meshtastic_HamParameters {
@@ -92,6 +99,14 @@ typedef struct _meshtastic_NodeRemoteHardwarePinsResponse {
9299
meshtastic_NodeRemoteHardwarePin node_remote_hardware_pins[16];
93100
} meshtastic_NodeRemoteHardwarePinsResponse;
94101

102+
typedef struct _meshtastic_SharedContact {
103+
/* The node number of the contact */
104+
uint32_t node_num;
105+
/* The User of the contact */
106+
bool has_user;
107+
meshtastic_User user;
108+
} meshtastic_SharedContact;
109+
95110
typedef PB_BYTES_ARRAY_T(8) meshtastic_AdminMessage_session_passkey_t;
96111
/* This message is handled by the Admin module and is responsible for all settings/channel read/write operations.
97112
This message is used to do settings operations to both remote AND local nodes.
@@ -145,6 +160,12 @@ typedef struct _meshtastic_AdminMessage {
145160
char delete_file_request[201];
146161
/* Set zero and offset for scale chips */
147162
uint32_t set_scale;
163+
/* Backup the node's preferences */
164+
meshtastic_AdminMessage_BackupLocation backup_preferences;
165+
/* Restore the node's preferences */
166+
meshtastic_AdminMessage_BackupLocation restore_preferences;
167+
/* Remove backups of the node's preferences */
168+
meshtastic_AdminMessage_BackupLocation remove_backup_preferences;
148169
/* Set the owner for this node */
149170
meshtastic_User set_owner;
150171
/* Set channels (using the new API).
@@ -189,6 +210,8 @@ typedef struct _meshtastic_AdminMessage {
189210
bool begin_edit_settings;
190211
/* Commits an open transaction for any edits made to config, module config, owner, and channel settings */
191212
bool commit_edit_settings;
213+
/* Add a contact (User) to the nodedb */
214+
meshtastic_SharedContact add_contact;
192215
/* Tell the node to factory reset config everything; all device state and configuration will be returned to factory defaults and BLE bonds will be cleared. */
193216
int32_t factory_reset_device;
194217
/* Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot)
@@ -226,8 +249,16 @@ extern "C" {
226249
#define _meshtastic_AdminMessage_ModuleConfigType_MAX meshtastic_AdminMessage_ModuleConfigType_PAXCOUNTER_CONFIG
227250
#define _meshtastic_AdminMessage_ModuleConfigType_ARRAYSIZE ((meshtastic_AdminMessage_ModuleConfigType)(meshtastic_AdminMessage_ModuleConfigType_PAXCOUNTER_CONFIG+1))
228251

252+
#define _meshtastic_AdminMessage_BackupLocation_MIN meshtastic_AdminMessage_BackupLocation_FLASH
253+
#define _meshtastic_AdminMessage_BackupLocation_MAX meshtastic_AdminMessage_BackupLocation_SD
254+
#define _meshtastic_AdminMessage_BackupLocation_ARRAYSIZE ((meshtastic_AdminMessage_BackupLocation)(meshtastic_AdminMessage_BackupLocation_SD+1))
255+
229256
#define meshtastic_AdminMessage_payload_variant_get_config_request_ENUMTYPE meshtastic_AdminMessage_ConfigType
230257
#define meshtastic_AdminMessage_payload_variant_get_module_config_request_ENUMTYPE meshtastic_AdminMessage_ModuleConfigType
258+
#define meshtastic_AdminMessage_payload_variant_backup_preferences_ENUMTYPE meshtastic_AdminMessage_BackupLocation
259+
#define meshtastic_AdminMessage_payload_variant_restore_preferences_ENUMTYPE meshtastic_AdminMessage_BackupLocation
260+
#define meshtastic_AdminMessage_payload_variant_remove_backup_preferences_ENUMTYPE meshtastic_AdminMessage_BackupLocation
261+
231262

232263

233264

@@ -236,16 +267,20 @@ extern "C" {
236267
#define meshtastic_AdminMessage_init_default {0, {0}, {0, {0}}}
237268
#define meshtastic_HamParameters_init_default {"", 0, 0, ""}
238269
#define meshtastic_NodeRemoteHardwarePinsResponse_init_default {0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}}
270+
#define meshtastic_SharedContact_init_default {0, false, meshtastic_User_init_default}
239271
#define meshtastic_AdminMessage_init_zero {0, {0}, {0, {0}}}
240272
#define meshtastic_HamParameters_init_zero {"", 0, 0, ""}
241273
#define meshtastic_NodeRemoteHardwarePinsResponse_init_zero {0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}}
274+
#define meshtastic_SharedContact_init_zero {0, false, meshtastic_User_init_zero}
242275

243276
/* Field tags (for use in manual encoding/decoding) */
244277
#define meshtastic_HamParameters_call_sign_tag 1
245278
#define meshtastic_HamParameters_tx_power_tag 2
246279
#define meshtastic_HamParameters_frequency_tag 3
247280
#define meshtastic_HamParameters_short_name_tag 4
248281
#define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_tag 1
282+
#define meshtastic_SharedContact_node_num_tag 1
283+
#define meshtastic_SharedContact_user_tag 2
249284
#define meshtastic_AdminMessage_get_channel_request_tag 1
250285
#define meshtastic_AdminMessage_get_channel_response_tag 2
251286
#define meshtastic_AdminMessage_get_owner_request_tag 3
@@ -268,6 +303,9 @@ extern "C" {
268303
#define meshtastic_AdminMessage_enter_dfu_mode_request_tag 21
269304
#define meshtastic_AdminMessage_delete_file_request_tag 22
270305
#define meshtastic_AdminMessage_set_scale_tag 23
306+
#define meshtastic_AdminMessage_backup_preferences_tag 24
307+
#define meshtastic_AdminMessage_restore_preferences_tag 25
308+
#define meshtastic_AdminMessage_remove_backup_preferences_tag 26
271309
#define meshtastic_AdminMessage_set_owner_tag 32
272310
#define meshtastic_AdminMessage_set_channel_tag 33
273311
#define meshtastic_AdminMessage_set_config_tag 34
@@ -287,6 +325,7 @@ extern "C" {
287325
#define meshtastic_AdminMessage_remove_ignored_node_tag 48
288326
#define meshtastic_AdminMessage_begin_edit_settings_tag 64
289327
#define meshtastic_AdminMessage_commit_edit_settings_tag 65
328+
#define meshtastic_AdminMessage_add_contact_tag 66
290329
#define meshtastic_AdminMessage_factory_reset_device_tag 94
291330
#define meshtastic_AdminMessage_reboot_ota_seconds_tag 95
292331
#define meshtastic_AdminMessage_exit_simulator_tag 96
@@ -320,6 +359,9 @@ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_node_remote_hardware_pin
320359
X(a, STATIC, ONEOF, BOOL, (payload_variant,enter_dfu_mode_request,enter_dfu_mode_request), 21) \
321360
X(a, STATIC, ONEOF, STRING, (payload_variant,delete_file_request,delete_file_request), 22) \
322361
X(a, STATIC, ONEOF, UINT32, (payload_variant,set_scale,set_scale), 23) \
362+
X(a, STATIC, ONEOF, UENUM, (payload_variant,backup_preferences,backup_preferences), 24) \
363+
X(a, STATIC, ONEOF, UENUM, (payload_variant,restore_preferences,restore_preferences), 25) \
364+
X(a, STATIC, ONEOF, UENUM, (payload_variant,remove_backup_preferences,remove_backup_preferences), 26) \
323365
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_owner,set_owner), 32) \
324366
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_channel,set_channel), 33) \
325367
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_config,set_config), 34) \
@@ -339,6 +381,7 @@ X(a, STATIC, ONEOF, UINT32, (payload_variant,set_ignored_node,set_ignored
339381
X(a, STATIC, ONEOF, UINT32, (payload_variant,remove_ignored_node,remove_ignored_node), 48) \
340382
X(a, STATIC, ONEOF, BOOL, (payload_variant,begin_edit_settings,begin_edit_settings), 64) \
341383
X(a, STATIC, ONEOF, BOOL, (payload_variant,commit_edit_settings,commit_edit_settings), 65) \
384+
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,add_contact,add_contact), 66) \
342385
X(a, STATIC, ONEOF, INT32, (payload_variant,factory_reset_device,factory_reset_device), 94) \
343386
X(a, STATIC, ONEOF, INT32, (payload_variant,reboot_ota_seconds,reboot_ota_seconds), 95) \
344387
X(a, STATIC, ONEOF, BOOL, (payload_variant,exit_simulator,exit_simulator), 96) \
@@ -364,6 +407,7 @@ X(a, STATIC, SINGULAR, BYTES, session_passkey, 101)
364407
#define meshtastic_AdminMessage_payload_variant_set_fixed_position_MSGTYPE meshtastic_Position
365408
#define meshtastic_AdminMessage_payload_variant_get_ui_config_response_MSGTYPE meshtastic_DeviceUIConfig
366409
#define meshtastic_AdminMessage_payload_variant_store_ui_config_MSGTYPE meshtastic_DeviceUIConfig
410+
#define meshtastic_AdminMessage_payload_variant_add_contact_MSGTYPE meshtastic_SharedContact
367411

368412
#define meshtastic_HamParameters_FIELDLIST(X, a) \
369413
X(a, STATIC, SINGULAR, STRING, call_sign, 1) \
@@ -379,20 +423,30 @@ X(a, STATIC, REPEATED, MESSAGE, node_remote_hardware_pins, 1)
379423
#define meshtastic_NodeRemoteHardwarePinsResponse_DEFAULT NULL
380424
#define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_MSGTYPE meshtastic_NodeRemoteHardwarePin
381425

426+
#define meshtastic_SharedContact_FIELDLIST(X, a) \
427+
X(a, STATIC, SINGULAR, UINT32, node_num, 1) \
428+
X(a, STATIC, OPTIONAL, MESSAGE, user, 2)
429+
#define meshtastic_SharedContact_CALLBACK NULL
430+
#define meshtastic_SharedContact_DEFAULT NULL
431+
#define meshtastic_SharedContact_user_MSGTYPE meshtastic_User
432+
382433
extern const pb_msgdesc_t meshtastic_AdminMessage_msg;
383434
extern const pb_msgdesc_t meshtastic_HamParameters_msg;
384435
extern const pb_msgdesc_t meshtastic_NodeRemoteHardwarePinsResponse_msg;
436+
extern const pb_msgdesc_t meshtastic_SharedContact_msg;
385437

386438
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
387439
#define meshtastic_AdminMessage_fields &meshtastic_AdminMessage_msg
388440
#define meshtastic_HamParameters_fields &meshtastic_HamParameters_msg
389441
#define meshtastic_NodeRemoteHardwarePinsResponse_fields &meshtastic_NodeRemoteHardwarePinsResponse_msg
442+
#define meshtastic_SharedContact_fields &meshtastic_SharedContact_msg
390443

391444
/* Maximum encoded size of messages (where known) */
392445
#define MESHTASTIC_MESHTASTIC_ADMIN_PB_H_MAX_SIZE meshtastic_AdminMessage_size
393446
#define meshtastic_AdminMessage_size 511
394447
#define meshtastic_HamParameters_size 31
395448
#define meshtastic_NodeRemoteHardwarePinsResponse_size 496
449+
#define meshtastic_SharedContact_size 123
396450

397451
#ifdef __cplusplus
398452
} /* extern "C" */

src/meshtastic/config.pb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ PB_BIND(meshtastic_Config_SessionkeyConfig, meshtastic_Config_SessionkeyConfig,
6363

6464

6565

66+
67+
6668

6769

6870

0 commit comments

Comments
 (0)