Skip to content

Commit 03f4cbc

Browse files
authored
Merge pull request #25 from todd-herbert/master
Out of the box for Arduino IDE
2 parents 6bab3df + 305f67d commit 03f4cbc

Some content is hidden

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

61 files changed

+5100
-511
lines changed

.github/workflows/update_protobufs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ jobs:
1717
1818
- name: Download nanopb
1919
run: |
20-
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.7-linux-x86.tar.gz
21-
tar xvzf nanopb-0.4.7-linux-x86.tar.gz
22-
mv nanopb-0.4.7-linux-x86 nanopb-0.4.7
20+
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.9-linux-x86.tar.gz
21+
tar xvzf nanopb-0.4.9-linux-x86.tar.gz
22+
mv nanopb-0.4.9-linux-x86 nanopb-0.4.9
23+
cp nanopb-0.4.9/pb* ./src/
2324
2425
- name: Re-generate protocol buffers
2526
run: |

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ Driver for interfacing with Meshtastic nodes over WiFi and Serial connections.
44

55
Note: This is **not** the [Meshtastic firmware](https://github.com/meshtastic/firmware) for use on a supported device with LoRa chip.
66

7-
When using the Arduino IDE, install the Nanopb dependency as explained [here](https://www.dfrobot.com/blog-1161.html) under "Setting up the environment".
8-
97
Author: Mike Schiraldi

bin/regen-protos.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cd protobufs && ..\nanopb-0.4.7\generator-bin\protoc.exe --nanopb_out=-v:..\src -I=..\protobufs meshtastic\*.proto
1+
cd protobufs && ..\nanopb-0.4.9\generator-bin\protoc.exe --experimental_allow_proto3_optional "--nanopb_out=-S.c -v:..\src" -I=..\protobufs\ ..\protobufs\meshtastic\*.proto && rm ../src/meshtastic/deviceonly.*

bin/regen-protos.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
set -e
44

5-
echo "This script requires https://jpa.kapsi.fi/nanopb/download/ version 0.4.7 to be located in the"
5+
echo "This script requires https://jpa.kapsi.fi/nanopb/download/ version 0.4.9 to be located in the"
66
echo "firmware root directory if the following step fails, you should download the correct"
7-
echo "prebuilt binaries for your computer into nanopb-0.4.7"
7+
echo "prebuilt binaries for your computer into nanopb-0.4.9"
88

99
# the nanopb tool seems to require that the .options file be in the current directory!
1010
cd protobufs
11-
../nanopb-0.4.7/generator-bin/protoc --nanopb_out=-v:../src -I=../protobufs meshtastic/*.proto
11+
../nanopb-0.4.9/generator-bin/protoc --experimental_allow_proto3_optional "--nanopb_out=-S.c -v:../src/" -I=../protobufs meshtastic/*.proto
12+
13+
# remove the device only protobuf, so we don't need std::vector
14+
rm -rf ../src/meshtastic/deviceonly.*
1215

1316
#echo "Regenerating protobuf documentation - if you see an error message"
1417
#echo "you can ignore it unless doing a new protobuf release to github."

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name=Meshtastic
2-
version=0.0.5
2+
version=0.0.6
33
author=Meshtastic
44
maintainer=Meshtastic <meshtastic@meshtastic.org>
55
sentence=Driver for interfacing with Meshtastic nodes over WiFi and Serial connections
66
paragraph=This library allows devices to send and receive information through the Meshtastic network via the WiFi or Serial interface of one of its nodes. Note: this is not the Meshtastic firmware itself.
77
category=Communication
88
url=http://meshtastic.org
9-
architectures=*
9+
architectures=*

src/Meshtastic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <Arduino.h>
55
#include "meshtastic/mesh.pb.h"
6-
#include <pb_encode.h>
7-
#include <pb_decode.h>
6+
#include "pb_encode.h"
7+
#include "pb_decode.h"
88

99
// Some sane limits on a few strings that the protocol would otherwise allow to be unlimited length
1010
#define MAX_USER_ID_LEN (sizeof(meshtastic_User().id) - 1)

src/meshtastic/admin.pb.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb constant definitions */
2-
/* Generated by nanopb-0.4.7 */
2+
/* Generated by nanopb-0.4.9 */
33

44
#include "meshtastic/admin.pb.h"
55
#if PB_PROTO_HEADER_VERSION != 40
@@ -18,3 +18,5 @@ PB_BIND(meshtastic_NodeRemoteHardwarePinsResponse, meshtastic_NodeRemoteHardware
1818

1919

2020

21+
22+

src/meshtastic/admin.pb.h

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb header */
2-
/* Generated by nanopb-0.4.7 */
2+
/* Generated by nanopb-0.4.9 */
33

44
#ifndef PB_MESHTASTIC_MESHTASTIC_ADMIN_PB_H_INCLUDED
55
#define PB_MESHTASTIC_MESHTASTIC_ADMIN_PB_H_INCLUDED
@@ -9,6 +9,7 @@
99
#include "meshtastic/connection_status.pb.h"
1010
#include "meshtastic/mesh.pb.h"
1111
#include "meshtastic/module_config.pb.h"
12+
#include "meshtastic/device_ui.pb.h"
1213

1314
#if PB_PROTO_HEADER_VERSION != 40
1415
#error Regenerate this file with the current version of nanopb generator.
@@ -34,7 +35,9 @@ typedef enum _meshtastic_AdminMessage_ConfigType {
3435
/* TODO: REPLACE */
3536
meshtastic_AdminMessage_ConfigType_SECURITY_CONFIG = 7,
3637
/* */
37-
meshtastic_AdminMessage_ConfigType_SESSIONKEY_CONFIG = 8
38+
meshtastic_AdminMessage_ConfigType_SESSIONKEY_CONFIG = 8,
39+
/* device-ui config */
40+
meshtastic_AdminMessage_ConfigType_DEVICEUI_CONFIG = 9
3841
} meshtastic_AdminMessage_ConfigType;
3942

4043
/* TODO: REPLACE */
@@ -171,6 +174,12 @@ typedef struct _meshtastic_AdminMessage {
171174
/* Set time only on the node
172175
Convenience method to set the time on the node (as Net quality) without any other position data */
173176
uint32_t set_time_only;
177+
/* Tell the node to send the stored ui data. */
178+
bool get_ui_config_request;
179+
/* Reply stored device ui data. */
180+
meshtastic_DeviceUIConfig get_ui_config_response;
181+
/* Tell the node to store UI data persistently. */
182+
meshtastic_DeviceUIConfig store_ui_config;
174183
/* Begins an edit transaction for config, module config, owner, and channel settings changes
175184
This will delay the standard *implicit* save to the file system and subsequent reboot behavior until committed (commit_edit_settings) */
176185
bool begin_edit_settings;
@@ -206,8 +215,8 @@ extern "C" {
206215

207216
/* Helper constants for enums */
208217
#define _meshtastic_AdminMessage_ConfigType_MIN meshtastic_AdminMessage_ConfigType_DEVICE_CONFIG
209-
#define _meshtastic_AdminMessage_ConfigType_MAX meshtastic_AdminMessage_ConfigType_SESSIONKEY_CONFIG
210-
#define _meshtastic_AdminMessage_ConfigType_ARRAYSIZE ((meshtastic_AdminMessage_ConfigType)(meshtastic_AdminMessage_ConfigType_SESSIONKEY_CONFIG+1))
218+
#define _meshtastic_AdminMessage_ConfigType_MAX meshtastic_AdminMessage_ConfigType_DEVICEUI_CONFIG
219+
#define _meshtastic_AdminMessage_ConfigType_ARRAYSIZE ((meshtastic_AdminMessage_ConfigType)(meshtastic_AdminMessage_ConfigType_DEVICEUI_CONFIG+1))
211220

212221
#define _meshtastic_AdminMessage_ModuleConfigType_MIN meshtastic_AdminMessage_ModuleConfigType_MQTT_CONFIG
213222
#define _meshtastic_AdminMessage_ModuleConfigType_MAX meshtastic_AdminMessage_ModuleConfigType_PAXCOUNTER_CONFIG
@@ -267,6 +276,9 @@ extern "C" {
267276
#define meshtastic_AdminMessage_set_fixed_position_tag 41
268277
#define meshtastic_AdminMessage_remove_fixed_position_tag 42
269278
#define meshtastic_AdminMessage_set_time_only_tag 43
279+
#define meshtastic_AdminMessage_get_ui_config_request_tag 44
280+
#define meshtastic_AdminMessage_get_ui_config_response_tag 45
281+
#define meshtastic_AdminMessage_store_ui_config_tag 46
270282
#define meshtastic_AdminMessage_begin_edit_settings_tag 64
271283
#define meshtastic_AdminMessage_commit_edit_settings_tag 65
272284
#define meshtastic_AdminMessage_factory_reset_device_tag 94
@@ -314,6 +326,9 @@ X(a, STATIC, ONEOF, UINT32, (payload_variant,remove_favorite_node,remove_
314326
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_fixed_position,set_fixed_position), 41) \
315327
X(a, STATIC, ONEOF, BOOL, (payload_variant,remove_fixed_position,remove_fixed_position), 42) \
316328
X(a, STATIC, ONEOF, FIXED32, (payload_variant,set_time_only,set_time_only), 43) \
329+
X(a, STATIC, ONEOF, BOOL, (payload_variant,get_ui_config_request,get_ui_config_request), 44) \
330+
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_ui_config_response,get_ui_config_response), 45) \
331+
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,store_ui_config,store_ui_config), 46) \
317332
X(a, STATIC, ONEOF, BOOL, (payload_variant,begin_edit_settings,begin_edit_settings), 64) \
318333
X(a, STATIC, ONEOF, BOOL, (payload_variant,commit_edit_settings,commit_edit_settings), 65) \
319334
X(a, STATIC, ONEOF, INT32, (payload_variant,factory_reset_device,factory_reset_device), 94) \
@@ -339,6 +354,8 @@ X(a, STATIC, SINGULAR, BYTES, session_passkey, 101)
339354
#define meshtastic_AdminMessage_payload_variant_set_config_MSGTYPE meshtastic_Config
340355
#define meshtastic_AdminMessage_payload_variant_set_module_config_MSGTYPE meshtastic_ModuleConfig
341356
#define meshtastic_AdminMessage_payload_variant_set_fixed_position_MSGTYPE meshtastic_Position
357+
#define meshtastic_AdminMessage_payload_variant_get_ui_config_response_MSGTYPE meshtastic_DeviceUIConfig
358+
#define meshtastic_AdminMessage_payload_variant_store_ui_config_MSGTYPE meshtastic_DeviceUIConfig
342359

343360
#define meshtastic_HamParameters_FIELDLIST(X, a) \
344361
X(a, STATIC, SINGULAR, STRING, call_sign, 1) \
@@ -364,6 +381,7 @@ extern const pb_msgdesc_t meshtastic_NodeRemoteHardwarePinsResponse_msg;
364381
#define meshtastic_NodeRemoteHardwarePinsResponse_fields &meshtastic_NodeRemoteHardwarePinsResponse_msg
365382

366383
/* Maximum encoded size of messages (where known) */
384+
#define MESHTASTIC_MESHTASTIC_ADMIN_PB_H_MAX_SIZE meshtastic_AdminMessage_size
367385
#define meshtastic_AdminMessage_size 511
368386
#define meshtastic_HamParameters_size 31
369387
#define meshtastic_NodeRemoteHardwarePinsResponse_size 496

src/meshtastic/apponly.pb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb constant definitions */
2-
/* Generated by nanopb-0.4.7 */
2+
/* Generated by nanopb-0.4.9 */
33

44
#include "meshtastic/apponly.pb.h"
55
#if PB_PROTO_HEADER_VERSION != 40

0 commit comments

Comments
 (0)