From 0e7797f3bbcf06b86aa097e11d565670b04b8d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 8 Jan 2023 18:15:51 +0100 Subject: [PATCH 01/20] Adding to generated for now, protobuf PR will come when it works ... :-) --- src/mesh/PhoneAPI.cpp | 18 ++- src/mesh/PhoneAPI.h | 3 + src/mesh/generated/mesh.pb.h | 14 ++- src/mesh/generated/xmodem.pb.c | 13 +++ src/mesh/generated/xmodem.pb.h | 77 +++++++++++++ src/xmodem.cpp | 201 +++++++++++++++++++++++++++++++++ src/xmodem.h | 71 ++++++++++++ 7 files changed, 394 insertions(+), 3 deletions(-) create mode 100644 src/mesh/generated/xmodem.pb.c create mode 100644 src/mesh/generated/xmodem.pb.h create mode 100644 src/xmodem.cpp create mode 100644 src/xmodem.h diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index c1d56b7ec..90c340cce 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -6,6 +6,7 @@ #include "PowerFSM.h" #include "RadioInterface.h" #include "configuration.h" +#include "xmodem.h" #include #if FromRadio_size > MAX_TO_FROM_RADIO_SIZE @@ -91,6 +92,10 @@ bool PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength) LOG_INFO("Disconnecting from phone\n"); close(); break; + case ToRadio_xmodemPacket_tag: + LOG_INFO("Got xmodem packet\n"); + xModem.handlePacket(toRadioScratch.xmodemPacket); + break; default: // Ignore nop messages // LOG_DEBUG("Error: unexpected ToRadio variant\n"); @@ -284,10 +289,14 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) // Do we have a message from the mesh? LOG_INFO("getFromRadio=STATE_SEND_PACKETS\n"); if (queueStatusPacketForPhone) { - fromRadioScratch.which_payload_variant = FromRadio_queueStatus_tag; fromRadioScratch.queueStatus = *queueStatusPacketForPhone; releaseQueueStatusPhonePacket(); + } else if (xmodemPacketForPhone) { + fromRadioScratch.which_payload_variant = FromRadio_xmodemPacket_tag; + fromRadioScratch.xmodemPacket = *xmodemPacketForPhone; + free(xmodemPacketForPhone); + xmodemPacketForPhone = NULL; } else if (packetForPhone) { printPacket("phone downloaded packet", packetForPhone); @@ -350,6 +359,7 @@ bool PhoneAPI::available() case STATE_SEND_MODULECONFIG: case STATE_SEND_COMPLETE_ID: return true; + case STATE_SEND_NODEINFO: if (!nodeInfoForPhone) nodeInfoForPhone = nodeDB.readNextInfo(); @@ -362,6 +372,12 @@ bool PhoneAPI::available() if (hasPacket) return true; + if (!xmodemPacketForPhone) + xmodemPacketForPhone = xModem.getForPhone(); + hasPacket = !!packetForPhone; + if (hasPacket) + return true; + if (!packetForPhone) packetForPhone = service.getForPhone(); hasPacket = !!packetForPhone; diff --git a/src/mesh/PhoneAPI.h b/src/mesh/PhoneAPI.h index 2f2695807..8e28efcbf 100644 --- a/src/mesh/PhoneAPI.h +++ b/src/mesh/PhoneAPI.h @@ -42,6 +42,9 @@ class PhoneAPI : public Observer // FIXME, we shouldn't be inheriting /// downloads it MeshPacket *packetForPhone = NULL; + // file transfer packets destined for phone. Push it to the queue then free it. + XModem *xmodemPacketForPhone = NULL; + // Keep QueueStatus packet just as packetForPhone QueueStatus *queueStatusPacketForPhone = NULL; diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index d1f3e5bf5..064b9cdcb 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -9,6 +9,7 @@ #include "module_config.pb.h" #include "portnums.pb.h" #include "telemetry.pb.h" +#include "xmodem.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. @@ -670,6 +671,8 @@ typedef struct _FromRadio { Channel channel; /* Queue status info */ QueueStatus queueStatus; + /* File Transfer Chunk */ + XModem xmodemPacket; }; } FromRadio; @@ -693,6 +696,7 @@ typedef struct _ToRadio { This is useful for serial links where there is no hardware/protocol based notification that the client has dropped the link. (Sending this message is optional for clients) */ bool disconnect; + XModem xmodemPacket; }; } ToRadio; @@ -904,9 +908,11 @@ extern "C" { #define FromRadio_moduleConfig_tag 9 #define FromRadio_channel_tag 10 #define FromRadio_queueStatus_tag 11 +#define FromRadio_xmodemPacket_tag 12 #define ToRadio_packet_tag 1 #define ToRadio_want_config_id_tag 3 #define ToRadio_disconnect_tag 4 +#define ToRadio_xmodemPacket_tag 5 #define Compressed_portnum_tag 1 #define Compressed_data_tag 2 @@ -1062,7 +1068,8 @@ X(a, STATIC, ONEOF, UINT32, (payload_variant,config_complete_id,config_co X(a, STATIC, ONEOF, BOOL, (payload_variant,rebooted,rebooted), 8) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,moduleConfig,moduleConfig), 9) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,channel,channel), 10) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,queueStatus,queueStatus), 11) +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,queueStatus,queueStatus), 11) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,xmodemPacket,xmodemPacket), 12) #define FromRadio_CALLBACK NULL #define FromRadio_DEFAULT NULL #define FromRadio_payload_variant_packet_MSGTYPE MeshPacket @@ -1073,14 +1080,17 @@ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,queueStatus,queueStatus), 1 #define FromRadio_payload_variant_moduleConfig_MSGTYPE ModuleConfig #define FromRadio_payload_variant_channel_MSGTYPE Channel #define FromRadio_payload_variant_queueStatus_MSGTYPE QueueStatus +#define FromRadio_payload_variant_xmodemPacket_MSGTYPE XModem #define ToRadio_FIELDLIST(X, a) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,packet,packet), 1) \ X(a, STATIC, ONEOF, UINT32, (payload_variant,want_config_id,want_config_id), 3) \ -X(a, STATIC, ONEOF, BOOL, (payload_variant,disconnect,disconnect), 4) +X(a, STATIC, ONEOF, BOOL, (payload_variant,disconnect,disconnect), 4) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,xmodemPacket,xmodemPacket), 5) #define ToRadio_CALLBACK NULL #define ToRadio_DEFAULT NULL #define ToRadio_payload_variant_packet_MSGTYPE MeshPacket +#define ToRadio_payload_variant_xmodemPacket_MSGTYPE XModem #define Compressed_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UENUM, portnum, 1) \ diff --git a/src/mesh/generated/xmodem.pb.c b/src/mesh/generated/xmodem.pb.c new file mode 100644 index 000000000..f210380fe --- /dev/null +++ b/src/mesh/generated/xmodem.pb.c @@ -0,0 +1,13 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "xmodem.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(XModem, XModem, AUTO) + + + + diff --git a/src/mesh/generated/xmodem.pb.h b/src/mesh/generated/xmodem.pb.h new file mode 100644 index 000000000..e5fd33234 --- /dev/null +++ b/src/mesh/generated/xmodem.pb.h @@ -0,0 +1,77 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_XMODEM_PB_H_INCLUDED +#define PB_XMODEM_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +typedef enum _XModem_Control { + XModem_Control_NUL = 0, + XModem_Control_SOH = 1, + XModem_Control_STX = 2, + XModem_Control_EOT = 4, + XModem_Control_ACK = 6, + XModem_Control_NAK = 21, + XModem_Control_CAN = 24, + XModem_Control_CTRLZ = 26 +} XModem_Control; + +/* Struct definitions */ +typedef PB_BYTES_ARRAY_T(128) XModem_buffer_t; +typedef struct _XModem { + XModem_Control control; + uint8_t seq; + uint16_t crc16; + XModem_buffer_t buffer; +} XModem; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Helper constants for enums */ +#define _XModem_Control_MIN XModem_Control_NUL +#define _XModem_Control_MAX XModem_Control_CTRLZ +#define _XModem_Control_ARRAYSIZE ((XModem_Control)(XModem_Control_CTRLZ+1)) + +#define XModem_control_ENUMTYPE XModem_Control + + +/* Initializer values for message structs */ +#define XModem_init_default {_XModem_Control_MIN, 0, 0, {0, {0}}} +#define XModem_init_zero {_XModem_Control_MIN, 0, 0, {0, {0}}} + +/* Field tags (for use in manual encoding/decoding) */ +#define XModem_control_tag 1 +#define XModem_seq_tag 2 +#define XModem_crc16_tag 3 +#define XModem_buffer_tag 4 + +/* Struct field encoding specification for nanopb */ +#define XModem_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, control, 1) \ +X(a, STATIC, SINGULAR, UINT32, seq, 2) \ +X(a, STATIC, SINGULAR, UINT32, crc16, 3) \ +X(a, STATIC, SINGULAR, BYTES, buffer, 4) +#define XModem_CALLBACK NULL +#define XModem_DEFAULT NULL + +extern const pb_msgdesc_t XModem_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define XModem_fields &XModem_msg + +/* Maximum encoded size of messages (where known) */ +#define XModem_size 140 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/xmodem.cpp b/src/xmodem.cpp new file mode 100644 index 000000000..bbbf751e1 --- /dev/null +++ b/src/xmodem.cpp @@ -0,0 +1,201 @@ +/*********************************************************************************************************************** + * XMODEM implementation with YMODEM support + *********************************************************************************************************************** + * Copyright 2001-2019 Georges Menie (www.menie.org) + * Modified by Thuffir in 2019 + * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the University of California, Berkeley nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **********************************************************************************************************************/ + +#include "xmodem.h" + +XModemAdapter xModem; + +XModemAdapter::XModemAdapter() +{ +} + +unsigned short XModemAdapter::crc16_ccitt(const pb_byte_t *buffer, int length) +{ + unsigned short crc16 = 0; + while(length != 0) { + crc16 = (unsigned char)(crc16 >> 8) | (crc16 << 8); + crc16 ^= *buffer; + crc16 ^= (unsigned char)(crc16 & 0xff) >> 4; + crc16 ^= (crc16 << 8) << 4; + crc16 ^= ((crc16 & 0xff) << 4) << 1; + buffer++; + length--; + } + + return crc16; +} + +int XModemAdapter::check(const pb_byte_t *buf, int sz, unsigned short tcrc) +{ + unsigned short crc = crc16_ccitt(buf, sz); + if (crc == tcrc) + return 1; + else + return 0; +} + +void XModemAdapter::sendControl(XModem_Control c) { + memset(xmodemStore, 0, XModem_size); + xmodemStore->control = c; +} + +XModem *XModemAdapter::getForPhone() +{ + if(xmodemStore) { + return xmodemStore; + } else { + return NULL; + } +} + +void XModemAdapter::handlePacket(XModem xmodemPacket) +{ + switch(xmodemPacket.control) { + case XModem_Control_SOH: + case XModem_Control_STX: + if ((xmodemPacket.seq == 0) && !isReceiving && !isTransmitting) { + // NULL packet has the destination filename + memcpy(filename, &xmodemPacket.buffer.bytes, xmodemPacket.buffer.size); + if(xmodemPacket.control == XModem_Control_SOH) { // Receive this file and put to Flash + file = FSCom.open(filename, FILE_O_WRITE); + if(file) { + sendControl(XModem_Control_ACK); + isReceiving = true; + packetno = 1; + break; + } + sendControl(XModem_Control_NAK); + isReceiving = false; + break; + } else { // Transmit this file from Flash + file = FSCom.open(filename, FILE_O_READ); + if (file) { + packetno = 1; + isTransmitting = true; + memset(xmodemStore, 0, XModem_size); + xmodemStore->control = XModem_Control_SOH; + xmodemStore->seq = packetno; + xmodemStore->buffer.size = file.read(xmodemStore->buffer.bytes, sizeof(XModem_buffer_t::bytes)); + xmodemStore->crc16 = crc16_ccitt(xmodemStore->buffer.bytes, xmodemStore->buffer.size); + break; + } + sendControl(XModem_Control_NAK); + isTransmitting = false; + break; + } + } else { + if (isReceiving) { + // normal file data packet + if ((xmodemPacket.seq == packetno) && check(xmodemPacket.buffer.bytes, xmodemPacket.buffer.size, xmodemPacket.crc16)) { + // valid packet + file.write(xmodemPacket.buffer.bytes, xmodemPacket.buffer.size); + sendControl(XModem_Control_ACK); + packetno++; + break; + } + // invalid packet + sendControl(XModem_Control_NAK); + break; + } else if (isTransmitting) { + // just received something weird. + sendControl(XModem_Control_CAN); + isTransmitting = false; + break; + } + } + break; + case XModem_Control_EOT: + // End of transmission + sendControl(XModem_Control_ACK); + file.close(); + isReceiving = false; + break; + case XModem_Control_CAN: + // Cancel transmission and remove file + sendControl(XModem_Control_ACK); + file.close(); + FSCom.remove(filename); + isReceiving = false; + break; + case XModem_Control_ACK: + // Acknowledge Send the next packet + if (isTransmitting) { + if (isEOT) { + sendControl(XModem_Control_EOT); + file.close(); + isTransmitting = false; + isEOT = false; + break; + } + retrans = MAXRETRANS; // reset retransmit counter + packetno++; + memset(xmodemStore, 0, XModem_size); + xmodemStore->control = XModem_Control_SOH; + xmodemStore->seq = packetno; + xmodemStore->buffer.size = file.read(xmodemStore->buffer.bytes, sizeof(XModem_buffer_t::bytes)); + xmodemStore->crc16 = crc16_ccitt(xmodemStore->buffer.bytes, xmodemStore->buffer.size); + if (xmodemStore->buffer.size < sizeof(XModem_buffer_t::bytes)) { + isEOT = true; + // send EOT on next Ack + } + } else { + // just received something weird. + sendControl(XModem_Control_CAN); + } + break; + case XModem_Control_NAK: + // Negative acknowledge. Send the same buffer again + if (isTransmitting) { + if (--retrans <= 0) { + sendControl(XModem_Control_CAN); + file.close(); + isTransmitting = false; + break; + } + memset(xmodemStore, 0, XModem_size); + xmodemStore->control = XModem_Control_SOH; + xmodemStore->seq = packetno; + file.seek((packetno-1) * sizeof(XModem_buffer_t::bytes)); + xmodemStore->buffer.size = file.read(xmodemStore->buffer.bytes, sizeof(XModem_buffer_t::bytes)); + xmodemStore->crc16 = crc16_ccitt(xmodemStore->buffer.bytes, xmodemStore->buffer.size); + if (xmodemStore->buffer.size < sizeof(XModem_buffer_t::bytes)) { + isEOT = true; + // send EOT on next Ack + } + } else { + // just received something weird. + sendControl(XModem_Control_CAN); + } + break; + default: + // Unknown control character + break; + } +} diff --git a/src/xmodem.h b/src/xmodem.h new file mode 100644 index 000000000..819ab970b --- /dev/null +++ b/src/xmodem.h @@ -0,0 +1,71 @@ +/*********************************************************************************************************************** + * XMODEM implementation with YMODEM support + *********************************************************************************************************************** + * Copyright 2001-2019 Georges Menie (www.menie.org) + * Modified by Thuffir in 2019 + * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the University of California, Berkeley nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **********************************************************************************************************************/ + +#pragma once + +#include "configuration.h" +#include "mesh/generated/xmodem.pb.h" +#include "FSCommon.h" + +#define MAXRETRANS 25 + +class XModemAdapter +{ + public: + XModemAdapter(); + + void handlePacket(XModem xmodemPacket); + XModem *getForPhone(); + + private: + bool isReceiving = false; + bool isTransmitting = false; + bool isEOT = false; + + int retrans = MAXRETRANS; + + unsigned char packetno = 0; + +#ifdef ARCH_NRF52 + File file = File(FSCom); +#else + File file; +#endif + + char filename[sizeof(XModem_buffer_t::bytes)] = {0}; + + protected: + XModem *xmodemStore = NULL; + unsigned short crc16_ccitt(const pb_byte_t *buffer, int length); + int check(const pb_byte_t *buf, int sz, unsigned short tcrc); + void sendControl(XModem_Control c); +}; + +extern XModemAdapter xModem; From fce52e16e34128890e77b5e8aeed183712f81e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 8 Jan 2023 18:34:56 +0100 Subject: [PATCH 02/20] update license. This is only loosely based on Xmodem. --- src/xmodem.cpp | 6 ++++-- src/xmodem.h | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/xmodem.cpp b/src/xmodem.cpp index bbbf751e1..9eeca4a8c 100644 --- a/src/xmodem.cpp +++ b/src/xmodem.cpp @@ -1,9 +1,11 @@ /*********************************************************************************************************************** - * XMODEM implementation with YMODEM support + * based on XMODEM implementation by Georges Menie (www.menie.org) *********************************************************************************************************************** * Copyright 2001-2019 Georges Menie (www.menie.org) - * Modified by Thuffir in 2019 * All rights reserved. + * + * Adapted for protobuf encapsulation. this is not really Xmodem any more. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * diff --git a/src/xmodem.h b/src/xmodem.h index 819ab970b..0032eb92e 100644 --- a/src/xmodem.h +++ b/src/xmodem.h @@ -1,9 +1,11 @@ /*********************************************************************************************************************** - * XMODEM implementation with YMODEM support + * based on XMODEM implementation by Georges Menie (www.menie.org) *********************************************************************************************************************** * Copyright 2001-2019 Georges Menie (www.menie.org) - * Modified by Thuffir in 2019 * All rights reserved. + * + * Adapted for protobuf encapsulation. this is not really Xmodem any more. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * From 3a6e3464e69a6e9afaffb6e6075568dae7b7026c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 9 Jan 2023 20:06:11 +0100 Subject: [PATCH 03/20] notify phoneAPI about new packages to process --- src/mesh/PhoneAPI.cpp | 2 ++ src/xmodem.cpp | 4 ++++ src/xmodem.h | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 90c340cce..4fc87a9fa 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -33,6 +33,7 @@ void PhoneAPI::handleStartConfig() if (!isConnected()) { onConnectionChanged(true); observe(&service.fromNumChanged); + observe(&xModem.packetReady); } // even if we were already connected - restart our state machine @@ -50,6 +51,7 @@ void PhoneAPI::close() state = STATE_SEND_NOTHING; unobserve(&service.fromNumChanged); + unobserve(&xModem.packetReady); releasePhonePacket(); // Don't leak phone packets on shutdown releaseQueueStatusPhonePacket(); diff --git a/src/xmodem.cpp b/src/xmodem.cpp index 9eeca4a8c..1f8d213c4 100644 --- a/src/xmodem.cpp +++ b/src/xmodem.cpp @@ -66,6 +66,7 @@ int XModemAdapter::check(const pb_byte_t *buf, int sz, unsigned short tcrc) void XModemAdapter::sendControl(XModem_Control c) { memset(xmodemStore, 0, XModem_size); xmodemStore->control = c; + packetReady.notifyObservers(packetno); } XModem *XModemAdapter::getForPhone() @@ -106,6 +107,7 @@ void XModemAdapter::handlePacket(XModem xmodemPacket) xmodemStore->seq = packetno; xmodemStore->buffer.size = file.read(xmodemStore->buffer.bytes, sizeof(XModem_buffer_t::bytes)); xmodemStore->crc16 = crc16_ccitt(xmodemStore->buffer.bytes, xmodemStore->buffer.size); + packetReady.notifyObservers(packetno); break; } sendControl(XModem_Control_NAK); @@ -167,6 +169,7 @@ void XModemAdapter::handlePacket(XModem xmodemPacket) isEOT = true; // send EOT on next Ack } + packetReady.notifyObservers(packetno); } else { // just received something weird. sendControl(XModem_Control_CAN); @@ -191,6 +194,7 @@ void XModemAdapter::handlePacket(XModem xmodemPacket) isEOT = true; // send EOT on next Ack } + packetReady.notifyObservers(packetno); } else { // just received something weird. sendControl(XModem_Control_CAN); diff --git a/src/xmodem.h b/src/xmodem.h index 0032eb92e..3de55ea39 100644 --- a/src/xmodem.h +++ b/src/xmodem.h @@ -41,6 +41,9 @@ class XModemAdapter { public: + // Called when we put a fragment in the outgoing memory + Observable packetReady; + XModemAdapter(); void handlePacket(XModem xmodemPacket); From c63536d948df8869e047d10c6e89a559f6a9bb0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 9 Jan 2023 20:23:32 +0100 Subject: [PATCH 04/20] switch to 16 bit packet number --- src/mesh/generated/mesh.pb.h | 1 + src/mesh/generated/xmodem.pb.h | 4 ++-- src/xmodem.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 064b9cdcb..6380092ac 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -696,6 +696,7 @@ typedef struct _ToRadio { This is useful for serial links where there is no hardware/protocol based notification that the client has dropped the link. (Sending this message is optional for clients) */ bool disconnect; + /* File Transfer Chunk */ XModem xmodemPacket; }; } ToRadio; diff --git a/src/mesh/generated/xmodem.pb.h b/src/mesh/generated/xmodem.pb.h index e5fd33234..453c8ce7c 100644 --- a/src/mesh/generated/xmodem.pb.h +++ b/src/mesh/generated/xmodem.pb.h @@ -25,7 +25,7 @@ typedef enum _XModem_Control { typedef PB_BYTES_ARRAY_T(128) XModem_buffer_t; typedef struct _XModem { XModem_Control control; - uint8_t seq; + uint16_t seq; uint16_t crc16; XModem_buffer_t buffer; } XModem; @@ -68,7 +68,7 @@ extern const pb_msgdesc_t XModem_msg; #define XModem_fields &XModem_msg /* Maximum encoded size of messages (where known) */ -#define XModem_size 140 +#define XModem_size 141 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/xmodem.h b/src/xmodem.h index 3de55ea39..6c2418926 100644 --- a/src/xmodem.h +++ b/src/xmodem.h @@ -56,7 +56,7 @@ class XModemAdapter int retrans = MAXRETRANS; - unsigned char packetno = 0; + uint16_t packetno = 0; #ifdef ARCH_NRF52 File file = File(FSCom); From 5e66dd0dadfb9f578b8150805f4d9efe86decd76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 12 Jan 2023 10:00:52 +0100 Subject: [PATCH 05/20] File Transfer: add debug logging and allocate memory used. --- src/xmodem.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/xmodem.cpp b/src/xmodem.cpp index 1f8d213c4..4f61c6c96 100644 --- a/src/xmodem.cpp +++ b/src/xmodem.cpp @@ -36,6 +36,7 @@ XModemAdapter xModem; XModemAdapter::XModemAdapter() { + xmodemStore = (XModem*)malloc(XModem_size); } unsigned short XModemAdapter::crc16_ccitt(const pb_byte_t *buffer, int length) @@ -66,6 +67,7 @@ int XModemAdapter::check(const pb_byte_t *buf, int sz, unsigned short tcrc) void XModemAdapter::sendControl(XModem_Control c) { memset(xmodemStore, 0, XModem_size); xmodemStore->control = c; + LOG_DEBUG("XModem: Notify Sending control %d.\n", c); packetReady.notifyObservers(packetno); } @@ -98,6 +100,7 @@ void XModemAdapter::handlePacket(XModem xmodemPacket) isReceiving = false; break; } else { // Transmit this file from Flash + LOG_INFO("XModem: Transmitting file %s\n", filename); file = FSCom.open(filename, FILE_O_READ); if (file) { packetno = 1; @@ -107,6 +110,11 @@ void XModemAdapter::handlePacket(XModem xmodemPacket) xmodemStore->seq = packetno; xmodemStore->buffer.size = file.read(xmodemStore->buffer.bytes, sizeof(XModem_buffer_t::bytes)); xmodemStore->crc16 = crc16_ccitt(xmodemStore->buffer.bytes, xmodemStore->buffer.size); + LOG_DEBUG("XModem: STX Notify Sending packet %d, %d Bytes.\n", packetno, xmodemStore->buffer.size); + if (xmodemStore->buffer.size < sizeof(XModem_buffer_t::bytes)) { + isEOT = true; + // send EOT on next Ack + } packetReady.notifyObservers(packetno); break; } @@ -154,6 +162,7 @@ void XModemAdapter::handlePacket(XModem xmodemPacket) if (isEOT) { sendControl(XModem_Control_EOT); file.close(); + LOG_INFO("XModem: Finished sending file %s\n", filename); isTransmitting = false; isEOT = false; break; @@ -165,6 +174,7 @@ void XModemAdapter::handlePacket(XModem xmodemPacket) xmodemStore->seq = packetno; xmodemStore->buffer.size = file.read(xmodemStore->buffer.bytes, sizeof(XModem_buffer_t::bytes)); xmodemStore->crc16 = crc16_ccitt(xmodemStore->buffer.bytes, xmodemStore->buffer.size); + LOG_DEBUG("XModem: ACK Notify Sending packet %d, %d Bytes.\n", packetno, xmodemStore->buffer.size); if (xmodemStore->buffer.size < sizeof(XModem_buffer_t::bytes)) { isEOT = true; // send EOT on next Ack @@ -181,6 +191,7 @@ void XModemAdapter::handlePacket(XModem xmodemPacket) if (--retrans <= 0) { sendControl(XModem_Control_CAN); file.close(); + LOG_INFO("XModem: Retransmit timeout, cancelling file %s\n", filename); isTransmitting = false; break; } @@ -190,6 +201,7 @@ void XModemAdapter::handlePacket(XModem xmodemPacket) file.seek((packetno-1) * sizeof(XModem_buffer_t::bytes)); xmodemStore->buffer.size = file.read(xmodemStore->buffer.bytes, sizeof(XModem_buffer_t::bytes)); xmodemStore->crc16 = crc16_ccitt(xmodemStore->buffer.bytes, xmodemStore->buffer.size); + LOG_DEBUG("XModem: NAK Notify Sending packet %d, %d Bytes.\n", packetno, xmodemStore->buffer.size); if (xmodemStore->buffer.size < sizeof(XModem_buffer_t::bytes)) { isEOT = true; // send EOT on next Ack From db3d66544dde3c8ada4cee48fabe627d2e9aadec Mon Sep 17 00:00:00 2001 From: Sacha Weatherstone Date: Tue, 17 Jan 2023 16:35:26 +1000 Subject: [PATCH 06/20] Setup Trunk (#2143) Co-authored-by: Ben Meadors --- .github/workflows/main_matrix.yml | 11 ++- .github/workflows/nightly.yml | 19 +++++ .trunk/.gitignore | 7 ++ .clang-format => .trunk/configs/.clang-format | 0 .trunk/configs/.hadolint.yaml | 4 + .trunk/configs/.markdownlint.yaml | 10 +++ .trunk/configs/.shellcheckrc | 7 ++ .trunk/configs/svgo.config.js | 14 ++++ .trunk/trunk.yaml | 32 ++++++++ .vscode/extensions.json | 6 +- .vscode/settings.json | 82 +------------------ 11 files changed, 105 insertions(+), 87 deletions(-) create mode 100644 .github/workflows/nightly.yml create mode 100644 .trunk/.gitignore rename .clang-format => .trunk/configs/.clang-format (100%) create mode 100644 .trunk/configs/.hadolint.yaml create mode 100644 .trunk/configs/.markdownlint.yaml create mode 100644 .trunk/configs/.shellcheckrc create mode 100644 .trunk/configs/svgo.config.js create mode 100644 .trunk/trunk.yaml diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 1953619c8..420ad0e35 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -33,7 +33,7 @@ jobs: - board: m5stack-coreink - board: tbeam-s3-core - board: tlora-t3s3-v1 - + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -41,6 +41,9 @@ jobs: id: base uses: ./.github/actions/setup-base + - name: Trunk Check + uses: trunk-io/trunk-action@v1 + - name: Check ${{ matrix.board }} run: bin/check-all.sh ${{ matrix.board }} @@ -132,11 +135,11 @@ jobs: path: | release/device-*.sh release/device-*.bat - + - name: Docker login if: ${{ github.event_name == 'workflow_dispatch' }} uses: docker/login-action@v2 - with: + with: username: meshtastic password: ${{ secrets.DOCKER_TOKEN }} @@ -152,7 +155,7 @@ jobs: file: ./Dockerfile push: true tags: meshtastic/device-simulator:latest - + after-checks: runs-on: ubuntu-latest needs: [check] diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..d9d52a2a4 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,19 @@ +name: Nightly +on: + schedule: + - cron: 0 8 * * 1-5 + workflow_dispatch: {} + +jobs: + trunk_check: + name: Trunk Check Upload + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Trunk Check + uses: trunk-io/trunk-action@v1 + with: + trunk-token: ${{ secrets.TRUNK_TOKEN }} diff --git a/.trunk/.gitignore b/.trunk/.gitignore new file mode 100644 index 000000000..cf2f25470 --- /dev/null +++ b/.trunk/.gitignore @@ -0,0 +1,7 @@ +*out +*logs +*actions +*notifications +plugins +user_trunk.yaml +user.yaml diff --git a/.clang-format b/.trunk/configs/.clang-format similarity index 100% rename from .clang-format rename to .trunk/configs/.clang-format diff --git a/.trunk/configs/.hadolint.yaml b/.trunk/configs/.hadolint.yaml new file mode 100644 index 000000000..98bf0cd2e --- /dev/null +++ b/.trunk/configs/.hadolint.yaml @@ -0,0 +1,4 @@ +# Following source doesn't work in most setups +ignored: + - SC1090 + - SC1091 diff --git a/.trunk/configs/.markdownlint.yaml b/.trunk/configs/.markdownlint.yaml new file mode 100644 index 000000000..fb940393d --- /dev/null +++ b/.trunk/configs/.markdownlint.yaml @@ -0,0 +1,10 @@ +# Autoformatter friendly markdownlint config (all formatting rules disabled) +default: true +blank_lines: false +bullet: false +html: false +indentation: false +line_length: false +spaces: false +url: false +whitespace: false diff --git a/.trunk/configs/.shellcheckrc b/.trunk/configs/.shellcheckrc new file mode 100644 index 000000000..8c7b1ada8 --- /dev/null +++ b/.trunk/configs/.shellcheckrc @@ -0,0 +1,7 @@ +enable=all +source-path=SCRIPTDIR +disable=SC2154 + +# If you're having issues with shellcheck following source, disable the errors via: +# disable=SC1090 +# disable=SC1091 diff --git a/.trunk/configs/svgo.config.js b/.trunk/configs/svgo.config.js new file mode 100644 index 000000000..b257d1349 --- /dev/null +++ b/.trunk/configs/svgo.config.js @@ -0,0 +1,14 @@ +module.exports = { + plugins: [ + { + name: "preset-default", + params: { + overrides: { + removeViewBox: false, // https://github.com/svg/svgo/issues/1128 + sortAttrs: true, + removeOffCanvasPaths: true, + }, + }, + }, + ], +}; diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml new file mode 100644 index 000000000..3ba9cca33 --- /dev/null +++ b/.trunk/trunk.yaml @@ -0,0 +1,32 @@ +version: 0.1 +cli: + version: 1.3.1 +plugins: + sources: + - id: trunk + ref: v0.0.8 + uri: https://github.com/trunk-io/plugins +lint: + enabled: + - shellcheck@0.9.0 + - shfmt@3.5.0 + - oxipng@8.0.0 + - actionlint@1.6.22 + - git-diff-check + - gitleaks@8.15.2 + - markdownlint@0.33.0 + - hadolint@2.12.0 + - clang-format@14.0.0 + - prettier@2.8.3 + - svgo@3.0.2 +runtimes: + enabled: + - go@1.18.3 + - node@18.12.1 +actions: + disabled: + - trunk-announce + - trunk-check-pre-push + - trunk-fmt-pre-commit + enabled: + - trunk-upgrade-available diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 9a91518aa..4fc84fa78 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,10 +2,8 @@ // See http://go.microsoft.com/fwlink/?LinkId=827846 // for the documentation about the extensions.json format "recommendations": [ + "ms-vscode.cpptools", "platformio.platformio-ide", - "xaver.clang-format" + "trunk.io" ], - "unwantedRecommendations": [ - "ms-vscode.cpptools-extension-pack" - ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 21b7b97b7..3b489975b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,80 +1,4 @@ { - "files.associations": { - "type_traits": "cpp", - "array": "cpp", - "*.tcc": "cpp", - "cctype": "cpp", - "clocale": "cpp", - "cmath": "cpp", - "cstdarg": "cpp", - "cstddef": "cpp", - "cstdint": "cpp", - "cstdio": "cpp", - "cstdlib": "cpp", - "cstring": "cpp", - "ctime": "cpp", - "cwchar": "cpp", - "cwctype": "cpp", - "deque": "cpp", - "unordered_map": "cpp", - "unordered_set": "cpp", - "vector": "cpp", - "exception": "cpp", - "algorithm": "cpp", - "functional": "cpp", - "system_error": "cpp", - "tuple": "cpp", - "fstream": "cpp", - "initializer_list": "cpp", - "iomanip": "cpp", - "iosfwd": "cpp", - "istream": "cpp", - "limits": "cpp", - "memory": "cpp", - "new": "cpp", - "ostream": "cpp", - "numeric": "cpp", - "sstream": "cpp", - "stdexcept": "cpp", - "streambuf": "cpp", - "cinttypes": "cpp", - "utility": "cpp", - "typeinfo": "cpp", - "string": "cpp", - "*.xbm": "cpp", - "list": "cpp", - "atomic": "cpp", - "memory_resource": "cpp", - "optional": "cpp", - "string_view": "cpp", - "cassert": "cpp", - "iterator": "cpp", - "shared_mutex": "cpp", - "iostream": "cpp", - "esp_nimble_hci.h": "c", - "map": "cpp", - "random": "cpp", - "*.tpp": "cpp" - }, - "cSpell.words": [ - "Blox", - "EINK", - "HFSR", - "Meshtastic", - "NEMAGPS", - "NMEAGPS", - "RDEF", - "Ublox", - "bkpt", - "cfsr", - "descs", - "ocrypto", - "protobufs", - "wifi" - ], - "C_Cpp.dimInactiveRegions": true, - "cmake.configureOnOpen": true, - "protoc": { - "compile_on_save": false, - } -} \ No newline at end of file + "editor.formatOnSave": true, + "editor.defaultFormatter": "trunk.io" +} From d7fa8fea8d0c023f520a04283d6d397a5f13bd04 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 18 Jan 2023 07:39:05 -0600 Subject: [PATCH 07/20] Update protos path for generator scripts --- bin/regen-protos.bat | 2 +- bin/regen-protos.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/regen-protos.bat b/bin/regen-protos.bat index 5c576c5b2..748363d78 100644 --- a/bin/regen-protos.bat +++ b/bin/regen-protos.bat @@ -1 +1 @@ -cd protobufs && ..\nanopb-0.4.7\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs *.proto +cd protobufs && ..\nanopb-0.4.7\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs meshtastic\*.proto diff --git a/bin/regen-protos.sh b/bin/regen-protos.sh index 133d587a3..df1a3a9d8 100755 --- a/bin/regen-protos.sh +++ b/bin/regen-protos.sh @@ -8,7 +8,7 @@ echo "prebuilt binaries for your computer into nanopb-0.4.7" # the nanopb tool seems to require that the .options file be in the current directory! cd protobufs -../nanopb-0.4.7/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../protobufs *.proto +../nanopb-0.4.7/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../protobufs meshtastic/*.proto #echo "Regenerating protobuf documentation - if you see an error message" #echo "you can ignore it unless doing a new protobuf release to github." From cf39628222d8eef51403b0a53d41f97d4b263548 Mon Sep 17 00:00:00 2001 From: thebentern Date: Wed, 18 Jan 2023 13:42:53 +0000 Subject: [PATCH 08/20] [create-pull-request] automated change --- protobufs | 2 +- src/mesh/generated/meshtastic/admin.pb.c | 14 + src/mesh/generated/meshtastic/admin.pb.h | 249 ++++ src/mesh/generated/meshtastic/apponly.pb.c | 12 + src/mesh/generated/meshtastic/apponly.pb.h | 63 + .../generated/meshtastic/cannedmessages.pb.c | 12 + .../generated/meshtastic/cannedmessages.pb.h | 49 + src/mesh/generated/meshtastic/channel.pb.c | 16 + src/mesh/generated/meshtastic/channel.pb.h | 172 +++ src/mesh/generated/meshtastic/config.pb.c | 46 + src/mesh/generated/meshtastic/config.pb.h | 707 ++++++++++ .../generated/meshtastic/device_metadata.pb.c | 12 + .../generated/meshtastic/device_metadata.pb.h | 78 ++ src/mesh/generated/meshtastic/deviceonly.pb.c | 19 + src/mesh/generated/meshtastic/deviceonly.pb.h | 184 +++ src/mesh/generated/meshtastic/localonly.pb.c | 15 + src/mesh/generated/meshtastic/localonly.pb.h | 166 +++ src/mesh/generated/meshtastic/mesh.pb.c | 60 + src/mesh/generated/meshtastic/mesh.pb.h | 1158 +++++++++++++++++ .../generated/meshtastic/module_config.pb.c | 43 + .../generated/meshtastic/module_config.pb.h | 568 ++++++++ src/mesh/generated/meshtastic/mqtt.pb.c | 12 + src/mesh/generated/meshtastic/mqtt.pb.h | 61 + src/mesh/generated/meshtastic/portnums.pb.c | 10 + src/mesh/generated/meshtastic/portnums.pb.h | 112 ++ .../generated/meshtastic/remote_hardware.pb.c | 13 + .../generated/meshtastic/remote_hardware.pb.h | 93 ++ src/mesh/generated/meshtastic/rtttl.pb.c | 12 + src/mesh/generated/meshtastic/rtttl.pb.h | 49 + .../generated/meshtastic/storeforward.pb.c | 22 + .../generated/meshtastic/storeforward.pb.h | 213 +++ src/mesh/generated/meshtastic/telemetry.pb.c | 19 + src/mesh/generated/meshtastic/telemetry.pb.h | 172 +++ src/mesh/generated/meshtastic/xmodem.pb.c | 13 + src/mesh/generated/meshtastic/xmodem.pb.h | 77 ++ 35 files changed, 4522 insertions(+), 1 deletion(-) create mode 100644 src/mesh/generated/meshtastic/admin.pb.c create mode 100644 src/mesh/generated/meshtastic/admin.pb.h create mode 100644 src/mesh/generated/meshtastic/apponly.pb.c create mode 100644 src/mesh/generated/meshtastic/apponly.pb.h create mode 100644 src/mesh/generated/meshtastic/cannedmessages.pb.c create mode 100644 src/mesh/generated/meshtastic/cannedmessages.pb.h create mode 100644 src/mesh/generated/meshtastic/channel.pb.c create mode 100644 src/mesh/generated/meshtastic/channel.pb.h create mode 100644 src/mesh/generated/meshtastic/config.pb.c create mode 100644 src/mesh/generated/meshtastic/config.pb.h create mode 100644 src/mesh/generated/meshtastic/device_metadata.pb.c create mode 100644 src/mesh/generated/meshtastic/device_metadata.pb.h create mode 100644 src/mesh/generated/meshtastic/deviceonly.pb.c create mode 100644 src/mesh/generated/meshtastic/deviceonly.pb.h create mode 100644 src/mesh/generated/meshtastic/localonly.pb.c create mode 100644 src/mesh/generated/meshtastic/localonly.pb.h create mode 100644 src/mesh/generated/meshtastic/mesh.pb.c create mode 100644 src/mesh/generated/meshtastic/mesh.pb.h create mode 100644 src/mesh/generated/meshtastic/module_config.pb.c create mode 100644 src/mesh/generated/meshtastic/module_config.pb.h create mode 100644 src/mesh/generated/meshtastic/mqtt.pb.c create mode 100644 src/mesh/generated/meshtastic/mqtt.pb.h create mode 100644 src/mesh/generated/meshtastic/portnums.pb.c create mode 100644 src/mesh/generated/meshtastic/portnums.pb.h create mode 100644 src/mesh/generated/meshtastic/remote_hardware.pb.c create mode 100644 src/mesh/generated/meshtastic/remote_hardware.pb.h create mode 100644 src/mesh/generated/meshtastic/rtttl.pb.c create mode 100644 src/mesh/generated/meshtastic/rtttl.pb.h create mode 100644 src/mesh/generated/meshtastic/storeforward.pb.c create mode 100644 src/mesh/generated/meshtastic/storeforward.pb.h create mode 100644 src/mesh/generated/meshtastic/telemetry.pb.c create mode 100644 src/mesh/generated/meshtastic/telemetry.pb.h create mode 100644 src/mesh/generated/meshtastic/xmodem.pb.c create mode 100644 src/mesh/generated/meshtastic/xmodem.pb.h diff --git a/protobufs b/protobufs index 1763fe4a3..2b391ff8a 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 1763fe4a389f0864f153a9986699e1ea56e67fac +Subproject commit 2b391ff8a76bfc07662faa007bb4fd6e01691ba8 diff --git a/src/mesh/generated/meshtastic/admin.pb.c b/src/mesh/generated/meshtastic/admin.pb.c new file mode 100644 index 000000000..1f668dabc --- /dev/null +++ b/src/mesh/generated/meshtastic/admin.pb.c @@ -0,0 +1,14 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/admin.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_AdminMessage, meshtastic_AdminMessage, 2) + + + + + diff --git a/src/mesh/generated/meshtastic/admin.pb.h b/src/mesh/generated/meshtastic/admin.pb.h new file mode 100644 index 000000000..5caa22bb7 --- /dev/null +++ b/src/mesh/generated/meshtastic/admin.pb.h @@ -0,0 +1,249 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_ADMIN_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_ADMIN_PB_H_INCLUDED +#include +#include "meshtastic/channel.pb.h" +#include "meshtastic/config.pb.h" +#include "meshtastic/device_metadata.pb.h" +#include "meshtastic/mesh.pb.h" +#include "meshtastic/module_config.pb.h" + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +/* TODO: REPLACE */ +typedef enum _meshtastic_AdminMessage_ConfigType { + /* TODO: REPLACE */ + meshtastic_AdminMessage_ConfigType_DEVICE_CONFIG = 0, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ConfigType_POSITION_CONFIG = 1, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ConfigType_POWER_CONFIG = 2, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ConfigType_NETWORK_CONFIG = 3, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ConfigType_DISPLAY_CONFIG = 4, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ConfigType_LORA_CONFIG = 5, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ConfigType_BLUETOOTH_CONFIG = 6 +} meshtastic_AdminMessage_ConfigType; + +/* TODO: REPLACE */ +typedef enum _meshtastic_AdminMessage_ModuleConfigType { + /* TODO: REPLACE */ + meshtastic_AdminMessage_ModuleConfigType_MQTT_CONFIG = 0, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ModuleConfigType_SERIAL_CONFIG = 1, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ModuleConfigType_EXTNOTIF_CONFIG = 2, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ModuleConfigType_STOREFORWARD_CONFIG = 3, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ModuleConfigType_RANGETEST_CONFIG = 4, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ModuleConfigType_TELEMETRY_CONFIG = 5, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ModuleConfigType_CANNEDMSG_CONFIG = 6, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ModuleConfigType_AUDIO_CONFIG = 7, + /* TODO: REPLACE */ + meshtastic_AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG = 8 +} meshtastic_AdminMessage_ModuleConfigType; + +/* Struct definitions */ +/* This message is handled by the Admin module and is responsible for all settings/channel read/write operations. + This message is used to do settings operations to both remote AND local nodes. + (Prior to 1.2 these operations were done via special ToRadio operations) */ +typedef struct _meshtastic_AdminMessage { + pb_size_t which_payload_variant; + union { + /* Send the specified channel in the response to this message + NOTE: This field is sent with the channel index + 1 (to ensure we never try to send 'zero' - which protobufs treats as not present) */ + uint32_t get_channel_request; + /* TODO: REPLACE */ + meshtastic_Channel get_channel_response; + /* Send the current owner data in the response to this message. */ + bool get_owner_request; + /* TODO: REPLACE */ + meshtastic_User get_owner_response; + /* Ask for the following config data to be sent */ + meshtastic_AdminMessage_ConfigType get_config_request; + /* Send the current Config in the response to this message. */ + meshtastic_Config get_config_response; + /* Ask for the following config data to be sent */ + meshtastic_AdminMessage_ModuleConfigType get_module_config_request; + /* Send the current Config in the response to this message. */ + meshtastic_ModuleConfig get_module_config_response; + /* Get the Canned Message Module messages in the response to this message. */ + bool get_canned_message_module_messages_request; + /* Get the Canned Message Module messages in the response to this message. */ + char get_canned_message_module_messages_response[201]; + /* Request the node to send device metadata (firmware, protobuf version, etc) */ + bool get_device_metadata_request; + /* Device metadata response */ + meshtastic_DeviceMetadata get_device_metadata_response; + /* Get the Ringtone in the response to this message. */ + bool get_ringtone_request; + /* Get the Ringtone in the response to this message. */ + char get_ringtone_response[231]; + /* Set the owner for this node */ + meshtastic_User set_owner; + /* Set channels (using the new API). + A special channel is the "primary channel". + The other records are secondary channels. + Note: only one channel can be marked as primary. + If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically. */ + meshtastic_Channel set_channel; + /* Set the current Config */ + meshtastic_Config set_config; + /* Set the current Config */ + meshtastic_ModuleConfig set_module_config; + /* Set the Canned Message Module messages text. */ + char set_canned_message_module_messages[201]; + /* Set the ringtone for ExternalNotification. */ + char set_ringtone_message[231]; + /* Begins an edit transaction for config, module config, owner, and channel settings changes + This will delay the standard *implicit* save to the file system and subsequent reboot behavior until committed (commit_edit_settings) */ + bool begin_edit_settings; + /* Commits an open transaction for any edits made to config, module config, owner, and channel settings */ + bool commit_edit_settings; + /* Setting channels/radio config remotely carries the risk that you might send an invalid config and the radio never talks to your mesh again. + Therefore if setting either of these properties remotely, you must send a confirm_xxx message within 10 minutes. + If you fail to do so, the radio will assume loss of comms and revert your changes. + These messages are optional when changing the local node. */ + bool confirm_set_channel; + /* TODO: REPLACE */ + bool confirm_set_radio; + /* Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot) + Only Implemented for ESP32 Devices. This needs to be issued to send a new main firmware via bluetooth. */ + int32_t reboot_ota_seconds; + /* This message is only supported for the simulator porduino build. + If received the simulator will exit successfully. */ + bool exit_simulator; + /* Tell the node to reboot in this many seconds (or <0 to cancel reboot) */ + int32_t reboot_seconds; + /* Tell the node to shutdown in this many seconds (or <0 to cancel shutdown) */ + int32_t shutdown_seconds; + /* Tell the node to factory reset, all device settings will be returned to factory defaults. */ + int32_t factory_reset; + /* Tell the node to reset the nodedb. */ + int32_t nodedb_reset; + }; +} meshtastic_AdminMessage; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Helper constants for enums */ +#define _meshtastic_AdminMessage_ConfigType_MIN meshtastic_AdminMessage_ConfigType_DEVICE_CONFIG +#define _meshtastic_AdminMessage_ConfigType_MAX meshtastic_AdminMessage_ConfigType_BLUETOOTH_CONFIG +#define _meshtastic_AdminMessage_ConfigType_ARRAYSIZE ((meshtastic_AdminMessage_ConfigType)(meshtastic_AdminMessage_ConfigType_BLUETOOTH_CONFIG+1)) + +#define _meshtastic_AdminMessage_ModuleConfigType_MIN meshtastic_AdminMessage_ModuleConfigType_MQTT_CONFIG +#define _meshtastic_AdminMessage_ModuleConfigType_MAX meshtastic_AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG +#define _meshtastic_AdminMessage_ModuleConfigType_ARRAYSIZE ((meshtastic_AdminMessage_ModuleConfigType)(meshtastic_AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG+1)) + +#define meshtastic_AdminMessage_payload_variant_get_config_request_ENUMTYPE meshtastic_AdminMessage_ConfigType +#define meshtastic_AdminMessage_payload_variant_get_module_config_request_ENUMTYPE meshtastic_AdminMessage_ModuleConfigType + + +/* Initializer values for message structs */ +#define meshtastic_AdminMessage_init_default {0, {0}} +#define meshtastic_AdminMessage_init_zero {0, {0}} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_AdminMessage_get_channel_request_tag 1 +#define meshtastic_AdminMessage_get_channel_response_tag 2 +#define meshtastic_AdminMessage_get_owner_request_tag 3 +#define meshtastic_AdminMessage_get_owner_response_tag 4 +#define meshtastic_AdminMessage_get_config_request_tag 5 +#define meshtastic_AdminMessage_get_config_response_tag 6 +#define meshtastic_AdminMessage_get_module_config_request_tag 7 +#define meshtastic_AdminMessage_get_module_config_response_tag 8 +#define meshtastic_AdminMessage_get_canned_message_module_messages_request_tag 10 +#define meshtastic_AdminMessage_get_canned_message_module_messages_response_tag 11 +#define meshtastic_AdminMessage_get_device_metadata_request_tag 12 +#define meshtastic_AdminMessage_get_device_metadata_response_tag 13 +#define meshtastic_AdminMessage_get_ringtone_request_tag 14 +#define meshtastic_AdminMessage_get_ringtone_response_tag 15 +#define meshtastic_AdminMessage_set_owner_tag 32 +#define meshtastic_AdminMessage_set_channel_tag 33 +#define meshtastic_AdminMessage_set_config_tag 34 +#define meshtastic_AdminMessage_set_module_config_tag 35 +#define meshtastic_AdminMessage_set_canned_message_module_messages_tag 36 +#define meshtastic_AdminMessage_set_ringtone_message_tag 37 +#define meshtastic_AdminMessage_begin_edit_settings_tag 64 +#define meshtastic_AdminMessage_commit_edit_settings_tag 65 +#define meshtastic_AdminMessage_confirm_set_channel_tag 66 +#define meshtastic_AdminMessage_confirm_set_radio_tag 67 +#define meshtastic_AdminMessage_reboot_ota_seconds_tag 95 +#define meshtastic_AdminMessage_exit_simulator_tag 96 +#define meshtastic_AdminMessage_reboot_seconds_tag 97 +#define meshtastic_AdminMessage_shutdown_seconds_tag 98 +#define meshtastic_AdminMessage_factory_reset_tag 99 +#define meshtastic_AdminMessage_nodedb_reset_tag 100 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_AdminMessage_FIELDLIST(X, a) \ +X(a, STATIC, ONEOF, UINT32, (payload_variant,get_channel_request,get_channel_request), 1) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_channel_response,get_channel_response), 2) \ +X(a, STATIC, ONEOF, BOOL, (payload_variant,get_owner_request,get_owner_request), 3) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_owner_response,get_owner_response), 4) \ +X(a, STATIC, ONEOF, UENUM, (payload_variant,get_config_request,get_config_request), 5) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_config_response,get_config_response), 6) \ +X(a, STATIC, ONEOF, UENUM, (payload_variant,get_module_config_request,get_module_config_request), 7) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_module_config_response,get_module_config_response), 8) \ +X(a, STATIC, ONEOF, BOOL, (payload_variant,get_canned_message_module_messages_request,get_canned_message_module_messages_request), 10) \ +X(a, STATIC, ONEOF, STRING, (payload_variant,get_canned_message_module_messages_response,get_canned_message_module_messages_response), 11) \ +X(a, STATIC, ONEOF, BOOL, (payload_variant,get_device_metadata_request,get_device_metadata_request), 12) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_device_metadata_response,get_device_metadata_response), 13) \ +X(a, STATIC, ONEOF, BOOL, (payload_variant,get_ringtone_request,get_ringtone_request), 14) \ +X(a, STATIC, ONEOF, STRING, (payload_variant,get_ringtone_response,get_ringtone_response), 15) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_owner,set_owner), 32) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_channel,set_channel), 33) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_config,set_config), 34) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_module_config,set_module_config), 35) \ +X(a, STATIC, ONEOF, STRING, (payload_variant,set_canned_message_module_messages,set_canned_message_module_messages), 36) \ +X(a, STATIC, ONEOF, STRING, (payload_variant,set_ringtone_message,set_ringtone_message), 37) \ +X(a, STATIC, ONEOF, BOOL, (payload_variant,begin_edit_settings,begin_edit_settings), 64) \ +X(a, STATIC, ONEOF, BOOL, (payload_variant,commit_edit_settings,commit_edit_settings), 65) \ +X(a, STATIC, ONEOF, BOOL, (payload_variant,confirm_set_channel,confirm_set_channel), 66) \ +X(a, STATIC, ONEOF, BOOL, (payload_variant,confirm_set_radio,confirm_set_radio), 67) \ +X(a, STATIC, ONEOF, INT32, (payload_variant,reboot_ota_seconds,reboot_ota_seconds), 95) \ +X(a, STATIC, ONEOF, BOOL, (payload_variant,exit_simulator,exit_simulator), 96) \ +X(a, STATIC, ONEOF, INT32, (payload_variant,reboot_seconds,reboot_seconds), 97) \ +X(a, STATIC, ONEOF, INT32, (payload_variant,shutdown_seconds,shutdown_seconds), 98) \ +X(a, STATIC, ONEOF, INT32, (payload_variant,factory_reset,factory_reset), 99) \ +X(a, STATIC, ONEOF, INT32, (payload_variant,nodedb_reset,nodedb_reset), 100) +#define meshtastic_AdminMessage_CALLBACK NULL +#define meshtastic_AdminMessage_DEFAULT NULL +#define meshtastic_AdminMessage_payload_variant_get_channel_response_MSGTYPE meshtastic_Channel +#define meshtastic_AdminMessage_payload_variant_get_owner_response_MSGTYPE meshtastic_User +#define meshtastic_AdminMessage_payload_variant_get_config_response_MSGTYPE meshtastic_Config +#define meshtastic_AdminMessage_payload_variant_get_module_config_response_MSGTYPE meshtastic_ModuleConfig +#define meshtastic_AdminMessage_payload_variant_get_device_metadata_response_MSGTYPE meshtastic_DeviceMetadata +#define meshtastic_AdminMessage_payload_variant_set_owner_MSGTYPE meshtastic_User +#define meshtastic_AdminMessage_payload_variant_set_channel_MSGTYPE meshtastic_Channel +#define meshtastic_AdminMessage_payload_variant_set_config_MSGTYPE meshtastic_Config +#define meshtastic_AdminMessage_payload_variant_set_module_config_MSGTYPE meshtastic_ModuleConfig + +extern const pb_msgdesc_t meshtastic_AdminMessage_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_AdminMessage_fields &meshtastic_AdminMessage_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_AdminMessage_size 234 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/apponly.pb.c b/src/mesh/generated/meshtastic/apponly.pb.c new file mode 100644 index 000000000..8c3801ed7 --- /dev/null +++ b/src/mesh/generated/meshtastic/apponly.pb.c @@ -0,0 +1,12 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/apponly.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_ChannelSet, meshtastic_ChannelSet, 2) + + + diff --git a/src/mesh/generated/meshtastic/apponly.pb.h b/src/mesh/generated/meshtastic/apponly.pb.h new file mode 100644 index 000000000..187df98d4 --- /dev/null +++ b/src/mesh/generated/meshtastic/apponly.pb.h @@ -0,0 +1,63 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_APPONLY_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_APPONLY_PB_H_INCLUDED +#include +#include "meshtastic/channel.pb.h" +#include "meshtastic/config.pb.h" + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Struct definitions */ +/* This is the most compact possible representation for a set of channels. + It includes only one PRIMARY channel (which must be first) and + any SECONDARY channels. + No DISABLED channels are included. + This abstraction is used only on the the 'app side' of the world (ie python, javascript and android etc) to show a group of Channels as a (long) URL */ +typedef struct _meshtastic_ChannelSet { + /* Channel list with settings */ + pb_size_t settings_count; + meshtastic_ChannelSettings settings[8]; + /* LoRa config */ + bool has_lora_config; + meshtastic_Config_LoRaConfig lora_config; +} meshtastic_ChannelSet; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initializer values for message structs */ +#define meshtastic_ChannelSet_init_default {0, {meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default}, false, meshtastic_Config_LoRaConfig_init_default} +#define meshtastic_ChannelSet_init_zero {0, {meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero}, false, meshtastic_Config_LoRaConfig_init_zero} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_ChannelSet_settings_tag 1 +#define meshtastic_ChannelSet_lora_config_tag 2 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_ChannelSet_FIELDLIST(X, a) \ +X(a, STATIC, REPEATED, MESSAGE, settings, 1) \ +X(a, STATIC, OPTIONAL, MESSAGE, lora_config, 2) +#define meshtastic_ChannelSet_CALLBACK NULL +#define meshtastic_ChannelSet_DEFAULT NULL +#define meshtastic_ChannelSet_settings_MSGTYPE meshtastic_ChannelSettings +#define meshtastic_ChannelSet_lora_config_MSGTYPE meshtastic_Config_LoRaConfig + +extern const pb_msgdesc_t meshtastic_ChannelSet_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_ChannelSet_fields &meshtastic_ChannelSet_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_ChannelSet_size 584 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/cannedmessages.pb.c b/src/mesh/generated/meshtastic/cannedmessages.pb.c new file mode 100644 index 000000000..fffa3fdf9 --- /dev/null +++ b/src/mesh/generated/meshtastic/cannedmessages.pb.c @@ -0,0 +1,12 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/cannedmessages.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_CannedMessageModuleConfig, meshtastic_CannedMessageModuleConfig, AUTO) + + + diff --git a/src/mesh/generated/meshtastic/cannedmessages.pb.h b/src/mesh/generated/meshtastic/cannedmessages.pb.h new file mode 100644 index 000000000..b81f65d0d --- /dev/null +++ b/src/mesh/generated/meshtastic/cannedmessages.pb.h @@ -0,0 +1,49 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_CANNEDMESSAGES_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_CANNEDMESSAGES_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Struct definitions */ +/* Canned message module configuration. */ +typedef struct _meshtastic_CannedMessageModuleConfig { + /* Predefined messages for canned message module separated by '|' characters. */ + char messages[201]; +} meshtastic_CannedMessageModuleConfig; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initializer values for message structs */ +#define meshtastic_CannedMessageModuleConfig_init_default {""} +#define meshtastic_CannedMessageModuleConfig_init_zero {""} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_CannedMessageModuleConfig_messages_tag 1 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_CannedMessageModuleConfig_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, STRING, messages, 1) +#define meshtastic_CannedMessageModuleConfig_CALLBACK NULL +#define meshtastic_CannedMessageModuleConfig_DEFAULT NULL + +extern const pb_msgdesc_t meshtastic_CannedMessageModuleConfig_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_CannedMessageModuleConfig_fields &meshtastic_CannedMessageModuleConfig_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_CannedMessageModuleConfig_size 203 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/channel.pb.c b/src/mesh/generated/meshtastic/channel.pb.c new file mode 100644 index 000000000..62585fd17 --- /dev/null +++ b/src/mesh/generated/meshtastic/channel.pb.c @@ -0,0 +1,16 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/channel.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_ChannelSettings, meshtastic_ChannelSettings, AUTO) + + +PB_BIND(meshtastic_Channel, meshtastic_Channel, AUTO) + + + + diff --git a/src/mesh/generated/meshtastic/channel.pb.h b/src/mesh/generated/meshtastic/channel.pb.h new file mode 100644 index 000000000..83ef7b5fc --- /dev/null +++ b/src/mesh/generated/meshtastic/channel.pb.h @@ -0,0 +1,172 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_CHANNEL_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_CHANNEL_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +/* How this channel is being used (or not). + Note: this field is an enum to give us options for the future. + In particular, someday we might make a 'SCANNING' option. + SCANNING channels could have different frequencies and the radio would + occasionally check that freq to see if anything is being transmitted. + For devices that have multiple physical radios attached, we could keep multiple PRIMARY/SCANNING channels active at once to allow + cross band routing as needed. + If a device has only a single radio (the common case) only one channel can be PRIMARY at a time + (but any number of SECONDARY channels can't be sent received on that common frequency) */ +typedef enum _meshtastic_Channel_Role { + /* This channel is not in use right now */ + meshtastic_Channel_Role_DISABLED = 0, + /* This channel is used to set the frequency for the radio - all other enabled channels must be SECONDARY */ + meshtastic_Channel_Role_PRIMARY = 1, + /* Secondary channels are only used for encryption/decryption/authentication purposes. + Their radio settings (freq etc) are ignored, only psk is used. */ + meshtastic_Channel_Role_SECONDARY = 2 +} meshtastic_Channel_Role; + +/* Struct definitions */ +typedef PB_BYTES_ARRAY_T(32) meshtastic_ChannelSettings_psk_t; +/* Full settings (center freq, spread factor, pre-shared secret key etc...) + needed to configure a radio for speaking on a particular channel This + information can be encoded as a QRcode/url so that other users can configure + their radio to join the same channel. + A note about how channel names are shown to users: channelname-Xy + poundsymbol is a prefix used to indicate this is a channel name (idea from @professr). + Where X is a letter from A-Z (base 26) representing a hash of the PSK for this + channel - so that if the user changes anything about the channel (which does + force a new PSK) this letter will also change. Thus preventing user confusion if + two friends try to type in a channel name of "BobsChan" and then can't talk + because their PSKs will be different. + The PSK is hashed into this letter by "0x41 + [xor all bytes of the psk ] modulo 26" + This also allows the option of someday if people have the PSK off (zero), the + users COULD type in a channel name and be able to talk. + Y is a lower case letter from a-z that represents the channel 'speed' settings + (for some future definition of speed) + FIXME: Add description of multi-channel support and how primary vs secondary channels are used. + FIXME: explain how apps use channels for security. + explain how remote settings and remote gpio are managed as an example */ +typedef struct _meshtastic_ChannelSettings { + /* Deprecated in favor of LoraConfig.channel_num */ + uint32_t channel_num; + /* A simple pre-shared key for now for crypto. + Must be either 0 bytes (no crypto), 16 bytes (AES128), or 32 bytes (AES256). + A special shorthand is used for 1 byte long psks. + These psks should be treated as only minimally secure, + because they are listed in this source code. + Those bytes are mapped using the following scheme: + `0` = No crypto + `1` = The special "default" channel key: {0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0x59, 0xf0, 0xbc, 0xff, 0xab, 0xcf, 0x4e, 0x69, 0xbf} + `2` through 10 = The default channel key, except with 1 through 9 added to the last byte. + Shown to user as simple1 through 10 */ + meshtastic_ChannelSettings_psk_t psk; + /* A SHORT name that will be packed into the URL. + Less than 12 bytes. + Something for end users to call the channel + If this is the empty string it is assumed that this channel + is the special (minimally secure) "Default"channel. + In user interfaces it should be rendered as a local language translation of "X". + For channel_num hashing empty string will be treated as "X". + Where "X" is selected based on the English words listed above for ModemPreset */ + char name[12]; + /* Used to construct a globally unique channel ID. + The full globally unique ID will be: "name.id" where ID is shown as base36. + Assuming that the number of meshtastic users is below 20K (true for a long time) + the chance of this 64 bit random number colliding with anyone else is super low. + And the penalty for collision is low as well, it just means that anyone trying to decrypt channel messages might need to + try multiple candidate channels. + Any time a non wire compatible change is made to a channel, this field should be regenerated. + There are a small number of 'special' globally known (and fairly) insecure standard channels. + Those channels do not have a numeric id included in the settings, but instead it is pulled from + a table of well known IDs. + (see Well Known Channels FIXME) */ + uint32_t id; + /* If true, messages on the mesh will be sent to the *public* internet by any gateway ndoe */ + bool uplink_enabled; + /* If true, messages seen on the internet will be forwarded to the local mesh. */ + bool downlink_enabled; +} meshtastic_ChannelSettings; + +/* A pair of a channel number, mode and the (sharable) settings for that channel */ +typedef struct _meshtastic_Channel { + /* The index of this channel in the channel table (from 0 to MAX_NUM_CHANNELS-1) + (Someday - not currently implemented) An index of -1 could be used to mean "set by name", + in which case the target node will find and set the channel by settings.name. */ + int8_t index; + /* The new settings, or NULL to disable that channel */ + bool has_settings; + meshtastic_ChannelSettings settings; + /* TODO: REPLACE */ + meshtastic_Channel_Role role; +} meshtastic_Channel; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Helper constants for enums */ +#define _meshtastic_Channel_Role_MIN meshtastic_Channel_Role_DISABLED +#define _meshtastic_Channel_Role_MAX meshtastic_Channel_Role_SECONDARY +#define _meshtastic_Channel_Role_ARRAYSIZE ((meshtastic_Channel_Role)(meshtastic_Channel_Role_SECONDARY+1)) + + +#define meshtastic_Channel_role_ENUMTYPE meshtastic_Channel_Role + + +/* Initializer values for message structs */ +#define meshtastic_ChannelSettings_init_default {0, {0, {0}}, "", 0, 0, 0} +#define meshtastic_Channel_init_default {0, false, meshtastic_ChannelSettings_init_default, _meshtastic_Channel_Role_MIN} +#define meshtastic_ChannelSettings_init_zero {0, {0, {0}}, "", 0, 0, 0} +#define meshtastic_Channel_init_zero {0, false, meshtastic_ChannelSettings_init_zero, _meshtastic_Channel_Role_MIN} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_ChannelSettings_channel_num_tag 1 +#define meshtastic_ChannelSettings_psk_tag 2 +#define meshtastic_ChannelSettings_name_tag 3 +#define meshtastic_ChannelSettings_id_tag 4 +#define meshtastic_ChannelSettings_uplink_enabled_tag 5 +#define meshtastic_ChannelSettings_downlink_enabled_tag 6 +#define meshtastic_Channel_index_tag 1 +#define meshtastic_Channel_settings_tag 2 +#define meshtastic_Channel_role_tag 3 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_ChannelSettings_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, channel_num, 1) \ +X(a, STATIC, SINGULAR, BYTES, psk, 2) \ +X(a, STATIC, SINGULAR, STRING, name, 3) \ +X(a, STATIC, SINGULAR, FIXED32, id, 4) \ +X(a, STATIC, SINGULAR, BOOL, uplink_enabled, 5) \ +X(a, STATIC, SINGULAR, BOOL, downlink_enabled, 6) +#define meshtastic_ChannelSettings_CALLBACK NULL +#define meshtastic_ChannelSettings_DEFAULT NULL + +#define meshtastic_Channel_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, INT32, index, 1) \ +X(a, STATIC, OPTIONAL, MESSAGE, settings, 2) \ +X(a, STATIC, SINGULAR, UENUM, role, 3) +#define meshtastic_Channel_CALLBACK NULL +#define meshtastic_Channel_DEFAULT NULL +#define meshtastic_Channel_settings_MSGTYPE meshtastic_ChannelSettings + +extern const pb_msgdesc_t meshtastic_ChannelSettings_msg; +extern const pb_msgdesc_t meshtastic_Channel_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_ChannelSettings_fields &meshtastic_ChannelSettings_msg +#define meshtastic_Channel_fields &meshtastic_Channel_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_ChannelSettings_size 62 +#define meshtastic_Channel_size 77 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/config.pb.c b/src/mesh/generated/meshtastic/config.pb.c new file mode 100644 index 000000000..7cbee2bb8 --- /dev/null +++ b/src/mesh/generated/meshtastic/config.pb.c @@ -0,0 +1,46 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/config.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_Config, meshtastic_Config, AUTO) + + +PB_BIND(meshtastic_Config_DeviceConfig, meshtastic_Config_DeviceConfig, AUTO) + + +PB_BIND(meshtastic_Config_PositionConfig, meshtastic_Config_PositionConfig, AUTO) + + +PB_BIND(meshtastic_Config_PowerConfig, meshtastic_Config_PowerConfig, AUTO) + + +PB_BIND(meshtastic_Config_NetworkConfig, meshtastic_Config_NetworkConfig, AUTO) + + +PB_BIND(meshtastic_Config_NetworkConfig_IpV4Config, meshtastic_Config_NetworkConfig_IpV4Config, AUTO) + + +PB_BIND(meshtastic_Config_DisplayConfig, meshtastic_Config_DisplayConfig, AUTO) + + +PB_BIND(meshtastic_Config_LoRaConfig, meshtastic_Config_LoRaConfig, 2) + + +PB_BIND(meshtastic_Config_BluetoothConfig, meshtastic_Config_BluetoothConfig, AUTO) + + + + + + + + + + + + + diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h new file mode 100644 index 000000000..ed8396d5f --- /dev/null +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -0,0 +1,707 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_CONFIG_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_CONFIG_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +/* Defines the device's role on the Mesh network */ +typedef enum _meshtastic_Config_DeviceConfig_Role { + /* Client device role */ + meshtastic_Config_DeviceConfig_Role_CLIENT = 0, + /* Client Mute device role + Same as a client except packets will not hop over this node, does not contribute to routing packets for mesh. */ + meshtastic_Config_DeviceConfig_Role_CLIENT_MUTE = 1, + /* Router device role. + Mesh packets will prefer to be routed over this node. This node will not be used by client apps. + The wifi/ble radios and the oled screen will be put to sleep. */ + meshtastic_Config_DeviceConfig_Role_ROUTER = 2, + /* Router Client device role + Mesh packets will prefer to be routed over this node. The Router Client can be used as both a Router and an app connected Client. */ + meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT = 3 +} meshtastic_Config_DeviceConfig_Role; + +/* Bit field of boolean configuration options, indicating which optional + fields to include when assembling POSITION messages + Longitude and latitude are always included (also time if GPS-synced) + NOTE: the more fields are included, the larger the message will be - + leading to longer airtime and a higher risk of packet loss */ +typedef enum _meshtastic_Config_PositionConfig_PositionFlags { + /* Required for compilation */ + meshtastic_Config_PositionConfig_PositionFlags_UNSET = 0, + /* Include an altitude value (if available) */ + meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE = 1, + /* Altitude value is MSL */ + meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE_MSL = 2, + /* Include geoidal separation */ + meshtastic_Config_PositionConfig_PositionFlags_GEOIDAL_SEPARATION = 4, + /* Include the DOP value ; PDOP used by default, see below */ + meshtastic_Config_PositionConfig_PositionFlags_DOP = 8, + /* If POS_DOP set, send separate HDOP / VDOP values instead of PDOP */ + meshtastic_Config_PositionConfig_PositionFlags_HVDOP = 16, + /* Include number of "satellites in view" */ + meshtastic_Config_PositionConfig_PositionFlags_SATINVIEW = 32, + /* Include a sequence number incremented per packet */ + meshtastic_Config_PositionConfig_PositionFlags_SEQ_NO = 64, + /* Include positional timestamp (from GPS solution) */ + meshtastic_Config_PositionConfig_PositionFlags_TIMESTAMP = 128, + /* Include positional heading + Intended for use with vehicle not walking speeds + walking speeds are likely to be error prone like the compass */ + meshtastic_Config_PositionConfig_PositionFlags_HEADING = 256, + /* Include positional speed + Intended for use with vehicle not walking speeds + walking speeds are likely to be error prone like the compass */ + meshtastic_Config_PositionConfig_PositionFlags_SPEED = 512 +} meshtastic_Config_PositionConfig_PositionFlags; + +typedef enum _meshtastic_Config_NetworkConfig_AddressMode { + /* obtain ip address via DHCP */ + meshtastic_Config_NetworkConfig_AddressMode_DHCP = 0, + /* use static ip address */ + meshtastic_Config_NetworkConfig_AddressMode_STATIC = 1 +} meshtastic_Config_NetworkConfig_AddressMode; + +/* How the GPS coordinates are displayed on the OLED screen. */ +typedef enum _meshtastic_Config_DisplayConfig_GpsCoordinateFormat { + /* GPS coordinates are displayed in the normal decimal degrees format: + DD.DDDDDD DDD.DDDDDD */ + meshtastic_Config_DisplayConfig_GpsCoordinateFormat_DEC = 0, + /* GPS coordinates are displayed in the degrees minutes seconds format: + DD°MM'SS"C DDD°MM'SS"C, where C is the compass point representing the locations quadrant */ + meshtastic_Config_DisplayConfig_GpsCoordinateFormat_DMS = 1, + /* Universal Transverse Mercator format: + ZZB EEEEEE NNNNNNN, where Z is zone, B is band, E is easting, N is northing */ + meshtastic_Config_DisplayConfig_GpsCoordinateFormat_UTM = 2, + /* Military Grid Reference System format: + ZZB CD EEEEE NNNNN, where Z is zone, B is band, C is the east 100k square, D is the north 100k square, + E is easting, N is northing */ + meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MGRS = 3, + /* Open Location Code (aka Plus Codes). */ + meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OLC = 4, + /* Ordnance Survey Grid Reference (the National Grid System of the UK). + Format: AB EEEEE NNNNN, where A is the east 100k square, B is the north 100k square, + E is the easting, N is the northing */ + meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OSGR = 5 +} meshtastic_Config_DisplayConfig_GpsCoordinateFormat; + +/* Unit display preference */ +typedef enum _meshtastic_Config_DisplayConfig_DisplayUnits { + /* Metric (Default) */ + meshtastic_Config_DisplayConfig_DisplayUnits_METRIC = 0, + /* Imperial */ + meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL = 1 +} meshtastic_Config_DisplayConfig_DisplayUnits; + +/* Override OLED outo detect with this if it fails. */ +typedef enum _meshtastic_Config_DisplayConfig_OledType { + /* Default / Auto */ + meshtastic_Config_DisplayConfig_OledType_OLED_AUTO = 0, + /* Default / Auto */ + meshtastic_Config_DisplayConfig_OledType_OLED_SSD1306 = 1, + /* Default / Auto */ + meshtastic_Config_DisplayConfig_OledType_OLED_SH1106 = 2 +} meshtastic_Config_DisplayConfig_OledType; + +typedef enum _meshtastic_Config_DisplayConfig_DisplayMode { + /* Default. The old style for the 128x64 OLED screen */ + meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT = 0, + /* Rearrange display elements to cater for bicolor OLED displays */ + meshtastic_Config_DisplayConfig_DisplayMode_TWOCOLOR = 1, + /* Same as TwoColor, but with inverted top bar. Not so good for Epaper displays */ + meshtastic_Config_DisplayConfig_DisplayMode_INVERTED = 2, + /* TFT Full Color Displays (not implemented yet) */ + meshtastic_Config_DisplayConfig_DisplayMode_COLOR = 3 +} meshtastic_Config_DisplayConfig_DisplayMode; + +typedef enum _meshtastic_Config_LoRaConfig_RegionCode { + /* Region is not set */ + meshtastic_Config_LoRaConfig_RegionCode_UNSET = 0, + /* United States */ + meshtastic_Config_LoRaConfig_RegionCode_US = 1, + /* European Union 433mhz */ + meshtastic_Config_LoRaConfig_RegionCode_EU_433 = 2, + /* European Union 433mhz */ + meshtastic_Config_LoRaConfig_RegionCode_EU_868 = 3, + /* China */ + meshtastic_Config_LoRaConfig_RegionCode_CN = 4, + /* Japan */ + meshtastic_Config_LoRaConfig_RegionCode_JP = 5, + /* Australia / New Zealand */ + meshtastic_Config_LoRaConfig_RegionCode_ANZ = 6, + /* Korea */ + meshtastic_Config_LoRaConfig_RegionCode_KR = 7, + /* Taiwan */ + meshtastic_Config_LoRaConfig_RegionCode_TW = 8, + /* Russia */ + meshtastic_Config_LoRaConfig_RegionCode_RU = 9, + /* India */ + meshtastic_Config_LoRaConfig_RegionCode_IN = 10, + /* New Zealand 865mhz */ + meshtastic_Config_LoRaConfig_RegionCode_NZ_865 = 11, + /* Thailand */ + meshtastic_Config_LoRaConfig_RegionCode_TH = 12, + /* WLAN Band */ + meshtastic_Config_LoRaConfig_RegionCode_LORA_24 = 13, + /* Ukraine 433mhz */ + meshtastic_Config_LoRaConfig_RegionCode_UA_433 = 14, + /* Ukraine 868mhz */ + meshtastic_Config_LoRaConfig_RegionCode_UA_868 = 15 +} meshtastic_Config_LoRaConfig_RegionCode; + +/* Standard predefined channel settings + Note: these mappings must match ModemPreset Choice in the device code. */ +typedef enum _meshtastic_Config_LoRaConfig_ModemPreset { + /* Long Range - Fast */ + meshtastic_Config_LoRaConfig_ModemPreset_LONG_FAST = 0, + /* Long Range - Slow */ + meshtastic_Config_LoRaConfig_ModemPreset_LONG_SLOW = 1, + /* Very Long Range - Slow */ + meshtastic_Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW = 2, + /* Medium Range - Slow */ + meshtastic_Config_LoRaConfig_ModemPreset_MEDIUM_SLOW = 3, + /* Medium Range - Fast */ + meshtastic_Config_LoRaConfig_ModemPreset_MEDIUM_FAST = 4, + /* Short Range - Slow */ + meshtastic_Config_LoRaConfig_ModemPreset_SHORT_SLOW = 5, + /* Short Range - Fast */ + meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST = 6 +} meshtastic_Config_LoRaConfig_ModemPreset; + +typedef enum _meshtastic_Config_BluetoothConfig_PairingMode { + /* Device generates a random pin that will be shown on the screen of the device for pairing */ + meshtastic_Config_BluetoothConfig_PairingMode_RANDOM_PIN = 0, + /* Device requires a specified fixed pin for pairing */ + meshtastic_Config_BluetoothConfig_PairingMode_FIXED_PIN = 1, + /* Device requires no pin for pairing */ + meshtastic_Config_BluetoothConfig_PairingMode_NO_PIN = 2 +} meshtastic_Config_BluetoothConfig_PairingMode; + +/* Struct definitions */ +/* Configuration */ +typedef struct _meshtastic_Config_DeviceConfig { + /* Sets the role of node */ + meshtastic_Config_DeviceConfig_Role role; + /* Disabling this will disable the SerialConsole by not initilizing the StreamAPI */ + bool serial_enabled; + /* By default we turn off logging as soon as an API client connects (to keep shared serial link quiet). + Set this to true to leave the debug log outputting even when API is active. */ + bool debug_log_enabled; + /* For boards without a hard wired button, this is the pin number that will be used + Boards that have more than one button can swap the function with this one. defaults to BUTTON_PIN if defined. */ + uint32_t button_gpio; + /* For boards without a PWM buzzer, this is the pin number that will be used + Defaults to PIN_BUZZER if defined. */ + uint32_t buzzer_gpio; +} meshtastic_Config_DeviceConfig; + +/* Position Config */ +typedef struct _meshtastic_Config_PositionConfig { + /* We should send our position this often (but only if it has changed significantly) + Defaults to 15 minutes */ + uint32_t position_broadcast_secs; + /* Adaptive position braoadcast, which is now the default. */ + bool position_broadcast_smart_enabled; + /* If set, this node is at a fixed position. + We will generate GPS position updates at the regular interval, but use whatever the last lat/lon/alt we have for the node. + The lat/lon/alt can be set by an internal GPS or with the help of the app. */ + bool fixed_position; + /* Is GPS enabled for this node? */ + bool gps_enabled; + /* How often should we try to get GPS position (in seconds) + or zero for the default of once every 30 seconds + or a very large value (maxint) to update only once at boot. */ + uint32_t gps_update_interval; + /* How long should we try to get our position during each gps_update_interval attempt? (in seconds) + Or if zero, use the default of 30 seconds. + If we don't get a new gps fix in that time, the gps will be put into sleep until the next gps_update_rate + window. */ + uint32_t gps_attempt_time; + /* Bit field of boolean configuration options for POSITION messages + (bitwise OR of PositionFlags) */ + uint32_t position_flags; + /* (Re)define GPS_RX_PIN for your board. */ + uint32_t rx_gpio; + /* (Re)define GPS_TX_PIN for your board. */ + uint32_t tx_gpio; +} meshtastic_Config_PositionConfig; + +/* Power Config\ + See [Power Config](/docs/settings/config/power) for additional power config details. */ +typedef struct _meshtastic_Config_PowerConfig { + /* If set, we are powered from a low-current source (i.e. solar), so even if it looks like we have power flowing in + we should try to minimize power consumption as much as possible. + YOU DO NOT NEED TO SET THIS IF YOU'VE set is_router (it is implied in that case). + Advanced Option */ + bool is_power_saving; + /* If non-zero, the device will fully power off this many seconds after external power is removed. */ + uint32_t on_battery_shutdown_after_secs; + /* Ratio of voltage divider for battery pin eg. 3.20 (R1=100k, R2=220k) + Overrides the ADC_MULTIPLIER defined in variant for battery voltage calculation. + Should be set to floating point value between 2 and 4 + Fixes issues on Heltec v2 */ + float adc_multiplier_override; + /* Wait Bluetooth Seconds + The number of seconds for to wait before turning off BLE in No Bluetooth states + 0 for default of 1 minute */ + uint32_t wait_bluetooth_secs; + /* Mesh Super Deep Sleep Timeout Seconds + While in Light Sleep if this value is exceeded we will lower into super deep sleep + for sds_secs (default 1 year) or a button press + 0 for default of two hours, MAXUINT for disabled */ + uint32_t mesh_sds_timeout_secs; + /* Super Deep Sleep Seconds + While in Light Sleep if mesh_sds_timeout_secs is exceeded we will lower into super deep sleep + for this value (default 1 year) or a button press + 0 for default of one year */ + uint32_t sds_secs; + /* Light Sleep Seconds + In light sleep the CPU is suspended, LoRa radio is on, BLE is off an GPS is on + ESP32 Only + 0 for default of 300 */ + uint32_t ls_secs; + /* Minimum Wake Seconds + While in light sleep when we receive packets on the LoRa radio we will wake and handle them and stay awake in no BLE mode for this value + 0 for default of 10 seconds */ + uint32_t min_wake_secs; +} meshtastic_Config_PowerConfig; + +typedef struct _meshtastic_Config_NetworkConfig_IpV4Config { + /* Static IP address */ + uint32_t ip; + /* Static gateway address */ + uint32_t gateway; + /* Static subnet mask */ + uint32_t subnet; + /* Static DNS server address */ + uint32_t dns; +} meshtastic_Config_NetworkConfig_IpV4Config; + +/* Network Config */ +typedef struct _meshtastic_Config_NetworkConfig { + /* Enable WiFi (disables Bluetooth) */ + bool wifi_enabled; + /* If set, this node will try to join the specified wifi network and + acquire an address via DHCP */ + char wifi_ssid[33]; + /* If set, will be use to authenticate to the named wifi */ + char wifi_psk[64]; + /* NTP server to use if WiFi is conneced, defaults to `0.pool.ntp.org` */ + char ntp_server[33]; + /* Enable Ethernet */ + bool eth_enabled; + /* acquire an address via DHCP or assign static */ + meshtastic_Config_NetworkConfig_AddressMode address_mode; + /* struct to keep static address */ + bool has_ipv4_config; + meshtastic_Config_NetworkConfig_IpV4Config ipv4_config; +} meshtastic_Config_NetworkConfig; + +/* Display Config */ +typedef struct _meshtastic_Config_DisplayConfig { + /* Number of seconds the screen stays on after pressing the user button or receiving a message + 0 for default of one minute MAXUINT for always on */ + uint32_t screen_on_secs; + /* How the GPS coordinates are formatted on the OLED screen. */ + meshtastic_Config_DisplayConfig_GpsCoordinateFormat gps_format; + /* Automatically toggles to the next page on the screen like a carousel, based the specified interval in seconds. + Potentially useful for devices without user buttons. */ + uint32_t auto_screen_carousel_secs; + /* If this is set, the displayed compass will always point north. if unset, the old behaviour + (top of display is heading direction) is used. */ + bool compass_north_top; + /* Flip screen vertically, for cases that mount the screen upside down */ + bool flip_screen; + /* Perferred display units */ + meshtastic_Config_DisplayConfig_DisplayUnits units; + /* Override auto-detect in screen */ + meshtastic_Config_DisplayConfig_OledType oled; + /* Display Mode */ + meshtastic_Config_DisplayConfig_DisplayMode displaymode; + /* Print first line in pseudo-bold? FALSE is original style, TRUE is bold */ + bool heading_bold; +} meshtastic_Config_DisplayConfig; + +/* Lora Config */ +typedef struct _meshtastic_Config_LoRaConfig { + /* When enabled, the `modem_preset` fields will be adheared to, else the `bandwidth`/`spread_factor`/`coding_rate` + will be taked from their respective manually defined fields */ + bool use_preset; + /* Either modem_config or bandwidth/spreading/coding will be specified - NOT BOTH. + As a heuristic: If bandwidth is specified, do not use modem_config. + Because protobufs take ZERO space when the value is zero this works out nicely. + This value is replaced by bandwidth/spread_factor/coding_rate. + If you'd like to experiment with other options add them to MeshRadio.cpp in the device code. */ + meshtastic_Config_LoRaConfig_ModemPreset modem_preset; + /* Bandwidth in MHz + Certain bandwidth numbers are 'special' and will be converted to the + appropriate floating point value: 31 -> 31.25MHz */ + uint16_t bandwidth; + /* A number from 7 to 12. + Indicates number of chirps per symbol as 1< +#include "meshtastic/config.pb.h" + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Struct definitions */ +/* Device metadata response */ +typedef struct _meshtastic_DeviceMetadata { + /* Device firmware version string */ + char firmware_version[18]; + /* Device state version */ + uint32_t device_state_version; + /* Indicates whether the device can shutdown CPU natively or via power management chip */ + bool canShutdown; + /* Indicates that the device has native wifi capability */ + bool hasWifi; + /* Indicates that the device has native bluetooth capability */ + bool hasBluetooth; + /* Indicates that the device has an ethernet peripheral */ + bool hasEthernet; + /* Indicates that the device's role in the mesh */ + meshtastic_Config_DeviceConfig_Role role; + /* Indicates the device's current enabled position flags */ + meshtastic_Config_PositionConfig_PositionFlags position_flags; +} meshtastic_DeviceMetadata; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initializer values for message structs */ +#define meshtastic_DeviceMetadata_init_default {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, _meshtastic_Config_PositionConfig_PositionFlags_MIN} +#define meshtastic_DeviceMetadata_init_zero {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, _meshtastic_Config_PositionConfig_PositionFlags_MIN} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_DeviceMetadata_firmware_version_tag 1 +#define meshtastic_DeviceMetadata_device_state_version_tag 2 +#define meshtastic_DeviceMetadata_canShutdown_tag 3 +#define meshtastic_DeviceMetadata_hasWifi_tag 4 +#define meshtastic_DeviceMetadata_hasBluetooth_tag 5 +#define meshtastic_DeviceMetadata_hasEthernet_tag 6 +#define meshtastic_DeviceMetadata_role_tag 7 +#define meshtastic_DeviceMetadata_position_flags_tag 8 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_DeviceMetadata_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, STRING, firmware_version, 1) \ +X(a, STATIC, SINGULAR, UINT32, device_state_version, 2) \ +X(a, STATIC, SINGULAR, BOOL, canShutdown, 3) \ +X(a, STATIC, SINGULAR, BOOL, hasWifi, 4) \ +X(a, STATIC, SINGULAR, BOOL, hasBluetooth, 5) \ +X(a, STATIC, SINGULAR, BOOL, hasEthernet, 6) \ +X(a, STATIC, SINGULAR, UENUM, role, 7) \ +X(a, STATIC, SINGULAR, UENUM, position_flags, 8) +#define meshtastic_DeviceMetadata_CALLBACK NULL +#define meshtastic_DeviceMetadata_DEFAULT NULL + +extern const pb_msgdesc_t meshtastic_DeviceMetadata_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_DeviceMetadata_fields &meshtastic_DeviceMetadata_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_DeviceMetadata_size 38 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.c b/src/mesh/generated/meshtastic/deviceonly.pb.c new file mode 100644 index 000000000..f3d27d086 --- /dev/null +++ b/src/mesh/generated/meshtastic/deviceonly.pb.c @@ -0,0 +1,19 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/deviceonly.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_DeviceState, meshtastic_DeviceState, 4) + + +PB_BIND(meshtastic_ChannelFile, meshtastic_ChannelFile, 2) + + +PB_BIND(meshtastic_OEMStore, meshtastic_OEMStore, 2) + + + + diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h new file mode 100644 index 000000000..842431b28 --- /dev/null +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -0,0 +1,184 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_INCLUDED +#include +#include "meshtastic/channel.pb.h" +#include "meshtastic/mesh.pb.h" + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +/* TODO: REPLACE */ +typedef enum _meshtastic_ScreenFonts { + /* TODO: REPLACE */ + meshtastic_ScreenFonts_FONT_SMALL = 0, + /* TODO: REPLACE */ + meshtastic_ScreenFonts_FONT_MEDIUM = 1, + /* TODO: REPLACE */ + meshtastic_ScreenFonts_FONT_LARGE = 2 +} meshtastic_ScreenFonts; + +/* Struct definitions */ +/* This message is never sent over the wire, but it is used for serializing DB + state to flash in the device code + FIXME, since we write this each time we enter deep sleep (and have infinite + flash) it would be better to use some sort of append only data structure for + the receive queue and use the preferences store for the other stuff */ +typedef struct _meshtastic_DeviceState { + /* Read only settings/info about this node */ + bool has_my_node; + meshtastic_MyNodeInfo my_node; + /* My owner info */ + bool has_owner; + meshtastic_User owner; + /* TODO: REPLACE */ + pb_size_t node_db_count; + meshtastic_NodeInfo node_db[80]; + /* Received packets saved for delivery to the phone */ + pb_size_t receive_queue_count; + meshtastic_MeshPacket receive_queue[1]; + /* We keep the last received text message (only) stored in the device flash, + so we can show it on the screen. + Might be null */ + bool has_rx_text_message; + meshtastic_MeshPacket rx_text_message; + /* A version integer used to invalidate old save files when we make + incompatible changes This integer is set at build time and is private to + NodeDB.cpp in the device code. */ + uint32_t version; + /* Used only during development. + Indicates developer is testing and changes should never be saved to flash. */ + bool no_save; + /* Some GPSes seem to have bogus settings from the factory, so we always do one factory reset. */ + bool did_gps_reset; +} meshtastic_DeviceState; + +/* The on-disk saved channels */ +typedef struct _meshtastic_ChannelFile { + /* The channels our node knows about */ + pb_size_t channels_count; + meshtastic_Channel channels[8]; + /* A version integer used to invalidate old save files when we make + incompatible changes This integer is set at build time and is private to + NodeDB.cpp in the device code. */ + uint32_t version; +} meshtastic_ChannelFile; + +typedef PB_BYTES_ARRAY_T(2048) meshtastic_OEMStore_oem_icon_bits_t; +typedef PB_BYTES_ARRAY_T(32) meshtastic_OEMStore_oem_aes_key_t; +/* This can be used for customizing the firmware distribution. If populated, + show a secondary bootup screen with cuatom logo and text for 2.5 seconds. */ +typedef struct _meshtastic_OEMStore { + /* The Logo width in Px */ + uint32_t oem_icon_width; + /* The Logo height in Px */ + uint32_t oem_icon_height; + /* The Logo in xbm bytechar format */ + meshtastic_OEMStore_oem_icon_bits_t oem_icon_bits; + /* Use this font for the OEM text. */ + meshtastic_ScreenFonts oem_font; + /* Use this font for the OEM text. */ + char oem_text[40]; + /* The default device encryption key, 16 or 32 byte */ + meshtastic_OEMStore_oem_aes_key_t oem_aes_key; +} meshtastic_OEMStore; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Helper constants for enums */ +#define _meshtastic_ScreenFonts_MIN meshtastic_ScreenFonts_FONT_SMALL +#define _meshtastic_ScreenFonts_MAX meshtastic_ScreenFonts_FONT_LARGE +#define _meshtastic_ScreenFonts_ARRAYSIZE ((meshtastic_ScreenFonts)(meshtastic_ScreenFonts_FONT_LARGE+1)) + + + +#define meshtastic_OEMStore_oem_font_ENUMTYPE meshtastic_ScreenFonts + + +/* Initializer values for message structs */ +#define meshtastic_DeviceState_init_default {false, meshtastic_MyNodeInfo_init_default, false, meshtastic_User_init_default, 0, {meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default}, 0, {meshtastic_MeshPacket_init_default}, false, meshtastic_MeshPacket_init_default, 0, 0, 0} +#define meshtastic_ChannelFile_init_default {0, {meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default}, 0} +#define meshtastic_OEMStore_init_default {0, 0, {0, {0}}, _meshtastic_ScreenFonts_MIN, "", {0, {0}}} +#define meshtastic_DeviceState_init_zero {false, meshtastic_MyNodeInfo_init_zero, false, meshtastic_User_init_zero, 0, {meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero}, 0, {meshtastic_MeshPacket_init_zero}, false, meshtastic_MeshPacket_init_zero, 0, 0, 0} +#define meshtastic_ChannelFile_init_zero {0, {meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero}, 0} +#define meshtastic_OEMStore_init_zero {0, 0, {0, {0}}, _meshtastic_ScreenFonts_MIN, "", {0, {0}}} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_DeviceState_my_node_tag 2 +#define meshtastic_DeviceState_owner_tag 3 +#define meshtastic_DeviceState_node_db_tag 4 +#define meshtastic_DeviceState_receive_queue_tag 5 +#define meshtastic_DeviceState_rx_text_message_tag 7 +#define meshtastic_DeviceState_version_tag 8 +#define meshtastic_DeviceState_no_save_tag 9 +#define meshtastic_DeviceState_did_gps_reset_tag 11 +#define meshtastic_ChannelFile_channels_tag 1 +#define meshtastic_ChannelFile_version_tag 2 +#define meshtastic_OEMStore_oem_icon_width_tag 1 +#define meshtastic_OEMStore_oem_icon_height_tag 2 +#define meshtastic_OEMStore_oem_icon_bits_tag 3 +#define meshtastic_OEMStore_oem_font_tag 4 +#define meshtastic_OEMStore_oem_text_tag 5 +#define meshtastic_OEMStore_oem_aes_key_tag 6 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_DeviceState_FIELDLIST(X, a) \ +X(a, STATIC, OPTIONAL, MESSAGE, my_node, 2) \ +X(a, STATIC, OPTIONAL, MESSAGE, owner, 3) \ +X(a, STATIC, REPEATED, MESSAGE, node_db, 4) \ +X(a, STATIC, REPEATED, MESSAGE, receive_queue, 5) \ +X(a, STATIC, OPTIONAL, MESSAGE, rx_text_message, 7) \ +X(a, STATIC, SINGULAR, UINT32, version, 8) \ +X(a, STATIC, SINGULAR, BOOL, no_save, 9) \ +X(a, STATIC, SINGULAR, BOOL, did_gps_reset, 11) +#define meshtastic_DeviceState_CALLBACK NULL +#define meshtastic_DeviceState_DEFAULT NULL +#define meshtastic_DeviceState_my_node_MSGTYPE meshtastic_MyNodeInfo +#define meshtastic_DeviceState_owner_MSGTYPE meshtastic_User +#define meshtastic_DeviceState_node_db_MSGTYPE meshtastic_NodeInfo +#define meshtastic_DeviceState_receive_queue_MSGTYPE meshtastic_MeshPacket +#define meshtastic_DeviceState_rx_text_message_MSGTYPE meshtastic_MeshPacket + +#define meshtastic_ChannelFile_FIELDLIST(X, a) \ +X(a, STATIC, REPEATED, MESSAGE, channels, 1) \ +X(a, STATIC, SINGULAR, UINT32, version, 2) +#define meshtastic_ChannelFile_CALLBACK NULL +#define meshtastic_ChannelFile_DEFAULT NULL +#define meshtastic_ChannelFile_channels_MSGTYPE meshtastic_Channel + +#define meshtastic_OEMStore_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, oem_icon_width, 1) \ +X(a, STATIC, SINGULAR, UINT32, oem_icon_height, 2) \ +X(a, STATIC, SINGULAR, BYTES, oem_icon_bits, 3) \ +X(a, STATIC, SINGULAR, UENUM, oem_font, 4) \ +X(a, STATIC, SINGULAR, STRING, oem_text, 5) \ +X(a, STATIC, SINGULAR, BYTES, oem_aes_key, 6) +#define meshtastic_OEMStore_CALLBACK NULL +#define meshtastic_OEMStore_DEFAULT NULL + +extern const pb_msgdesc_t meshtastic_DeviceState_msg; +extern const pb_msgdesc_t meshtastic_ChannelFile_msg; +extern const pb_msgdesc_t meshtastic_OEMStore_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_DeviceState_fields &meshtastic_DeviceState_msg +#define meshtastic_ChannelFile_fields &meshtastic_ChannelFile_msg +#define meshtastic_OEMStore_fields &meshtastic_OEMStore_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_ChannelFile_size 638 +#define meshtastic_DeviceState_size 21800 +#define meshtastic_OEMStore_size 2140 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/localonly.pb.c b/src/mesh/generated/meshtastic/localonly.pb.c new file mode 100644 index 000000000..8fc3f1139 --- /dev/null +++ b/src/mesh/generated/meshtastic/localonly.pb.c @@ -0,0 +1,15 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/localonly.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_LocalConfig, meshtastic_LocalConfig, 2) + + +PB_BIND(meshtastic_LocalModuleConfig, meshtastic_LocalModuleConfig, 2) + + + diff --git a/src/mesh/generated/meshtastic/localonly.pb.h b/src/mesh/generated/meshtastic/localonly.pb.h new file mode 100644 index 000000000..4d806ec12 --- /dev/null +++ b/src/mesh/generated/meshtastic/localonly.pb.h @@ -0,0 +1,166 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_INCLUDED +#include +#include "meshtastic/config.pb.h" +#include "meshtastic/module_config.pb.h" + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Struct definitions */ +typedef struct _meshtastic_LocalConfig { + /* The part of the config that is specific to the Device */ + bool has_device; + meshtastic_Config_DeviceConfig device; + /* The part of the config that is specific to the GPS Position */ + bool has_position; + meshtastic_Config_PositionConfig position; + /* The part of the config that is specific to the Power settings */ + bool has_power; + meshtastic_Config_PowerConfig power; + /* The part of the config that is specific to the Wifi Settings */ + bool has_network; + meshtastic_Config_NetworkConfig network; + /* The part of the config that is specific to the Display */ + bool has_display; + meshtastic_Config_DisplayConfig display; + /* The part of the config that is specific to the Lora Radio */ + bool has_lora; + meshtastic_Config_LoRaConfig lora; + /* The part of the config that is specific to the Bluetooth settings */ + bool has_bluetooth; + meshtastic_Config_BluetoothConfig bluetooth; + /* A version integer used to invalidate old save files when we make + incompatible changes This integer is set at build time and is private to + NodeDB.cpp in the device code. */ + uint32_t version; +} meshtastic_LocalConfig; + +typedef struct _meshtastic_LocalModuleConfig { + /* The part of the config that is specific to the MQTT module */ + bool has_mqtt; + meshtastic_ModuleConfig_MQTTConfig mqtt; + /* The part of the config that is specific to the Serial module */ + bool has_serial; + meshtastic_ModuleConfig_SerialConfig serial; + /* The part of the config that is specific to the ExternalNotification module */ + bool has_external_notification; + meshtastic_ModuleConfig_ExternalNotificationConfig external_notification; + /* The part of the config that is specific to the Store & Forward module */ + bool has_store_forward; + meshtastic_ModuleConfig_StoreForwardConfig store_forward; + /* The part of the config that is specific to the RangeTest module */ + bool has_range_test; + meshtastic_ModuleConfig_RangeTestConfig range_test; + /* The part of the config that is specific to the Telemetry module */ + bool has_telemetry; + meshtastic_ModuleConfig_TelemetryConfig telemetry; + /* The part of the config that is specific to the Canned Message module */ + bool has_canned_message; + meshtastic_ModuleConfig_CannedMessageConfig canned_message; + /* A version integer used to invalidate old save files when we make + incompatible changes This integer is set at build time and is private to + NodeDB.cpp in the device code. */ + uint32_t version; + /* The part of the config that is specific to the Audio module */ + bool has_audio; + meshtastic_ModuleConfig_AudioConfig audio; + /* The part of the config that is specific to the Remote Hardware module */ + bool has_remote_hardware; + meshtastic_ModuleConfig_RemoteHardwareConfig remote_hardware; +} meshtastic_LocalModuleConfig; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initializer values for message structs */ +#define meshtastic_LocalConfig_init_default {false, meshtastic_Config_DeviceConfig_init_default, false, meshtastic_Config_PositionConfig_init_default, false, meshtastic_Config_PowerConfig_init_default, false, meshtastic_Config_NetworkConfig_init_default, false, meshtastic_Config_DisplayConfig_init_default, false, meshtastic_Config_LoRaConfig_init_default, false, meshtastic_Config_BluetoothConfig_init_default, 0} +#define meshtastic_LocalModuleConfig_init_default {false, meshtastic_ModuleConfig_MQTTConfig_init_default, false, meshtastic_ModuleConfig_SerialConfig_init_default, false, meshtastic_ModuleConfig_ExternalNotificationConfig_init_default, false, meshtastic_ModuleConfig_StoreForwardConfig_init_default, false, meshtastic_ModuleConfig_RangeTestConfig_init_default, false, meshtastic_ModuleConfig_TelemetryConfig_init_default, false, meshtastic_ModuleConfig_CannedMessageConfig_init_default, 0, false, meshtastic_ModuleConfig_AudioConfig_init_default, false, meshtastic_ModuleConfig_RemoteHardwareConfig_init_default} +#define meshtastic_LocalConfig_init_zero {false, meshtastic_Config_DeviceConfig_init_zero, false, meshtastic_Config_PositionConfig_init_zero, false, meshtastic_Config_PowerConfig_init_zero, false, meshtastic_Config_NetworkConfig_init_zero, false, meshtastic_Config_DisplayConfig_init_zero, false, meshtastic_Config_LoRaConfig_init_zero, false, meshtastic_Config_BluetoothConfig_init_zero, 0} +#define meshtastic_LocalModuleConfig_init_zero {false, meshtastic_ModuleConfig_MQTTConfig_init_zero, false, meshtastic_ModuleConfig_SerialConfig_init_zero, false, meshtastic_ModuleConfig_ExternalNotificationConfig_init_zero, false, meshtastic_ModuleConfig_StoreForwardConfig_init_zero, false, meshtastic_ModuleConfig_RangeTestConfig_init_zero, false, meshtastic_ModuleConfig_TelemetryConfig_init_zero, false, meshtastic_ModuleConfig_CannedMessageConfig_init_zero, 0, false, meshtastic_ModuleConfig_AudioConfig_init_zero, false, meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_LocalConfig_device_tag 1 +#define meshtastic_LocalConfig_position_tag 2 +#define meshtastic_LocalConfig_power_tag 3 +#define meshtastic_LocalConfig_network_tag 4 +#define meshtastic_LocalConfig_display_tag 5 +#define meshtastic_LocalConfig_lora_tag 6 +#define meshtastic_LocalConfig_bluetooth_tag 7 +#define meshtastic_LocalConfig_version_tag 8 +#define meshtastic_LocalModuleConfig_mqtt_tag 1 +#define meshtastic_LocalModuleConfig_serial_tag 2 +#define meshtastic_LocalModuleConfig_external_notification_tag 3 +#define meshtastic_LocalModuleConfig_store_forward_tag 4 +#define meshtastic_LocalModuleConfig_range_test_tag 5 +#define meshtastic_LocalModuleConfig_telemetry_tag 6 +#define meshtastic_LocalModuleConfig_canned_message_tag 7 +#define meshtastic_LocalModuleConfig_version_tag 8 +#define meshtastic_LocalModuleConfig_audio_tag 9 +#define meshtastic_LocalModuleConfig_remote_hardware_tag 10 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_LocalConfig_FIELDLIST(X, a) \ +X(a, STATIC, OPTIONAL, MESSAGE, device, 1) \ +X(a, STATIC, OPTIONAL, MESSAGE, position, 2) \ +X(a, STATIC, OPTIONAL, MESSAGE, power, 3) \ +X(a, STATIC, OPTIONAL, MESSAGE, network, 4) \ +X(a, STATIC, OPTIONAL, MESSAGE, display, 5) \ +X(a, STATIC, OPTIONAL, MESSAGE, lora, 6) \ +X(a, STATIC, OPTIONAL, MESSAGE, bluetooth, 7) \ +X(a, STATIC, SINGULAR, UINT32, version, 8) +#define meshtastic_LocalConfig_CALLBACK NULL +#define meshtastic_LocalConfig_DEFAULT NULL +#define meshtastic_LocalConfig_device_MSGTYPE meshtastic_Config_DeviceConfig +#define meshtastic_LocalConfig_position_MSGTYPE meshtastic_Config_PositionConfig +#define meshtastic_LocalConfig_power_MSGTYPE meshtastic_Config_PowerConfig +#define meshtastic_LocalConfig_network_MSGTYPE meshtastic_Config_NetworkConfig +#define meshtastic_LocalConfig_display_MSGTYPE meshtastic_Config_DisplayConfig +#define meshtastic_LocalConfig_lora_MSGTYPE meshtastic_Config_LoRaConfig +#define meshtastic_LocalConfig_bluetooth_MSGTYPE meshtastic_Config_BluetoothConfig + +#define meshtastic_LocalModuleConfig_FIELDLIST(X, a) \ +X(a, STATIC, OPTIONAL, MESSAGE, mqtt, 1) \ +X(a, STATIC, OPTIONAL, MESSAGE, serial, 2) \ +X(a, STATIC, OPTIONAL, MESSAGE, external_notification, 3) \ +X(a, STATIC, OPTIONAL, MESSAGE, store_forward, 4) \ +X(a, STATIC, OPTIONAL, MESSAGE, range_test, 5) \ +X(a, STATIC, OPTIONAL, MESSAGE, telemetry, 6) \ +X(a, STATIC, OPTIONAL, MESSAGE, canned_message, 7) \ +X(a, STATIC, SINGULAR, UINT32, version, 8) \ +X(a, STATIC, OPTIONAL, MESSAGE, audio, 9) \ +X(a, STATIC, OPTIONAL, MESSAGE, remote_hardware, 10) +#define meshtastic_LocalModuleConfig_CALLBACK NULL +#define meshtastic_LocalModuleConfig_DEFAULT NULL +#define meshtastic_LocalModuleConfig_mqtt_MSGTYPE meshtastic_ModuleConfig_MQTTConfig +#define meshtastic_LocalModuleConfig_serial_MSGTYPE meshtastic_ModuleConfig_SerialConfig +#define meshtastic_LocalModuleConfig_external_notification_MSGTYPE meshtastic_ModuleConfig_ExternalNotificationConfig +#define meshtastic_LocalModuleConfig_store_forward_MSGTYPE meshtastic_ModuleConfig_StoreForwardConfig +#define meshtastic_LocalModuleConfig_range_test_MSGTYPE meshtastic_ModuleConfig_RangeTestConfig +#define meshtastic_LocalModuleConfig_telemetry_MSGTYPE meshtastic_ModuleConfig_TelemetryConfig +#define meshtastic_LocalModuleConfig_canned_message_MSGTYPE meshtastic_ModuleConfig_CannedMessageConfig +#define meshtastic_LocalModuleConfig_audio_MSGTYPE meshtastic_ModuleConfig_AudioConfig +#define meshtastic_LocalModuleConfig_remote_hardware_MSGTYPE meshtastic_ModuleConfig_RemoteHardwareConfig + +extern const pb_msgdesc_t meshtastic_LocalConfig_msg; +extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_LocalConfig_fields &meshtastic_LocalConfig_msg +#define meshtastic_LocalModuleConfig_fields &meshtastic_LocalModuleConfig_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_LocalConfig_size 391 +#define meshtastic_LocalModuleConfig_size 412 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/mesh.pb.c b/src/mesh/generated/meshtastic/mesh.pb.c new file mode 100644 index 000000000..977e3916f --- /dev/null +++ b/src/mesh/generated/meshtastic/mesh.pb.c @@ -0,0 +1,60 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/mesh.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_Position, meshtastic_Position, AUTO) + + +PB_BIND(meshtastic_User, meshtastic_User, AUTO) + + +PB_BIND(meshtastic_RouteDiscovery, meshtastic_RouteDiscovery, AUTO) + + +PB_BIND(meshtastic_Routing, meshtastic_Routing, AUTO) + + +PB_BIND(meshtastic_Data, meshtastic_Data, 2) + + +PB_BIND(meshtastic_Waypoint, meshtastic_Waypoint, AUTO) + + +PB_BIND(meshtastic_MeshPacket, meshtastic_MeshPacket, 2) + + +PB_BIND(meshtastic_NodeInfo, meshtastic_NodeInfo, AUTO) + + +PB_BIND(meshtastic_MyNodeInfo, meshtastic_MyNodeInfo, AUTO) + + +PB_BIND(meshtastic_LogRecord, meshtastic_LogRecord, AUTO) + + +PB_BIND(meshtastic_QueueStatus, meshtastic_QueueStatus, AUTO) + + +PB_BIND(meshtastic_FromRadio, meshtastic_FromRadio, 2) + + +PB_BIND(meshtastic_ToRadio, meshtastic_ToRadio, 2) + + +PB_BIND(meshtastic_Compressed, meshtastic_Compressed, AUTO) + + + + + + + + + + + + diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h new file mode 100644 index 000000000..0a8cf5cfe --- /dev/null +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -0,0 +1,1158 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_MESH_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_MESH_PB_H_INCLUDED +#include +#include "meshtastic/channel.pb.h" +#include "meshtastic/config.pb.h" +#include "meshtastic/module_config.pb.h" +#include "meshtastic/portnums.pb.h" +#include "meshtastic/telemetry.pb.h" +#include "meshtastic/xmodem.pb.h" + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +/* Note: these enum names must EXACTLY match the string used in the device + bin/build-all.sh script. + Because they will be used to find firmware filenames in the android app for OTA updates. + To match the old style filenames, _ is converted to -, p is converted to . */ +typedef enum _meshtastic_HardwareModel { + /* TODO: REPLACE */ + meshtastic_HardwareModel_UNSET = 0, + /* TODO: REPLACE */ + meshtastic_HardwareModel_TLORA_V2 = 1, + /* TODO: REPLACE */ + meshtastic_HardwareModel_TLORA_V1 = 2, + /* TODO: REPLACE */ + meshtastic_HardwareModel_TLORA_V2_1_1P6 = 3, + /* TODO: REPLACE */ + meshtastic_HardwareModel_TBEAM = 4, + /* The original heltec WiFi_Lora_32_V2, which had battery voltage sensing hooked to GPIO 13 + (see HELTEC_V2 for the new version). */ + meshtastic_HardwareModel_HELTEC_V2_0 = 5, + /* TODO: REPLACE */ + meshtastic_HardwareModel_TBEAM_V0P7 = 6, + /* TODO: REPLACE */ + meshtastic_HardwareModel_T_ECHO = 7, + /* TODO: REPLACE */ + meshtastic_HardwareModel_TLORA_V1_1P3 = 8, + /* TODO: REPLACE */ + meshtastic_HardwareModel_RAK4631 = 9, + /* The new version of the heltec WiFi_Lora_32_V2 board that has battery sensing hooked to GPIO 37. + Sadly they did not update anything on the silkscreen to identify this board */ + meshtastic_HardwareModel_HELTEC_V2_1 = 10, + /* Ancient heltec WiFi_Lora_32 board */ + meshtastic_HardwareModel_HELTEC_V1 = 11, + /* New T-BEAM with ESP32-S3 CPU */ + meshtastic_HardwareModel_LILYGO_TBEAM_S3_CORE = 12, + /* RAK WisBlock ESP32 core: https://docs.rakwireless.com/Product-Categories/WisBlock/RAK11200/Overview/ */ + meshtastic_HardwareModel_RAK11200 = 13, + /* B&Q Consulting Nano Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:nano */ + meshtastic_HardwareModel_NANO_G1 = 14, + /* TODO: REPLACE */ + meshtastic_HardwareModel_TLORA_V2_1_1P8 = 15, + /* TODO: REPLACE */ + meshtastic_HardwareModel_TLORA_T3_S3 = 16, + /* B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station */ + meshtastic_HardwareModel_STATION_G1 = 25, + /* Less common/prototype boards listed here (needs one more byte over the air) */ + meshtastic_HardwareModel_LORA_RELAY_V1 = 32, + /* TODO: REPLACE */ + meshtastic_HardwareModel_NRF52840DK = 33, + /* TODO: REPLACE */ + meshtastic_HardwareModel_PPR = 34, + /* TODO: REPLACE */ + meshtastic_HardwareModel_GENIEBLOCKS = 35, + /* TODO: REPLACE */ + meshtastic_HardwareModel_NRF52_UNKNOWN = 36, + /* TODO: REPLACE */ + meshtastic_HardwareModel_PORTDUINO = 37, + /* The simulator built into the android app */ + meshtastic_HardwareModel_ANDROID_SIM = 38, + /* Custom DIY device based on @NanoVHF schematics: https://github.com/NanoVHF/Meshtastic-DIY/tree/main/Schematics */ + meshtastic_HardwareModel_DIY_V1 = 39, + /* nRF52840 Dongle : https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle/ */ + meshtastic_HardwareModel_NRF52840_PCA10059 = 40, + /* Custom Disaster Radio esp32 v3 device https://github.com/sudomesh/disaster-radio/tree/master/hardware/board_esp32_v3 */ + meshtastic_HardwareModel_DR_DEV = 41, + /* M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, Paper) https://m5stack.com/ */ + meshtastic_HardwareModel_M5STACK = 42, + /* New Heltec LoRA32 with ESP32-S3 CPU */ + meshtastic_HardwareModel_HELTEC_V3 = 43, + /* New Heltec Wireless Stick Lite with ESP32-S3 CPU */ + meshtastic_HardwareModel_HELTEC_WSL_V3 = 44, + /* New BETAFPV ELRS Micro TX Module 2.4G with ESP32 CPU */ + meshtastic_HardwareModel_BETAFPV_2400_TX = 45, + /* Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. */ + meshtastic_HardwareModel_PRIVATE_HW = 255 +} meshtastic_HardwareModel; + +/* Shared constants between device and phone */ +typedef enum _meshtastic_Constants { + /* First enum must be zero, and we are just using this enum to + pass int constants between two very different environments */ + meshtastic_Constants_ZERO = 0, + /* From mesh.options + note: this payload length is ONLY the bytes that are sent inside of the Data protobuf (excluding protobuf overhead). The 16 byte header is + outside of this envelope */ + meshtastic_Constants_DATA_PAYLOAD_LEN = 237 +} meshtastic_Constants; + +/* Error codes for critical errors + The device might report these fault codes on the screen. + If you encounter a fault code, please post on the meshtastic.discourse.group + and we'll try to help. */ +typedef enum _meshtastic_CriticalErrorCode { + /* TODO: REPLACE */ + meshtastic_CriticalErrorCode_NONE = 0, + /* A software bug was detected while trying to send lora */ + meshtastic_CriticalErrorCode_TX_WATCHDOG = 1, + /* A software bug was detected on entry to sleep */ + meshtastic_CriticalErrorCode_SLEEP_ENTER_WAIT = 2, + /* No Lora radio hardware could be found */ + meshtastic_CriticalErrorCode_NO_RADIO = 3, + /* Not normally used */ + meshtastic_CriticalErrorCode_UNSPECIFIED = 4, + /* We failed while configuring a UBlox GPS */ + meshtastic_CriticalErrorCode_UBLOX_UNIT_FAILED = 5, + /* This board was expected to have a power management chip and it is missing or broken */ + meshtastic_CriticalErrorCode_NO_AXP192 = 6, + /* The channel tried to set a radio setting which is not supported by this chipset, + radio comms settings are now undefined. */ + meshtastic_CriticalErrorCode_INVALID_RADIO_SETTING = 7, + /* Radio transmit hardware failure. We sent data to the radio chip, but it didn't + reply with an interrupt. */ + meshtastic_CriticalErrorCode_TRANSMIT_FAILED = 8, + /* We detected that the main CPU voltage dropped below the minumum acceptable value */ + meshtastic_CriticalErrorCode_BROWNOUT = 9, + /* Selftest of SX1262 radio chip failed */ + meshtastic_CriticalErrorCode_SX1262_FAILURE = 10, + /* A (likely software but possibly hardware) failure was detected while trying to send packets. + If this occurs on your board, please post in the forum so that we can ask you to collect some information to allow fixing this bug */ + meshtastic_CriticalErrorCode_RADIO_SPI_BUG = 11 +} meshtastic_CriticalErrorCode; + +/* How the location was acquired: manual, onboard GPS, external (EUD) GPS */ +typedef enum _meshtastic_Position_LocSource { + /* TODO: REPLACE */ + meshtastic_Position_LocSource_LOC_UNSET = 0, + /* TODO: REPLACE */ + meshtastic_Position_LocSource_LOC_MANUAL = 1, + /* TODO: REPLACE */ + meshtastic_Position_LocSource_LOC_INTERNAL = 2, + /* TODO: REPLACE */ + meshtastic_Position_LocSource_LOC_EXTERNAL = 3 +} meshtastic_Position_LocSource; + +/* How the altitude was acquired: manual, GPS int/ext, etc + Default: same as location_source if present */ +typedef enum _meshtastic_Position_AltSource { + /* TODO: REPLACE */ + meshtastic_Position_AltSource_ALT_UNSET = 0, + /* TODO: REPLACE */ + meshtastic_Position_AltSource_ALT_MANUAL = 1, + /* TODO: REPLACE */ + meshtastic_Position_AltSource_ALT_INTERNAL = 2, + /* TODO: REPLACE */ + meshtastic_Position_AltSource_ALT_EXTERNAL = 3, + /* TODO: REPLACE */ + meshtastic_Position_AltSource_ALT_BAROMETRIC = 4 +} meshtastic_Position_AltSource; + +/* A failure in delivering a message (usually used for routing control messages, but might be provided in addition to ack.fail_id to provide + details on the type of failure). */ +typedef enum _meshtastic_Routing_Error { + /* This message is not a failure */ + meshtastic_Routing_Error_NONE = 0, + /* Our node doesn't have a route to the requested destination anymore. */ + meshtastic_Routing_Error_NO_ROUTE = 1, + /* We received a nak while trying to forward on your behalf */ + meshtastic_Routing_Error_GOT_NAK = 2, + /* TODO: REPLACE */ + meshtastic_Routing_Error_TIMEOUT = 3, + /* No suitable interface could be found for delivering this packet */ + meshtastic_Routing_Error_NO_INTERFACE = 4, + /* We reached the max retransmission count (typically for naive flood routing) */ + meshtastic_Routing_Error_MAX_RETRANSMIT = 5, + /* No suitable channel was found for sending this packet (i.e. was requested channel index disabled?) */ + meshtastic_Routing_Error_NO_CHANNEL = 6, + /* The packet was too big for sending (exceeds interface MTU after encoding) */ + meshtastic_Routing_Error_TOO_LARGE = 7, + /* The request had want_response set, the request reached the destination node, but no service on that node wants to send a response + (possibly due to bad channel permissions) */ + meshtastic_Routing_Error_NO_RESPONSE = 8, + /* Cannot send currently because duty cycle regulations will be violated. */ + meshtastic_Routing_Error_DUTY_CYCLE_LIMIT = 9, + /* The application layer service on the remote node received your request, but considered your request somehow invalid */ + meshtastic_Routing_Error_BAD_REQUEST = 32, + /* The application layer service on the remote node received your request, but considered your request not authorized + (i.e you did not send the request on the required bound channel) */ + meshtastic_Routing_Error_NOT_AUTHORIZED = 33 +} meshtastic_Routing_Error; + +/* The priority of this message for sending. + Higher priorities are sent first (when managing the transmit queue). + This field is never sent over the air, it is only used internally inside of a local device node. + API clients (either on the local node or connected directly to the node) + can set this parameter if necessary. + (values must be <= 127 to keep protobuf field to one byte in size. + Detailed background on this field: + I noticed a funny side effect of lora being so slow: Usually when making + a protocol there isn’t much need to use message priority to change the order + of transmission (because interfaces are fairly fast). + But for lora where packets can take a few seconds each, it is very important + to make sure that critical packets are sent ASAP. + In the case of meshtastic that means we want to send protocol acks as soon as possible + (to prevent unneeded retransmissions), we want routing messages to be sent next, + then messages marked as reliable and finally ‘background’ packets like periodic position updates. + So I bit the bullet and implemented a new (internal - not sent over the air) + field in MeshPacket called ‘priority’. + And the transmission queue in the router object is now a priority queue. */ +typedef enum _meshtastic_MeshPacket_Priority { + /* Treated as Priority.DEFAULT */ + meshtastic_MeshPacket_Priority_UNSET = 0, + /* TODO: REPLACE */ + meshtastic_MeshPacket_Priority_MIN = 1, + /* Background position updates are sent with very low priority - + if the link is super congested they might not go out at all */ + meshtastic_MeshPacket_Priority_BACKGROUND = 10, + /* This priority is used for most messages that don't have a priority set */ + meshtastic_MeshPacket_Priority_DEFAULT = 64, + /* If priority is unset but the message is marked as want_ack, + assume it is important and use a slightly higher priority */ + meshtastic_MeshPacket_Priority_RELIABLE = 70, + /* Ack/naks are sent with very high priority to ensure that retransmission + stops as soon as possible */ + meshtastic_MeshPacket_Priority_ACK = 120, + /* TODO: REPLACE */ + meshtastic_MeshPacket_Priority_MAX = 127 +} meshtastic_MeshPacket_Priority; + +/* Identify if this is a delayed packet */ +typedef enum _meshtastic_MeshPacket_Delayed { + /* If unset, the message is being sent in real time. */ + meshtastic_MeshPacket_Delayed_NO_DELAY = 0, + /* The message is delayed and was originally a broadcast */ + meshtastic_MeshPacket_Delayed_DELAYED_BROADCAST = 1, + /* The message is delayed and was originally a direct message */ + meshtastic_MeshPacket_Delayed_DELAYED_DIRECT = 2 +} meshtastic_MeshPacket_Delayed; + +/* Log levels, chosen to match python logging conventions. */ +typedef enum _meshtastic_LogRecord_Level { + /* Log levels, chosen to match python logging conventions. */ + meshtastic_LogRecord_Level_UNSET = 0, + /* Log levels, chosen to match python logging conventions. */ + meshtastic_LogRecord_Level_CRITICAL = 50, + /* Log levels, chosen to match python logging conventions. */ + meshtastic_LogRecord_Level_ERROR = 40, + /* Log levels, chosen to match python logging conventions. */ + meshtastic_LogRecord_Level_WARNING = 30, + /* Log levels, chosen to match python logging conventions. */ + meshtastic_LogRecord_Level_INFO = 20, + /* Log levels, chosen to match python logging conventions. */ + meshtastic_LogRecord_Level_DEBUG = 10, + /* Log levels, chosen to match python logging conventions. */ + meshtastic_LogRecord_Level_TRACE = 5 +} meshtastic_LogRecord_Level; + +/* Struct definitions */ +/* a gps position */ +typedef struct _meshtastic_Position { + /* The new preferred location encoding, multiply by 1e-7 to get degrees + in floating point */ + int32_t latitude_i; + /* TODO: REPLACE */ + int32_t longitude_i; + /* In meters above MSL (but see issue #359) */ + int32_t altitude; + /* This is usually not sent over the mesh (to save space), but it is sent + from the phone so that the local device can set its RTC If it is sent over + the mesh (because there are devices on the mesh without GPS), it will only + be sent by devices which has a hardware GPS clock. + seconds since 1970 */ + uint32_t time; + /* TODO: REPLACE */ + meshtastic_Position_LocSource location_source; + /* TODO: REPLACE */ + meshtastic_Position_AltSource altitude_source; + /* Positional timestamp (actual timestamp of GPS solution) in integer epoch seconds */ + uint32_t timestamp; + /* Pos. timestamp milliseconds adjustment (rarely available or required) */ + int32_t timestamp_millis_adjust; + /* HAE altitude in meters - can be used instead of MSL altitude */ + int32_t altitude_hae; + /* Geoidal separation in meters */ + int32_t altitude_geoidal_separation; + /* Horizontal, Vertical and Position Dilution of Precision, in 1/100 units + - PDOP is sufficient for most cases + - for higher precision scenarios, HDOP and VDOP can be used instead, + in which case PDOP becomes redundant (PDOP=sqrt(HDOP^2 + VDOP^2)) + TODO: REMOVE/INTEGRATE */ + uint32_t PDOP; + /* TODO: REPLACE */ + uint32_t HDOP; + /* TODO: REPLACE */ + uint32_t VDOP; + /* GPS accuracy (a hardware specific constant) in mm + multiplied with DOP to calculate positional accuracy + Default: "'bout three meters-ish" :) */ + uint32_t gps_accuracy; + /* Ground speed in m/s and True North TRACK in 1/100 degrees + Clarification of terms: + - "track" is the direction of motion (measured in horizontal plane) + - "heading" is where the fuselage points (measured in horizontal plane) + - "yaw" indicates a relative rotation about the vertical axis + TODO: REMOVE/INTEGRATE */ + uint32_t ground_speed; + /* TODO: REPLACE */ + uint32_t ground_track; + /* GPS fix quality (from NMEA GxGGA statement or similar) */ + uint32_t fix_quality; + /* GPS fix type 2D/3D (from NMEA GxGSA statement) */ + uint32_t fix_type; + /* GPS "Satellites in View" number */ + uint32_t sats_in_view; + /* Sensor ID - in case multiple positioning sensors are being used */ + uint32_t sensor_id; + /* Estimated/expected time (in seconds) until next update: + - if we update at fixed intervals of X seconds, use X + - if we update at dynamic intervals (based on relative movement etc), + but "AT LEAST every Y seconds", use Y */ + uint32_t next_update; + /* A sequence number, incremented with each Position message to help + detect lost updates if needed */ + uint32_t seq_number; +} meshtastic_Position; + +/* Broadcast when a newly powered mesh node wants to find a node num it can use + Sent from the phone over bluetooth to set the user id for the owner of this node. + Also sent from nodes to each other when a new node signs on (so all clients can have this info) + The algorithm is as follows: + when a node starts up, it broadcasts their user and the normal flow is for all + other nodes to reply with their User as well (so the new node can build its nodedb) + If a node ever receives a User (not just the first broadcast) message where + the sender node number equals our node number, that indicates a collision has + occurred and the following steps should happen: + If the receiving node (that was already in the mesh)'s macaddr is LOWER than the + new User who just tried to sign in: it gets to keep its nodenum. + We send a broadcast message of OUR User (we use a broadcast so that the other node can + receive our message, considering we have the same id - it also serves to let + observers correct their nodedb) - this case is rare so it should be okay. + If any node receives a User where the macaddr is GTE than their local macaddr, + they have been vetoed and should pick a new random nodenum (filtering against + whatever it knows about the nodedb) and rebroadcast their User. + A few nodenums are reserved and will never be requested: + 0xff - broadcast + 0 through 3 - for future use */ +typedef struct _meshtastic_User { + /* A globally unique ID string for this user. + In the case of Signal that would mean +16504442323, for the default macaddr derived id it would be !<8 hexidecimal bytes>. + Note: app developers are encouraged to also use the following standard + node IDs "^all" (for broadcast), "^local" (for the locally connected node) */ + char id[16]; + /* A full name for this user, i.e. "Kevin Hester" */ + char long_name[40]; + /* A VERY short name, ideally two characters. + Suitable for a tiny OLED screen */ + char short_name[5]; + /* This is the addr of the radio. + Not populated by the phone, but added by the esp32 when broadcasting */ + pb_byte_t macaddr[6]; + /* TBEAM, HELTEC, etc... + Starting in 1.2.11 moved to hw_model enum in the NodeInfo object. + Apps will still need the string here for older builds + (so OTA update can find the right image), but if the enum is available it will be used instead. */ + meshtastic_HardwareModel hw_model; + /* In some regions Ham radio operators have different bandwidth limitations than others. + If this user is a licensed operator, set this flag. + Also, "long_name" should be their licence number. */ + bool is_licensed; +} meshtastic_User; + +/* A message used in our Dynamic Source Routing protocol (RFC 4728 based) */ +typedef struct _meshtastic_RouteDiscovery { + /* The list of nodenums this packet has visited so far */ + pb_size_t route_count; + uint32_t route[8]; +} meshtastic_RouteDiscovery; + +/* A Routing control Data packet handled by the routing module */ +typedef struct _meshtastic_Routing { + pb_size_t which_variant; + union { + /* A route request going from the requester */ + meshtastic_RouteDiscovery route_request; + /* A route reply */ + meshtastic_RouteDiscovery route_reply; + /* A failure in delivering a message (usually used for routing control messages, but might be provided + in addition to ack.fail_id to provide details on the type of failure). */ + meshtastic_Routing_Error error_reason; + }; +} meshtastic_Routing; + +typedef PB_BYTES_ARRAY_T(237) meshtastic_Data_payload_t; +/* (Formerly called SubPacket) + The payload portion fo a packet, this is the actual bytes that are sent + inside a radio packet (because from/to are broken out by the comms library) */ +typedef struct _meshtastic_Data { + /* Formerly named typ and of type Type */ + meshtastic_PortNum portnum; + /* TODO: REPLACE */ + meshtastic_Data_payload_t payload; + /* Not normally used, but for testing a sender can request that recipient + responds in kind (i.e. if it received a position, it should unicast back it's position). + Note: that if you set this on a broadcast you will receive many replies. */ + bool want_response; + /* The address of the destination node. + This field is is filled in by the mesh radio device software, application + layer software should never need it. + RouteDiscovery messages _must_ populate this. + Other message types might need to if they are doing multihop routing. */ + uint32_t dest; + /* The address of the original sender for this message. + This field should _only_ be populated for reliable multihop packets (to keep + packets small). */ + uint32_t source; + /* Only used in routing or response messages. + Indicates the original message ID that this message is reporting failure on. (formerly called original_id) */ + uint32_t request_id; + /* If set, this message is intened to be a reply to a previously sent message with the defined id. */ + uint32_t reply_id; + /* Defaults to false. If true, then what is in the payload should be treated as an emoji like giving + a message a heart or poop emoji. */ + uint32_t emoji; +} meshtastic_Data; + +/* Waypoint message, used to share arbitrary locations across the mesh */ +typedef struct _meshtastic_Waypoint { + /* Id of the waypoint */ + uint32_t id; + /* latitude_i */ + int32_t latitude_i; + /* longitude_i */ + int32_t longitude_i; + /* Time the waypoint is to expire (epoch) */ + uint32_t expire; + /* If greater than zero, treat the value as a nodenum only allowing them to update the waypoint. + If zero, the waypoint is open to be edited by any member of the mesh. */ + uint32_t locked_to; + /* Name of the waypoint - max 30 chars */ + char name[30]; + /* Description of the waypoint - max 100 chars */ + char description[100]; + /* Designator icon for the waypoint in the form of a unicode emoji */ + uint32_t icon; +} meshtastic_Waypoint; + +typedef PB_BYTES_ARRAY_T(256) meshtastic_MeshPacket_encrypted_t; +/* A packet envelope sent/received over the mesh + only payload_variant is sent in the payload portion of the LORA packet. + The other fields are either not sent at all, or sent in the special 16 byte LORA header. */ +typedef struct _meshtastic_MeshPacket { + /* The sending node number. + Note: Our crypto implementation uses this field as well. + See [crypto](/docs/overview/encryption) for details. + FIXME - really should be fixed32 instead, this encoding only hurts the ble link though. */ + uint32_t from; + /* The (immediatSee Priority description for more details.y should be fixed32 instead, this encoding only + hurts the ble link though. */ + uint32_t to; + /* (Usually) If set, this indicates the index in the secondary_channels table that this packet was sent/received on. + If unset, packet was on the primary channel. + A particular node might know only a subset of channels in use on the mesh. + Therefore channel_index is inherently a local concept and meaningless to send between nodes. + Very briefly, while sending and receiving deep inside the device Router code, this field instead + contains the 'channel hash' instead of the index. + This 'trick' is only used while the payload_variant is an 'encrypted'. */ + uint8_t channel; + pb_size_t which_payload_variant; + union { + /* TODO: REPLACE */ + meshtastic_Data decoded; + /* TODO: REPLACE */ + meshtastic_MeshPacket_encrypted_t encrypted; + }; + /* A unique ID for this packet. + Always 0 for no-ack packets or non broadcast packets (and therefore take zero bytes of space). + Otherwise a unique ID for this packet, useful for flooding algorithms. + ID only needs to be unique on a _per sender_ basis, and it only + needs to be unique for a few minutes (long enough to last for the length of + any ACK or the completion of a mesh broadcast flood). + Note: Our crypto implementation uses this id as well. + See [crypto](/docs/overview/encryption) for details. + FIXME - really should be fixed32 instead, this encoding only + hurts the ble link though. */ + uint32_t id; + /* The time this message was received by the esp32 (secs since 1970). + Note: this field is _never_ sent on the radio link itself (to save space) Times + are typically not sent over the mesh, but they will be added to any Packet + (chain of SubPacket) sent to the phone (so the phone can know exact time of reception) */ + uint32_t rx_time; + /* *Never* sent over the radio links. + Set during reception to indicate the SNR of this packet. + Used to collect statistics on current link quality. */ + float rx_snr; + /* If unset treated as zero (no forwarding, send to adjacent nodes only) + if 1, allow hopping through one node, etc... + For our usecase real world topologies probably have a max of about 3. + This field is normally placed into a few of bits in the header. */ + uint8_t hop_limit; + /* This packet is being sent as a reliable message, we would prefer it to arrive at the destination. + We would like to receive a ack packet in response. + Broadcasts messages treat this flag specially: Since acks for broadcasts would + rapidly flood the channel, the normal ack behavior is suppressed. + Instead, the original sender listens to see if at least one node is rebroadcasting this packet (because naive flooding algorithm). + If it hears that the odds (given typical LoRa topologies) the odds are very high that every node should eventually receive the message. + So FloodingRouter.cpp generates an implicit ack which is delivered to the original sender. + If after some time we don't hear anyone rebroadcast our packet, we will timeout and retransmit, using the regular resend logic. + Note: This flag is normally sent in a flag bit in the header when sent over the wire */ + bool want_ack; + /* The priority of this message for sending. + See MeshPacket.Priority description for more details. */ + meshtastic_MeshPacket_Priority priority; + /* rssi of received packet. Only sent to phone for dispay purposes. */ + int32_t rx_rssi; + /* Describe if this message is delayed */ + meshtastic_MeshPacket_Delayed delayed; +} meshtastic_MeshPacket; + +/* The bluetooth to device link: + Old BTLE protocol docs from TODO, merge in above and make real docs... + use protocol buffers, and NanoPB + messages from device to phone: + POSITION_UPDATE (..., time) + TEXT_RECEIVED(from, text, time) + OPAQUE_RECEIVED(from, payload, time) (for signal messages or other applications) + messages from phone to device: + SET_MYID(id, human readable long, human readable short) (send down the unique ID + string used for this node, a human readable string shown for that id, and a very + short human readable string suitable for oled screen) SEND_OPAQUE(dest, payload) + (for signal messages or other applications) SEND_TEXT(dest, text) Get all + nodes() (returns list of nodes, with full info, last time seen, loc, battery + level etc) SET_CONFIG (switches device to a new set of radio params and + preshared key, drops all existing nodes, force our node to rejoin this new group) + Full information about a node on the mesh */ +typedef struct _meshtastic_NodeInfo { + /* The node number */ + uint32_t num; + /* The user info for this node */ + bool has_user; + meshtastic_User user; + /* This position data. Note: before 1.2.14 we would also store the last time we've heard from this node in position.time, that is no longer true. + Position.time now indicates the last time we received a POSITION from that node. */ + bool has_position; + meshtastic_Position position; + /* Returns the Signal-to-noise ratio (SNR) of the last received message, + as measured by the receiver. Return SNR of the last received message in dB */ + float snr; + /* Set to indicate the last time we received a packet from this node */ + uint32_t last_heard; + /* The latest device metrics for the node. */ + bool has_device_metrics; + meshtastic_DeviceMetrics device_metrics; +} meshtastic_NodeInfo; + +/* Unique local debugging info for this node + Note: we don't include position or the user info, because that will come in the + Sent to the phone in response to WantNodes. */ +typedef struct _meshtastic_MyNodeInfo { + /* Tells the phone what our node number is, default starting value is + lowbyte of macaddr, but it will be fixed if that is already in use */ + uint32_t my_node_num; + /* Note: This flag merely means we detected a hardware GPS in our node. + Not the same as UserPreferences.location_sharing */ + bool has_gps; + /* The maximum number of 'software' channels that can be set on this node. */ + uint32_t max_channels; + /* 0.0.5 etc... */ + char firmware_version[18]; + /* An error message we'd like to report back to the mothership through analytics. + It indicates a serious bug occurred on the device, the device coped with it, + but we still want to tell the devs about the bug. + This field will be cleared after the phone reads MyNodeInfo + (i.e. it will only be reported once) + a numeric error code to go with error message, zero means no error */ + meshtastic_CriticalErrorCode error_code; + /* A numeric error address (nonzero if available) */ + uint32_t error_address; + /* The total number of errors this node has ever encountered + (well - since the last time we discarded preferences) */ + uint32_t error_count; + /* The total number of reboots this node has ever encountered + (well - since the last time we discarded preferences) */ + uint32_t reboot_count; + /* Calculated bitrate of the current channel (in Bytes Per Second) */ + float bitrate; + /* How long before we consider a message abandoned and we can clear our + caches of any messages in flight Normally quite large to handle the worst case + message delivery time, 5 minutes. + Formerly called FLOOD_EXPIRE_TIME in the device code */ + uint32_t message_timeout_msec; + /* The minimum app version that can talk to this device. + Phone/PC apps should compare this to their build number and if too low tell the user they must update their app */ + uint32_t min_app_version; + /* 24 time windows of 1hr each with the airtime transmitted out of the device per hour. */ + pb_size_t air_period_tx_count; + uint32_t air_period_tx[8]; + /* 24 time windows of 1hr each with the airtime of valid packets for your mesh. */ + pb_size_t air_period_rx_count; + uint32_t air_period_rx[8]; + /* Is the device wifi capable? */ + bool has_wifi; + /* Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise). */ + float channel_utilization; + /* Percent of airtime for transmission used within the last hour. */ + float air_util_tx; +} meshtastic_MyNodeInfo; + +/* Debug output from the device. + To minimize the size of records inside the device code, if a time/source/level is not set + on the message it is assumed to be a continuation of the previously sent message. + This allows the device code to use fixed maxlen 64 byte strings for messages, + and then extend as needed by emitting multiple records. */ +typedef struct _meshtastic_LogRecord { + /* Log levels, chosen to match python logging conventions. */ + char message[64]; + /* Seconds since 1970 - or 0 for unknown/unset */ + uint32_t time; + /* Usually based on thread name - if known */ + char source[8]; + /* Not yet set */ + meshtastic_LogRecord_Level level; +} meshtastic_LogRecord; + +typedef struct _meshtastic_QueueStatus { + /* Last attempt to queue status, ErrorCode */ + int8_t res; + /* Free entries in the outgoing queue */ + uint8_t free; + /* Maximum entries in the outgoing queue */ + uint8_t maxlen; + /* What was mesh packet id that generated this response? */ + uint32_t mesh_packet_id; +} meshtastic_QueueStatus; + +/* Packets from the radio to the phone will appear on the fromRadio characteristic. + It will support READ and NOTIFY. When a new packet arrives the device will BLE notify? + It will sit in that descriptor until consumed by the phone, + at which point the next item in the FIFO will be populated. */ +typedef struct _meshtastic_FromRadio { + /* The packet id, used to allow the phone to request missing read packets from the FIFO, + see our bluetooth docs */ + uint32_t id; + pb_size_t which_payload_variant; + union { + /* Log levels, chosen to match python logging conventions. */ + meshtastic_MeshPacket packet; + /* Tells the phone what our node number is, can be -1 if we've not yet joined a mesh. + NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps. */ + meshtastic_MyNodeInfo my_info; + /* One packet is sent for each node in the on radio DB + starts over with the first node in our DB */ + meshtastic_NodeInfo node_info; + /* Include a part of the config (was: RadioConfig radio) */ + meshtastic_Config config; + /* Set to send debug console output over our protobuf stream */ + meshtastic_LogRecord log_record; + /* Sent as true once the device has finished sending all of the responses to want_config + recipient should check if this ID matches our original request nonce, if + not, it means your config responses haven't started yet. + NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps. */ + uint32_t config_complete_id; + /* Sent to tell clients the radio has just rebooted. + Set to true if present. + Not used on all transports, currently just used for the serial console. + NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps. */ + bool rebooted; + /* Include module config */ + meshtastic_ModuleConfig moduleConfig; + /* One packet is sent for each channel */ + meshtastic_Channel channel; + /* Queue status info */ + meshtastic_QueueStatus queueStatus; + /* File Transfer Chunk */ + meshtastic_XModem xmodemPacket; + }; +} meshtastic_FromRadio; + +/* Packets/commands to the radio will be written (reliably) to the toRadio characteristic. + Once the write completes the phone can assume it is handled. */ +typedef struct _meshtastic_ToRadio { + pb_size_t which_payload_variant; + union { + /* Send this packet on the mesh */ + meshtastic_MeshPacket packet; + /* Phone wants radio to send full node db to the phone, This is + typically the first packet sent to the radio when the phone gets a + bluetooth connection. The radio will respond by sending back a + MyNodeInfo, a owner, a radio config and a series of + FromRadio.node_infos, and config_complete + the integer you write into this field will be reported back in the + config_complete_id response this allows clients to never be confused by + a stale old partially sent config. */ + uint32_t want_config_id; + /* Tell API server we are disconnecting now. + This is useful for serial links where there is no hardware/protocol based notification that the client has dropped the link. + (Sending this message is optional for clients) */ + bool disconnect; + meshtastic_XModem xmodemPacket; + }; +} meshtastic_ToRadio; + +typedef PB_BYTES_ARRAY_T(237) meshtastic_Compressed_data_t; +/* Compressed message payload */ +typedef struct _meshtastic_Compressed { + /* PortNum to determine the how to handle the compressed payload. */ + meshtastic_PortNum portnum; + /* Compressed data. */ + meshtastic_Compressed_data_t data; +} meshtastic_Compressed; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Helper constants for enums */ +#define _meshtastic_HardwareModel_MIN meshtastic_HardwareModel_UNSET +#define _meshtastic_HardwareModel_MAX meshtastic_HardwareModel_PRIVATE_HW +#define _meshtastic_HardwareModel_ARRAYSIZE ((meshtastic_HardwareModel)(meshtastic_HardwareModel_PRIVATE_HW+1)) + +#define _meshtastic_Constants_MIN meshtastic_Constants_ZERO +#define _meshtastic_Constants_MAX meshtastic_Constants_DATA_PAYLOAD_LEN +#define _meshtastic_Constants_ARRAYSIZE ((meshtastic_Constants)(meshtastic_Constants_DATA_PAYLOAD_LEN+1)) + +#define _meshtastic_CriticalErrorCode_MIN meshtastic_CriticalErrorCode_NONE +#define _meshtastic_CriticalErrorCode_MAX meshtastic_CriticalErrorCode_RADIO_SPI_BUG +#define _meshtastic_CriticalErrorCode_ARRAYSIZE ((meshtastic_CriticalErrorCode)(meshtastic_CriticalErrorCode_RADIO_SPI_BUG+1)) + +#define _meshtastic_Position_LocSource_MIN meshtastic_Position_LocSource_LOC_UNSET +#define _meshtastic_Position_LocSource_MAX meshtastic_Position_LocSource_LOC_EXTERNAL +#define _meshtastic_Position_LocSource_ARRAYSIZE ((meshtastic_Position_LocSource)(meshtastic_Position_LocSource_LOC_EXTERNAL+1)) + +#define _meshtastic_Position_AltSource_MIN meshtastic_Position_AltSource_ALT_UNSET +#define _meshtastic_Position_AltSource_MAX meshtastic_Position_AltSource_ALT_BAROMETRIC +#define _meshtastic_Position_AltSource_ARRAYSIZE ((meshtastic_Position_AltSource)(meshtastic_Position_AltSource_ALT_BAROMETRIC+1)) + +#define _meshtastic_Routing_Error_MIN meshtastic_Routing_Error_NONE +#define _meshtastic_Routing_Error_MAX meshtastic_Routing_Error_NOT_AUTHORIZED +#define _meshtastic_Routing_Error_ARRAYSIZE ((meshtastic_Routing_Error)(meshtastic_Routing_Error_NOT_AUTHORIZED+1)) + +#define _meshtastic_MeshPacket_Priority_MIN meshtastic_MeshPacket_Priority_UNSET +#define _meshtastic_MeshPacket_Priority_MAX meshtastic_MeshPacket_Priority_MAX +#define _meshtastic_MeshPacket_Priority_ARRAYSIZE ((meshtastic_MeshPacket_Priority)(meshtastic_MeshPacket_Priority_MAX+1)) + +#define _meshtastic_MeshPacket_Delayed_MIN meshtastic_MeshPacket_Delayed_NO_DELAY +#define _meshtastic_MeshPacket_Delayed_MAX meshtastic_MeshPacket_Delayed_DELAYED_DIRECT +#define _meshtastic_MeshPacket_Delayed_ARRAYSIZE ((meshtastic_MeshPacket_Delayed)(meshtastic_MeshPacket_Delayed_DELAYED_DIRECT+1)) + +#define _meshtastic_LogRecord_Level_MIN meshtastic_LogRecord_Level_UNSET +#define _meshtastic_LogRecord_Level_MAX meshtastic_LogRecord_Level_CRITICAL +#define _meshtastic_LogRecord_Level_ARRAYSIZE ((meshtastic_LogRecord_Level)(meshtastic_LogRecord_Level_CRITICAL+1)) + +#define meshtastic_Position_location_source_ENUMTYPE meshtastic_Position_LocSource +#define meshtastic_Position_altitude_source_ENUMTYPE meshtastic_Position_AltSource + +#define meshtastic_User_hw_model_ENUMTYPE meshtastic_HardwareModel + + +#define meshtastic_Routing_variant_error_reason_ENUMTYPE meshtastic_Routing_Error + +#define meshtastic_Data_portnum_ENUMTYPE meshtastic_PortNum + + +#define meshtastic_MeshPacket_priority_ENUMTYPE meshtastic_MeshPacket_Priority +#define meshtastic_MeshPacket_delayed_ENUMTYPE meshtastic_MeshPacket_Delayed + + +#define meshtastic_MyNodeInfo_error_code_ENUMTYPE meshtastic_CriticalErrorCode + +#define meshtastic_LogRecord_level_ENUMTYPE meshtastic_LogRecord_Level + + + + +#define meshtastic_Compressed_portnum_ENUMTYPE meshtastic_PortNum + + +/* Initializer values for message structs */ +#define meshtastic_Position_init_default {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define meshtastic_User_init_default {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0} +#define meshtastic_RouteDiscovery_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}} +#define meshtastic_Routing_init_default {0, {meshtastic_RouteDiscovery_init_default}} +#define meshtastic_Data_init_default {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0} +#define meshtastic_Waypoint_init_default {0, 0, 0, 0, 0, "", "", 0} +#define meshtastic_MeshPacket_init_default {0, 0, 0, 0, {meshtastic_Data_init_default}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN} +#define meshtastic_NodeInfo_init_default {0, false, meshtastic_User_init_default, false, meshtastic_Position_init_default, 0, 0, false, meshtastic_DeviceMetrics_init_default} +#define meshtastic_MyNodeInfo_init_default {0, 0, 0, "", _meshtastic_CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} +#define meshtastic_LogRecord_init_default {"", 0, "", _meshtastic_LogRecord_Level_MIN} +#define meshtastic_QueueStatus_init_default {0, 0, 0, 0} +#define meshtastic_FromRadio_init_default {0, 0, {meshtastic_MeshPacket_init_default}} +#define meshtastic_ToRadio_init_default {0, {meshtastic_MeshPacket_init_default}} +#define meshtastic_Compressed_init_default {_meshtastic_PortNum_MIN, {0, {0}}} +#define meshtastic_Position_init_zero {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define meshtastic_User_init_zero {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0} +#define meshtastic_RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}} +#define meshtastic_Routing_init_zero {0, {meshtastic_RouteDiscovery_init_zero}} +#define meshtastic_Data_init_zero {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0} +#define meshtastic_Waypoint_init_zero {0, 0, 0, 0, 0, "", "", 0} +#define meshtastic_MeshPacket_init_zero {0, 0, 0, 0, {meshtastic_Data_init_zero}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN} +#define meshtastic_NodeInfo_init_zero {0, false, meshtastic_User_init_zero, false, meshtastic_Position_init_zero, 0, 0, false, meshtastic_DeviceMetrics_init_zero} +#define meshtastic_MyNodeInfo_init_zero {0, 0, 0, "", _meshtastic_CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} +#define meshtastic_LogRecord_init_zero {"", 0, "", _meshtastic_LogRecord_Level_MIN} +#define meshtastic_QueueStatus_init_zero {0, 0, 0, 0} +#define meshtastic_FromRadio_init_zero {0, 0, {meshtastic_MeshPacket_init_zero}} +#define meshtastic_ToRadio_init_zero {0, {meshtastic_MeshPacket_init_zero}} +#define meshtastic_Compressed_init_zero {_meshtastic_PortNum_MIN, {0, {0}}} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_Position_latitude_i_tag 1 +#define meshtastic_Position_longitude_i_tag 2 +#define meshtastic_Position_altitude_tag 3 +#define meshtastic_Position_time_tag 4 +#define meshtastic_Position_location_source_tag 5 +#define meshtastic_Position_altitude_source_tag 6 +#define meshtastic_Position_timestamp_tag 7 +#define meshtastic_Position_timestamp_millis_adjust_tag 8 +#define meshtastic_Position_altitude_hae_tag 9 +#define meshtastic_Position_altitude_geoidal_separation_tag 10 +#define meshtastic_Position_PDOP_tag 11 +#define meshtastic_Position_HDOP_tag 12 +#define meshtastic_Position_VDOP_tag 13 +#define meshtastic_Position_gps_accuracy_tag 14 +#define meshtastic_Position_ground_speed_tag 15 +#define meshtastic_Position_ground_track_tag 16 +#define meshtastic_Position_fix_quality_tag 17 +#define meshtastic_Position_fix_type_tag 18 +#define meshtastic_Position_sats_in_view_tag 19 +#define meshtastic_Position_sensor_id_tag 20 +#define meshtastic_Position_next_update_tag 21 +#define meshtastic_Position_seq_number_tag 22 +#define meshtastic_User_id_tag 1 +#define meshtastic_User_long_name_tag 2 +#define meshtastic_User_short_name_tag 3 +#define meshtastic_User_macaddr_tag 4 +#define meshtastic_User_hw_model_tag 5 +#define meshtastic_User_is_licensed_tag 6 +#define meshtastic_RouteDiscovery_route_tag 1 +#define meshtastic_Routing_route_request_tag 1 +#define meshtastic_Routing_route_reply_tag 2 +#define meshtastic_Routing_error_reason_tag 3 +#define meshtastic_Data_portnum_tag 1 +#define meshtastic_Data_payload_tag 2 +#define meshtastic_Data_want_response_tag 3 +#define meshtastic_Data_dest_tag 4 +#define meshtastic_Data_source_tag 5 +#define meshtastic_Data_request_id_tag 6 +#define meshtastic_Data_reply_id_tag 7 +#define meshtastic_Data_emoji_tag 8 +#define meshtastic_Waypoint_id_tag 1 +#define meshtastic_Waypoint_latitude_i_tag 2 +#define meshtastic_Waypoint_longitude_i_tag 3 +#define meshtastic_Waypoint_expire_tag 4 +#define meshtastic_Waypoint_locked_to_tag 5 +#define meshtastic_Waypoint_name_tag 6 +#define meshtastic_Waypoint_description_tag 7 +#define meshtastic_Waypoint_icon_tag 8 +#define meshtastic_MeshPacket_from_tag 1 +#define meshtastic_MeshPacket_to_tag 2 +#define meshtastic_MeshPacket_channel_tag 3 +#define meshtastic_MeshPacket_decoded_tag 4 +#define meshtastic_MeshPacket_encrypted_tag 5 +#define meshtastic_MeshPacket_id_tag 6 +#define meshtastic_MeshPacket_rx_time_tag 7 +#define meshtastic_MeshPacket_rx_snr_tag 8 +#define meshtastic_MeshPacket_hop_limit_tag 9 +#define meshtastic_MeshPacket_want_ack_tag 10 +#define meshtastic_MeshPacket_priority_tag 11 +#define meshtastic_MeshPacket_rx_rssi_tag 12 +#define meshtastic_MeshPacket_delayed_tag 13 +#define meshtastic_NodeInfo_num_tag 1 +#define meshtastic_NodeInfo_user_tag 2 +#define meshtastic_NodeInfo_position_tag 3 +#define meshtastic_NodeInfo_snr_tag 4 +#define meshtastic_NodeInfo_last_heard_tag 5 +#define meshtastic_NodeInfo_device_metrics_tag 6 +#define meshtastic_MyNodeInfo_my_node_num_tag 1 +#define meshtastic_MyNodeInfo_has_gps_tag 2 +#define meshtastic_MyNodeInfo_max_channels_tag 3 +#define meshtastic_MyNodeInfo_firmware_version_tag 4 +#define meshtastic_MyNodeInfo_error_code_tag 5 +#define meshtastic_MyNodeInfo_error_address_tag 6 +#define meshtastic_MyNodeInfo_error_count_tag 7 +#define meshtastic_MyNodeInfo_reboot_count_tag 8 +#define meshtastic_MyNodeInfo_bitrate_tag 9 +#define meshtastic_MyNodeInfo_message_timeout_msec_tag 10 +#define meshtastic_MyNodeInfo_min_app_version_tag 11 +#define meshtastic_MyNodeInfo_air_period_tx_tag 12 +#define meshtastic_MyNodeInfo_air_period_rx_tag 13 +#define meshtastic_MyNodeInfo_has_wifi_tag 14 +#define meshtastic_MyNodeInfo_channel_utilization_tag 15 +#define meshtastic_MyNodeInfo_air_util_tx_tag 16 +#define meshtastic_LogRecord_message_tag 1 +#define meshtastic_LogRecord_time_tag 2 +#define meshtastic_LogRecord_source_tag 3 +#define meshtastic_LogRecord_level_tag 4 +#define meshtastic_QueueStatus_res_tag 1 +#define meshtastic_QueueStatus_free_tag 2 +#define meshtastic_QueueStatus_maxlen_tag 3 +#define meshtastic_QueueStatus_mesh_packet_id_tag 4 +#define meshtastic_FromRadio_id_tag 1 +#define meshtastic_FromRadio_packet_tag 2 +#define meshtastic_FromRadio_my_info_tag 3 +#define meshtastic_FromRadio_node_info_tag 4 +#define meshtastic_FromRadio_config_tag 5 +#define meshtastic_FromRadio_log_record_tag 6 +#define meshtastic_FromRadio_config_complete_id_tag 7 +#define meshtastic_FromRadio_rebooted_tag 8 +#define meshtastic_FromRadio_moduleConfig_tag 9 +#define meshtastic_FromRadio_channel_tag 10 +#define meshtastic_FromRadio_queueStatus_tag 11 +#define meshtastic_FromRadio_xmodemPacket_tag 12 +#define meshtastic_ToRadio_packet_tag 1 +#define meshtastic_ToRadio_want_config_id_tag 3 +#define meshtastic_ToRadio_disconnect_tag 4 +#define meshtastic_ToRadio_xmodemPacket_tag 5 +#define meshtastic_Compressed_portnum_tag 1 +#define meshtastic_Compressed_data_tag 2 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_Position_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, SFIXED32, latitude_i, 1) \ +X(a, STATIC, SINGULAR, SFIXED32, longitude_i, 2) \ +X(a, STATIC, SINGULAR, INT32, altitude, 3) \ +X(a, STATIC, SINGULAR, FIXED32, time, 4) \ +X(a, STATIC, SINGULAR, UENUM, location_source, 5) \ +X(a, STATIC, SINGULAR, UENUM, altitude_source, 6) \ +X(a, STATIC, SINGULAR, FIXED32, timestamp, 7) \ +X(a, STATIC, SINGULAR, INT32, timestamp_millis_adjust, 8) \ +X(a, STATIC, SINGULAR, SINT32, altitude_hae, 9) \ +X(a, STATIC, SINGULAR, SINT32, altitude_geoidal_separation, 10) \ +X(a, STATIC, SINGULAR, UINT32, PDOP, 11) \ +X(a, STATIC, SINGULAR, UINT32, HDOP, 12) \ +X(a, STATIC, SINGULAR, UINT32, VDOP, 13) \ +X(a, STATIC, SINGULAR, UINT32, gps_accuracy, 14) \ +X(a, STATIC, SINGULAR, UINT32, ground_speed, 15) \ +X(a, STATIC, SINGULAR, UINT32, ground_track, 16) \ +X(a, STATIC, SINGULAR, UINT32, fix_quality, 17) \ +X(a, STATIC, SINGULAR, UINT32, fix_type, 18) \ +X(a, STATIC, SINGULAR, UINT32, sats_in_view, 19) \ +X(a, STATIC, SINGULAR, UINT32, sensor_id, 20) \ +X(a, STATIC, SINGULAR, UINT32, next_update, 21) \ +X(a, STATIC, SINGULAR, UINT32, seq_number, 22) +#define meshtastic_Position_CALLBACK NULL +#define meshtastic_Position_DEFAULT NULL + +#define meshtastic_User_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, STRING, id, 1) \ +X(a, STATIC, SINGULAR, STRING, long_name, 2) \ +X(a, STATIC, SINGULAR, STRING, short_name, 3) \ +X(a, STATIC, SINGULAR, FIXED_LENGTH_BYTES, macaddr, 4) \ +X(a, STATIC, SINGULAR, UENUM, hw_model, 5) \ +X(a, STATIC, SINGULAR, BOOL, is_licensed, 6) +#define meshtastic_User_CALLBACK NULL +#define meshtastic_User_DEFAULT NULL + +#define meshtastic_RouteDiscovery_FIELDLIST(X, a) \ +X(a, STATIC, REPEATED, FIXED32, route, 1) +#define meshtastic_RouteDiscovery_CALLBACK NULL +#define meshtastic_RouteDiscovery_DEFAULT NULL + +#define meshtastic_Routing_FIELDLIST(X, a) \ +X(a, STATIC, ONEOF, MESSAGE, (variant,route_request,route_request), 1) \ +X(a, STATIC, ONEOF, MESSAGE, (variant,route_reply,route_reply), 2) \ +X(a, STATIC, ONEOF, UENUM, (variant,error_reason,error_reason), 3) +#define meshtastic_Routing_CALLBACK NULL +#define meshtastic_Routing_DEFAULT NULL +#define meshtastic_Routing_variant_route_request_MSGTYPE meshtastic_RouteDiscovery +#define meshtastic_Routing_variant_route_reply_MSGTYPE meshtastic_RouteDiscovery + +#define meshtastic_Data_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, portnum, 1) \ +X(a, STATIC, SINGULAR, BYTES, payload, 2) \ +X(a, STATIC, SINGULAR, BOOL, want_response, 3) \ +X(a, STATIC, SINGULAR, FIXED32, dest, 4) \ +X(a, STATIC, SINGULAR, FIXED32, source, 5) \ +X(a, STATIC, SINGULAR, FIXED32, request_id, 6) \ +X(a, STATIC, SINGULAR, FIXED32, reply_id, 7) \ +X(a, STATIC, SINGULAR, FIXED32, emoji, 8) +#define meshtastic_Data_CALLBACK NULL +#define meshtastic_Data_DEFAULT NULL + +#define meshtastic_Waypoint_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, id, 1) \ +X(a, STATIC, SINGULAR, SFIXED32, latitude_i, 2) \ +X(a, STATIC, SINGULAR, SFIXED32, longitude_i, 3) \ +X(a, STATIC, SINGULAR, UINT32, expire, 4) \ +X(a, STATIC, SINGULAR, UINT32, locked_to, 5) \ +X(a, STATIC, SINGULAR, STRING, name, 6) \ +X(a, STATIC, SINGULAR, STRING, description, 7) \ +X(a, STATIC, SINGULAR, FIXED32, icon, 8) +#define meshtastic_Waypoint_CALLBACK NULL +#define meshtastic_Waypoint_DEFAULT NULL + +#define meshtastic_MeshPacket_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, FIXED32, from, 1) \ +X(a, STATIC, SINGULAR, FIXED32, to, 2) \ +X(a, STATIC, SINGULAR, UINT32, channel, 3) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,decoded,decoded), 4) \ +X(a, STATIC, ONEOF, BYTES, (payload_variant,encrypted,encrypted), 5) \ +X(a, STATIC, SINGULAR, FIXED32, id, 6) \ +X(a, STATIC, SINGULAR, FIXED32, rx_time, 7) \ +X(a, STATIC, SINGULAR, FLOAT, rx_snr, 8) \ +X(a, STATIC, SINGULAR, UINT32, hop_limit, 9) \ +X(a, STATIC, SINGULAR, BOOL, want_ack, 10) \ +X(a, STATIC, SINGULAR, UENUM, priority, 11) \ +X(a, STATIC, SINGULAR, INT32, rx_rssi, 12) \ +X(a, STATIC, SINGULAR, UENUM, delayed, 13) +#define meshtastic_MeshPacket_CALLBACK NULL +#define meshtastic_MeshPacket_DEFAULT NULL +#define meshtastic_MeshPacket_payload_variant_decoded_MSGTYPE meshtastic_Data + +#define meshtastic_NodeInfo_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, num, 1) \ +X(a, STATIC, OPTIONAL, MESSAGE, user, 2) \ +X(a, STATIC, OPTIONAL, MESSAGE, position, 3) \ +X(a, STATIC, SINGULAR, FLOAT, snr, 4) \ +X(a, STATIC, SINGULAR, FIXED32, last_heard, 5) \ +X(a, STATIC, OPTIONAL, MESSAGE, device_metrics, 6) +#define meshtastic_NodeInfo_CALLBACK NULL +#define meshtastic_NodeInfo_DEFAULT NULL +#define meshtastic_NodeInfo_user_MSGTYPE meshtastic_User +#define meshtastic_NodeInfo_position_MSGTYPE meshtastic_Position +#define meshtastic_NodeInfo_device_metrics_MSGTYPE meshtastic_DeviceMetrics + +#define meshtastic_MyNodeInfo_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, my_node_num, 1) \ +X(a, STATIC, SINGULAR, BOOL, has_gps, 2) \ +X(a, STATIC, SINGULAR, UINT32, max_channels, 3) \ +X(a, STATIC, SINGULAR, STRING, firmware_version, 4) \ +X(a, STATIC, SINGULAR, UENUM, error_code, 5) \ +X(a, STATIC, SINGULAR, UINT32, error_address, 6) \ +X(a, STATIC, SINGULAR, UINT32, error_count, 7) \ +X(a, STATIC, SINGULAR, UINT32, reboot_count, 8) \ +X(a, STATIC, SINGULAR, FLOAT, bitrate, 9) \ +X(a, STATIC, SINGULAR, UINT32, message_timeout_msec, 10) \ +X(a, STATIC, SINGULAR, UINT32, min_app_version, 11) \ +X(a, STATIC, REPEATED, UINT32, air_period_tx, 12) \ +X(a, STATIC, REPEATED, UINT32, air_period_rx, 13) \ +X(a, STATIC, SINGULAR, BOOL, has_wifi, 14) \ +X(a, STATIC, SINGULAR, FLOAT, channel_utilization, 15) \ +X(a, STATIC, SINGULAR, FLOAT, air_util_tx, 16) +#define meshtastic_MyNodeInfo_CALLBACK NULL +#define meshtastic_MyNodeInfo_DEFAULT NULL + +#define meshtastic_LogRecord_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, STRING, message, 1) \ +X(a, STATIC, SINGULAR, FIXED32, time, 2) \ +X(a, STATIC, SINGULAR, STRING, source, 3) \ +X(a, STATIC, SINGULAR, UENUM, level, 4) +#define meshtastic_LogRecord_CALLBACK NULL +#define meshtastic_LogRecord_DEFAULT NULL + +#define meshtastic_QueueStatus_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, INT32, res, 1) \ +X(a, STATIC, SINGULAR, UINT32, free, 2) \ +X(a, STATIC, SINGULAR, UINT32, maxlen, 3) \ +X(a, STATIC, SINGULAR, UINT32, mesh_packet_id, 4) +#define meshtastic_QueueStatus_CALLBACK NULL +#define meshtastic_QueueStatus_DEFAULT NULL + +#define meshtastic_FromRadio_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, id, 1) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,packet,packet), 2) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,my_info,my_info), 3) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,node_info,node_info), 4) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,config,config), 5) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,log_record,log_record), 6) \ +X(a, STATIC, ONEOF, UINT32, (payload_variant,config_complete_id,config_complete_id), 7) \ +X(a, STATIC, ONEOF, BOOL, (payload_variant,rebooted,rebooted), 8) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,moduleConfig,moduleConfig), 9) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,channel,channel), 10) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,queueStatus,queueStatus), 11) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,xmodemPacket,xmodemPacket), 12) +#define meshtastic_FromRadio_CALLBACK NULL +#define meshtastic_FromRadio_DEFAULT NULL +#define meshtastic_FromRadio_payload_variant_packet_MSGTYPE meshtastic_MeshPacket +#define meshtastic_FromRadio_payload_variant_my_info_MSGTYPE meshtastic_MyNodeInfo +#define meshtastic_FromRadio_payload_variant_node_info_MSGTYPE meshtastic_NodeInfo +#define meshtastic_FromRadio_payload_variant_config_MSGTYPE meshtastic_Config +#define meshtastic_FromRadio_payload_variant_log_record_MSGTYPE meshtastic_LogRecord +#define meshtastic_FromRadio_payload_variant_moduleConfig_MSGTYPE meshtastic_ModuleConfig +#define meshtastic_FromRadio_payload_variant_channel_MSGTYPE meshtastic_Channel +#define meshtastic_FromRadio_payload_variant_queueStatus_MSGTYPE meshtastic_QueueStatus +#define meshtastic_FromRadio_payload_variant_xmodemPacket_MSGTYPE meshtastic_XModem + +#define meshtastic_ToRadio_FIELDLIST(X, a) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,packet,packet), 1) \ +X(a, STATIC, ONEOF, UINT32, (payload_variant,want_config_id,want_config_id), 3) \ +X(a, STATIC, ONEOF, BOOL, (payload_variant,disconnect,disconnect), 4) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,xmodemPacket,xmodemPacket), 5) +#define meshtastic_ToRadio_CALLBACK NULL +#define meshtastic_ToRadio_DEFAULT NULL +#define meshtastic_ToRadio_payload_variant_packet_MSGTYPE meshtastic_MeshPacket +#define meshtastic_ToRadio_payload_variant_xmodemPacket_MSGTYPE meshtastic_XModem + +#define meshtastic_Compressed_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, portnum, 1) \ +X(a, STATIC, SINGULAR, BYTES, data, 2) +#define meshtastic_Compressed_CALLBACK NULL +#define meshtastic_Compressed_DEFAULT NULL + +extern const pb_msgdesc_t meshtastic_Position_msg; +extern const pb_msgdesc_t meshtastic_User_msg; +extern const pb_msgdesc_t meshtastic_RouteDiscovery_msg; +extern const pb_msgdesc_t meshtastic_Routing_msg; +extern const pb_msgdesc_t meshtastic_Data_msg; +extern const pb_msgdesc_t meshtastic_Waypoint_msg; +extern const pb_msgdesc_t meshtastic_MeshPacket_msg; +extern const pb_msgdesc_t meshtastic_NodeInfo_msg; +extern const pb_msgdesc_t meshtastic_MyNodeInfo_msg; +extern const pb_msgdesc_t meshtastic_LogRecord_msg; +extern const pb_msgdesc_t meshtastic_QueueStatus_msg; +extern const pb_msgdesc_t meshtastic_FromRadio_msg; +extern const pb_msgdesc_t meshtastic_ToRadio_msg; +extern const pb_msgdesc_t meshtastic_Compressed_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_Position_fields &meshtastic_Position_msg +#define meshtastic_User_fields &meshtastic_User_msg +#define meshtastic_RouteDiscovery_fields &meshtastic_RouteDiscovery_msg +#define meshtastic_Routing_fields &meshtastic_Routing_msg +#define meshtastic_Data_fields &meshtastic_Data_msg +#define meshtastic_Waypoint_fields &meshtastic_Waypoint_msg +#define meshtastic_MeshPacket_fields &meshtastic_MeshPacket_msg +#define meshtastic_NodeInfo_fields &meshtastic_NodeInfo_msg +#define meshtastic_MyNodeInfo_fields &meshtastic_MyNodeInfo_msg +#define meshtastic_LogRecord_fields &meshtastic_LogRecord_msg +#define meshtastic_QueueStatus_fields &meshtastic_QueueStatus_msg +#define meshtastic_FromRadio_fields &meshtastic_FromRadio_msg +#define meshtastic_ToRadio_fields &meshtastic_ToRadio_msg +#define meshtastic_Compressed_fields &meshtastic_Compressed_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_Compressed_size 243 +#define meshtastic_Data_size 270 +#define meshtastic_FromRadio_size 330 +#define meshtastic_LogRecord_size 81 +#define meshtastic_MeshPacket_size 321 +#define meshtastic_MyNodeInfo_size 179 +#define meshtastic_NodeInfo_size 258 +#define meshtastic_Position_size 137 +#define meshtastic_QueueStatus_size 23 +#define meshtastic_RouteDiscovery_size 40 +#define meshtastic_Routing_size 42 +#define meshtastic_ToRadio_size 324 +#define meshtastic_User_size 77 +#define meshtastic_Waypoint_size 165 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/module_config.pb.c b/src/mesh/generated/meshtastic/module_config.pb.c new file mode 100644 index 000000000..0878be909 --- /dev/null +++ b/src/mesh/generated/meshtastic/module_config.pb.c @@ -0,0 +1,43 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/module_config.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_ModuleConfig, meshtastic_ModuleConfig, AUTO) + + +PB_BIND(meshtastic_ModuleConfig_MQTTConfig, meshtastic_ModuleConfig_MQTTConfig, AUTO) + + +PB_BIND(meshtastic_ModuleConfig_RemoteHardwareConfig, meshtastic_ModuleConfig_RemoteHardwareConfig, AUTO) + + +PB_BIND(meshtastic_ModuleConfig_AudioConfig, meshtastic_ModuleConfig_AudioConfig, AUTO) + + +PB_BIND(meshtastic_ModuleConfig_SerialConfig, meshtastic_ModuleConfig_SerialConfig, AUTO) + + +PB_BIND(meshtastic_ModuleConfig_ExternalNotificationConfig, meshtastic_ModuleConfig_ExternalNotificationConfig, AUTO) + + +PB_BIND(meshtastic_ModuleConfig_StoreForwardConfig, meshtastic_ModuleConfig_StoreForwardConfig, AUTO) + + +PB_BIND(meshtastic_ModuleConfig_RangeTestConfig, meshtastic_ModuleConfig_RangeTestConfig, AUTO) + + +PB_BIND(meshtastic_ModuleConfig_TelemetryConfig, meshtastic_ModuleConfig_TelemetryConfig, AUTO) + + +PB_BIND(meshtastic_ModuleConfig_CannedMessageConfig, meshtastic_ModuleConfig_CannedMessageConfig, AUTO) + + + + + + + diff --git a/src/mesh/generated/meshtastic/module_config.pb.h b/src/mesh/generated/meshtastic/module_config.pb.h new file mode 100644 index 000000000..50fed5197 --- /dev/null +++ b/src/mesh/generated/meshtastic/module_config.pb.h @@ -0,0 +1,568 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_MODULE_CONFIG_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_MODULE_CONFIG_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +/* Baudrate for codec2 voice */ +typedef enum _meshtastic_ModuleConfig_AudioConfig_Audio_Baud { + meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_DEFAULT = 0, + meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_3200 = 1, + meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_2400 = 2, + meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1600 = 3, + meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1400 = 4, + meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1300 = 5, + meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1200 = 6, + meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700 = 7, + meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B = 8 +} meshtastic_ModuleConfig_AudioConfig_Audio_Baud; + +/* TODO: REPLACE */ +typedef enum _meshtastic_ModuleConfig_SerialConfig_Serial_Baud { + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_DEFAULT = 0, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_110 = 1, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_300 = 2, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_600 = 3, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_1200 = 4, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_2400 = 5, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_4800 = 6, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_9600 = 7, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_19200 = 8, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_38400 = 9, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_57600 = 10, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_115200 = 11, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_230400 = 12, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_460800 = 13, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_576000 = 14, + meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600 = 15 +} meshtastic_ModuleConfig_SerialConfig_Serial_Baud; + +/* TODO: REPLACE */ +typedef enum _meshtastic_ModuleConfig_SerialConfig_Serial_Mode { + meshtastic_ModuleConfig_SerialConfig_Serial_Mode_DEFAULT = 0, + meshtastic_ModuleConfig_SerialConfig_Serial_Mode_SIMPLE = 1, + meshtastic_ModuleConfig_SerialConfig_Serial_Mode_PROTO = 2, + meshtastic_ModuleConfig_SerialConfig_Serial_Mode_TEXTMSG = 3, + meshtastic_ModuleConfig_SerialConfig_Serial_Mode_NMEA = 4 +} meshtastic_ModuleConfig_SerialConfig_Serial_Mode; + +/* TODO: REPLACE */ +typedef enum _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar { + /* TODO: REPLACE */ + meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE = 0, + /* TODO: REPLACE */ + meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP = 17, + /* TODO: REPLACE */ + meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN = 18, + /* TODO: REPLACE */ + meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT = 19, + /* TODO: REPLACE */ + meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT = 20, + /* '\n' */ + meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT = 10, + /* TODO: REPLACE */ + meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK = 27, + /* TODO: REPLACE */ + meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL = 24 +} meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar; + +/* Struct definitions */ +/* MQTT Client Config */ +typedef struct _meshtastic_ModuleConfig_MQTTConfig { + /* If a meshtastic node is able to reach the internet it will normally attempt to gateway any channels that are marked as + is_uplink_enabled or is_downlink_enabled. */ + bool enabled; + /* The server to use for our MQTT global message gateway feature. + If not set, the default server will be used */ + char address[64]; + /* MQTT username to use (most useful for a custom MQTT server). + If using a custom server, this will be honoured even if empty. + If using the default server, this will only be honoured if set, otherwise the device will use the default username */ + char username[64]; + /* MQTT password to use (most useful for a custom MQTT server). + If using a custom server, this will be honoured even if empty. + If using the default server, this will only be honoured if set, otherwise the device will use the default password */ + char password[64]; + /* Whether to send encrypted or decrypted packets to MQTT. + This parameter is only honoured if you also set server + (the default official mqtt.meshtastic.org server can handle encrypted packets) + Decrypted packets may be useful for external systems that want to consume meshtastic packets */ + bool encryption_enabled; + /* Whether to send / consume json packets on MQTT */ + bool json_enabled; +} meshtastic_ModuleConfig_MQTTConfig; + +/* RemoteHardwareModule Config */ +typedef struct _meshtastic_ModuleConfig_RemoteHardwareConfig { + /* Whether the Module is enabled */ + bool enabled; +} meshtastic_ModuleConfig_RemoteHardwareConfig; + +/* Audio Config for codec2 voice */ +typedef struct _meshtastic_ModuleConfig_AudioConfig { + /* Whether Audio is enabled */ + bool codec2_enabled; + /* PTT Pin */ + uint8_t ptt_pin; + /* The audio sample rate to use for codec2 */ + meshtastic_ModuleConfig_AudioConfig_Audio_Baud bitrate; + /* I2S Word Select */ + uint8_t i2s_ws; + /* I2S Data IN */ + uint8_t i2s_sd; + /* I2S Data OUT */ + uint8_t i2s_din; + /* I2S Clock */ + uint8_t i2s_sck; +} meshtastic_ModuleConfig_AudioConfig; + +/* Serial Config */ +typedef struct _meshtastic_ModuleConfig_SerialConfig { + /* Preferences for the SerialModule + FIXME - Move this out of UserPreferences and into a section for module configuration. */ + bool enabled; + /* TODO: REPLACE */ + bool echo; + /* TODO: REPLACE */ + uint32_t rxd; + /* TODO: REPLACE */ + uint32_t txd; + /* TODO: REPLACE */ + meshtastic_ModuleConfig_SerialConfig_Serial_Baud baud; + /* TODO: REPLACE */ + uint32_t timeout; + /* TODO: REPLACE */ + meshtastic_ModuleConfig_SerialConfig_Serial_Mode mode; +} meshtastic_ModuleConfig_SerialConfig; + +/* External Notifications Config */ +typedef struct _meshtastic_ModuleConfig_ExternalNotificationConfig { + /* Enable the ExternalNotificationModule */ + bool enabled; + /* When using in On/Off mode, keep the output on for this many + milliseconds. Default 1000ms (1 second). */ + uint32_t output_ms; + /* Define the output pin GPIO setting Defaults to + EXT_NOTIFY_OUT if set for the board. + In standalone devices this pin should drive the LED to match the UI. */ + uint32_t output; + /* IF this is true, the 'output' Pin will be pulled active high, false + means active low. */ + bool active; + /* True: Alert when a text message arrives (output) */ + bool alert_message; + /* True: Alert when the bell character is received (output) */ + bool alert_bell; + /* use a PWM output instead of a simple on/off output. This will ignore + the 'output', 'output_ms' and 'active' settings and use the + device.buzzer_gpio instead. */ + bool use_pwm; + /* Optional: Define a secondary output pin for a vibra motor + This is used in standalone devices to match the UI. */ + uint8_t output_vibra; + /* Optional: Define a tertiary output pin for an active buzzer + This is used in standalone devices to to match the UI. */ + uint8_t output_buzzer; + /* True: Alert when a text message arrives (output_vibra) */ + bool alert_message_vibra; + /* True: Alert when a text message arrives (output_buzzer) */ + bool alert_message_buzzer; + /* True: Alert when the bell character is received (output_vibra) */ + bool alert_bell_vibra; + /* True: Alert when the bell character is received (output_buzzer) */ + bool alert_bell_buzzer; + /* The notification will toggle with 'output_ms' for this time of seconds. + Default is 0 which means don't repeat at all. 60 would mean blink + and/or beep for 60 seconds */ + uint16_t nag_timeout; +} meshtastic_ModuleConfig_ExternalNotificationConfig; + +/* Store and Forward Module Config */ +typedef struct _meshtastic_ModuleConfig_StoreForwardConfig { + /* Enable the Store and Forward Module */ + bool enabled; + /* TODO: REPLACE */ + bool heartbeat; + /* TODO: REPLACE */ + uint32_t records; + /* TODO: REPLACE */ + uint32_t history_return_max; + /* TODO: REPLACE */ + uint32_t history_return_window; +} meshtastic_ModuleConfig_StoreForwardConfig; + +/* Preferences for the RangeTestModule */ +typedef struct _meshtastic_ModuleConfig_RangeTestConfig { + /* Enable the Range Test Module */ + bool enabled; + /* Send out range test messages from this node */ + uint32_t sender; + /* Bool value indicating that this node should save a RangeTest.csv file. + ESP32 Only */ + bool save; +} meshtastic_ModuleConfig_RangeTestConfig; + +/* Configuration for both device and environment metrics */ +typedef struct _meshtastic_ModuleConfig_TelemetryConfig { + /* Interval in seconds of how often we should try to send our + device metrics to the mesh */ + uint32_t device_update_interval; + uint32_t environment_update_interval; + /* Preferences for the Telemetry Module (Environment) + Enable/Disable the telemetry measurement module measurement collection */ + bool environment_measurement_enabled; + /* Enable/Disable the telemetry measurement module on-device display */ + bool environment_screen_enabled; + /* We'll always read the sensor in Celsius, but sometimes we might want to + display the results in Fahrenheit as a "user preference". */ + bool environment_display_fahrenheit; +} meshtastic_ModuleConfig_TelemetryConfig; + +/* TODO: REPLACE */ +typedef struct _meshtastic_ModuleConfig_CannedMessageConfig { + /* Enable the rotary encoder #1. This is a 'dumb' encoder sending pulses on both A and B pins while rotating. */ + bool rotary1_enabled; + /* GPIO pin for rotary encoder A port. */ + uint32_t inputbroker_pin_a; + /* GPIO pin for rotary encoder B port. */ + uint32_t inputbroker_pin_b; + /* GPIO pin for rotary encoder Press port. */ + uint32_t inputbroker_pin_press; + /* Generate input event on CW of this kind. */ + meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_cw; + /* Generate input event on CCW of this kind. */ + meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_ccw; + /* Generate input event on Press of this kind. */ + meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_press; + /* Enable the Up/Down/Select input device. Can be RAK rotary encoder or 3 buttons. Uses the a/b/press definitions from inputbroker. */ + bool updown1_enabled; + /* Enable/disable CannedMessageModule. */ + bool enabled; + /* Input event origin accepted by the canned message module. + Can be e.g. "rotEnc1", "upDownEnc1" or keyword "_any" */ + char allow_input_source[16]; + /* CannedMessageModule also sends a bell character with the messages. + ExternalNotificationModule can benefit from this feature. */ + bool send_bell; +} meshtastic_ModuleConfig_CannedMessageConfig; + +/* Module Config */ +typedef struct _meshtastic_ModuleConfig { + pb_size_t which_payload_variant; + union { + /* TODO: REPLACE */ + meshtastic_ModuleConfig_MQTTConfig mqtt; + /* TODO: REPLACE */ + meshtastic_ModuleConfig_SerialConfig serial; + /* TODO: REPLACE */ + meshtastic_ModuleConfig_ExternalNotificationConfig external_notification; + /* TODO: REPLACE */ + meshtastic_ModuleConfig_StoreForwardConfig store_forward; + /* TODO: REPLACE */ + meshtastic_ModuleConfig_RangeTestConfig range_test; + /* TODO: REPLACE */ + meshtastic_ModuleConfig_TelemetryConfig telemetry; + /* TODO: REPLACE */ + meshtastic_ModuleConfig_CannedMessageConfig canned_message; + /* TODO: REPLACE */ + meshtastic_ModuleConfig_AudioConfig audio; + /* TODO: REPLACE */ + meshtastic_ModuleConfig_RemoteHardwareConfig remote_hardware; + } payload_variant; +} meshtastic_ModuleConfig; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Helper constants for enums */ +#define _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_DEFAULT +#define _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MAX meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B +#define _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_ARRAYSIZE ((meshtastic_ModuleConfig_AudioConfig_Audio_Baud)(meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B+1)) + +#define _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MIN meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_DEFAULT +#define _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MAX meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600 +#define _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Baud)(meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600+1)) + +#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN meshtastic_ModuleConfig_SerialConfig_Serial_Mode_DEFAULT +#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MAX meshtastic_ModuleConfig_SerialConfig_Serial_Mode_NMEA +#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Mode)(meshtastic_ModuleConfig_SerialConfig_Serial_Mode_NMEA+1)) + +#define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE +#define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MAX meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK +#define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_ARRAYSIZE ((meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar)(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK+1)) + + + + +#define meshtastic_ModuleConfig_AudioConfig_bitrate_ENUMTYPE meshtastic_ModuleConfig_AudioConfig_Audio_Baud + +#define meshtastic_ModuleConfig_SerialConfig_baud_ENUMTYPE meshtastic_ModuleConfig_SerialConfig_Serial_Baud +#define meshtastic_ModuleConfig_SerialConfig_mode_ENUMTYPE meshtastic_ModuleConfig_SerialConfig_Serial_Mode + + + + + +#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_cw_ENUMTYPE meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar +#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_ccw_ENUMTYPE meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar +#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_press_ENUMTYPE meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar + + +/* Initializer values for message structs */ +#define meshtastic_ModuleConfig_init_default {0, {meshtastic_ModuleConfig_MQTTConfig_init_default}} +#define meshtastic_ModuleConfig_MQTTConfig_init_default {0, "", "", "", 0, 0} +#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_default {0} +#define meshtastic_ModuleConfig_AudioConfig_init_default {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0} +#define meshtastic_ModuleConfig_SerialConfig_init_default {0, 0, 0, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN} +#define meshtastic_ModuleConfig_ExternalNotificationConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define meshtastic_ModuleConfig_StoreForwardConfig_init_default {0, 0, 0, 0, 0} +#define meshtastic_ModuleConfig_RangeTestConfig_init_default {0, 0, 0} +#define meshtastic_ModuleConfig_TelemetryConfig_init_default {0, 0, 0, 0, 0} +#define meshtastic_ModuleConfig_CannedMessageConfig_init_default {0, 0, 0, 0, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, 0, 0, "", 0} +#define meshtastic_ModuleConfig_init_zero {0, {meshtastic_ModuleConfig_MQTTConfig_init_zero}} +#define meshtastic_ModuleConfig_MQTTConfig_init_zero {0, "", "", "", 0, 0} +#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero {0} +#define meshtastic_ModuleConfig_AudioConfig_init_zero {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0} +#define meshtastic_ModuleConfig_SerialConfig_init_zero {0, 0, 0, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN} +#define meshtastic_ModuleConfig_ExternalNotificationConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define meshtastic_ModuleConfig_StoreForwardConfig_init_zero {0, 0, 0, 0, 0} +#define meshtastic_ModuleConfig_RangeTestConfig_init_zero {0, 0, 0} +#define meshtastic_ModuleConfig_TelemetryConfig_init_zero {0, 0, 0, 0, 0} +#define meshtastic_ModuleConfig_CannedMessageConfig_init_zero {0, 0, 0, 0, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, 0, 0, "", 0} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_ModuleConfig_MQTTConfig_enabled_tag 1 +#define meshtastic_ModuleConfig_MQTTConfig_address_tag 2 +#define meshtastic_ModuleConfig_MQTTConfig_username_tag 3 +#define meshtastic_ModuleConfig_MQTTConfig_password_tag 4 +#define meshtastic_ModuleConfig_MQTTConfig_encryption_enabled_tag 5 +#define meshtastic_ModuleConfig_MQTTConfig_json_enabled_tag 6 +#define meshtastic_ModuleConfig_RemoteHardwareConfig_enabled_tag 1 +#define meshtastic_ModuleConfig_AudioConfig_codec2_enabled_tag 1 +#define meshtastic_ModuleConfig_AudioConfig_ptt_pin_tag 2 +#define meshtastic_ModuleConfig_AudioConfig_bitrate_tag 3 +#define meshtastic_ModuleConfig_AudioConfig_i2s_ws_tag 4 +#define meshtastic_ModuleConfig_AudioConfig_i2s_sd_tag 5 +#define meshtastic_ModuleConfig_AudioConfig_i2s_din_tag 6 +#define meshtastic_ModuleConfig_AudioConfig_i2s_sck_tag 7 +#define meshtastic_ModuleConfig_SerialConfig_enabled_tag 1 +#define meshtastic_ModuleConfig_SerialConfig_echo_tag 2 +#define meshtastic_ModuleConfig_SerialConfig_rxd_tag 3 +#define meshtastic_ModuleConfig_SerialConfig_txd_tag 4 +#define meshtastic_ModuleConfig_SerialConfig_baud_tag 5 +#define meshtastic_ModuleConfig_SerialConfig_timeout_tag 6 +#define meshtastic_ModuleConfig_SerialConfig_mode_tag 7 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_enabled_tag 1 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_output_ms_tag 2 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_output_tag 3 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_active_tag 4 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_alert_message_tag 5 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_alert_bell_tag 6 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_use_pwm_tag 7 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_output_vibra_tag 8 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_output_buzzer_tag 9 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_alert_message_vibra_tag 10 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_alert_message_buzzer_tag 11 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_alert_bell_vibra_tag 12 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_alert_bell_buzzer_tag 13 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_nag_timeout_tag 14 +#define meshtastic_ModuleConfig_StoreForwardConfig_enabled_tag 1 +#define meshtastic_ModuleConfig_StoreForwardConfig_heartbeat_tag 2 +#define meshtastic_ModuleConfig_StoreForwardConfig_records_tag 3 +#define meshtastic_ModuleConfig_StoreForwardConfig_history_return_max_tag 4 +#define meshtastic_ModuleConfig_StoreForwardConfig_history_return_window_tag 5 +#define meshtastic_ModuleConfig_RangeTestConfig_enabled_tag 1 +#define meshtastic_ModuleConfig_RangeTestConfig_sender_tag 2 +#define meshtastic_ModuleConfig_RangeTestConfig_save_tag 3 +#define meshtastic_ModuleConfig_TelemetryConfig_device_update_interval_tag 1 +#define meshtastic_ModuleConfig_TelemetryConfig_environment_update_interval_tag 2 +#define meshtastic_ModuleConfig_TelemetryConfig_environment_measurement_enabled_tag 3 +#define meshtastic_ModuleConfig_TelemetryConfig_environment_screen_enabled_tag 4 +#define meshtastic_ModuleConfig_TelemetryConfig_environment_display_fahrenheit_tag 5 +#define meshtastic_ModuleConfig_CannedMessageConfig_rotary1_enabled_tag 1 +#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_pin_a_tag 2 +#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_pin_b_tag 3 +#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_pin_press_tag 4 +#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_cw_tag 5 +#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_ccw_tag 6 +#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_press_tag 7 +#define meshtastic_ModuleConfig_CannedMessageConfig_updown1_enabled_tag 8 +#define meshtastic_ModuleConfig_CannedMessageConfig_enabled_tag 9 +#define meshtastic_ModuleConfig_CannedMessageConfig_allow_input_source_tag 10 +#define meshtastic_ModuleConfig_CannedMessageConfig_send_bell_tag 11 +#define meshtastic_ModuleConfig_mqtt_tag 1 +#define meshtastic_ModuleConfig_serial_tag 2 +#define meshtastic_ModuleConfig_external_notification_tag 3 +#define meshtastic_ModuleConfig_store_forward_tag 4 +#define meshtastic_ModuleConfig_range_test_tag 5 +#define meshtastic_ModuleConfig_telemetry_tag 6 +#define meshtastic_ModuleConfig_canned_message_tag 7 +#define meshtastic_ModuleConfig_audio_tag 8 +#define meshtastic_ModuleConfig_remote_hardware_tag 9 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_ModuleConfig_FIELDLIST(X, a) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,mqtt,payload_variant.mqtt), 1) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,serial,payload_variant.serial), 2) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,external_notification,payload_variant.external_notification), 3) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,store_forward,payload_variant.store_forward), 4) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,range_test,payload_variant.range_test), 5) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,telemetry,payload_variant.telemetry), 6) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,canned_message,payload_variant.canned_message), 7) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,audio,payload_variant.audio), 8) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,remote_hardware,payload_variant.remote_hardware), 9) +#define meshtastic_ModuleConfig_CALLBACK NULL +#define meshtastic_ModuleConfig_DEFAULT NULL +#define meshtastic_ModuleConfig_payload_variant_mqtt_MSGTYPE meshtastic_ModuleConfig_MQTTConfig +#define meshtastic_ModuleConfig_payload_variant_serial_MSGTYPE meshtastic_ModuleConfig_SerialConfig +#define meshtastic_ModuleConfig_payload_variant_external_notification_MSGTYPE meshtastic_ModuleConfig_ExternalNotificationConfig +#define meshtastic_ModuleConfig_payload_variant_store_forward_MSGTYPE meshtastic_ModuleConfig_StoreForwardConfig +#define meshtastic_ModuleConfig_payload_variant_range_test_MSGTYPE meshtastic_ModuleConfig_RangeTestConfig +#define meshtastic_ModuleConfig_payload_variant_telemetry_MSGTYPE meshtastic_ModuleConfig_TelemetryConfig +#define meshtastic_ModuleConfig_payload_variant_canned_message_MSGTYPE meshtastic_ModuleConfig_CannedMessageConfig +#define meshtastic_ModuleConfig_payload_variant_audio_MSGTYPE meshtastic_ModuleConfig_AudioConfig +#define meshtastic_ModuleConfig_payload_variant_remote_hardware_MSGTYPE meshtastic_ModuleConfig_RemoteHardwareConfig + +#define meshtastic_ModuleConfig_MQTTConfig_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ +X(a, STATIC, SINGULAR, STRING, address, 2) \ +X(a, STATIC, SINGULAR, STRING, username, 3) \ +X(a, STATIC, SINGULAR, STRING, password, 4) \ +X(a, STATIC, SINGULAR, BOOL, encryption_enabled, 5) \ +X(a, STATIC, SINGULAR, BOOL, json_enabled, 6) +#define meshtastic_ModuleConfig_MQTTConfig_CALLBACK NULL +#define meshtastic_ModuleConfig_MQTTConfig_DEFAULT NULL + +#define meshtastic_ModuleConfig_RemoteHardwareConfig_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, BOOL, enabled, 1) +#define meshtastic_ModuleConfig_RemoteHardwareConfig_CALLBACK NULL +#define meshtastic_ModuleConfig_RemoteHardwareConfig_DEFAULT NULL + +#define meshtastic_ModuleConfig_AudioConfig_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, BOOL, codec2_enabled, 1) \ +X(a, STATIC, SINGULAR, UINT32, ptt_pin, 2) \ +X(a, STATIC, SINGULAR, UENUM, bitrate, 3) \ +X(a, STATIC, SINGULAR, UINT32, i2s_ws, 4) \ +X(a, STATIC, SINGULAR, UINT32, i2s_sd, 5) \ +X(a, STATIC, SINGULAR, UINT32, i2s_din, 6) \ +X(a, STATIC, SINGULAR, UINT32, i2s_sck, 7) +#define meshtastic_ModuleConfig_AudioConfig_CALLBACK NULL +#define meshtastic_ModuleConfig_AudioConfig_DEFAULT NULL + +#define meshtastic_ModuleConfig_SerialConfig_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ +X(a, STATIC, SINGULAR, BOOL, echo, 2) \ +X(a, STATIC, SINGULAR, UINT32, rxd, 3) \ +X(a, STATIC, SINGULAR, UINT32, txd, 4) \ +X(a, STATIC, SINGULAR, UENUM, baud, 5) \ +X(a, STATIC, SINGULAR, UINT32, timeout, 6) \ +X(a, STATIC, SINGULAR, UENUM, mode, 7) +#define meshtastic_ModuleConfig_SerialConfig_CALLBACK NULL +#define meshtastic_ModuleConfig_SerialConfig_DEFAULT NULL + +#define meshtastic_ModuleConfig_ExternalNotificationConfig_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ +X(a, STATIC, SINGULAR, UINT32, output_ms, 2) \ +X(a, STATIC, SINGULAR, UINT32, output, 3) \ +X(a, STATIC, SINGULAR, BOOL, active, 4) \ +X(a, STATIC, SINGULAR, BOOL, alert_message, 5) \ +X(a, STATIC, SINGULAR, BOOL, alert_bell, 6) \ +X(a, STATIC, SINGULAR, BOOL, use_pwm, 7) \ +X(a, STATIC, SINGULAR, UINT32, output_vibra, 8) \ +X(a, STATIC, SINGULAR, UINT32, output_buzzer, 9) \ +X(a, STATIC, SINGULAR, BOOL, alert_message_vibra, 10) \ +X(a, STATIC, SINGULAR, BOOL, alert_message_buzzer, 11) \ +X(a, STATIC, SINGULAR, BOOL, alert_bell_vibra, 12) \ +X(a, STATIC, SINGULAR, BOOL, alert_bell_buzzer, 13) \ +X(a, STATIC, SINGULAR, UINT32, nag_timeout, 14) +#define meshtastic_ModuleConfig_ExternalNotificationConfig_CALLBACK NULL +#define meshtastic_ModuleConfig_ExternalNotificationConfig_DEFAULT NULL + +#define meshtastic_ModuleConfig_StoreForwardConfig_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ +X(a, STATIC, SINGULAR, BOOL, heartbeat, 2) \ +X(a, STATIC, SINGULAR, UINT32, records, 3) \ +X(a, STATIC, SINGULAR, UINT32, history_return_max, 4) \ +X(a, STATIC, SINGULAR, UINT32, history_return_window, 5) +#define meshtastic_ModuleConfig_StoreForwardConfig_CALLBACK NULL +#define meshtastic_ModuleConfig_StoreForwardConfig_DEFAULT NULL + +#define meshtastic_ModuleConfig_RangeTestConfig_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ +X(a, STATIC, SINGULAR, UINT32, sender, 2) \ +X(a, STATIC, SINGULAR, BOOL, save, 3) +#define meshtastic_ModuleConfig_RangeTestConfig_CALLBACK NULL +#define meshtastic_ModuleConfig_RangeTestConfig_DEFAULT NULL + +#define meshtastic_ModuleConfig_TelemetryConfig_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, device_update_interval, 1) \ +X(a, STATIC, SINGULAR, UINT32, environment_update_interval, 2) \ +X(a, STATIC, SINGULAR, BOOL, environment_measurement_enabled, 3) \ +X(a, STATIC, SINGULAR, BOOL, environment_screen_enabled, 4) \ +X(a, STATIC, SINGULAR, BOOL, environment_display_fahrenheit, 5) +#define meshtastic_ModuleConfig_TelemetryConfig_CALLBACK NULL +#define meshtastic_ModuleConfig_TelemetryConfig_DEFAULT NULL + +#define meshtastic_ModuleConfig_CannedMessageConfig_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, BOOL, rotary1_enabled, 1) \ +X(a, STATIC, SINGULAR, UINT32, inputbroker_pin_a, 2) \ +X(a, STATIC, SINGULAR, UINT32, inputbroker_pin_b, 3) \ +X(a, STATIC, SINGULAR, UINT32, inputbroker_pin_press, 4) \ +X(a, STATIC, SINGULAR, UENUM, inputbroker_event_cw, 5) \ +X(a, STATIC, SINGULAR, UENUM, inputbroker_event_ccw, 6) \ +X(a, STATIC, SINGULAR, UENUM, inputbroker_event_press, 7) \ +X(a, STATIC, SINGULAR, BOOL, updown1_enabled, 8) \ +X(a, STATIC, SINGULAR, BOOL, enabled, 9) \ +X(a, STATIC, SINGULAR, STRING, allow_input_source, 10) \ +X(a, STATIC, SINGULAR, BOOL, send_bell, 11) +#define meshtastic_ModuleConfig_CannedMessageConfig_CALLBACK NULL +#define meshtastic_ModuleConfig_CannedMessageConfig_DEFAULT NULL + +extern const pb_msgdesc_t meshtastic_ModuleConfig_msg; +extern const pb_msgdesc_t meshtastic_ModuleConfig_MQTTConfig_msg; +extern const pb_msgdesc_t meshtastic_ModuleConfig_RemoteHardwareConfig_msg; +extern const pb_msgdesc_t meshtastic_ModuleConfig_AudioConfig_msg; +extern const pb_msgdesc_t meshtastic_ModuleConfig_SerialConfig_msg; +extern const pb_msgdesc_t meshtastic_ModuleConfig_ExternalNotificationConfig_msg; +extern const pb_msgdesc_t meshtastic_ModuleConfig_StoreForwardConfig_msg; +extern const pb_msgdesc_t meshtastic_ModuleConfig_RangeTestConfig_msg; +extern const pb_msgdesc_t meshtastic_ModuleConfig_TelemetryConfig_msg; +extern const pb_msgdesc_t meshtastic_ModuleConfig_CannedMessageConfig_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_ModuleConfig_fields &meshtastic_ModuleConfig_msg +#define meshtastic_ModuleConfig_MQTTConfig_fields &meshtastic_ModuleConfig_MQTTConfig_msg +#define meshtastic_ModuleConfig_RemoteHardwareConfig_fields &meshtastic_ModuleConfig_RemoteHardwareConfig_msg +#define meshtastic_ModuleConfig_AudioConfig_fields &meshtastic_ModuleConfig_AudioConfig_msg +#define meshtastic_ModuleConfig_SerialConfig_fields &meshtastic_ModuleConfig_SerialConfig_msg +#define meshtastic_ModuleConfig_ExternalNotificationConfig_fields &meshtastic_ModuleConfig_ExternalNotificationConfig_msg +#define meshtastic_ModuleConfig_StoreForwardConfig_fields &meshtastic_ModuleConfig_StoreForwardConfig_msg +#define meshtastic_ModuleConfig_RangeTestConfig_fields &meshtastic_ModuleConfig_RangeTestConfig_msg +#define meshtastic_ModuleConfig_TelemetryConfig_fields &meshtastic_ModuleConfig_TelemetryConfig_msg +#define meshtastic_ModuleConfig_CannedMessageConfig_fields &meshtastic_ModuleConfig_CannedMessageConfig_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_ModuleConfig_AudioConfig_size 19 +#define meshtastic_ModuleConfig_CannedMessageConfig_size 49 +#define meshtastic_ModuleConfig_ExternalNotificationConfig_size 40 +#define meshtastic_ModuleConfig_MQTTConfig_size 201 +#define meshtastic_ModuleConfig_RangeTestConfig_size 10 +#define meshtastic_ModuleConfig_RemoteHardwareConfig_size 2 +#define meshtastic_ModuleConfig_SerialConfig_size 26 +#define meshtastic_ModuleConfig_StoreForwardConfig_size 22 +#define meshtastic_ModuleConfig_TelemetryConfig_size 18 +#define meshtastic_ModuleConfig_size 204 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/mqtt.pb.c b/src/mesh/generated/meshtastic/mqtt.pb.c new file mode 100644 index 000000000..3046e6109 --- /dev/null +++ b/src/mesh/generated/meshtastic/mqtt.pb.c @@ -0,0 +1,12 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/mqtt.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_ServiceEnvelope, meshtastic_ServiceEnvelope, AUTO) + + + diff --git a/src/mesh/generated/meshtastic/mqtt.pb.h b/src/mesh/generated/meshtastic/mqtt.pb.h new file mode 100644 index 000000000..12e83c724 --- /dev/null +++ b/src/mesh/generated/meshtastic/mqtt.pb.h @@ -0,0 +1,61 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_MQTT_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_MQTT_PB_H_INCLUDED +#include +#include "meshtastic/mesh.pb.h" + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Struct definitions */ +/* This message wraps a MeshPacket with extra metadata about the sender and how it arrived. */ +typedef struct _meshtastic_ServiceEnvelope { + /* The (probably encrypted) packet */ + struct _meshtastic_MeshPacket *packet; + /* The global channel ID it was sent on */ + char *channel_id; + /* The sending gateway node ID. Can we use this to authenticate/prevent fake + nodeid impersonation for senders? - i.e. use gateway/mesh id (which is authenticated) + local node id as + the globally trusted nodenum */ + char *gateway_id; +} meshtastic_ServiceEnvelope; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initializer values for message structs */ +#define meshtastic_ServiceEnvelope_init_default {NULL, NULL, NULL} +#define meshtastic_ServiceEnvelope_init_zero {NULL, NULL, NULL} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_ServiceEnvelope_packet_tag 1 +#define meshtastic_ServiceEnvelope_channel_id_tag 2 +#define meshtastic_ServiceEnvelope_gateway_id_tag 3 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_ServiceEnvelope_FIELDLIST(X, a) \ +X(a, POINTER, OPTIONAL, MESSAGE, packet, 1) \ +X(a, POINTER, SINGULAR, STRING, channel_id, 2) \ +X(a, POINTER, SINGULAR, STRING, gateway_id, 3) +#define meshtastic_ServiceEnvelope_CALLBACK NULL +#define meshtastic_ServiceEnvelope_DEFAULT NULL +#define meshtastic_ServiceEnvelope_packet_MSGTYPE meshtastic_MeshPacket + +extern const pb_msgdesc_t meshtastic_ServiceEnvelope_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_ServiceEnvelope_fields &meshtastic_ServiceEnvelope_msg + +/* Maximum encoded size of messages (where known) */ +/* meshtastic_ServiceEnvelope_size depends on runtime parameters */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/portnums.pb.c b/src/mesh/generated/meshtastic/portnums.pb.c new file mode 100644 index 000000000..dd0d00e20 --- /dev/null +++ b/src/mesh/generated/meshtastic/portnums.pb.c @@ -0,0 +1,10 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/portnums.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + + + diff --git a/src/mesh/generated/meshtastic/portnums.pb.h b/src/mesh/generated/meshtastic/portnums.pb.h new file mode 100644 index 000000000..59cf0ebe5 --- /dev/null +++ b/src/mesh/generated/meshtastic/portnums.pb.h @@ -0,0 +1,112 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_PORTNUMS_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_PORTNUMS_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +/* For any new 'apps' that run on the device or via sister apps on phones/PCs they should pick and use a + unique 'portnum' for their application. + If you are making a new app using meshtastic, please send in a pull request to add your 'portnum' to this + master table. + PortNums should be assigned in the following range: + 0-63 Core Meshtastic use, do not use for third party apps + 64-127 Registered 3rd party apps, send in a pull request that adds a new entry to portnums.proto to register your application + 256-511 Use one of these portnums for your private applications that you don't want to register publically + All other values are reserved. + Note: This was formerly a Type enum named 'typ' with the same id # + We have change to this 'portnum' based scheme for specifying app handlers for particular payloads. + This change is backwards compatible by treating the legacy OPAQUE/CLEAR_TEXT values identically. */ +typedef enum _meshtastic_PortNum { + /* Deprecated: do not use in new code (formerly called OPAQUE) + A message sent from a device outside of the mesh, in a form the mesh does not understand + NOTE: This must be 0, because it is documented in IMeshService.aidl to be so */ + meshtastic_PortNum_UNKNOWN_APP = 0, + /* A simple UTF-8 text message, which even the little micros in the mesh + can understand and show on their screen eventually in some circumstances + even signal might send messages in this form (see below) */ + meshtastic_PortNum_TEXT_MESSAGE_APP = 1, + /* Reserved for built-in GPIO/example app. + See remote_hardware.proto/HardwareMessage for details on the message sent/received to this port number */ + meshtastic_PortNum_REMOTE_HARDWARE_APP = 2, + /* The built-in position messaging app. + Payload is a [Position](/docs/developers/protobufs/api#position) message */ + meshtastic_PortNum_POSITION_APP = 3, + /* The built-in user info app. + Payload is a [User](/docs/developers/protobufs/api#user) message */ + meshtastic_PortNum_NODEINFO_APP = 4, + /* Protocol control packets for mesh protocol use. + Payload is a [Routing](/docs/developers/protobufs/api#routing) message */ + meshtastic_PortNum_ROUTING_APP = 5, + /* Admin control packets. + Payload is a [AdminMessage](/docs/developers/protobufs/api#adminmessage) message */ + meshtastic_PortNum_ADMIN_APP = 6, + /* Compressed TEXT_MESSAGE payloads. */ + meshtastic_PortNum_TEXT_MESSAGE_COMPRESSED_APP = 7, + /* Waypoint payloads. + Payload is a [Waypoint](/docs/developers/protobufs/api#waypoint) message */ + meshtastic_PortNum_WAYPOINT_APP = 8, + /* Audio Payloads. + Encapsulated codec2 packets. On 2.4 GHZ Bandwidths only for now */ + meshtastic_PortNum_AUDIO_APP = 9, + /* Provides a 'ping' service that replies to any packet it receives. + Also serves as a small example module. */ + meshtastic_PortNum_REPLY_APP = 32, + /* Used for the python IP tunnel feature */ + meshtastic_PortNum_IP_TUNNEL_APP = 33, + /* Provides a hardware serial interface to send and receive from the Meshtastic network. + Connect to the RX/TX pins of a device with 38400 8N1. Packets received from the Meshtastic + network is forwarded to the RX pin while sending a packet to TX will go out to the Mesh network. + Maximum packet size of 240 bytes. + Module is disabled by default can be turned on by setting SERIAL_MODULE_ENABLED = 1 in SerialPlugh.cpp. */ + meshtastic_PortNum_SERIAL_APP = 64, + /* STORE_FORWARD_APP (Work in Progress) + Maintained by Jm Casler (MC Hamster) : jm@casler.org */ + meshtastic_PortNum_STORE_FORWARD_APP = 65, + /* Optional port for messages for the range test module. */ + meshtastic_PortNum_RANGE_TEST_APP = 66, + /* Provides a format to send and receive telemetry data from the Meshtastic network. + Maintained by Charles Crossan (crossan007) : crossan007@gmail.com */ + meshtastic_PortNum_TELEMETRY_APP = 67, + /* Experimental tools for estimating node position without a GPS + Maintained by Github user a-f-G-U-C (a Meshtastic contributor) + Project files at https://github.com/a-f-G-U-C/Meshtastic-ZPS */ + meshtastic_PortNum_ZPS_APP = 68, + /* Used to let multiple instances of Linux native applications communicate + as if they did using their LoRa chip. + Maintained by GitHub user GUVWAF. + Project files at https://github.com/GUVWAF/Meshtasticator */ + meshtastic_PortNum_SIMULATOR_APP = 69, + /* Provides a traceroute functionality to show the route a packet towards + a certain destination would take on the mesh. */ + meshtastic_PortNum_TRACEROUTE_APP = 70, + /* Private applications should use portnums >= 256. + To simplify initial development and testing you can use "PRIVATE_APP" + in your code without needing to rebuild protobuf files (via [regen-protos.sh](https://github.com/meshtastic/firmware/blob/master/bin/regen-protos.sh)) */ + meshtastic_PortNum_PRIVATE_APP = 256, + /* ATAK Forwarder Module https://github.com/paulmandal/atak-forwarder */ + meshtastic_PortNum_ATAK_FORWARDER = 257, + /* Currently we limit port nums to no higher than this value */ + meshtastic_PortNum_MAX = 511 +} meshtastic_PortNum; + +#ifdef __cplusplus +extern "C" { +#endif + +/* Helper constants for enums */ +#define _meshtastic_PortNum_MIN meshtastic_PortNum_UNKNOWN_APP +#define _meshtastic_PortNum_MAX meshtastic_PortNum_MAX +#define _meshtastic_PortNum_ARRAYSIZE ((meshtastic_PortNum)(meshtastic_PortNum_MAX+1)) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/remote_hardware.pb.c b/src/mesh/generated/meshtastic/remote_hardware.pb.c new file mode 100644 index 000000000..f368ec1ef --- /dev/null +++ b/src/mesh/generated/meshtastic/remote_hardware.pb.c @@ -0,0 +1,13 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/remote_hardware.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_HardwareMessage, meshtastic_HardwareMessage, AUTO) + + + + diff --git a/src/mesh/generated/meshtastic/remote_hardware.pb.h b/src/mesh/generated/meshtastic/remote_hardware.pb.h new file mode 100644 index 000000000..26df97616 --- /dev/null +++ b/src/mesh/generated/meshtastic/remote_hardware.pb.h @@ -0,0 +1,93 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_REMOTE_HARDWARE_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_REMOTE_HARDWARE_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +/* TODO: REPLACE */ +typedef enum _meshtastic_HardwareMessage_Type { + /* Unset/unused */ + meshtastic_HardwareMessage_Type_UNSET = 0, + /* Set gpio gpios based on gpio_mask/gpio_value */ + meshtastic_HardwareMessage_Type_WRITE_GPIOS = 1, + /* We are now interested in watching the gpio_mask gpios. + If the selected gpios change, please broadcast GPIOS_CHANGED. + Will implicitly change the gpios requested to be INPUT gpios. */ + meshtastic_HardwareMessage_Type_WATCH_GPIOS = 2, + /* The gpios listed in gpio_mask have changed, the new values are listed in gpio_value */ + meshtastic_HardwareMessage_Type_GPIOS_CHANGED = 3, + /* Read the gpios specified in gpio_mask, send back a READ_GPIOS_REPLY reply with gpio_value populated */ + meshtastic_HardwareMessage_Type_READ_GPIOS = 4, + /* A reply to READ_GPIOS. gpio_mask and gpio_value will be populated */ + meshtastic_HardwareMessage_Type_READ_GPIOS_REPLY = 5 +} meshtastic_HardwareMessage_Type; + +/* Struct definitions */ +/* An example app to show off the module system. This message is used for + REMOTE_HARDWARE_APP PortNums. + Also provides easy remote access to any GPIO. + In the future other remote hardware operations can be added based on user interest + (i.e. serial output, spi/i2c input/output). + FIXME - currently this feature is turned on by default which is dangerous + because no security yet (beyond the channel mechanism). + It should be off by default and then protected based on some TBD mechanism + (a special channel once multichannel support is included?) */ +typedef struct _meshtastic_HardwareMessage { + /* What type of HardwareMessage is this? */ + meshtastic_HardwareMessage_Type type; + /* What gpios are we changing. Not used for all MessageTypes, see MessageType for details */ + uint64_t gpio_mask; + /* For gpios that were listed in gpio_mask as valid, what are the signal levels for those gpios. + Not used for all MessageTypes, see MessageType for details */ + uint64_t gpio_value; +} meshtastic_HardwareMessage; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Helper constants for enums */ +#define _meshtastic_HardwareMessage_Type_MIN meshtastic_HardwareMessage_Type_UNSET +#define _meshtastic_HardwareMessage_Type_MAX meshtastic_HardwareMessage_Type_READ_GPIOS_REPLY +#define _meshtastic_HardwareMessage_Type_ARRAYSIZE ((meshtastic_HardwareMessage_Type)(meshtastic_HardwareMessage_Type_READ_GPIOS_REPLY+1)) + +#define meshtastic_HardwareMessage_type_ENUMTYPE meshtastic_HardwareMessage_Type + + +/* Initializer values for message structs */ +#define meshtastic_HardwareMessage_init_default {_meshtastic_HardwareMessage_Type_MIN, 0, 0} +#define meshtastic_HardwareMessage_init_zero {_meshtastic_HardwareMessage_Type_MIN, 0, 0} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_HardwareMessage_type_tag 1 +#define meshtastic_HardwareMessage_gpio_mask_tag 2 +#define meshtastic_HardwareMessage_gpio_value_tag 3 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_HardwareMessage_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, type, 1) \ +X(a, STATIC, SINGULAR, UINT64, gpio_mask, 2) \ +X(a, STATIC, SINGULAR, UINT64, gpio_value, 3) +#define meshtastic_HardwareMessage_CALLBACK NULL +#define meshtastic_HardwareMessage_DEFAULT NULL + +extern const pb_msgdesc_t meshtastic_HardwareMessage_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_HardwareMessage_fields &meshtastic_HardwareMessage_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_HardwareMessage_size 24 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/rtttl.pb.c b/src/mesh/generated/meshtastic/rtttl.pb.c new file mode 100644 index 000000000..685bbde45 --- /dev/null +++ b/src/mesh/generated/meshtastic/rtttl.pb.c @@ -0,0 +1,12 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/rtttl.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_RTTTLConfig, meshtastic_RTTTLConfig, AUTO) + + + diff --git a/src/mesh/generated/meshtastic/rtttl.pb.h b/src/mesh/generated/meshtastic/rtttl.pb.h new file mode 100644 index 000000000..aa55d0b7d --- /dev/null +++ b/src/mesh/generated/meshtastic/rtttl.pb.h @@ -0,0 +1,49 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_RTTTL_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_RTTTL_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Struct definitions */ +/* Canned message module configuration. */ +typedef struct _meshtastic_RTTTLConfig { + /* Ringtone for PWM Buzzer in RTTTL Format. */ + char ringtone[230]; +} meshtastic_RTTTLConfig; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initializer values for message structs */ +#define meshtastic_RTTTLConfig_init_default {""} +#define meshtastic_RTTTLConfig_init_zero {""} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_RTTTLConfig_ringtone_tag 1 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_RTTTLConfig_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, STRING, ringtone, 1) +#define meshtastic_RTTTLConfig_CALLBACK NULL +#define meshtastic_RTTTLConfig_DEFAULT NULL + +extern const pb_msgdesc_t meshtastic_RTTTLConfig_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_RTTTLConfig_fields &meshtastic_RTTTLConfig_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_RTTTLConfig_size 232 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/storeforward.pb.c b/src/mesh/generated/meshtastic/storeforward.pb.c new file mode 100644 index 000000000..44a1c70c1 --- /dev/null +++ b/src/mesh/generated/meshtastic/storeforward.pb.c @@ -0,0 +1,22 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/storeforward.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_StoreAndForward, meshtastic_StoreAndForward, AUTO) + + +PB_BIND(meshtastic_StoreAndForward_Statistics, meshtastic_StoreAndForward_Statistics, AUTO) + + +PB_BIND(meshtastic_StoreAndForward_History, meshtastic_StoreAndForward_History, AUTO) + + +PB_BIND(meshtastic_StoreAndForward_Heartbeat, meshtastic_StoreAndForward_Heartbeat, AUTO) + + + + diff --git a/src/mesh/generated/meshtastic/storeforward.pb.h b/src/mesh/generated/meshtastic/storeforward.pb.h new file mode 100644 index 000000000..e6cb51f61 --- /dev/null +++ b/src/mesh/generated/meshtastic/storeforward.pb.h @@ -0,0 +1,213 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_STOREFORWARD_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_STOREFORWARD_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +/* 001 - 063 = From Router + 064 - 127 = From Client */ +typedef enum _meshtastic_StoreAndForward_RequestResponse { + /* Unset/unused */ + meshtastic_StoreAndForward_RequestResponse_UNSET = 0, + /* Router is an in error state. */ + meshtastic_StoreAndForward_RequestResponse_ROUTER_ERROR = 1, + /* Router heartbeat */ + meshtastic_StoreAndForward_RequestResponse_ROUTER_HEARTBEAT = 2, + /* Router has requested the client respond. This can work as a + "are you there" message. */ + meshtastic_StoreAndForward_RequestResponse_ROUTER_PING = 3, + /* The response to a "Ping" */ + meshtastic_StoreAndForward_RequestResponse_ROUTER_PONG = 4, + /* Router is currently busy. Please try again later. */ + meshtastic_StoreAndForward_RequestResponse_ROUTER_BUSY = 5, + /* Router is responding to a request for history. */ + meshtastic_StoreAndForward_RequestResponse_ROUTER_HISTORY = 6, + /* Router is responding to a request for stats. */ + meshtastic_StoreAndForward_RequestResponse_ROUTER_STATS = 7, + /* Client is an in error state. */ + meshtastic_StoreAndForward_RequestResponse_CLIENT_ERROR = 64, + /* Client has requested a replay from the router. */ + meshtastic_StoreAndForward_RequestResponse_CLIENT_HISTORY = 65, + /* Client has requested stats from the router. */ + meshtastic_StoreAndForward_RequestResponse_CLIENT_STATS = 66, + /* Client has requested the router respond. This can work as a + "are you there" message. */ + meshtastic_StoreAndForward_RequestResponse_CLIENT_PING = 67, + /* The response to a "Ping" */ + meshtastic_StoreAndForward_RequestResponse_CLIENT_PONG = 68, + /* Client has requested that the router abort processing the client's request */ + meshtastic_StoreAndForward_RequestResponse_CLIENT_ABORT = 106 +} meshtastic_StoreAndForward_RequestResponse; + +/* Struct definitions */ +/* TODO: REPLACE */ +typedef struct _meshtastic_StoreAndForward_Statistics { + /* Number of messages we have ever seen */ + uint32_t messages_total; + /* Number of messages we have currently saved our history. */ + uint32_t messages_saved; + /* Maximum number of messages we will save */ + uint32_t messages_max; + /* Router uptime in seconds */ + uint32_t up_time; + /* Number of times any client sent a request to the S&F. */ + uint32_t requests; + /* Number of times the history was requested. */ + uint32_t requests_history; + /* Is the heartbeat enabled on the server? */ + bool heartbeat; + /* Is the heartbeat enabled on the server? */ + uint32_t return_max; + /* Is the heartbeat enabled on the server? */ + uint32_t return_window; +} meshtastic_StoreAndForward_Statistics; + +/* TODO: REPLACE */ +typedef struct _meshtastic_StoreAndForward_History { + /* Number of that will be sent to the client */ + uint32_t history_messages; + /* The window of messages that was used to filter the history client requested */ + uint32_t window; + /* The window of messages that was used to filter the history client requested */ + uint32_t last_request; +} meshtastic_StoreAndForward_History; + +/* TODO: REPLACE */ +typedef struct _meshtastic_StoreAndForward_Heartbeat { + /* Number of that will be sent to the client */ + uint32_t period; + /* If set, this is not the primary Store & Forward router on the mesh */ + uint32_t secondary; +} meshtastic_StoreAndForward_Heartbeat; + +/* TODO: REPLACE */ +typedef struct _meshtastic_StoreAndForward { + /* TODO: REPLACE */ + meshtastic_StoreAndForward_RequestResponse rr; + pb_size_t which_variant; + union { + /* TODO: REPLACE */ + meshtastic_StoreAndForward_Statistics stats; + /* TODO: REPLACE */ + meshtastic_StoreAndForward_History history; + /* TODO: REPLACE */ + meshtastic_StoreAndForward_Heartbeat heartbeat; + /* Empty Payload */ + bool empty; + } variant; +} meshtastic_StoreAndForward; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Helper constants for enums */ +#define _meshtastic_StoreAndForward_RequestResponse_MIN meshtastic_StoreAndForward_RequestResponse_UNSET +#define _meshtastic_StoreAndForward_RequestResponse_MAX meshtastic_StoreAndForward_RequestResponse_CLIENT_ABORT +#define _meshtastic_StoreAndForward_RequestResponse_ARRAYSIZE ((meshtastic_StoreAndForward_RequestResponse)(meshtastic_StoreAndForward_RequestResponse_CLIENT_ABORT+1)) + +#define meshtastic_StoreAndForward_rr_ENUMTYPE meshtastic_StoreAndForward_RequestResponse + + + + + +/* Initializer values for message structs */ +#define meshtastic_StoreAndForward_init_default {_meshtastic_StoreAndForward_RequestResponse_MIN, 0, {meshtastic_StoreAndForward_Statistics_init_default}} +#define meshtastic_StoreAndForward_Statistics_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0} +#define meshtastic_StoreAndForward_History_init_default {0, 0, 0} +#define meshtastic_StoreAndForward_Heartbeat_init_default {0, 0} +#define meshtastic_StoreAndForward_init_zero {_meshtastic_StoreAndForward_RequestResponse_MIN, 0, {meshtastic_StoreAndForward_Statistics_init_zero}} +#define meshtastic_StoreAndForward_Statistics_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0} +#define meshtastic_StoreAndForward_History_init_zero {0, 0, 0} +#define meshtastic_StoreAndForward_Heartbeat_init_zero {0, 0} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_StoreAndForward_Statistics_messages_total_tag 1 +#define meshtastic_StoreAndForward_Statistics_messages_saved_tag 2 +#define meshtastic_StoreAndForward_Statistics_messages_max_tag 3 +#define meshtastic_StoreAndForward_Statistics_up_time_tag 4 +#define meshtastic_StoreAndForward_Statistics_requests_tag 5 +#define meshtastic_StoreAndForward_Statistics_requests_history_tag 6 +#define meshtastic_StoreAndForward_Statistics_heartbeat_tag 7 +#define meshtastic_StoreAndForward_Statistics_return_max_tag 8 +#define meshtastic_StoreAndForward_Statistics_return_window_tag 9 +#define meshtastic_StoreAndForward_History_history_messages_tag 1 +#define meshtastic_StoreAndForward_History_window_tag 2 +#define meshtastic_StoreAndForward_History_last_request_tag 3 +#define meshtastic_StoreAndForward_Heartbeat_period_tag 1 +#define meshtastic_StoreAndForward_Heartbeat_secondary_tag 2 +#define meshtastic_StoreAndForward_rr_tag 1 +#define meshtastic_StoreAndForward_stats_tag 2 +#define meshtastic_StoreAndForward_history_tag 3 +#define meshtastic_StoreAndForward_heartbeat_tag 4 +#define meshtastic_StoreAndForward_empty_tag 5 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_StoreAndForward_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, rr, 1) \ +X(a, STATIC, ONEOF, MESSAGE, (variant,stats,variant.stats), 2) \ +X(a, STATIC, ONEOF, MESSAGE, (variant,history,variant.history), 3) \ +X(a, STATIC, ONEOF, MESSAGE, (variant,heartbeat,variant.heartbeat), 4) \ +X(a, STATIC, ONEOF, BOOL, (variant,empty,variant.empty), 5) +#define meshtastic_StoreAndForward_CALLBACK NULL +#define meshtastic_StoreAndForward_DEFAULT NULL +#define meshtastic_StoreAndForward_variant_stats_MSGTYPE meshtastic_StoreAndForward_Statistics +#define meshtastic_StoreAndForward_variant_history_MSGTYPE meshtastic_StoreAndForward_History +#define meshtastic_StoreAndForward_variant_heartbeat_MSGTYPE meshtastic_StoreAndForward_Heartbeat + +#define meshtastic_StoreAndForward_Statistics_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, messages_total, 1) \ +X(a, STATIC, SINGULAR, UINT32, messages_saved, 2) \ +X(a, STATIC, SINGULAR, UINT32, messages_max, 3) \ +X(a, STATIC, SINGULAR, UINT32, up_time, 4) \ +X(a, STATIC, SINGULAR, UINT32, requests, 5) \ +X(a, STATIC, SINGULAR, UINT32, requests_history, 6) \ +X(a, STATIC, SINGULAR, BOOL, heartbeat, 7) \ +X(a, STATIC, SINGULAR, UINT32, return_max, 8) \ +X(a, STATIC, SINGULAR, UINT32, return_window, 9) +#define meshtastic_StoreAndForward_Statistics_CALLBACK NULL +#define meshtastic_StoreAndForward_Statistics_DEFAULT NULL + +#define meshtastic_StoreAndForward_History_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, history_messages, 1) \ +X(a, STATIC, SINGULAR, UINT32, window, 2) \ +X(a, STATIC, SINGULAR, UINT32, last_request, 3) +#define meshtastic_StoreAndForward_History_CALLBACK NULL +#define meshtastic_StoreAndForward_History_DEFAULT NULL + +#define meshtastic_StoreAndForward_Heartbeat_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, period, 1) \ +X(a, STATIC, SINGULAR, UINT32, secondary, 2) +#define meshtastic_StoreAndForward_Heartbeat_CALLBACK NULL +#define meshtastic_StoreAndForward_Heartbeat_DEFAULT NULL + +extern const pb_msgdesc_t meshtastic_StoreAndForward_msg; +extern const pb_msgdesc_t meshtastic_StoreAndForward_Statistics_msg; +extern const pb_msgdesc_t meshtastic_StoreAndForward_History_msg; +extern const pb_msgdesc_t meshtastic_StoreAndForward_Heartbeat_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_StoreAndForward_fields &meshtastic_StoreAndForward_msg +#define meshtastic_StoreAndForward_Statistics_fields &meshtastic_StoreAndForward_Statistics_msg +#define meshtastic_StoreAndForward_History_fields &meshtastic_StoreAndForward_History_msg +#define meshtastic_StoreAndForward_Heartbeat_fields &meshtastic_StoreAndForward_Heartbeat_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_StoreAndForward_Heartbeat_size 12 +#define meshtastic_StoreAndForward_History_size 18 +#define meshtastic_StoreAndForward_Statistics_size 50 +#define meshtastic_StoreAndForward_size 54 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/telemetry.pb.c b/src/mesh/generated/meshtastic/telemetry.pb.c new file mode 100644 index 000000000..cdc01710a --- /dev/null +++ b/src/mesh/generated/meshtastic/telemetry.pb.c @@ -0,0 +1,19 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/telemetry.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_DeviceMetrics, meshtastic_DeviceMetrics, AUTO) + + +PB_BIND(meshtastic_EnvironmentMetrics, meshtastic_EnvironmentMetrics, AUTO) + + +PB_BIND(meshtastic_Telemetry, meshtastic_Telemetry, AUTO) + + + + diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h new file mode 100644 index 000000000..511ae1229 --- /dev/null +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -0,0 +1,172 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +/* TODO: REPLACE */ +typedef enum _meshtastic_TelemetrySensorType { + /* No external telemetry sensor explicitly set */ + meshtastic_TelemetrySensorType_SENSOR_UNSET = 0, + /* High accuracy temperature, pressure, humidity */ + meshtastic_TelemetrySensorType_BME280 = 1, + /* High accuracy temperature, pressure, humidity, and air resistance */ + meshtastic_TelemetrySensorType_BME680 = 2, + /* Very high accuracy temperature */ + meshtastic_TelemetrySensorType_MCP9808 = 3, + /* Moderate accuracy current and voltage */ + meshtastic_TelemetrySensorType_INA260 = 4, + /* Moderate accuracy current and voltage */ + meshtastic_TelemetrySensorType_INA219 = 5, + /* High accuracy temperature and pressure */ + meshtastic_TelemetrySensorType_BMP280 = 6, + /* High accuracy temperature and humidity */ + meshtastic_TelemetrySensorType_SHTC3 = 7, + /* High accuracy pressure */ + meshtastic_TelemetrySensorType_LPS22 = 8, + /* 3-Axis magnetic sensor */ + meshtastic_TelemetrySensorType_QMC6310 = 9, + /* 6-Axis inertial measurement sensor */ + meshtastic_TelemetrySensorType_QMI8658 = 10, + /* 3-Axis magnetic sensor */ + meshtastic_TelemetrySensorType_QMC5883L = 11, + /* High accuracy temperature and humidity */ + meshtastic_TelemetrySensorType_SHT31 = 12 +} meshtastic_TelemetrySensorType; + +/* Struct definitions */ +/* Key native device metrics such as battery level */ +typedef struct _meshtastic_DeviceMetrics { + /* 1-100 (0 means powered) */ + uint32_t battery_level; + /* Voltage measured */ + float voltage; + /* Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise). */ + float channel_utilization; + /* Percent of airtime for transmission used within the last hour. */ + float air_util_tx; +} meshtastic_DeviceMetrics; + +/* Weather station or other environmental metrics */ +typedef struct _meshtastic_EnvironmentMetrics { + /* Temperature measured */ + float temperature; + /* Relative humidity percent measured */ + float relative_humidity; + /* Barometric pressure in hPA measured */ + float barometric_pressure; + /* Gas resistance in mOhm measured */ + float gas_resistance; + /* Voltage measured */ + float voltage; + /* Current measured */ + float current; +} meshtastic_EnvironmentMetrics; + +/* Types of Measurements the telemetry module is equipped to handle */ +typedef struct _meshtastic_Telemetry { + /* This is usually not sent over the mesh (to save space), but it is sent + from the phone so that the local device can set its RTC If it is sent over + the mesh (because there are devices on the mesh without GPS), it will only + be sent by devices which has a hardware GPS clock (IE Mobile Phone). + seconds since 1970 */ + uint32_t time; + pb_size_t which_variant; + union { + /* Key native device metrics such as battery level */ + meshtastic_DeviceMetrics device_metrics; + /* Weather station or other environmental metrics */ + meshtastic_EnvironmentMetrics environment_metrics; + } variant; +} meshtastic_Telemetry; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Helper constants for enums */ +#define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET +#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_SHT31 +#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_SHT31+1)) + + + + + +/* Initializer values for message structs */ +#define meshtastic_DeviceMetrics_init_default {0, 0, 0, 0} +#define meshtastic_EnvironmentMetrics_init_default {0, 0, 0, 0, 0, 0} +#define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}} +#define meshtastic_DeviceMetrics_init_zero {0, 0, 0, 0} +#define meshtastic_EnvironmentMetrics_init_zero {0, 0, 0, 0, 0, 0} +#define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_DeviceMetrics_battery_level_tag 1 +#define meshtastic_DeviceMetrics_voltage_tag 2 +#define meshtastic_DeviceMetrics_channel_utilization_tag 3 +#define meshtastic_DeviceMetrics_air_util_tx_tag 4 +#define meshtastic_EnvironmentMetrics_temperature_tag 1 +#define meshtastic_EnvironmentMetrics_relative_humidity_tag 2 +#define meshtastic_EnvironmentMetrics_barometric_pressure_tag 3 +#define meshtastic_EnvironmentMetrics_gas_resistance_tag 4 +#define meshtastic_EnvironmentMetrics_voltage_tag 5 +#define meshtastic_EnvironmentMetrics_current_tag 6 +#define meshtastic_Telemetry_time_tag 1 +#define meshtastic_Telemetry_device_metrics_tag 2 +#define meshtastic_Telemetry_environment_metrics_tag 3 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_DeviceMetrics_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, battery_level, 1) \ +X(a, STATIC, SINGULAR, FLOAT, voltage, 2) \ +X(a, STATIC, SINGULAR, FLOAT, channel_utilization, 3) \ +X(a, STATIC, SINGULAR, FLOAT, air_util_tx, 4) +#define meshtastic_DeviceMetrics_CALLBACK NULL +#define meshtastic_DeviceMetrics_DEFAULT NULL + +#define meshtastic_EnvironmentMetrics_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, FLOAT, temperature, 1) \ +X(a, STATIC, SINGULAR, FLOAT, relative_humidity, 2) \ +X(a, STATIC, SINGULAR, FLOAT, barometric_pressure, 3) \ +X(a, STATIC, SINGULAR, FLOAT, gas_resistance, 4) \ +X(a, STATIC, SINGULAR, FLOAT, voltage, 5) \ +X(a, STATIC, SINGULAR, FLOAT, current, 6) +#define meshtastic_EnvironmentMetrics_CALLBACK NULL +#define meshtastic_EnvironmentMetrics_DEFAULT NULL + +#define meshtastic_Telemetry_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, FIXED32, time, 1) \ +X(a, STATIC, ONEOF, MESSAGE, (variant,device_metrics,variant.device_metrics), 2) \ +X(a, STATIC, ONEOF, MESSAGE, (variant,environment_metrics,variant.environment_metrics), 3) +#define meshtastic_Telemetry_CALLBACK NULL +#define meshtastic_Telemetry_DEFAULT NULL +#define meshtastic_Telemetry_variant_device_metrics_MSGTYPE meshtastic_DeviceMetrics +#define meshtastic_Telemetry_variant_environment_metrics_MSGTYPE meshtastic_EnvironmentMetrics + +extern const pb_msgdesc_t meshtastic_DeviceMetrics_msg; +extern const pb_msgdesc_t meshtastic_EnvironmentMetrics_msg; +extern const pb_msgdesc_t meshtastic_Telemetry_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_DeviceMetrics_fields &meshtastic_DeviceMetrics_msg +#define meshtastic_EnvironmentMetrics_fields &meshtastic_EnvironmentMetrics_msg +#define meshtastic_Telemetry_fields &meshtastic_Telemetry_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_DeviceMetrics_size 21 +#define meshtastic_EnvironmentMetrics_size 30 +#define meshtastic_Telemetry_size 37 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/mesh/generated/meshtastic/xmodem.pb.c b/src/mesh/generated/meshtastic/xmodem.pb.c new file mode 100644 index 000000000..9692a5eb4 --- /dev/null +++ b/src/mesh/generated/meshtastic/xmodem.pb.c @@ -0,0 +1,13 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.7 */ + +#include "meshtastic/xmodem.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_XModem, meshtastic_XModem, AUTO) + + + + diff --git a/src/mesh/generated/meshtastic/xmodem.pb.h b/src/mesh/generated/meshtastic/xmodem.pb.h new file mode 100644 index 000000000..48d5aa5cd --- /dev/null +++ b/src/mesh/generated/meshtastic/xmodem.pb.h @@ -0,0 +1,77 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.7 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_XMODEM_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_XMODEM_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +typedef enum _meshtastic_XModem_Control { + meshtastic_XModem_Control_NUL = 0, + meshtastic_XModem_Control_SOH = 1, + meshtastic_XModem_Control_STX = 2, + meshtastic_XModem_Control_EOT = 4, + meshtastic_XModem_Control_ACK = 6, + meshtastic_XModem_Control_NAK = 21, + meshtastic_XModem_Control_CAN = 24, + meshtastic_XModem_Control_CTRLZ = 26 +} meshtastic_XModem_Control; + +/* Struct definitions */ +typedef PB_BYTES_ARRAY_T(128) meshtastic_XModem_buffer_t; +typedef struct _meshtastic_XModem { + meshtastic_XModem_Control control; + uint16_t seq; + uint16_t crc16; + meshtastic_XModem_buffer_t buffer; +} meshtastic_XModem; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Helper constants for enums */ +#define _meshtastic_XModem_Control_MIN meshtastic_XModem_Control_NUL +#define _meshtastic_XModem_Control_MAX meshtastic_XModem_Control_CTRLZ +#define _meshtastic_XModem_Control_ARRAYSIZE ((meshtastic_XModem_Control)(meshtastic_XModem_Control_CTRLZ+1)) + +#define meshtastic_XModem_control_ENUMTYPE meshtastic_XModem_Control + + +/* Initializer values for message structs */ +#define meshtastic_XModem_init_default {_meshtastic_XModem_Control_MIN, 0, 0, {0, {0}}} +#define meshtastic_XModem_init_zero {_meshtastic_XModem_Control_MIN, 0, 0, {0, {0}}} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_XModem_control_tag 1 +#define meshtastic_XModem_seq_tag 2 +#define meshtastic_XModem_crc16_tag 3 +#define meshtastic_XModem_buffer_tag 4 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_XModem_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, control, 1) \ +X(a, STATIC, SINGULAR, UINT32, seq, 2) \ +X(a, STATIC, SINGULAR, UINT32, crc16, 3) \ +X(a, STATIC, SINGULAR, BYTES, buffer, 4) +#define meshtastic_XModem_CALLBACK NULL +#define meshtastic_XModem_DEFAULT NULL + +extern const pb_msgdesc_t meshtastic_XModem_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_XModem_fields &meshtastic_XModem_msg + +/* Maximum encoded size of messages (where known) */ +#define meshtastic_XModem_size 141 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif From 1b932c6bbe8dcf89c966044624def35924296f58 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 18 Jan 2023 07:53:19 -0600 Subject: [PATCH 09/20] Fix scripts patch and remove files in previous dir --- bin/regen-protos.bat | 2 +- bin/regen-protos.sh | 2 +- src/mesh/generated/admin.pb.c | 14 - src/mesh/generated/admin.pb.h | 249 ----- src/mesh/generated/apponly.pb.c | 12 - src/mesh/generated/apponly.pb.h | 63 -- src/mesh/generated/cannedmessages.pb.c | 12 - src/mesh/generated/cannedmessages.pb.h | 49 - src/mesh/generated/channel.pb.c | 16 - src/mesh/generated/channel.pb.h | 172 ---- src/mesh/generated/config.pb.c | 46 - src/mesh/generated/config.pb.h | 707 -------------- src/mesh/generated/device_metadata.pb.c | 12 - src/mesh/generated/device_metadata.pb.h | 69 -- src/mesh/generated/deviceonly.pb.c | 19 - src/mesh/generated/deviceonly.pb.h | 184 ---- src/mesh/generated/localonly.pb.c | 15 - src/mesh/generated/localonly.pb.h | 166 ---- src/mesh/generated/mesh.pb.c | 60 -- src/mesh/generated/mesh.pb.h | 1159 ----------------------- src/mesh/generated/module_config.pb.c | 43 - src/mesh/generated/module_config.pb.h | 568 ----------- src/mesh/generated/mqtt.pb.c | 12 - src/mesh/generated/mqtt.pb.h | 61 -- src/mesh/generated/portnums.pb.c | 10 - src/mesh/generated/portnums.pb.h | 112 --- src/mesh/generated/remote_hardware.pb.c | 13 - src/mesh/generated/remote_hardware.pb.h | 93 -- src/mesh/generated/rtttl.pb.c | 12 - src/mesh/generated/rtttl.pb.h | 49 - src/mesh/generated/storeforward.pb.c | 22 - src/mesh/generated/storeforward.pb.h | 213 ----- src/mesh/generated/telemetry.pb.c | 19 - src/mesh/generated/telemetry.pb.h | 172 ---- src/mesh/generated/xmodem.pb.c | 13 - src/mesh/generated/xmodem.pb.h | 77 -- 36 files changed, 2 insertions(+), 4515 deletions(-) delete mode 100644 src/mesh/generated/admin.pb.c delete mode 100644 src/mesh/generated/admin.pb.h delete mode 100644 src/mesh/generated/apponly.pb.c delete mode 100644 src/mesh/generated/apponly.pb.h delete mode 100644 src/mesh/generated/cannedmessages.pb.c delete mode 100644 src/mesh/generated/cannedmessages.pb.h delete mode 100644 src/mesh/generated/channel.pb.c delete mode 100644 src/mesh/generated/channel.pb.h delete mode 100644 src/mesh/generated/config.pb.c delete mode 100644 src/mesh/generated/config.pb.h delete mode 100644 src/mesh/generated/device_metadata.pb.c delete mode 100644 src/mesh/generated/device_metadata.pb.h delete mode 100644 src/mesh/generated/deviceonly.pb.c delete mode 100644 src/mesh/generated/deviceonly.pb.h delete mode 100644 src/mesh/generated/localonly.pb.c delete mode 100644 src/mesh/generated/localonly.pb.h delete mode 100644 src/mesh/generated/mesh.pb.c delete mode 100644 src/mesh/generated/mesh.pb.h delete mode 100644 src/mesh/generated/module_config.pb.c delete mode 100644 src/mesh/generated/module_config.pb.h delete mode 100644 src/mesh/generated/mqtt.pb.c delete mode 100644 src/mesh/generated/mqtt.pb.h delete mode 100644 src/mesh/generated/portnums.pb.c delete mode 100644 src/mesh/generated/portnums.pb.h delete mode 100644 src/mesh/generated/remote_hardware.pb.c delete mode 100644 src/mesh/generated/remote_hardware.pb.h delete mode 100644 src/mesh/generated/rtttl.pb.c delete mode 100644 src/mesh/generated/rtttl.pb.h delete mode 100644 src/mesh/generated/storeforward.pb.c delete mode 100644 src/mesh/generated/storeforward.pb.h delete mode 100644 src/mesh/generated/telemetry.pb.c delete mode 100644 src/mesh/generated/telemetry.pb.h delete mode 100644 src/mesh/generated/xmodem.pb.c delete mode 100644 src/mesh/generated/xmodem.pb.h diff --git a/bin/regen-protos.bat b/bin/regen-protos.bat index 748363d78..29f35d0ae 100644 --- a/bin/regen-protos.bat +++ b/bin/regen-protos.bat @@ -1 +1 @@ -cd protobufs && ..\nanopb-0.4.7\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs meshtastic\*.proto +cd protobufs && ..\nanopb-0.4.7\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated\meshtastic -I=..\protobufs meshtastic\*.proto diff --git a/bin/regen-protos.sh b/bin/regen-protos.sh index df1a3a9d8..bf3cf7ca0 100755 --- a/bin/regen-protos.sh +++ b/bin/regen-protos.sh @@ -8,7 +8,7 @@ echo "prebuilt binaries for your computer into nanopb-0.4.7" # the nanopb tool seems to require that the .options file be in the current directory! cd protobufs -../nanopb-0.4.7/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../protobufs meshtastic/*.proto +../nanopb-0.4.7/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated/meshtastic -I=../protobufs meshtastic/*.proto #echo "Regenerating protobuf documentation - if you see an error message" #echo "you can ignore it unless doing a new protobuf release to github." diff --git a/src/mesh/generated/admin.pb.c b/src/mesh/generated/admin.pb.c deleted file mode 100644 index 3fdd0cb3d..000000000 --- a/src/mesh/generated/admin.pb.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "admin.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(AdminMessage, AdminMessage, 2) - - - - - diff --git a/src/mesh/generated/admin.pb.h b/src/mesh/generated/admin.pb.h deleted file mode 100644 index a00376f21..000000000 --- a/src/mesh/generated/admin.pb.h +++ /dev/null @@ -1,249 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_ADMIN_PB_H_INCLUDED -#define PB_ADMIN_PB_H_INCLUDED -#include -#include "channel.pb.h" -#include "config.pb.h" -#include "device_metadata.pb.h" -#include "mesh.pb.h" -#include "module_config.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -/* TODO: REPLACE */ -typedef enum _AdminMessage_ConfigType { - /* TODO: REPLACE */ - AdminMessage_ConfigType_DEVICE_CONFIG = 0, - /* TODO: REPLACE */ - AdminMessage_ConfigType_POSITION_CONFIG = 1, - /* TODO: REPLACE */ - AdminMessage_ConfigType_POWER_CONFIG = 2, - /* TODO: REPLACE */ - AdminMessage_ConfigType_NETWORK_CONFIG = 3, - /* TODO: REPLACE */ - AdminMessage_ConfigType_DISPLAY_CONFIG = 4, - /* TODO: REPLACE */ - AdminMessage_ConfigType_LORA_CONFIG = 5, - /* TODO: REPLACE */ - AdminMessage_ConfigType_BLUETOOTH_CONFIG = 6 -} AdminMessage_ConfigType; - -/* TODO: REPLACE */ -typedef enum _AdminMessage_ModuleConfigType { - /* TODO: REPLACE */ - AdminMessage_ModuleConfigType_MQTT_CONFIG = 0, - /* TODO: REPLACE */ - AdminMessage_ModuleConfigType_SERIAL_CONFIG = 1, - /* TODO: REPLACE */ - AdminMessage_ModuleConfigType_EXTNOTIF_CONFIG = 2, - /* TODO: REPLACE */ - AdminMessage_ModuleConfigType_STOREFORWARD_CONFIG = 3, - /* TODO: REPLACE */ - AdminMessage_ModuleConfigType_RANGETEST_CONFIG = 4, - /* TODO: REPLACE */ - AdminMessage_ModuleConfigType_TELEMETRY_CONFIG = 5, - /* TODO: REPLACE */ - AdminMessage_ModuleConfigType_CANNEDMSG_CONFIG = 6, - /* TODO: REPLACE */ - AdminMessage_ModuleConfigType_AUDIO_CONFIG = 7, - /* TODO: REPLACE */ - AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG = 8 -} AdminMessage_ModuleConfigType; - -/* Struct definitions */ -/* This message is handled by the Admin module and is responsible for all settings/channel read/write operations. - This message is used to do settings operations to both remote AND local nodes. - (Prior to 1.2 these operations were done via special ToRadio operations) */ -typedef struct _AdminMessage { - pb_size_t which_payload_variant; - union { - /* Send the specified channel in the response to this message - NOTE: This field is sent with the channel index + 1 (to ensure we never try to send 'zero' - which protobufs treats as not present) */ - uint32_t get_channel_request; - /* TODO: REPLACE */ - Channel get_channel_response; - /* Send the current owner data in the response to this message. */ - bool get_owner_request; - /* TODO: REPLACE */ - User get_owner_response; - /* Ask for the following config data to be sent */ - AdminMessage_ConfigType get_config_request; - /* Send the current Config in the response to this message. */ - Config get_config_response; - /* Ask for the following config data to be sent */ - AdminMessage_ModuleConfigType get_module_config_request; - /* Send the current Config in the response to this message. */ - ModuleConfig get_module_config_response; - /* Get the Canned Message Module messages in the response to this message. */ - bool get_canned_message_module_messages_request; - /* Get the Canned Message Module messages in the response to this message. */ - char get_canned_message_module_messages_response[201]; - /* Request the node to send device metadata (firmware, protobuf version, etc) */ - bool get_device_metadata_request; - /* Device metadata response */ - DeviceMetadata get_device_metadata_response; - /* Get the Ringtone in the response to this message. */ - bool get_ringtone_request; - /* Get the Ringtone in the response to this message. */ - char get_ringtone_response[231]; - /* Set the owner for this node */ - User set_owner; - /* Set channels (using the new API). - A special channel is the "primary channel". - The other records are secondary channels. - Note: only one channel can be marked as primary. - If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically. */ - Channel set_channel; - /* Set the current Config */ - Config set_config; - /* Set the current Config */ - ModuleConfig set_module_config; - /* Set the Canned Message Module messages text. */ - char set_canned_message_module_messages[201]; - /* Set the ringtone for ExternalNotification. */ - char set_ringtone_message[231]; - /* Begins an edit transaction for config, module config, owner, and channel settings changes - This will delay the standard *implicit* save to the file system and subsequent reboot behavior until committed (commit_edit_settings) */ - bool begin_edit_settings; - /* Commits an open transaction for any edits made to config, module config, owner, and channel settings */ - bool commit_edit_settings; - /* Setting channels/radio config remotely carries the risk that you might send an invalid config and the radio never talks to your mesh again. - Therefore if setting either of these properties remotely, you must send a confirm_xxx message within 10 minutes. - If you fail to do so, the radio will assume loss of comms and revert your changes. - These messages are optional when changing the local node. */ - bool confirm_set_channel; - /* TODO: REPLACE */ - bool confirm_set_radio; - /* Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot) - Only Implemented for ESP32 Devices. This needs to be issued to send a new main firmware via bluetooth. */ - int32_t reboot_ota_seconds; - /* This message is only supported for the simulator porduino build. - If received the simulator will exit successfully. */ - bool exit_simulator; - /* Tell the node to reboot in this many seconds (or <0 to cancel reboot) */ - int32_t reboot_seconds; - /* Tell the node to shutdown in this many seconds (or <0 to cancel shutdown) */ - int32_t shutdown_seconds; - /* Tell the node to factory reset, all device settings will be returned to factory defaults. */ - int32_t factory_reset; - /* Tell the node to reset the nodedb. */ - int32_t nodedb_reset; - }; -} AdminMessage; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Helper constants for enums */ -#define _AdminMessage_ConfigType_MIN AdminMessage_ConfigType_DEVICE_CONFIG -#define _AdminMessage_ConfigType_MAX AdminMessage_ConfigType_BLUETOOTH_CONFIG -#define _AdminMessage_ConfigType_ARRAYSIZE ((AdminMessage_ConfigType)(AdminMessage_ConfigType_BLUETOOTH_CONFIG+1)) - -#define _AdminMessage_ModuleConfigType_MIN AdminMessage_ModuleConfigType_MQTT_CONFIG -#define _AdminMessage_ModuleConfigType_MAX AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG -#define _AdminMessage_ModuleConfigType_ARRAYSIZE ((AdminMessage_ModuleConfigType)(AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG+1)) - -#define AdminMessage_payload_variant_get_config_request_ENUMTYPE AdminMessage_ConfigType -#define AdminMessage_payload_variant_get_module_config_request_ENUMTYPE AdminMessage_ModuleConfigType - - -/* Initializer values for message structs */ -#define AdminMessage_init_default {0, {0}} -#define AdminMessage_init_zero {0, {0}} - -/* Field tags (for use in manual encoding/decoding) */ -#define AdminMessage_get_channel_request_tag 1 -#define AdminMessage_get_channel_response_tag 2 -#define AdminMessage_get_owner_request_tag 3 -#define AdminMessage_get_owner_response_tag 4 -#define AdminMessage_get_config_request_tag 5 -#define AdminMessage_get_config_response_tag 6 -#define AdminMessage_get_module_config_request_tag 7 -#define AdminMessage_get_module_config_response_tag 8 -#define AdminMessage_get_canned_message_module_messages_request_tag 10 -#define AdminMessage_get_canned_message_module_messages_response_tag 11 -#define AdminMessage_get_device_metadata_request_tag 12 -#define AdminMessage_get_device_metadata_response_tag 13 -#define AdminMessage_get_ringtone_request_tag 14 -#define AdminMessage_get_ringtone_response_tag 15 -#define AdminMessage_set_owner_tag 32 -#define AdminMessage_set_channel_tag 33 -#define AdminMessage_set_config_tag 34 -#define AdminMessage_set_module_config_tag 35 -#define AdminMessage_set_canned_message_module_messages_tag 36 -#define AdminMessage_set_ringtone_message_tag 37 -#define AdminMessage_begin_edit_settings_tag 64 -#define AdminMessage_commit_edit_settings_tag 65 -#define AdminMessage_confirm_set_channel_tag 66 -#define AdminMessage_confirm_set_radio_tag 67 -#define AdminMessage_reboot_ota_seconds_tag 95 -#define AdminMessage_exit_simulator_tag 96 -#define AdminMessage_reboot_seconds_tag 97 -#define AdminMessage_shutdown_seconds_tag 98 -#define AdminMessage_factory_reset_tag 99 -#define AdminMessage_nodedb_reset_tag 100 - -/* Struct field encoding specification for nanopb */ -#define AdminMessage_FIELDLIST(X, a) \ -X(a, STATIC, ONEOF, UINT32, (payload_variant,get_channel_request,get_channel_request), 1) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_channel_response,get_channel_response), 2) \ -X(a, STATIC, ONEOF, BOOL, (payload_variant,get_owner_request,get_owner_request), 3) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_owner_response,get_owner_response), 4) \ -X(a, STATIC, ONEOF, UENUM, (payload_variant,get_config_request,get_config_request), 5) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_config_response,get_config_response), 6) \ -X(a, STATIC, ONEOF, UENUM, (payload_variant,get_module_config_request,get_module_config_request), 7) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_module_config_response,get_module_config_response), 8) \ -X(a, STATIC, ONEOF, BOOL, (payload_variant,get_canned_message_module_messages_request,get_canned_message_module_messages_request), 10) \ -X(a, STATIC, ONEOF, STRING, (payload_variant,get_canned_message_module_messages_response,get_canned_message_module_messages_response), 11) \ -X(a, STATIC, ONEOF, BOOL, (payload_variant,get_device_metadata_request,get_device_metadata_request), 12) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_device_metadata_response,get_device_metadata_response), 13) \ -X(a, STATIC, ONEOF, BOOL, (payload_variant,get_ringtone_request,get_ringtone_request), 14) \ -X(a, STATIC, ONEOF, STRING, (payload_variant,get_ringtone_response,get_ringtone_response), 15) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_owner,set_owner), 32) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_channel,set_channel), 33) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_config,set_config), 34) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_module_config,set_module_config), 35) \ -X(a, STATIC, ONEOF, STRING, (payload_variant,set_canned_message_module_messages,set_canned_message_module_messages), 36) \ -X(a, STATIC, ONEOF, STRING, (payload_variant,set_ringtone_message,set_ringtone_message), 37) \ -X(a, STATIC, ONEOF, BOOL, (payload_variant,begin_edit_settings,begin_edit_settings), 64) \ -X(a, STATIC, ONEOF, BOOL, (payload_variant,commit_edit_settings,commit_edit_settings), 65) \ -X(a, STATIC, ONEOF, BOOL, (payload_variant,confirm_set_channel,confirm_set_channel), 66) \ -X(a, STATIC, ONEOF, BOOL, (payload_variant,confirm_set_radio,confirm_set_radio), 67) \ -X(a, STATIC, ONEOF, INT32, (payload_variant,reboot_ota_seconds,reboot_ota_seconds), 95) \ -X(a, STATIC, ONEOF, BOOL, (payload_variant,exit_simulator,exit_simulator), 96) \ -X(a, STATIC, ONEOF, INT32, (payload_variant,reboot_seconds,reboot_seconds), 97) \ -X(a, STATIC, ONEOF, INT32, (payload_variant,shutdown_seconds,shutdown_seconds), 98) \ -X(a, STATIC, ONEOF, INT32, (payload_variant,factory_reset,factory_reset), 99) \ -X(a, STATIC, ONEOF, INT32, (payload_variant,nodedb_reset,nodedb_reset), 100) -#define AdminMessage_CALLBACK NULL -#define AdminMessage_DEFAULT NULL -#define AdminMessage_payload_variant_get_channel_response_MSGTYPE Channel -#define AdminMessage_payload_variant_get_owner_response_MSGTYPE User -#define AdminMessage_payload_variant_get_config_response_MSGTYPE Config -#define AdminMessage_payload_variant_get_module_config_response_MSGTYPE ModuleConfig -#define AdminMessage_payload_variant_get_device_metadata_response_MSGTYPE DeviceMetadata -#define AdminMessage_payload_variant_set_owner_MSGTYPE User -#define AdminMessage_payload_variant_set_channel_MSGTYPE Channel -#define AdminMessage_payload_variant_set_config_MSGTYPE Config -#define AdminMessage_payload_variant_set_module_config_MSGTYPE ModuleConfig - -extern const pb_msgdesc_t AdminMessage_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define AdminMessage_fields &AdminMessage_msg - -/* Maximum encoded size of messages (where known) */ -#define AdminMessage_size 234 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/apponly.pb.c b/src/mesh/generated/apponly.pb.c deleted file mode 100644 index ce68d47c6..000000000 --- a/src/mesh/generated/apponly.pb.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "apponly.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(ChannelSet, ChannelSet, 2) - - - diff --git a/src/mesh/generated/apponly.pb.h b/src/mesh/generated/apponly.pb.h deleted file mode 100644 index e0a6d7cd5..000000000 --- a/src/mesh/generated/apponly.pb.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_APPONLY_PB_H_INCLUDED -#define PB_APPONLY_PB_H_INCLUDED -#include -#include "channel.pb.h" -#include "config.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Struct definitions */ -/* This is the most compact possible representation for a set of channels. - It includes only one PRIMARY channel (which must be first) and - any SECONDARY channels. - No DISABLED channels are included. - This abstraction is used only on the the 'app side' of the world (ie python, javascript and android etc) to show a group of Channels as a (long) URL */ -typedef struct _ChannelSet { - /* Channel list with settings */ - pb_size_t settings_count; - ChannelSettings settings[8]; - /* LoRa config */ - bool has_lora_config; - Config_LoRaConfig lora_config; -} ChannelSet; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initializer values for message structs */ -#define ChannelSet_init_default {0, {ChannelSettings_init_default, ChannelSettings_init_default, ChannelSettings_init_default, ChannelSettings_init_default, ChannelSettings_init_default, ChannelSettings_init_default, ChannelSettings_init_default, ChannelSettings_init_default}, false, Config_LoRaConfig_init_default} -#define ChannelSet_init_zero {0, {ChannelSettings_init_zero, ChannelSettings_init_zero, ChannelSettings_init_zero, ChannelSettings_init_zero, ChannelSettings_init_zero, ChannelSettings_init_zero, ChannelSettings_init_zero, ChannelSettings_init_zero}, false, Config_LoRaConfig_init_zero} - -/* Field tags (for use in manual encoding/decoding) */ -#define ChannelSet_settings_tag 1 -#define ChannelSet_lora_config_tag 2 - -/* Struct field encoding specification for nanopb */ -#define ChannelSet_FIELDLIST(X, a) \ -X(a, STATIC, REPEATED, MESSAGE, settings, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, lora_config, 2) -#define ChannelSet_CALLBACK NULL -#define ChannelSet_DEFAULT NULL -#define ChannelSet_settings_MSGTYPE ChannelSettings -#define ChannelSet_lora_config_MSGTYPE Config_LoRaConfig - -extern const pb_msgdesc_t ChannelSet_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define ChannelSet_fields &ChannelSet_msg - -/* Maximum encoded size of messages (where known) */ -#define ChannelSet_size 584 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/cannedmessages.pb.c b/src/mesh/generated/cannedmessages.pb.c deleted file mode 100644 index 448517f13..000000000 --- a/src/mesh/generated/cannedmessages.pb.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "cannedmessages.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(CannedMessageModuleConfig, CannedMessageModuleConfig, AUTO) - - - diff --git a/src/mesh/generated/cannedmessages.pb.h b/src/mesh/generated/cannedmessages.pb.h deleted file mode 100644 index 4981fef18..000000000 --- a/src/mesh/generated/cannedmessages.pb.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_CANNEDMESSAGES_PB_H_INCLUDED -#define PB_CANNEDMESSAGES_PB_H_INCLUDED -#include - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Struct definitions */ -/* Canned message module configuration. */ -typedef struct _CannedMessageModuleConfig { - /* Predefined messages for canned message module separated by '|' characters. */ - char messages[201]; -} CannedMessageModuleConfig; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initializer values for message structs */ -#define CannedMessageModuleConfig_init_default {""} -#define CannedMessageModuleConfig_init_zero {""} - -/* Field tags (for use in manual encoding/decoding) */ -#define CannedMessageModuleConfig_messages_tag 1 - -/* Struct field encoding specification for nanopb */ -#define CannedMessageModuleConfig_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, STRING, messages, 1) -#define CannedMessageModuleConfig_CALLBACK NULL -#define CannedMessageModuleConfig_DEFAULT NULL - -extern const pb_msgdesc_t CannedMessageModuleConfig_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define CannedMessageModuleConfig_fields &CannedMessageModuleConfig_msg - -/* Maximum encoded size of messages (where known) */ -#define CannedMessageModuleConfig_size 203 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/channel.pb.c b/src/mesh/generated/channel.pb.c deleted file mode 100644 index d8e4d8332..000000000 --- a/src/mesh/generated/channel.pb.c +++ /dev/null @@ -1,16 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "channel.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(ChannelSettings, ChannelSettings, AUTO) - - -PB_BIND(Channel, Channel, AUTO) - - - - diff --git a/src/mesh/generated/channel.pb.h b/src/mesh/generated/channel.pb.h deleted file mode 100644 index 2dc16bce5..000000000 --- a/src/mesh/generated/channel.pb.h +++ /dev/null @@ -1,172 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_CHANNEL_PB_H_INCLUDED -#define PB_CHANNEL_PB_H_INCLUDED -#include - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -/* How this channel is being used (or not). - Note: this field is an enum to give us options for the future. - In particular, someday we might make a 'SCANNING' option. - SCANNING channels could have different frequencies and the radio would - occasionally check that freq to see if anything is being transmitted. - For devices that have multiple physical radios attached, we could keep multiple PRIMARY/SCANNING channels active at once to allow - cross band routing as needed. - If a device has only a single radio (the common case) only one channel can be PRIMARY at a time - (but any number of SECONDARY channels can't be sent received on that common frequency) */ -typedef enum _Channel_Role { - /* This channel is not in use right now */ - Channel_Role_DISABLED = 0, - /* This channel is used to set the frequency for the radio - all other enabled channels must be SECONDARY */ - Channel_Role_PRIMARY = 1, - /* Secondary channels are only used for encryption/decryption/authentication purposes. - Their radio settings (freq etc) are ignored, only psk is used. */ - Channel_Role_SECONDARY = 2 -} Channel_Role; - -/* Struct definitions */ -typedef PB_BYTES_ARRAY_T(32) ChannelSettings_psk_t; -/* Full settings (center freq, spread factor, pre-shared secret key etc...) - needed to configure a radio for speaking on a particular channel This - information can be encoded as a QRcode/url so that other users can configure - their radio to join the same channel. - A note about how channel names are shown to users: channelname-Xy - poundsymbol is a prefix used to indicate this is a channel name (idea from @professr). - Where X is a letter from A-Z (base 26) representing a hash of the PSK for this - channel - so that if the user changes anything about the channel (which does - force a new PSK) this letter will also change. Thus preventing user confusion if - two friends try to type in a channel name of "BobsChan" and then can't talk - because their PSKs will be different. - The PSK is hashed into this letter by "0x41 + [xor all bytes of the psk ] modulo 26" - This also allows the option of someday if people have the PSK off (zero), the - users COULD type in a channel name and be able to talk. - Y is a lower case letter from a-z that represents the channel 'speed' settings - (for some future definition of speed) - FIXME: Add description of multi-channel support and how primary vs secondary channels are used. - FIXME: explain how apps use channels for security. - explain how remote settings and remote gpio are managed as an example */ -typedef struct _ChannelSettings { - /* Deprecated in favor of LoraConfig.channel_num */ - uint32_t channel_num; - /* A simple pre-shared key for now for crypto. - Must be either 0 bytes (no crypto), 16 bytes (AES128), or 32 bytes (AES256). - A special shorthand is used for 1 byte long psks. - These psks should be treated as only minimally secure, - because they are listed in this source code. - Those bytes are mapped using the following scheme: - `0` = No crypto - `1` = The special "default" channel key: {0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0x59, 0xf0, 0xbc, 0xff, 0xab, 0xcf, 0x4e, 0x69, 0xbf} - `2` through 10 = The default channel key, except with 1 through 9 added to the last byte. - Shown to user as simple1 through 10 */ - ChannelSettings_psk_t psk; - /* A SHORT name that will be packed into the URL. - Less than 12 bytes. - Something for end users to call the channel - If this is the empty string it is assumed that this channel - is the special (minimally secure) "Default"channel. - In user interfaces it should be rendered as a local language translation of "X". - For channel_num hashing empty string will be treated as "X". - Where "X" is selected based on the English words listed above for ModemPreset */ - char name[12]; - /* Used to construct a globally unique channel ID. - The full globally unique ID will be: "name.id" where ID is shown as base36. - Assuming that the number of meshtastic users is below 20K (true for a long time) - the chance of this 64 bit random number colliding with anyone else is super low. - And the penalty for collision is low as well, it just means that anyone trying to decrypt channel messages might need to - try multiple candidate channels. - Any time a non wire compatible change is made to a channel, this field should be regenerated. - There are a small number of 'special' globally known (and fairly) insecure standard channels. - Those channels do not have a numeric id included in the settings, but instead it is pulled from - a table of well known IDs. - (see Well Known Channels FIXME) */ - uint32_t id; - /* If true, messages on the mesh will be sent to the *public* internet by any gateway ndoe */ - bool uplink_enabled; - /* If true, messages seen on the internet will be forwarded to the local mesh. */ - bool downlink_enabled; -} ChannelSettings; - -/* A pair of a channel number, mode and the (sharable) settings for that channel */ -typedef struct _Channel { - /* The index of this channel in the channel table (from 0 to MAX_NUM_CHANNELS-1) - (Someday - not currently implemented) An index of -1 could be used to mean "set by name", - in which case the target node will find and set the channel by settings.name. */ - int8_t index; - /* The new settings, or NULL to disable that channel */ - bool has_settings; - ChannelSettings settings; - /* TODO: REPLACE */ - Channel_Role role; -} Channel; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Helper constants for enums */ -#define _Channel_Role_MIN Channel_Role_DISABLED -#define _Channel_Role_MAX Channel_Role_SECONDARY -#define _Channel_Role_ARRAYSIZE ((Channel_Role)(Channel_Role_SECONDARY+1)) - - -#define Channel_role_ENUMTYPE Channel_Role - - -/* Initializer values for message structs */ -#define ChannelSettings_init_default {0, {0, {0}}, "", 0, 0, 0} -#define Channel_init_default {0, false, ChannelSettings_init_default, _Channel_Role_MIN} -#define ChannelSettings_init_zero {0, {0, {0}}, "", 0, 0, 0} -#define Channel_init_zero {0, false, ChannelSettings_init_zero, _Channel_Role_MIN} - -/* Field tags (for use in manual encoding/decoding) */ -#define ChannelSettings_channel_num_tag 1 -#define ChannelSettings_psk_tag 2 -#define ChannelSettings_name_tag 3 -#define ChannelSettings_id_tag 4 -#define ChannelSettings_uplink_enabled_tag 5 -#define ChannelSettings_downlink_enabled_tag 6 -#define Channel_index_tag 1 -#define Channel_settings_tag 2 -#define Channel_role_tag 3 - -/* Struct field encoding specification for nanopb */ -#define ChannelSettings_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, channel_num, 1) \ -X(a, STATIC, SINGULAR, BYTES, psk, 2) \ -X(a, STATIC, SINGULAR, STRING, name, 3) \ -X(a, STATIC, SINGULAR, FIXED32, id, 4) \ -X(a, STATIC, SINGULAR, BOOL, uplink_enabled, 5) \ -X(a, STATIC, SINGULAR, BOOL, downlink_enabled, 6) -#define ChannelSettings_CALLBACK NULL -#define ChannelSettings_DEFAULT NULL - -#define Channel_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, INT32, index, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, settings, 2) \ -X(a, STATIC, SINGULAR, UENUM, role, 3) -#define Channel_CALLBACK NULL -#define Channel_DEFAULT NULL -#define Channel_settings_MSGTYPE ChannelSettings - -extern const pb_msgdesc_t ChannelSettings_msg; -extern const pb_msgdesc_t Channel_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define ChannelSettings_fields &ChannelSettings_msg -#define Channel_fields &Channel_msg - -/* Maximum encoded size of messages (where known) */ -#define ChannelSettings_size 62 -#define Channel_size 77 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/config.pb.c b/src/mesh/generated/config.pb.c deleted file mode 100644 index d43f4beae..000000000 --- a/src/mesh/generated/config.pb.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "config.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(Config, Config, AUTO) - - -PB_BIND(Config_DeviceConfig, Config_DeviceConfig, AUTO) - - -PB_BIND(Config_PositionConfig, Config_PositionConfig, AUTO) - - -PB_BIND(Config_PowerConfig, Config_PowerConfig, AUTO) - - -PB_BIND(Config_NetworkConfig, Config_NetworkConfig, AUTO) - - -PB_BIND(Config_NetworkConfig_IpV4Config, Config_NetworkConfig_IpV4Config, AUTO) - - -PB_BIND(Config_DisplayConfig, Config_DisplayConfig, AUTO) - - -PB_BIND(Config_LoRaConfig, Config_LoRaConfig, 2) - - -PB_BIND(Config_BluetoothConfig, Config_BluetoothConfig, AUTO) - - - - - - - - - - - - - diff --git a/src/mesh/generated/config.pb.h b/src/mesh/generated/config.pb.h deleted file mode 100644 index a6c84306e..000000000 --- a/src/mesh/generated/config.pb.h +++ /dev/null @@ -1,707 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_CONFIG_PB_H_INCLUDED -#define PB_CONFIG_PB_H_INCLUDED -#include - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -/* Defines the device's role on the Mesh network */ -typedef enum _Config_DeviceConfig_Role { - /* Client device role */ - Config_DeviceConfig_Role_CLIENT = 0, - /* Client Mute device role - Same as a client except packets will not hop over this node, does not contribute to routing packets for mesh. */ - Config_DeviceConfig_Role_CLIENT_MUTE = 1, - /* Router device role. - Mesh packets will prefer to be routed over this node. This node will not be used by client apps. - The wifi/ble radios and the oled screen will be put to sleep. */ - Config_DeviceConfig_Role_ROUTER = 2, - /* Router Client device role - Mesh packets will prefer to be routed over this node. The Router Client can be used as both a Router and an app connected Client. */ - Config_DeviceConfig_Role_ROUTER_CLIENT = 3 -} Config_DeviceConfig_Role; - -/* Bit field of boolean configuration options, indicating which optional - fields to include when assembling POSITION messages - Longitude and latitude are always included (also time if GPS-synced) - NOTE: the more fields are included, the larger the message will be - - leading to longer airtime and a higher risk of packet loss */ -typedef enum _Config_PositionConfig_PositionFlags { - /* Required for compilation */ - Config_PositionConfig_PositionFlags_UNSET = 0, - /* Include an altitude value (if available) */ - Config_PositionConfig_PositionFlags_ALTITUDE = 1, - /* Altitude value is MSL */ - Config_PositionConfig_PositionFlags_ALTITUDE_MSL = 2, - /* Include geoidal separation */ - Config_PositionConfig_PositionFlags_GEOIDAL_SEPARATION = 4, - /* Include the DOP value ; PDOP used by default, see below */ - Config_PositionConfig_PositionFlags_DOP = 8, - /* If POS_DOP set, send separate HDOP / VDOP values instead of PDOP */ - Config_PositionConfig_PositionFlags_HVDOP = 16, - /* Include number of "satellites in view" */ - Config_PositionConfig_PositionFlags_SATINVIEW = 32, - /* Include a sequence number incremented per packet */ - Config_PositionConfig_PositionFlags_SEQ_NO = 64, - /* Include positional timestamp (from GPS solution) */ - Config_PositionConfig_PositionFlags_TIMESTAMP = 128, - /* Include positional heading - Intended for use with vehicle not walking speeds - walking speeds are likely to be error prone like the compass */ - Config_PositionConfig_PositionFlags_HEADING = 256, - /* Include positional speed - Intended for use with vehicle not walking speeds - walking speeds are likely to be error prone like the compass */ - Config_PositionConfig_PositionFlags_SPEED = 512 -} Config_PositionConfig_PositionFlags; - -typedef enum _Config_NetworkConfig_AddressMode { - /* obtain ip address via DHCP */ - Config_NetworkConfig_AddressMode_DHCP = 0, - /* use static ip address */ - Config_NetworkConfig_AddressMode_STATIC = 1 -} Config_NetworkConfig_AddressMode; - -/* How the GPS coordinates are displayed on the OLED screen. */ -typedef enum _Config_DisplayConfig_GpsCoordinateFormat { - /* GPS coordinates are displayed in the normal decimal degrees format: - DD.DDDDDD DDD.DDDDDD */ - Config_DisplayConfig_GpsCoordinateFormat_DEC = 0, - /* GPS coordinates are displayed in the degrees minutes seconds format: - DD°MM'SS"C DDD°MM'SS"C, where C is the compass point representing the locations quadrant */ - Config_DisplayConfig_GpsCoordinateFormat_DMS = 1, - /* Universal Transverse Mercator format: - ZZB EEEEEE NNNNNNN, where Z is zone, B is band, E is easting, N is northing */ - Config_DisplayConfig_GpsCoordinateFormat_UTM = 2, - /* Military Grid Reference System format: - ZZB CD EEEEE NNNNN, where Z is zone, B is band, C is the east 100k square, D is the north 100k square, - E is easting, N is northing */ - Config_DisplayConfig_GpsCoordinateFormat_MGRS = 3, - /* Open Location Code (aka Plus Codes). */ - Config_DisplayConfig_GpsCoordinateFormat_OLC = 4, - /* Ordnance Survey Grid Reference (the National Grid System of the UK). - Format: AB EEEEE NNNNN, where A is the east 100k square, B is the north 100k square, - E is the easting, N is the northing */ - Config_DisplayConfig_GpsCoordinateFormat_OSGR = 5 -} Config_DisplayConfig_GpsCoordinateFormat; - -/* Unit display preference */ -typedef enum _Config_DisplayConfig_DisplayUnits { - /* Metric (Default) */ - Config_DisplayConfig_DisplayUnits_METRIC = 0, - /* Imperial */ - Config_DisplayConfig_DisplayUnits_IMPERIAL = 1 -} Config_DisplayConfig_DisplayUnits; - -/* Override OLED outo detect with this if it fails. */ -typedef enum _Config_DisplayConfig_OledType { - /* Default / Auto */ - Config_DisplayConfig_OledType_OLED_AUTO = 0, - /* Default / Auto */ - Config_DisplayConfig_OledType_OLED_SSD1306 = 1, - /* Default / Auto */ - Config_DisplayConfig_OledType_OLED_SH1106 = 2 -} Config_DisplayConfig_OledType; - -typedef enum _Config_DisplayConfig_DisplayMode { - /* Default. The old style for the 128x64 OLED screen */ - Config_DisplayConfig_DisplayMode_DEFAULT = 0, - /* Rearrange display elements to cater for bicolor OLED displays */ - Config_DisplayConfig_DisplayMode_TWOCOLOR = 1, - /* Same as TwoColor, but with inverted top bar. Not so good for Epaper displays */ - Config_DisplayConfig_DisplayMode_INVERTED = 2, - /* TFT Full Color Displays (not implemented yet) */ - Config_DisplayConfig_DisplayMode_COLOR = 3 -} Config_DisplayConfig_DisplayMode; - -typedef enum _Config_LoRaConfig_RegionCode { - /* Region is not set */ - Config_LoRaConfig_RegionCode_UNSET = 0, - /* United States */ - Config_LoRaConfig_RegionCode_US = 1, - /* European Union 433mhz */ - Config_LoRaConfig_RegionCode_EU_433 = 2, - /* European Union 433mhz */ - Config_LoRaConfig_RegionCode_EU_868 = 3, - /* China */ - Config_LoRaConfig_RegionCode_CN = 4, - /* Japan */ - Config_LoRaConfig_RegionCode_JP = 5, - /* Australia / New Zealand */ - Config_LoRaConfig_RegionCode_ANZ = 6, - /* Korea */ - Config_LoRaConfig_RegionCode_KR = 7, - /* Taiwan */ - Config_LoRaConfig_RegionCode_TW = 8, - /* Russia */ - Config_LoRaConfig_RegionCode_RU = 9, - /* India */ - Config_LoRaConfig_RegionCode_IN = 10, - /* New Zealand 865mhz */ - Config_LoRaConfig_RegionCode_NZ_865 = 11, - /* Thailand */ - Config_LoRaConfig_RegionCode_TH = 12, - /* WLAN Band */ - Config_LoRaConfig_RegionCode_LORA_24 = 13, - /* Ukraine 433mhz */ - Config_LoRaConfig_RegionCode_UA_433 = 14, - /* Ukraine 868mhz */ - Config_LoRaConfig_RegionCode_UA_868 = 15 -} Config_LoRaConfig_RegionCode; - -/* Standard predefined channel settings - Note: these mappings must match ModemPreset Choice in the device code. */ -typedef enum _Config_LoRaConfig_ModemPreset { - /* Long Range - Fast */ - Config_LoRaConfig_ModemPreset_LONG_FAST = 0, - /* Long Range - Slow */ - Config_LoRaConfig_ModemPreset_LONG_SLOW = 1, - /* Very Long Range - Slow */ - Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW = 2, - /* Medium Range - Slow */ - Config_LoRaConfig_ModemPreset_MEDIUM_SLOW = 3, - /* Medium Range - Fast */ - Config_LoRaConfig_ModemPreset_MEDIUM_FAST = 4, - /* Short Range - Slow */ - Config_LoRaConfig_ModemPreset_SHORT_SLOW = 5, - /* Short Range - Fast */ - Config_LoRaConfig_ModemPreset_SHORT_FAST = 6 -} Config_LoRaConfig_ModemPreset; - -typedef enum _Config_BluetoothConfig_PairingMode { - /* Device generates a random pin that will be shown on the screen of the device for pairing */ - Config_BluetoothConfig_PairingMode_RANDOM_PIN = 0, - /* Device requires a specified fixed pin for pairing */ - Config_BluetoothConfig_PairingMode_FIXED_PIN = 1, - /* Device requires no pin for pairing */ - Config_BluetoothConfig_PairingMode_NO_PIN = 2 -} Config_BluetoothConfig_PairingMode; - -/* Struct definitions */ -/* Configuration */ -typedef struct _Config_DeviceConfig { - /* Sets the role of node */ - Config_DeviceConfig_Role role; - /* Disabling this will disable the SerialConsole by not initilizing the StreamAPI */ - bool serial_enabled; - /* By default we turn off logging as soon as an API client connects (to keep shared serial link quiet). - Set this to true to leave the debug log outputting even when API is active. */ - bool debug_log_enabled; - /* For boards without a hard wired button, this is the pin number that will be used - Boards that have more than one button can swap the function with this one. defaults to BUTTON_PIN if defined. */ - uint32_t button_gpio; - /* For boards without a PWM buzzer, this is the pin number that will be used - Defaults to PIN_BUZZER if defined. */ - uint32_t buzzer_gpio; -} Config_DeviceConfig; - -/* Position Config */ -typedef struct _Config_PositionConfig { - /* We should send our position this often (but only if it has changed significantly) - Defaults to 15 minutes */ - uint32_t position_broadcast_secs; - /* Adaptive position braoadcast, which is now the default. */ - bool position_broadcast_smart_enabled; - /* If set, this node is at a fixed position. - We will generate GPS position updates at the regular interval, but use whatever the last lat/lon/alt we have for the node. - The lat/lon/alt can be set by an internal GPS or with the help of the app. */ - bool fixed_position; - /* Is GPS enabled for this node? */ - bool gps_enabled; - /* How often should we try to get GPS position (in seconds) - or zero for the default of once every 30 seconds - or a very large value (maxint) to update only once at boot. */ - uint32_t gps_update_interval; - /* How long should we try to get our position during each gps_update_interval attempt? (in seconds) - Or if zero, use the default of 30 seconds. - If we don't get a new gps fix in that time, the gps will be put into sleep until the next gps_update_rate - window. */ - uint32_t gps_attempt_time; - /* Bit field of boolean configuration options for POSITION messages - (bitwise OR of PositionFlags) */ - uint32_t position_flags; - /* (Re)define GPS_RX_PIN for your board. */ - uint32_t rx_gpio; - /* (Re)define GPS_TX_PIN for your board. */ - uint32_t tx_gpio; -} Config_PositionConfig; - -/* Power Config\ - See [Power Config](/docs/settings/config/power) for additional power config details. */ -typedef struct _Config_PowerConfig { - /* If set, we are powered from a low-current source (i.e. solar), so even if it looks like we have power flowing in - we should try to minimize power consumption as much as possible. - YOU DO NOT NEED TO SET THIS IF YOU'VE set is_router (it is implied in that case). - Advanced Option */ - bool is_power_saving; - /* If non-zero, the device will fully power off this many seconds after external power is removed. */ - uint32_t on_battery_shutdown_after_secs; - /* Ratio of voltage divider for battery pin eg. 3.20 (R1=100k, R2=220k) - Overrides the ADC_MULTIPLIER defined in variant for battery voltage calculation. - Should be set to floating point value between 2 and 4 - Fixes issues on Heltec v2 */ - float adc_multiplier_override; - /* Wait Bluetooth Seconds - The number of seconds for to wait before turning off BLE in No Bluetooth states - 0 for default of 1 minute */ - uint32_t wait_bluetooth_secs; - /* Mesh Super Deep Sleep Timeout Seconds - While in Light Sleep if this value is exceeded we will lower into super deep sleep - for sds_secs (default 1 year) or a button press - 0 for default of two hours, MAXUINT for disabled */ - uint32_t mesh_sds_timeout_secs; - /* Super Deep Sleep Seconds - While in Light Sleep if mesh_sds_timeout_secs is exceeded we will lower into super deep sleep - for this value (default 1 year) or a button press - 0 for default of one year */ - uint32_t sds_secs; - /* Light Sleep Seconds - In light sleep the CPU is suspended, LoRa radio is on, BLE is off an GPS is on - ESP32 Only - 0 for default of 300 */ - uint32_t ls_secs; - /* Minimum Wake Seconds - While in light sleep when we receive packets on the LoRa radio we will wake and handle them and stay awake in no BLE mode for this value - 0 for default of 10 seconds */ - uint32_t min_wake_secs; -} Config_PowerConfig; - -typedef struct _Config_NetworkConfig_IpV4Config { - /* Static IP address */ - uint32_t ip; - /* Static gateway address */ - uint32_t gateway; - /* Static subnet mask */ - uint32_t subnet; - /* Static DNS server address */ - uint32_t dns; -} Config_NetworkConfig_IpV4Config; - -/* Network Config */ -typedef struct _Config_NetworkConfig { - /* Enable WiFi (disables Bluetooth) */ - bool wifi_enabled; - /* If set, this node will try to join the specified wifi network and - acquire an address via DHCP */ - char wifi_ssid[33]; - /* If set, will be use to authenticate to the named wifi */ - char wifi_psk[64]; - /* NTP server to use if WiFi is conneced, defaults to `0.pool.ntp.org` */ - char ntp_server[33]; - /* Enable Ethernet */ - bool eth_enabled; - /* acquire an address via DHCP or assign static */ - Config_NetworkConfig_AddressMode address_mode; - /* struct to keep static address */ - bool has_ipv4_config; - Config_NetworkConfig_IpV4Config ipv4_config; -} Config_NetworkConfig; - -/* Display Config */ -typedef struct _Config_DisplayConfig { - /* Number of seconds the screen stays on after pressing the user button or receiving a message - 0 for default of one minute MAXUINT for always on */ - uint32_t screen_on_secs; - /* How the GPS coordinates are formatted on the OLED screen. */ - Config_DisplayConfig_GpsCoordinateFormat gps_format; - /* Automatically toggles to the next page on the screen like a carousel, based the specified interval in seconds. - Potentially useful for devices without user buttons. */ - uint32_t auto_screen_carousel_secs; - /* If this is set, the displayed compass will always point north. if unset, the old behaviour - (top of display is heading direction) is used. */ - bool compass_north_top; - /* Flip screen vertically, for cases that mount the screen upside down */ - bool flip_screen; - /* Perferred display units */ - Config_DisplayConfig_DisplayUnits units; - /* Override auto-detect in screen */ - Config_DisplayConfig_OledType oled; - /* Display Mode */ - Config_DisplayConfig_DisplayMode displaymode; - /* Print first line in pseudo-bold? FALSE is original style, TRUE is bold */ - bool heading_bold; -} Config_DisplayConfig; - -/* Lora Config */ -typedef struct _Config_LoRaConfig { - /* When enabled, the `modem_preset` fields will be adheared to, else the `bandwidth`/`spread_factor`/`coding_rate` - will be taked from their respective manually defined fields */ - bool use_preset; - /* Either modem_config or bandwidth/spreading/coding will be specified - NOT BOTH. - As a heuristic: If bandwidth is specified, do not use modem_config. - Because protobufs take ZERO space when the value is zero this works out nicely. - This value is replaced by bandwidth/spread_factor/coding_rate. - If you'd like to experiment with other options add them to MeshRadio.cpp in the device code. */ - Config_LoRaConfig_ModemPreset modem_preset; - /* Bandwidth in MHz - Certain bandwidth numbers are 'special' and will be converted to the - appropriate floating point value: 31 -> 31.25MHz */ - uint16_t bandwidth; - /* A number from 7 to 12. - Indicates number of chirps per symbol as 1< - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Struct definitions */ -/* Device metadata response */ -typedef struct _DeviceMetadata { - /* Device firmware version string */ - char firmware_version[18]; - /* Device state version */ - uint32_t device_state_version; - /* Indicates whether the device can shutdown CPU natively or via power management chip */ - bool canShutdown; - /* Indicates that the device has native wifi capability */ - bool hasWifi; - /* Indicates that the device has native bluetooth capability */ - bool hasBluetooth; - /* Indicates that the device has an ethernet peripheral */ - bool hasEthernet; -} DeviceMetadata; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initializer values for message structs */ -#define DeviceMetadata_init_default {"", 0, 0, 0, 0, 0} -#define DeviceMetadata_init_zero {"", 0, 0, 0, 0, 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define DeviceMetadata_firmware_version_tag 1 -#define DeviceMetadata_device_state_version_tag 2 -#define DeviceMetadata_canShutdown_tag 3 -#define DeviceMetadata_hasWifi_tag 4 -#define DeviceMetadata_hasBluetooth_tag 5 -#define DeviceMetadata_hasEthernet_tag 6 - -/* Struct field encoding specification for nanopb */ -#define DeviceMetadata_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, STRING, firmware_version, 1) \ -X(a, STATIC, SINGULAR, UINT32, device_state_version, 2) \ -X(a, STATIC, SINGULAR, BOOL, canShutdown, 3) \ -X(a, STATIC, SINGULAR, BOOL, hasWifi, 4) \ -X(a, STATIC, SINGULAR, BOOL, hasBluetooth, 5) \ -X(a, STATIC, SINGULAR, BOOL, hasEthernet, 6) -#define DeviceMetadata_CALLBACK NULL -#define DeviceMetadata_DEFAULT NULL - -extern const pb_msgdesc_t DeviceMetadata_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define DeviceMetadata_fields &DeviceMetadata_msg - -/* Maximum encoded size of messages (where known) */ -#define DeviceMetadata_size 33 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/deviceonly.pb.c b/src/mesh/generated/deviceonly.pb.c deleted file mode 100644 index e3acb0db4..000000000 --- a/src/mesh/generated/deviceonly.pb.c +++ /dev/null @@ -1,19 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "deviceonly.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(DeviceState, DeviceState, 4) - - -PB_BIND(ChannelFile, ChannelFile, 2) - - -PB_BIND(OEMStore, OEMStore, 2) - - - - diff --git a/src/mesh/generated/deviceonly.pb.h b/src/mesh/generated/deviceonly.pb.h deleted file mode 100644 index 1a95a0970..000000000 --- a/src/mesh/generated/deviceonly.pb.h +++ /dev/null @@ -1,184 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_DEVICEONLY_PB_H_INCLUDED -#define PB_DEVICEONLY_PB_H_INCLUDED -#include -#include "channel.pb.h" -#include "mesh.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -/* TODO: REPLACE */ -typedef enum _ScreenFonts { - /* TODO: REPLACE */ - ScreenFonts_FONT_SMALL = 0, - /* TODO: REPLACE */ - ScreenFonts_FONT_MEDIUM = 1, - /* TODO: REPLACE */ - ScreenFonts_FONT_LARGE = 2 -} ScreenFonts; - -/* Struct definitions */ -/* This message is never sent over the wire, but it is used for serializing DB - state to flash in the device code - FIXME, since we write this each time we enter deep sleep (and have infinite - flash) it would be better to use some sort of append only data structure for - the receive queue and use the preferences store for the other stuff */ -typedef struct _DeviceState { - /* Read only settings/info about this node */ - bool has_my_node; - MyNodeInfo my_node; - /* My owner info */ - bool has_owner; - User owner; - /* TODO: REPLACE */ - pb_size_t node_db_count; - NodeInfo node_db[80]; - /* Received packets saved for delivery to the phone */ - pb_size_t receive_queue_count; - MeshPacket receive_queue[1]; - /* We keep the last received text message (only) stored in the device flash, - so we can show it on the screen. - Might be null */ - bool has_rx_text_message; - MeshPacket rx_text_message; - /* A version integer used to invalidate old save files when we make - incompatible changes This integer is set at build time and is private to - NodeDB.cpp in the device code. */ - uint32_t version; - /* Used only during development. - Indicates developer is testing and changes should never be saved to flash. */ - bool no_save; - /* Some GPSes seem to have bogus settings from the factory, so we always do one factory reset. */ - bool did_gps_reset; -} DeviceState; - -/* The on-disk saved channels */ -typedef struct _ChannelFile { - /* The channels our node knows about */ - pb_size_t channels_count; - Channel channels[8]; - /* A version integer used to invalidate old save files when we make - incompatible changes This integer is set at build time and is private to - NodeDB.cpp in the device code. */ - uint32_t version; -} ChannelFile; - -typedef PB_BYTES_ARRAY_T(2048) OEMStore_oem_icon_bits_t; -typedef PB_BYTES_ARRAY_T(32) OEMStore_oem_aes_key_t; -/* This can be used for customizing the firmware distribution. If populated, - show a secondary bootup screen with cuatom logo and text for 2.5 seconds. */ -typedef struct _OEMStore { - /* The Logo width in Px */ - uint32_t oem_icon_width; - /* The Logo height in Px */ - uint32_t oem_icon_height; - /* The Logo in xbm bytechar format */ - OEMStore_oem_icon_bits_t oem_icon_bits; - /* Use this font for the OEM text. */ - ScreenFonts oem_font; - /* Use this font for the OEM text. */ - char oem_text[40]; - /* The default device encryption key, 16 or 32 byte */ - OEMStore_oem_aes_key_t oem_aes_key; -} OEMStore; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Helper constants for enums */ -#define _ScreenFonts_MIN ScreenFonts_FONT_SMALL -#define _ScreenFonts_MAX ScreenFonts_FONT_LARGE -#define _ScreenFonts_ARRAYSIZE ((ScreenFonts)(ScreenFonts_FONT_LARGE+1)) - - - -#define OEMStore_oem_font_ENUMTYPE ScreenFonts - - -/* Initializer values for message structs */ -#define DeviceState_init_default {false, MyNodeInfo_init_default, false, User_init_default, 0, {NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default}, 0, {MeshPacket_init_default}, false, MeshPacket_init_default, 0, 0, 0} -#define ChannelFile_init_default {0, {Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default}, 0} -#define OEMStore_init_default {0, 0, {0, {0}}, _ScreenFonts_MIN, "", {0, {0}}} -#define DeviceState_init_zero {false, MyNodeInfo_init_zero, false, User_init_zero, 0, {NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero}, 0, {MeshPacket_init_zero}, false, MeshPacket_init_zero, 0, 0, 0} -#define ChannelFile_init_zero {0, {Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero}, 0} -#define OEMStore_init_zero {0, 0, {0, {0}}, _ScreenFonts_MIN, "", {0, {0}}} - -/* Field tags (for use in manual encoding/decoding) */ -#define DeviceState_my_node_tag 2 -#define DeviceState_owner_tag 3 -#define DeviceState_node_db_tag 4 -#define DeviceState_receive_queue_tag 5 -#define DeviceState_rx_text_message_tag 7 -#define DeviceState_version_tag 8 -#define DeviceState_no_save_tag 9 -#define DeviceState_did_gps_reset_tag 11 -#define ChannelFile_channels_tag 1 -#define ChannelFile_version_tag 2 -#define OEMStore_oem_icon_width_tag 1 -#define OEMStore_oem_icon_height_tag 2 -#define OEMStore_oem_icon_bits_tag 3 -#define OEMStore_oem_font_tag 4 -#define OEMStore_oem_text_tag 5 -#define OEMStore_oem_aes_key_tag 6 - -/* Struct field encoding specification for nanopb */ -#define DeviceState_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, my_node, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, owner, 3) \ -X(a, STATIC, REPEATED, MESSAGE, node_db, 4) \ -X(a, STATIC, REPEATED, MESSAGE, receive_queue, 5) \ -X(a, STATIC, OPTIONAL, MESSAGE, rx_text_message, 7) \ -X(a, STATIC, SINGULAR, UINT32, version, 8) \ -X(a, STATIC, SINGULAR, BOOL, no_save, 9) \ -X(a, STATIC, SINGULAR, BOOL, did_gps_reset, 11) -#define DeviceState_CALLBACK NULL -#define DeviceState_DEFAULT NULL -#define DeviceState_my_node_MSGTYPE MyNodeInfo -#define DeviceState_owner_MSGTYPE User -#define DeviceState_node_db_MSGTYPE NodeInfo -#define DeviceState_receive_queue_MSGTYPE MeshPacket -#define DeviceState_rx_text_message_MSGTYPE MeshPacket - -#define ChannelFile_FIELDLIST(X, a) \ -X(a, STATIC, REPEATED, MESSAGE, channels, 1) \ -X(a, STATIC, SINGULAR, UINT32, version, 2) -#define ChannelFile_CALLBACK NULL -#define ChannelFile_DEFAULT NULL -#define ChannelFile_channels_MSGTYPE Channel - -#define OEMStore_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, oem_icon_width, 1) \ -X(a, STATIC, SINGULAR, UINT32, oem_icon_height, 2) \ -X(a, STATIC, SINGULAR, BYTES, oem_icon_bits, 3) \ -X(a, STATIC, SINGULAR, UENUM, oem_font, 4) \ -X(a, STATIC, SINGULAR, STRING, oem_text, 5) \ -X(a, STATIC, SINGULAR, BYTES, oem_aes_key, 6) -#define OEMStore_CALLBACK NULL -#define OEMStore_DEFAULT NULL - -extern const pb_msgdesc_t DeviceState_msg; -extern const pb_msgdesc_t ChannelFile_msg; -extern const pb_msgdesc_t OEMStore_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define DeviceState_fields &DeviceState_msg -#define ChannelFile_fields &ChannelFile_msg -#define OEMStore_fields &OEMStore_msg - -/* Maximum encoded size of messages (where known) */ -#define ChannelFile_size 638 -#define DeviceState_size 21800 -#define OEMStore_size 2140 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/localonly.pb.c b/src/mesh/generated/localonly.pb.c deleted file mode 100644 index 4eac55fd7..000000000 --- a/src/mesh/generated/localonly.pb.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "localonly.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(LocalConfig, LocalConfig, 2) - - -PB_BIND(LocalModuleConfig, LocalModuleConfig, 2) - - - diff --git a/src/mesh/generated/localonly.pb.h b/src/mesh/generated/localonly.pb.h deleted file mode 100644 index 1e4aa633c..000000000 --- a/src/mesh/generated/localonly.pb.h +++ /dev/null @@ -1,166 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_LOCALONLY_PB_H_INCLUDED -#define PB_LOCALONLY_PB_H_INCLUDED -#include -#include "config.pb.h" -#include "module_config.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Struct definitions */ -typedef struct _LocalConfig { - /* The part of the config that is specific to the Device */ - bool has_device; - Config_DeviceConfig device; - /* The part of the config that is specific to the GPS Position */ - bool has_position; - Config_PositionConfig position; - /* The part of the config that is specific to the Power settings */ - bool has_power; - Config_PowerConfig power; - /* The part of the config that is specific to the Wifi Settings */ - bool has_network; - Config_NetworkConfig network; - /* The part of the config that is specific to the Display */ - bool has_display; - Config_DisplayConfig display; - /* The part of the config that is specific to the Lora Radio */ - bool has_lora; - Config_LoRaConfig lora; - /* The part of the config that is specific to the Bluetooth settings */ - bool has_bluetooth; - Config_BluetoothConfig bluetooth; - /* A version integer used to invalidate old save files when we make - incompatible changes This integer is set at build time and is private to - NodeDB.cpp in the device code. */ - uint32_t version; -} LocalConfig; - -typedef struct _LocalModuleConfig { - /* The part of the config that is specific to the MQTT module */ - bool has_mqtt; - ModuleConfig_MQTTConfig mqtt; - /* The part of the config that is specific to the Serial module */ - bool has_serial; - ModuleConfig_SerialConfig serial; - /* The part of the config that is specific to the ExternalNotification module */ - bool has_external_notification; - ModuleConfig_ExternalNotificationConfig external_notification; - /* The part of the config that is specific to the Store & Forward module */ - bool has_store_forward; - ModuleConfig_StoreForwardConfig store_forward; - /* The part of the config that is specific to the RangeTest module */ - bool has_range_test; - ModuleConfig_RangeTestConfig range_test; - /* The part of the config that is specific to the Telemetry module */ - bool has_telemetry; - ModuleConfig_TelemetryConfig telemetry; - /* The part of the config that is specific to the Canned Message module */ - bool has_canned_message; - ModuleConfig_CannedMessageConfig canned_message; - /* A version integer used to invalidate old save files when we make - incompatible changes This integer is set at build time and is private to - NodeDB.cpp in the device code. */ - uint32_t version; - /* The part of the config that is specific to the Audio module */ - bool has_audio; - ModuleConfig_AudioConfig audio; - /* The part of the config that is specific to the Remote Hardware module */ - bool has_remote_hardware; - ModuleConfig_RemoteHardwareConfig remote_hardware; -} LocalModuleConfig; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initializer values for message structs */ -#define LocalConfig_init_default {false, Config_DeviceConfig_init_default, false, Config_PositionConfig_init_default, false, Config_PowerConfig_init_default, false, Config_NetworkConfig_init_default, false, Config_DisplayConfig_init_default, false, Config_LoRaConfig_init_default, false, Config_BluetoothConfig_init_default, 0} -#define LocalModuleConfig_init_default {false, ModuleConfig_MQTTConfig_init_default, false, ModuleConfig_SerialConfig_init_default, false, ModuleConfig_ExternalNotificationConfig_init_default, false, ModuleConfig_StoreForwardConfig_init_default, false, ModuleConfig_RangeTestConfig_init_default, false, ModuleConfig_TelemetryConfig_init_default, false, ModuleConfig_CannedMessageConfig_init_default, 0, false, ModuleConfig_AudioConfig_init_default, false, ModuleConfig_RemoteHardwareConfig_init_default} -#define LocalConfig_init_zero {false, Config_DeviceConfig_init_zero, false, Config_PositionConfig_init_zero, false, Config_PowerConfig_init_zero, false, Config_NetworkConfig_init_zero, false, Config_DisplayConfig_init_zero, false, Config_LoRaConfig_init_zero, false, Config_BluetoothConfig_init_zero, 0} -#define LocalModuleConfig_init_zero {false, ModuleConfig_MQTTConfig_init_zero, false, ModuleConfig_SerialConfig_init_zero, false, ModuleConfig_ExternalNotificationConfig_init_zero, false, ModuleConfig_StoreForwardConfig_init_zero, false, ModuleConfig_RangeTestConfig_init_zero, false, ModuleConfig_TelemetryConfig_init_zero, false, ModuleConfig_CannedMessageConfig_init_zero, 0, false, ModuleConfig_AudioConfig_init_zero, false, ModuleConfig_RemoteHardwareConfig_init_zero} - -/* Field tags (for use in manual encoding/decoding) */ -#define LocalConfig_device_tag 1 -#define LocalConfig_position_tag 2 -#define LocalConfig_power_tag 3 -#define LocalConfig_network_tag 4 -#define LocalConfig_display_tag 5 -#define LocalConfig_lora_tag 6 -#define LocalConfig_bluetooth_tag 7 -#define LocalConfig_version_tag 8 -#define LocalModuleConfig_mqtt_tag 1 -#define LocalModuleConfig_serial_tag 2 -#define LocalModuleConfig_external_notification_tag 3 -#define LocalModuleConfig_store_forward_tag 4 -#define LocalModuleConfig_range_test_tag 5 -#define LocalModuleConfig_telemetry_tag 6 -#define LocalModuleConfig_canned_message_tag 7 -#define LocalModuleConfig_version_tag 8 -#define LocalModuleConfig_audio_tag 9 -#define LocalModuleConfig_remote_hardware_tag 10 - -/* Struct field encoding specification for nanopb */ -#define LocalConfig_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, device, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, position, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, power, 3) \ -X(a, STATIC, OPTIONAL, MESSAGE, network, 4) \ -X(a, STATIC, OPTIONAL, MESSAGE, display, 5) \ -X(a, STATIC, OPTIONAL, MESSAGE, lora, 6) \ -X(a, STATIC, OPTIONAL, MESSAGE, bluetooth, 7) \ -X(a, STATIC, SINGULAR, UINT32, version, 8) -#define LocalConfig_CALLBACK NULL -#define LocalConfig_DEFAULT NULL -#define LocalConfig_device_MSGTYPE Config_DeviceConfig -#define LocalConfig_position_MSGTYPE Config_PositionConfig -#define LocalConfig_power_MSGTYPE Config_PowerConfig -#define LocalConfig_network_MSGTYPE Config_NetworkConfig -#define LocalConfig_display_MSGTYPE Config_DisplayConfig -#define LocalConfig_lora_MSGTYPE Config_LoRaConfig -#define LocalConfig_bluetooth_MSGTYPE Config_BluetoothConfig - -#define LocalModuleConfig_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, mqtt, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, serial, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, external_notification, 3) \ -X(a, STATIC, OPTIONAL, MESSAGE, store_forward, 4) \ -X(a, STATIC, OPTIONAL, MESSAGE, range_test, 5) \ -X(a, STATIC, OPTIONAL, MESSAGE, telemetry, 6) \ -X(a, STATIC, OPTIONAL, MESSAGE, canned_message, 7) \ -X(a, STATIC, SINGULAR, UINT32, version, 8) \ -X(a, STATIC, OPTIONAL, MESSAGE, audio, 9) \ -X(a, STATIC, OPTIONAL, MESSAGE, remote_hardware, 10) -#define LocalModuleConfig_CALLBACK NULL -#define LocalModuleConfig_DEFAULT NULL -#define LocalModuleConfig_mqtt_MSGTYPE ModuleConfig_MQTTConfig -#define LocalModuleConfig_serial_MSGTYPE ModuleConfig_SerialConfig -#define LocalModuleConfig_external_notification_MSGTYPE ModuleConfig_ExternalNotificationConfig -#define LocalModuleConfig_store_forward_MSGTYPE ModuleConfig_StoreForwardConfig -#define LocalModuleConfig_range_test_MSGTYPE ModuleConfig_RangeTestConfig -#define LocalModuleConfig_telemetry_MSGTYPE ModuleConfig_TelemetryConfig -#define LocalModuleConfig_canned_message_MSGTYPE ModuleConfig_CannedMessageConfig -#define LocalModuleConfig_audio_MSGTYPE ModuleConfig_AudioConfig -#define LocalModuleConfig_remote_hardware_MSGTYPE ModuleConfig_RemoteHardwareConfig - -extern const pb_msgdesc_t LocalConfig_msg; -extern const pb_msgdesc_t LocalModuleConfig_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define LocalConfig_fields &LocalConfig_msg -#define LocalModuleConfig_fields &LocalModuleConfig_msg - -/* Maximum encoded size of messages (where known) */ -#define LocalConfig_size 391 -#define LocalModuleConfig_size 412 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/mesh.pb.c b/src/mesh/generated/mesh.pb.c deleted file mode 100644 index 29594c612..000000000 --- a/src/mesh/generated/mesh.pb.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "mesh.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(Position, Position, AUTO) - - -PB_BIND(User, User, AUTO) - - -PB_BIND(RouteDiscovery, RouteDiscovery, AUTO) - - -PB_BIND(Routing, Routing, AUTO) - - -PB_BIND(Data, Data, 2) - - -PB_BIND(Waypoint, Waypoint, AUTO) - - -PB_BIND(MeshPacket, MeshPacket, 2) - - -PB_BIND(NodeInfo, NodeInfo, AUTO) - - -PB_BIND(MyNodeInfo, MyNodeInfo, AUTO) - - -PB_BIND(LogRecord, LogRecord, AUTO) - - -PB_BIND(QueueStatus, QueueStatus, AUTO) - - -PB_BIND(FromRadio, FromRadio, 2) - - -PB_BIND(ToRadio, ToRadio, 2) - - -PB_BIND(Compressed, Compressed, AUTO) - - - - - - - - - - - - diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h deleted file mode 100644 index 4d2c629e0..000000000 --- a/src/mesh/generated/mesh.pb.h +++ /dev/null @@ -1,1159 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_MESH_PB_H_INCLUDED -#define PB_MESH_PB_H_INCLUDED -#include -#include "channel.pb.h" -#include "config.pb.h" -#include "module_config.pb.h" -#include "portnums.pb.h" -#include "telemetry.pb.h" -#include "xmodem.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -/* Note: these enum names must EXACTLY match the string used in the device - bin/build-all.sh script. - Because they will be used to find firmware filenames in the android app for OTA updates. - To match the old style filenames, _ is converted to -, p is converted to . */ -typedef enum _HardwareModel { - /* TODO: REPLACE */ - HardwareModel_UNSET = 0, - /* TODO: REPLACE */ - HardwareModel_TLORA_V2 = 1, - /* TODO: REPLACE */ - HardwareModel_TLORA_V1 = 2, - /* TODO: REPLACE */ - HardwareModel_TLORA_V2_1_1P6 = 3, - /* TODO: REPLACE */ - HardwareModel_TBEAM = 4, - /* The original heltec WiFi_Lora_32_V2, which had battery voltage sensing hooked to GPIO 13 - (see HELTEC_V2 for the new version). */ - HardwareModel_HELTEC_V2_0 = 5, - /* TODO: REPLACE */ - HardwareModel_TBEAM_V0P7 = 6, - /* TODO: REPLACE */ - HardwareModel_T_ECHO = 7, - /* TODO: REPLACE */ - HardwareModel_TLORA_V1_1P3 = 8, - /* TODO: REPLACE */ - HardwareModel_RAK4631 = 9, - /* The new version of the heltec WiFi_Lora_32_V2 board that has battery sensing hooked to GPIO 37. - Sadly they did not update anything on the silkscreen to identify this board */ - HardwareModel_HELTEC_V2_1 = 10, - /* Ancient heltec WiFi_Lora_32 board */ - HardwareModel_HELTEC_V1 = 11, - /* New T-BEAM with ESP32-S3 CPU */ - HardwareModel_LILYGO_TBEAM_S3_CORE = 12, - /* RAK WisBlock ESP32 core: https://docs.rakwireless.com/Product-Categories/WisBlock/RAK11200/Overview/ */ - HardwareModel_RAK11200 = 13, - /* B&Q Consulting Nano Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:nano */ - HardwareModel_NANO_G1 = 14, - /* TODO: REPLACE */ - HardwareModel_TLORA_V2_1_1P8 = 15, - /* TODO: REPLACE */ - HardwareModel_TLORA_T3_S3 = 16, - /* B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station */ - HardwareModel_STATION_G1 = 25, - /* Less common/prototype boards listed here (needs one more byte over the air) */ - HardwareModel_LORA_RELAY_V1 = 32, - /* TODO: REPLACE */ - HardwareModel_NRF52840DK = 33, - /* TODO: REPLACE */ - HardwareModel_PPR = 34, - /* TODO: REPLACE */ - HardwareModel_GENIEBLOCKS = 35, - /* TODO: REPLACE */ - HardwareModel_NRF52_UNKNOWN = 36, - /* TODO: REPLACE */ - HardwareModel_PORTDUINO = 37, - /* The simulator built into the android app */ - HardwareModel_ANDROID_SIM = 38, - /* Custom DIY device based on @NanoVHF schematics: https://github.com/NanoVHF/Meshtastic-DIY/tree/main/Schematics */ - HardwareModel_DIY_V1 = 39, - /* nRF52840 Dongle : https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle/ */ - HardwareModel_NRF52840_PCA10059 = 40, - /* Custom Disaster Radio esp32 v3 device https://github.com/sudomesh/disaster-radio/tree/master/hardware/board_esp32_v3 */ - HardwareModel_DR_DEV = 41, - /* M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, Paper) https://m5stack.com/ */ - HardwareModel_M5STACK = 42, - /* New Heltec LoRA32 with ESP32-S3 CPU */ - HardwareModel_HELTEC_V3 = 43, - /* New Heltec Wireless Stick Lite with ESP32-S3 CPU */ - HardwareModel_HELTEC_WSL_V3 = 44, - /* New BETAFPV ELRS Micro TX Module 2.4G with ESP32 CPU */ - HardwareModel_BETAFPV_2400_TX = 45, - /* Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. */ - HardwareModel_PRIVATE_HW = 255 -} HardwareModel; - -/* Shared constants between device and phone */ -typedef enum _Constants { - /* First enum must be zero, and we are just using this enum to - pass int constants between two very different environments */ - Constants_ZERO = 0, - /* From mesh.options - note: this payload length is ONLY the bytes that are sent inside of the Data protobuf (excluding protobuf overhead). The 16 byte header is - outside of this envelope */ - Constants_DATA_PAYLOAD_LEN = 237 -} Constants; - -/* Error codes for critical errors - The device might report these fault codes on the screen. - If you encounter a fault code, please post on the meshtastic.discourse.group - and we'll try to help. */ -typedef enum _CriticalErrorCode { - /* TODO: REPLACE */ - CriticalErrorCode_NONE = 0, - /* A software bug was detected while trying to send lora */ - CriticalErrorCode_TX_WATCHDOG = 1, - /* A software bug was detected on entry to sleep */ - CriticalErrorCode_SLEEP_ENTER_WAIT = 2, - /* No Lora radio hardware could be found */ - CriticalErrorCode_NO_RADIO = 3, - /* Not normally used */ - CriticalErrorCode_UNSPECIFIED = 4, - /* We failed while configuring a UBlox GPS */ - CriticalErrorCode_UBLOX_UNIT_FAILED = 5, - /* This board was expected to have a power management chip and it is missing or broken */ - CriticalErrorCode_NO_AXP192 = 6, - /* The channel tried to set a radio setting which is not supported by this chipset, - radio comms settings are now undefined. */ - CriticalErrorCode_INVALID_RADIO_SETTING = 7, - /* Radio transmit hardware failure. We sent data to the radio chip, but it didn't - reply with an interrupt. */ - CriticalErrorCode_TRANSMIT_FAILED = 8, - /* We detected that the main CPU voltage dropped below the minumum acceptable value */ - CriticalErrorCode_BROWNOUT = 9, - /* Selftest of SX1262 radio chip failed */ - CriticalErrorCode_SX1262_FAILURE = 10, - /* A (likely software but possibly hardware) failure was detected while trying to send packets. - If this occurs on your board, please post in the forum so that we can ask you to collect some information to allow fixing this bug */ - CriticalErrorCode_RADIO_SPI_BUG = 11 -} CriticalErrorCode; - -/* How the location was acquired: manual, onboard GPS, external (EUD) GPS */ -typedef enum _Position_LocSource { - /* TODO: REPLACE */ - Position_LocSource_LOC_UNSET = 0, - /* TODO: REPLACE */ - Position_LocSource_LOC_MANUAL = 1, - /* TODO: REPLACE */ - Position_LocSource_LOC_INTERNAL = 2, - /* TODO: REPLACE */ - Position_LocSource_LOC_EXTERNAL = 3 -} Position_LocSource; - -/* How the altitude was acquired: manual, GPS int/ext, etc - Default: same as location_source if present */ -typedef enum _Position_AltSource { - /* TODO: REPLACE */ - Position_AltSource_ALT_UNSET = 0, - /* TODO: REPLACE */ - Position_AltSource_ALT_MANUAL = 1, - /* TODO: REPLACE */ - Position_AltSource_ALT_INTERNAL = 2, - /* TODO: REPLACE */ - Position_AltSource_ALT_EXTERNAL = 3, - /* TODO: REPLACE */ - Position_AltSource_ALT_BAROMETRIC = 4 -} Position_AltSource; - -/* A failure in delivering a message (usually used for routing control messages, but might be provided in addition to ack.fail_id to provide - details on the type of failure). */ -typedef enum _Routing_Error { - /* This message is not a failure */ - Routing_Error_NONE = 0, - /* Our node doesn't have a route to the requested destination anymore. */ - Routing_Error_NO_ROUTE = 1, - /* We received a nak while trying to forward on your behalf */ - Routing_Error_GOT_NAK = 2, - /* TODO: REPLACE */ - Routing_Error_TIMEOUT = 3, - /* No suitable interface could be found for delivering this packet */ - Routing_Error_NO_INTERFACE = 4, - /* We reached the max retransmission count (typically for naive flood routing) */ - Routing_Error_MAX_RETRANSMIT = 5, - /* No suitable channel was found for sending this packet (i.e. was requested channel index disabled?) */ - Routing_Error_NO_CHANNEL = 6, - /* The packet was too big for sending (exceeds interface MTU after encoding) */ - Routing_Error_TOO_LARGE = 7, - /* The request had want_response set, the request reached the destination node, but no service on that node wants to send a response - (possibly due to bad channel permissions) */ - Routing_Error_NO_RESPONSE = 8, - /* Cannot send currently because duty cycle regulations will be violated. */ - Routing_Error_DUTY_CYCLE_LIMIT = 9, - /* The application layer service on the remote node received your request, but considered your request somehow invalid */ - Routing_Error_BAD_REQUEST = 32, - /* The application layer service on the remote node received your request, but considered your request not authorized - (i.e you did not send the request on the required bound channel) */ - Routing_Error_NOT_AUTHORIZED = 33 -} Routing_Error; - -/* The priority of this message for sending. - Higher priorities are sent first (when managing the transmit queue). - This field is never sent over the air, it is only used internally inside of a local device node. - API clients (either on the local node or connected directly to the node) - can set this parameter if necessary. - (values must be <= 127 to keep protobuf field to one byte in size. - Detailed background on this field: - I noticed a funny side effect of lora being so slow: Usually when making - a protocol there isn’t much need to use message priority to change the order - of transmission (because interfaces are fairly fast). - But for lora where packets can take a few seconds each, it is very important - to make sure that critical packets are sent ASAP. - In the case of meshtastic that means we want to send protocol acks as soon as possible - (to prevent unneeded retransmissions), we want routing messages to be sent next, - then messages marked as reliable and finally ‘background’ packets like periodic position updates. - So I bit the bullet and implemented a new (internal - not sent over the air) - field in MeshPacket called ‘priority’. - And the transmission queue in the router object is now a priority queue. */ -typedef enum _MeshPacket_Priority { - /* Treated as Priority.DEFAULT */ - MeshPacket_Priority_UNSET = 0, - /* TODO: REPLACE */ - MeshPacket_Priority_MIN = 1, - /* Background position updates are sent with very low priority - - if the link is super congested they might not go out at all */ - MeshPacket_Priority_BACKGROUND = 10, - /* This priority is used for most messages that don't have a priority set */ - MeshPacket_Priority_DEFAULT = 64, - /* If priority is unset but the message is marked as want_ack, - assume it is important and use a slightly higher priority */ - MeshPacket_Priority_RELIABLE = 70, - /* Ack/naks are sent with very high priority to ensure that retransmission - stops as soon as possible */ - MeshPacket_Priority_ACK = 120, - /* TODO: REPLACE */ - MeshPacket_Priority_MAX = 127 -} MeshPacket_Priority; - -/* Identify if this is a delayed packet */ -typedef enum _MeshPacket_Delayed { - /* If unset, the message is being sent in real time. */ - MeshPacket_Delayed_NO_DELAY = 0, - /* The message is delayed and was originally a broadcast */ - MeshPacket_Delayed_DELAYED_BROADCAST = 1, - /* The message is delayed and was originally a direct message */ - MeshPacket_Delayed_DELAYED_DIRECT = 2 -} MeshPacket_Delayed; - -/* Log levels, chosen to match python logging conventions. */ -typedef enum _LogRecord_Level { - /* Log levels, chosen to match python logging conventions. */ - LogRecord_Level_UNSET = 0, - /* Log levels, chosen to match python logging conventions. */ - LogRecord_Level_CRITICAL = 50, - /* Log levels, chosen to match python logging conventions. */ - LogRecord_Level_ERROR = 40, - /* Log levels, chosen to match python logging conventions. */ - LogRecord_Level_WARNING = 30, - /* Log levels, chosen to match python logging conventions. */ - LogRecord_Level_INFO = 20, - /* Log levels, chosen to match python logging conventions. */ - LogRecord_Level_DEBUG = 10, - /* Log levels, chosen to match python logging conventions. */ - LogRecord_Level_TRACE = 5 -} LogRecord_Level; - -/* Struct definitions */ -/* a gps position */ -typedef struct _Position { - /* The new preferred location encoding, multiply by 1e-7 to get degrees - in floating point */ - int32_t latitude_i; - /* TODO: REPLACE */ - int32_t longitude_i; - /* In meters above MSL (but see issue #359) */ - int32_t altitude; - /* This is usually not sent over the mesh (to save space), but it is sent - from the phone so that the local device can set its RTC If it is sent over - the mesh (because there are devices on the mesh without GPS), it will only - be sent by devices which has a hardware GPS clock. - seconds since 1970 */ - uint32_t time; - /* TODO: REPLACE */ - Position_LocSource location_source; - /* TODO: REPLACE */ - Position_AltSource altitude_source; - /* Positional timestamp (actual timestamp of GPS solution) in integer epoch seconds */ - uint32_t timestamp; - /* Pos. timestamp milliseconds adjustment (rarely available or required) */ - int32_t timestamp_millis_adjust; - /* HAE altitude in meters - can be used instead of MSL altitude */ - int32_t altitude_hae; - /* Geoidal separation in meters */ - int32_t altitude_geoidal_separation; - /* Horizontal, Vertical and Position Dilution of Precision, in 1/100 units - - PDOP is sufficient for most cases - - for higher precision scenarios, HDOP and VDOP can be used instead, - in which case PDOP becomes redundant (PDOP=sqrt(HDOP^2 + VDOP^2)) - TODO: REMOVE/INTEGRATE */ - uint32_t PDOP; - /* TODO: REPLACE */ - uint32_t HDOP; - /* TODO: REPLACE */ - uint32_t VDOP; - /* GPS accuracy (a hardware specific constant) in mm - multiplied with DOP to calculate positional accuracy - Default: "'bout three meters-ish" :) */ - uint32_t gps_accuracy; - /* Ground speed in m/s and True North TRACK in 1/100 degrees - Clarification of terms: - - "track" is the direction of motion (measured in horizontal plane) - - "heading" is where the fuselage points (measured in horizontal plane) - - "yaw" indicates a relative rotation about the vertical axis - TODO: REMOVE/INTEGRATE */ - uint32_t ground_speed; - /* TODO: REPLACE */ - uint32_t ground_track; - /* GPS fix quality (from NMEA GxGGA statement or similar) */ - uint32_t fix_quality; - /* GPS fix type 2D/3D (from NMEA GxGSA statement) */ - uint32_t fix_type; - /* GPS "Satellites in View" number */ - uint32_t sats_in_view; - /* Sensor ID - in case multiple positioning sensors are being used */ - uint32_t sensor_id; - /* Estimated/expected time (in seconds) until next update: - - if we update at fixed intervals of X seconds, use X - - if we update at dynamic intervals (based on relative movement etc), - but "AT LEAST every Y seconds", use Y */ - uint32_t next_update; - /* A sequence number, incremented with each Position message to help - detect lost updates if needed */ - uint32_t seq_number; -} Position; - -/* Broadcast when a newly powered mesh node wants to find a node num it can use - Sent from the phone over bluetooth to set the user id for the owner of this node. - Also sent from nodes to each other when a new node signs on (so all clients can have this info) - The algorithm is as follows: - when a node starts up, it broadcasts their user and the normal flow is for all - other nodes to reply with their User as well (so the new node can build its nodedb) - If a node ever receives a User (not just the first broadcast) message where - the sender node number equals our node number, that indicates a collision has - occurred and the following steps should happen: - If the receiving node (that was already in the mesh)'s macaddr is LOWER than the - new User who just tried to sign in: it gets to keep its nodenum. - We send a broadcast message of OUR User (we use a broadcast so that the other node can - receive our message, considering we have the same id - it also serves to let - observers correct their nodedb) - this case is rare so it should be okay. - If any node receives a User where the macaddr is GTE than their local macaddr, - they have been vetoed and should pick a new random nodenum (filtering against - whatever it knows about the nodedb) and rebroadcast their User. - A few nodenums are reserved and will never be requested: - 0xff - broadcast - 0 through 3 - for future use */ -typedef struct _User { - /* A globally unique ID string for this user. - In the case of Signal that would mean +16504442323, for the default macaddr derived id it would be !<8 hexidecimal bytes>. - Note: app developers are encouraged to also use the following standard - node IDs "^all" (for broadcast), "^local" (for the locally connected node) */ - char id[16]; - /* A full name for this user, i.e. "Kevin Hester" */ - char long_name[40]; - /* A VERY short name, ideally two characters. - Suitable for a tiny OLED screen */ - char short_name[5]; - /* This is the addr of the radio. - Not populated by the phone, but added by the esp32 when broadcasting */ - pb_byte_t macaddr[6]; - /* TBEAM, HELTEC, etc... - Starting in 1.2.11 moved to hw_model enum in the NodeInfo object. - Apps will still need the string here for older builds - (so OTA update can find the right image), but if the enum is available it will be used instead. */ - HardwareModel hw_model; - /* In some regions Ham radio operators have different bandwidth limitations than others. - If this user is a licensed operator, set this flag. - Also, "long_name" should be their licence number. */ - bool is_licensed; -} User; - -/* A message used in our Dynamic Source Routing protocol (RFC 4728 based) */ -typedef struct _RouteDiscovery { - /* The list of nodenums this packet has visited so far */ - pb_size_t route_count; - uint32_t route[8]; -} RouteDiscovery; - -/* A Routing control Data packet handled by the routing module */ -typedef struct _Routing { - pb_size_t which_variant; - union { - /* A route request going from the requester */ - RouteDiscovery route_request; - /* A route reply */ - RouteDiscovery route_reply; - /* A failure in delivering a message (usually used for routing control messages, but might be provided - in addition to ack.fail_id to provide details on the type of failure). */ - Routing_Error error_reason; - }; -} Routing; - -typedef PB_BYTES_ARRAY_T(237) Data_payload_t; -/* (Formerly called SubPacket) - The payload portion fo a packet, this is the actual bytes that are sent - inside a radio packet (because from/to are broken out by the comms library) */ -typedef struct _Data { - /* Formerly named typ and of type Type */ - PortNum portnum; - /* TODO: REPLACE */ - Data_payload_t payload; - /* Not normally used, but for testing a sender can request that recipient - responds in kind (i.e. if it received a position, it should unicast back it's position). - Note: that if you set this on a broadcast you will receive many replies. */ - bool want_response; - /* The address of the destination node. - This field is is filled in by the mesh radio device software, application - layer software should never need it. - RouteDiscovery messages _must_ populate this. - Other message types might need to if they are doing multihop routing. */ - uint32_t dest; - /* The address of the original sender for this message. - This field should _only_ be populated for reliable multihop packets (to keep - packets small). */ - uint32_t source; - /* Only used in routing or response messages. - Indicates the original message ID that this message is reporting failure on. (formerly called original_id) */ - uint32_t request_id; - /* If set, this message is intened to be a reply to a previously sent message with the defined id. */ - uint32_t reply_id; - /* Defaults to false. If true, then what is in the payload should be treated as an emoji like giving - a message a heart or poop emoji. */ - uint32_t emoji; -} Data; - -/* Waypoint message, used to share arbitrary locations across the mesh */ -typedef struct _Waypoint { - /* Id of the waypoint */ - uint32_t id; - /* latitude_i */ - int32_t latitude_i; - /* longitude_i */ - int32_t longitude_i; - /* Time the waypoint is to expire (epoch) */ - uint32_t expire; - /* If greater than zero, treat the value as a nodenum only allowing them to update the waypoint. - If zero, the waypoint is open to be edited by any member of the mesh. */ - uint32_t locked_to; - /* Name of the waypoint - max 30 chars */ - char name[30]; - /* Description of the waypoint - max 100 chars */ - char description[100]; - /* Designator icon for the waypoint in the form of a unicode emoji */ - uint32_t icon; -} Waypoint; - -typedef PB_BYTES_ARRAY_T(256) MeshPacket_encrypted_t; -/* A packet envelope sent/received over the mesh - only payload_variant is sent in the payload portion of the LORA packet. - The other fields are either not sent at all, or sent in the special 16 byte LORA header. */ -typedef struct _MeshPacket { - /* The sending node number. - Note: Our crypto implementation uses this field as well. - See [crypto](/docs/overview/encryption) for details. - FIXME - really should be fixed32 instead, this encoding only hurts the ble link though. */ - uint32_t from; - /* The (immediatSee Priority description for more details.y should be fixed32 instead, this encoding only - hurts the ble link though. */ - uint32_t to; - /* (Usually) If set, this indicates the index in the secondary_channels table that this packet was sent/received on. - If unset, packet was on the primary channel. - A particular node might know only a subset of channels in use on the mesh. - Therefore channel_index is inherently a local concept and meaningless to send between nodes. - Very briefly, while sending and receiving deep inside the device Router code, this field instead - contains the 'channel hash' instead of the index. - This 'trick' is only used while the payload_variant is an 'encrypted'. */ - uint8_t channel; - pb_size_t which_payload_variant; - union { - /* TODO: REPLACE */ - Data decoded; - /* TODO: REPLACE */ - MeshPacket_encrypted_t encrypted; - }; - /* A unique ID for this packet. - Always 0 for no-ack packets or non broadcast packets (and therefore take zero bytes of space). - Otherwise a unique ID for this packet, useful for flooding algorithms. - ID only needs to be unique on a _per sender_ basis, and it only - needs to be unique for a few minutes (long enough to last for the length of - any ACK or the completion of a mesh broadcast flood). - Note: Our crypto implementation uses this id as well. - See [crypto](/docs/overview/encryption) for details. - FIXME - really should be fixed32 instead, this encoding only - hurts the ble link though. */ - uint32_t id; - /* The time this message was received by the esp32 (secs since 1970). - Note: this field is _never_ sent on the radio link itself (to save space) Times - are typically not sent over the mesh, but they will be added to any Packet - (chain of SubPacket) sent to the phone (so the phone can know exact time of reception) */ - uint32_t rx_time; - /* *Never* sent over the radio links. - Set during reception to indicate the SNR of this packet. - Used to collect statistics on current link quality. */ - float rx_snr; - /* If unset treated as zero (no forwarding, send to adjacent nodes only) - if 1, allow hopping through one node, etc... - For our usecase real world topologies probably have a max of about 3. - This field is normally placed into a few of bits in the header. */ - uint8_t hop_limit; - /* This packet is being sent as a reliable message, we would prefer it to arrive at the destination. - We would like to receive a ack packet in response. - Broadcasts messages treat this flag specially: Since acks for broadcasts would - rapidly flood the channel, the normal ack behavior is suppressed. - Instead, the original sender listens to see if at least one node is rebroadcasting this packet (because naive flooding algorithm). - If it hears that the odds (given typical LoRa topologies) the odds are very high that every node should eventually receive the message. - So FloodingRouter.cpp generates an implicit ack which is delivered to the original sender. - If after some time we don't hear anyone rebroadcast our packet, we will timeout and retransmit, using the regular resend logic. - Note: This flag is normally sent in a flag bit in the header when sent over the wire */ - bool want_ack; - /* The priority of this message for sending. - See MeshPacket.Priority description for more details. */ - MeshPacket_Priority priority; - /* rssi of received packet. Only sent to phone for dispay purposes. */ - int32_t rx_rssi; - /* Describe if this message is delayed */ - MeshPacket_Delayed delayed; -} MeshPacket; - -/* The bluetooth to device link: - Old BTLE protocol docs from TODO, merge in above and make real docs... - use protocol buffers, and NanoPB - messages from device to phone: - POSITION_UPDATE (..., time) - TEXT_RECEIVED(from, text, time) - OPAQUE_RECEIVED(from, payload, time) (for signal messages or other applications) - messages from phone to device: - SET_MYID(id, human readable long, human readable short) (send down the unique ID - string used for this node, a human readable string shown for that id, and a very - short human readable string suitable for oled screen) SEND_OPAQUE(dest, payload) - (for signal messages or other applications) SEND_TEXT(dest, text) Get all - nodes() (returns list of nodes, with full info, last time seen, loc, battery - level etc) SET_CONFIG (switches device to a new set of radio params and - preshared key, drops all existing nodes, force our node to rejoin this new group) - Full information about a node on the mesh */ -typedef struct _NodeInfo { - /* The node number */ - uint32_t num; - /* The user info for this node */ - bool has_user; - User user; - /* This position data. Note: before 1.2.14 we would also store the last time we've heard from this node in position.time, that is no longer true. - Position.time now indicates the last time we received a POSITION from that node. */ - bool has_position; - Position position; - /* Returns the Signal-to-noise ratio (SNR) of the last received message, - as measured by the receiver. Return SNR of the last received message in dB */ - float snr; - /* Set to indicate the last time we received a packet from this node */ - uint32_t last_heard; - /* The latest device metrics for the node. */ - bool has_device_metrics; - DeviceMetrics device_metrics; -} NodeInfo; - -/* Unique local debugging info for this node - Note: we don't include position or the user info, because that will come in the - Sent to the phone in response to WantNodes. */ -typedef struct _MyNodeInfo { - /* Tells the phone what our node number is, default starting value is - lowbyte of macaddr, but it will be fixed if that is already in use */ - uint32_t my_node_num; - /* Note: This flag merely means we detected a hardware GPS in our node. - Not the same as UserPreferences.location_sharing */ - bool has_gps; - /* The maximum number of 'software' channels that can be set on this node. */ - uint32_t max_channels; - /* 0.0.5 etc... */ - char firmware_version[18]; - /* An error message we'd like to report back to the mothership through analytics. - It indicates a serious bug occurred on the device, the device coped with it, - but we still want to tell the devs about the bug. - This field will be cleared after the phone reads MyNodeInfo - (i.e. it will only be reported once) - a numeric error code to go with error message, zero means no error */ - CriticalErrorCode error_code; - /* A numeric error address (nonzero if available) */ - uint32_t error_address; - /* The total number of errors this node has ever encountered - (well - since the last time we discarded preferences) */ - uint32_t error_count; - /* The total number of reboots this node has ever encountered - (well - since the last time we discarded preferences) */ - uint32_t reboot_count; - /* Calculated bitrate of the current channel (in Bytes Per Second) */ - float bitrate; - /* How long before we consider a message abandoned and we can clear our - caches of any messages in flight Normally quite large to handle the worst case - message delivery time, 5 minutes. - Formerly called FLOOD_EXPIRE_TIME in the device code */ - uint32_t message_timeout_msec; - /* The minimum app version that can talk to this device. - Phone/PC apps should compare this to their build number and if too low tell the user they must update their app */ - uint32_t min_app_version; - /* 24 time windows of 1hr each with the airtime transmitted out of the device per hour. */ - pb_size_t air_period_tx_count; - uint32_t air_period_tx[8]; - /* 24 time windows of 1hr each with the airtime of valid packets for your mesh. */ - pb_size_t air_period_rx_count; - uint32_t air_period_rx[8]; - /* Is the device wifi capable? */ - bool has_wifi; - /* Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise). */ - float channel_utilization; - /* Percent of airtime for transmission used within the last hour. */ - float air_util_tx; -} MyNodeInfo; - -/* Debug output from the device. - To minimize the size of records inside the device code, if a time/source/level is not set - on the message it is assumed to be a continuation of the previously sent message. - This allows the device code to use fixed maxlen 64 byte strings for messages, - and then extend as needed by emitting multiple records. */ -typedef struct _LogRecord { - /* Log levels, chosen to match python logging conventions. */ - char message[64]; - /* Seconds since 1970 - or 0 for unknown/unset */ - uint32_t time; - /* Usually based on thread name - if known */ - char source[8]; - /* Not yet set */ - LogRecord_Level level; -} LogRecord; - -typedef struct _QueueStatus { - /* Last attempt to queue status, ErrorCode */ - int8_t res; - /* Free entries in the outgoing queue */ - uint8_t free; - /* Maximum entries in the outgoing queue */ - uint8_t maxlen; - /* What was mesh packet id that generated this response? */ - uint32_t mesh_packet_id; -} QueueStatus; - -/* Packets from the radio to the phone will appear on the fromRadio characteristic. - It will support READ and NOTIFY. When a new packet arrives the device will BLE notify? - It will sit in that descriptor until consumed by the phone, - at which point the next item in the FIFO will be populated. */ -typedef struct _FromRadio { - /* The packet id, used to allow the phone to request missing read packets from the FIFO, - see our bluetooth docs */ - uint32_t id; - pb_size_t which_payload_variant; - union { - /* Log levels, chosen to match python logging conventions. */ - MeshPacket packet; - /* Tells the phone what our node number is, can be -1 if we've not yet joined a mesh. - NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps. */ - MyNodeInfo my_info; - /* One packet is sent for each node in the on radio DB - starts over with the first node in our DB */ - NodeInfo node_info; - /* Include a part of the config (was: RadioConfig radio) */ - Config config; - /* Set to send debug console output over our protobuf stream */ - LogRecord log_record; - /* Sent as true once the device has finished sending all of the responses to want_config - recipient should check if this ID matches our original request nonce, if - not, it means your config responses haven't started yet. - NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps. */ - uint32_t config_complete_id; - /* Sent to tell clients the radio has just rebooted. - Set to true if present. - Not used on all transports, currently just used for the serial console. - NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps. */ - bool rebooted; - /* Include module config */ - ModuleConfig moduleConfig; - /* One packet is sent for each channel */ - Channel channel; - /* Queue status info */ - QueueStatus queueStatus; - /* File Transfer Chunk */ - XModem xmodemPacket; - }; -} FromRadio; - -/* Packets/commands to the radio will be written (reliably) to the toRadio characteristic. - Once the write completes the phone can assume it is handled. */ -typedef struct _ToRadio { - pb_size_t which_payload_variant; - union { - /* Send this packet on the mesh */ - MeshPacket packet; - /* Phone wants radio to send full node db to the phone, This is - typically the first packet sent to the radio when the phone gets a - bluetooth connection. The radio will respond by sending back a - MyNodeInfo, a owner, a radio config and a series of - FromRadio.node_infos, and config_complete - the integer you write into this field will be reported back in the - config_complete_id response this allows clients to never be confused by - a stale old partially sent config. */ - uint32_t want_config_id; - /* Tell API server we are disconnecting now. - This is useful for serial links where there is no hardware/protocol based notification that the client has dropped the link. - (Sending this message is optional for clients) */ - bool disconnect; - /* File Transfer Chunk */ - XModem xmodemPacket; - }; -} ToRadio; - -typedef PB_BYTES_ARRAY_T(237) Compressed_data_t; -/* Compressed message payload */ -typedef struct _Compressed { - /* PortNum to determine the how to handle the compressed payload. */ - PortNum portnum; - /* Compressed data. */ - Compressed_data_t data; -} Compressed; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Helper constants for enums */ -#define _HardwareModel_MIN HardwareModel_UNSET -#define _HardwareModel_MAX HardwareModel_PRIVATE_HW -#define _HardwareModel_ARRAYSIZE ((HardwareModel)(HardwareModel_PRIVATE_HW+1)) - -#define _Constants_MIN Constants_ZERO -#define _Constants_MAX Constants_DATA_PAYLOAD_LEN -#define _Constants_ARRAYSIZE ((Constants)(Constants_DATA_PAYLOAD_LEN+1)) - -#define _CriticalErrorCode_MIN CriticalErrorCode_NONE -#define _CriticalErrorCode_MAX CriticalErrorCode_RADIO_SPI_BUG -#define _CriticalErrorCode_ARRAYSIZE ((CriticalErrorCode)(CriticalErrorCode_RADIO_SPI_BUG+1)) - -#define _Position_LocSource_MIN Position_LocSource_LOC_UNSET -#define _Position_LocSource_MAX Position_LocSource_LOC_EXTERNAL -#define _Position_LocSource_ARRAYSIZE ((Position_LocSource)(Position_LocSource_LOC_EXTERNAL+1)) - -#define _Position_AltSource_MIN Position_AltSource_ALT_UNSET -#define _Position_AltSource_MAX Position_AltSource_ALT_BAROMETRIC -#define _Position_AltSource_ARRAYSIZE ((Position_AltSource)(Position_AltSource_ALT_BAROMETRIC+1)) - -#define _Routing_Error_MIN Routing_Error_NONE -#define _Routing_Error_MAX Routing_Error_NOT_AUTHORIZED -#define _Routing_Error_ARRAYSIZE ((Routing_Error)(Routing_Error_NOT_AUTHORIZED+1)) - -#define _MeshPacket_Priority_MIN MeshPacket_Priority_UNSET -#define _MeshPacket_Priority_MAX MeshPacket_Priority_MAX -#define _MeshPacket_Priority_ARRAYSIZE ((MeshPacket_Priority)(MeshPacket_Priority_MAX+1)) - -#define _MeshPacket_Delayed_MIN MeshPacket_Delayed_NO_DELAY -#define _MeshPacket_Delayed_MAX MeshPacket_Delayed_DELAYED_DIRECT -#define _MeshPacket_Delayed_ARRAYSIZE ((MeshPacket_Delayed)(MeshPacket_Delayed_DELAYED_DIRECT+1)) - -#define _LogRecord_Level_MIN LogRecord_Level_UNSET -#define _LogRecord_Level_MAX LogRecord_Level_CRITICAL -#define _LogRecord_Level_ARRAYSIZE ((LogRecord_Level)(LogRecord_Level_CRITICAL+1)) - -#define Position_location_source_ENUMTYPE Position_LocSource -#define Position_altitude_source_ENUMTYPE Position_AltSource - -#define User_hw_model_ENUMTYPE HardwareModel - - -#define Routing_variant_error_reason_ENUMTYPE Routing_Error - -#define Data_portnum_ENUMTYPE PortNum - - -#define MeshPacket_priority_ENUMTYPE MeshPacket_Priority -#define MeshPacket_delayed_ENUMTYPE MeshPacket_Delayed - - -#define MyNodeInfo_error_code_ENUMTYPE CriticalErrorCode - -#define LogRecord_level_ENUMTYPE LogRecord_Level - - - - -#define Compressed_portnum_ENUMTYPE PortNum - - -/* Initializer values for message structs */ -#define Position_init_default {0, 0, 0, 0, _Position_LocSource_MIN, _Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -#define User_init_default {"", "", "", {0}, _HardwareModel_MIN, 0} -#define RouteDiscovery_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}} -#define Routing_init_default {0, {RouteDiscovery_init_default}} -#define Data_init_default {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0} -#define Waypoint_init_default {0, 0, 0, 0, 0, "", "", 0} -#define MeshPacket_init_default {0, 0, 0, 0, {Data_init_default}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN} -#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0, false, DeviceMetrics_init_default} -#define MyNodeInfo_init_default {0, 0, 0, "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} -#define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN} -#define QueueStatus_init_default {0, 0, 0, 0} -#define FromRadio_init_default {0, 0, {MeshPacket_init_default}} -#define ToRadio_init_default {0, {MeshPacket_init_default}} -#define Compressed_init_default {_PortNum_MIN, {0, {0}}} -#define Position_init_zero {0, 0, 0, 0, _Position_LocSource_MIN, _Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -#define User_init_zero {"", "", "", {0}, _HardwareModel_MIN, 0} -#define RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}} -#define Routing_init_zero {0, {RouteDiscovery_init_zero}} -#define Data_init_zero {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0} -#define Waypoint_init_zero {0, 0, 0, 0, 0, "", "", 0} -#define MeshPacket_init_zero {0, 0, 0, 0, {Data_init_zero}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN} -#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0, false, DeviceMetrics_init_zero} -#define MyNodeInfo_init_zero {0, 0, 0, "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} -#define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN} -#define QueueStatus_init_zero {0, 0, 0, 0} -#define FromRadio_init_zero {0, 0, {MeshPacket_init_zero}} -#define ToRadio_init_zero {0, {MeshPacket_init_zero}} -#define Compressed_init_zero {_PortNum_MIN, {0, {0}}} - -/* Field tags (for use in manual encoding/decoding) */ -#define Position_latitude_i_tag 1 -#define Position_longitude_i_tag 2 -#define Position_altitude_tag 3 -#define Position_time_tag 4 -#define Position_location_source_tag 5 -#define Position_altitude_source_tag 6 -#define Position_timestamp_tag 7 -#define Position_timestamp_millis_adjust_tag 8 -#define Position_altitude_hae_tag 9 -#define Position_altitude_geoidal_separation_tag 10 -#define Position_PDOP_tag 11 -#define Position_HDOP_tag 12 -#define Position_VDOP_tag 13 -#define Position_gps_accuracy_tag 14 -#define Position_ground_speed_tag 15 -#define Position_ground_track_tag 16 -#define Position_fix_quality_tag 17 -#define Position_fix_type_tag 18 -#define Position_sats_in_view_tag 19 -#define Position_sensor_id_tag 20 -#define Position_next_update_tag 21 -#define Position_seq_number_tag 22 -#define User_id_tag 1 -#define User_long_name_tag 2 -#define User_short_name_tag 3 -#define User_macaddr_tag 4 -#define User_hw_model_tag 5 -#define User_is_licensed_tag 6 -#define RouteDiscovery_route_tag 1 -#define Routing_route_request_tag 1 -#define Routing_route_reply_tag 2 -#define Routing_error_reason_tag 3 -#define Data_portnum_tag 1 -#define Data_payload_tag 2 -#define Data_want_response_tag 3 -#define Data_dest_tag 4 -#define Data_source_tag 5 -#define Data_request_id_tag 6 -#define Data_reply_id_tag 7 -#define Data_emoji_tag 8 -#define Waypoint_id_tag 1 -#define Waypoint_latitude_i_tag 2 -#define Waypoint_longitude_i_tag 3 -#define Waypoint_expire_tag 4 -#define Waypoint_locked_to_tag 5 -#define Waypoint_name_tag 6 -#define Waypoint_description_tag 7 -#define Waypoint_icon_tag 8 -#define MeshPacket_from_tag 1 -#define MeshPacket_to_tag 2 -#define MeshPacket_channel_tag 3 -#define MeshPacket_decoded_tag 4 -#define MeshPacket_encrypted_tag 5 -#define MeshPacket_id_tag 6 -#define MeshPacket_rx_time_tag 7 -#define MeshPacket_rx_snr_tag 8 -#define MeshPacket_hop_limit_tag 9 -#define MeshPacket_want_ack_tag 10 -#define MeshPacket_priority_tag 11 -#define MeshPacket_rx_rssi_tag 12 -#define MeshPacket_delayed_tag 13 -#define NodeInfo_num_tag 1 -#define NodeInfo_user_tag 2 -#define NodeInfo_position_tag 3 -#define NodeInfo_snr_tag 4 -#define NodeInfo_last_heard_tag 5 -#define NodeInfo_device_metrics_tag 6 -#define MyNodeInfo_my_node_num_tag 1 -#define MyNodeInfo_has_gps_tag 2 -#define MyNodeInfo_max_channels_tag 3 -#define MyNodeInfo_firmware_version_tag 4 -#define MyNodeInfo_error_code_tag 5 -#define MyNodeInfo_error_address_tag 6 -#define MyNodeInfo_error_count_tag 7 -#define MyNodeInfo_reboot_count_tag 8 -#define MyNodeInfo_bitrate_tag 9 -#define MyNodeInfo_message_timeout_msec_tag 10 -#define MyNodeInfo_min_app_version_tag 11 -#define MyNodeInfo_air_period_tx_tag 12 -#define MyNodeInfo_air_period_rx_tag 13 -#define MyNodeInfo_has_wifi_tag 14 -#define MyNodeInfo_channel_utilization_tag 15 -#define MyNodeInfo_air_util_tx_tag 16 -#define LogRecord_message_tag 1 -#define LogRecord_time_tag 2 -#define LogRecord_source_tag 3 -#define LogRecord_level_tag 4 -#define QueueStatus_res_tag 1 -#define QueueStatus_free_tag 2 -#define QueueStatus_maxlen_tag 3 -#define QueueStatus_mesh_packet_id_tag 4 -#define FromRadio_id_tag 1 -#define FromRadio_packet_tag 2 -#define FromRadio_my_info_tag 3 -#define FromRadio_node_info_tag 4 -#define FromRadio_config_tag 5 -#define FromRadio_log_record_tag 6 -#define FromRadio_config_complete_id_tag 7 -#define FromRadio_rebooted_tag 8 -#define FromRadio_moduleConfig_tag 9 -#define FromRadio_channel_tag 10 -#define FromRadio_queueStatus_tag 11 -#define FromRadio_xmodemPacket_tag 12 -#define ToRadio_packet_tag 1 -#define ToRadio_want_config_id_tag 3 -#define ToRadio_disconnect_tag 4 -#define ToRadio_xmodemPacket_tag 5 -#define Compressed_portnum_tag 1 -#define Compressed_data_tag 2 - -/* Struct field encoding specification for nanopb */ -#define Position_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, SFIXED32, latitude_i, 1) \ -X(a, STATIC, SINGULAR, SFIXED32, longitude_i, 2) \ -X(a, STATIC, SINGULAR, INT32, altitude, 3) \ -X(a, STATIC, SINGULAR, FIXED32, time, 4) \ -X(a, STATIC, SINGULAR, UENUM, location_source, 5) \ -X(a, STATIC, SINGULAR, UENUM, altitude_source, 6) \ -X(a, STATIC, SINGULAR, FIXED32, timestamp, 7) \ -X(a, STATIC, SINGULAR, INT32, timestamp_millis_adjust, 8) \ -X(a, STATIC, SINGULAR, SINT32, altitude_hae, 9) \ -X(a, STATIC, SINGULAR, SINT32, altitude_geoidal_separation, 10) \ -X(a, STATIC, SINGULAR, UINT32, PDOP, 11) \ -X(a, STATIC, SINGULAR, UINT32, HDOP, 12) \ -X(a, STATIC, SINGULAR, UINT32, VDOP, 13) \ -X(a, STATIC, SINGULAR, UINT32, gps_accuracy, 14) \ -X(a, STATIC, SINGULAR, UINT32, ground_speed, 15) \ -X(a, STATIC, SINGULAR, UINT32, ground_track, 16) \ -X(a, STATIC, SINGULAR, UINT32, fix_quality, 17) \ -X(a, STATIC, SINGULAR, UINT32, fix_type, 18) \ -X(a, STATIC, SINGULAR, UINT32, sats_in_view, 19) \ -X(a, STATIC, SINGULAR, UINT32, sensor_id, 20) \ -X(a, STATIC, SINGULAR, UINT32, next_update, 21) \ -X(a, STATIC, SINGULAR, UINT32, seq_number, 22) -#define Position_CALLBACK NULL -#define Position_DEFAULT NULL - -#define User_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, STRING, id, 1) \ -X(a, STATIC, SINGULAR, STRING, long_name, 2) \ -X(a, STATIC, SINGULAR, STRING, short_name, 3) \ -X(a, STATIC, SINGULAR, FIXED_LENGTH_BYTES, macaddr, 4) \ -X(a, STATIC, SINGULAR, UENUM, hw_model, 5) \ -X(a, STATIC, SINGULAR, BOOL, is_licensed, 6) -#define User_CALLBACK NULL -#define User_DEFAULT NULL - -#define RouteDiscovery_FIELDLIST(X, a) \ -X(a, STATIC, REPEATED, FIXED32, route, 1) -#define RouteDiscovery_CALLBACK NULL -#define RouteDiscovery_DEFAULT NULL - -#define Routing_FIELDLIST(X, a) \ -X(a, STATIC, ONEOF, MESSAGE, (variant,route_request,route_request), 1) \ -X(a, STATIC, ONEOF, MESSAGE, (variant,route_reply,route_reply), 2) \ -X(a, STATIC, ONEOF, UENUM, (variant,error_reason,error_reason), 3) -#define Routing_CALLBACK NULL -#define Routing_DEFAULT NULL -#define Routing_variant_route_request_MSGTYPE RouteDiscovery -#define Routing_variant_route_reply_MSGTYPE RouteDiscovery - -#define Data_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UENUM, portnum, 1) \ -X(a, STATIC, SINGULAR, BYTES, payload, 2) \ -X(a, STATIC, SINGULAR, BOOL, want_response, 3) \ -X(a, STATIC, SINGULAR, FIXED32, dest, 4) \ -X(a, STATIC, SINGULAR, FIXED32, source, 5) \ -X(a, STATIC, SINGULAR, FIXED32, request_id, 6) \ -X(a, STATIC, SINGULAR, FIXED32, reply_id, 7) \ -X(a, STATIC, SINGULAR, FIXED32, emoji, 8) -#define Data_CALLBACK NULL -#define Data_DEFAULT NULL - -#define Waypoint_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, id, 1) \ -X(a, STATIC, SINGULAR, SFIXED32, latitude_i, 2) \ -X(a, STATIC, SINGULAR, SFIXED32, longitude_i, 3) \ -X(a, STATIC, SINGULAR, UINT32, expire, 4) \ -X(a, STATIC, SINGULAR, UINT32, locked_to, 5) \ -X(a, STATIC, SINGULAR, STRING, name, 6) \ -X(a, STATIC, SINGULAR, STRING, description, 7) \ -X(a, STATIC, SINGULAR, FIXED32, icon, 8) -#define Waypoint_CALLBACK NULL -#define Waypoint_DEFAULT NULL - -#define MeshPacket_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, FIXED32, from, 1) \ -X(a, STATIC, SINGULAR, FIXED32, to, 2) \ -X(a, STATIC, SINGULAR, UINT32, channel, 3) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,decoded,decoded), 4) \ -X(a, STATIC, ONEOF, BYTES, (payload_variant,encrypted,encrypted), 5) \ -X(a, STATIC, SINGULAR, FIXED32, id, 6) \ -X(a, STATIC, SINGULAR, FIXED32, rx_time, 7) \ -X(a, STATIC, SINGULAR, FLOAT, rx_snr, 8) \ -X(a, STATIC, SINGULAR, UINT32, hop_limit, 9) \ -X(a, STATIC, SINGULAR, BOOL, want_ack, 10) \ -X(a, STATIC, SINGULAR, UENUM, priority, 11) \ -X(a, STATIC, SINGULAR, INT32, rx_rssi, 12) \ -X(a, STATIC, SINGULAR, UENUM, delayed, 13) -#define MeshPacket_CALLBACK NULL -#define MeshPacket_DEFAULT NULL -#define MeshPacket_payload_variant_decoded_MSGTYPE Data - -#define NodeInfo_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, num, 1) \ -X(a, STATIC, OPTIONAL, MESSAGE, user, 2) \ -X(a, STATIC, OPTIONAL, MESSAGE, position, 3) \ -X(a, STATIC, SINGULAR, FLOAT, snr, 4) \ -X(a, STATIC, SINGULAR, FIXED32, last_heard, 5) \ -X(a, STATIC, OPTIONAL, MESSAGE, device_metrics, 6) -#define NodeInfo_CALLBACK NULL -#define NodeInfo_DEFAULT NULL -#define NodeInfo_user_MSGTYPE User -#define NodeInfo_position_MSGTYPE Position -#define NodeInfo_device_metrics_MSGTYPE DeviceMetrics - -#define MyNodeInfo_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, my_node_num, 1) \ -X(a, STATIC, SINGULAR, BOOL, has_gps, 2) \ -X(a, STATIC, SINGULAR, UINT32, max_channels, 3) \ -X(a, STATIC, SINGULAR, STRING, firmware_version, 4) \ -X(a, STATIC, SINGULAR, UENUM, error_code, 5) \ -X(a, STATIC, SINGULAR, UINT32, error_address, 6) \ -X(a, STATIC, SINGULAR, UINT32, error_count, 7) \ -X(a, STATIC, SINGULAR, UINT32, reboot_count, 8) \ -X(a, STATIC, SINGULAR, FLOAT, bitrate, 9) \ -X(a, STATIC, SINGULAR, UINT32, message_timeout_msec, 10) \ -X(a, STATIC, SINGULAR, UINT32, min_app_version, 11) \ -X(a, STATIC, REPEATED, UINT32, air_period_tx, 12) \ -X(a, STATIC, REPEATED, UINT32, air_period_rx, 13) \ -X(a, STATIC, SINGULAR, BOOL, has_wifi, 14) \ -X(a, STATIC, SINGULAR, FLOAT, channel_utilization, 15) \ -X(a, STATIC, SINGULAR, FLOAT, air_util_tx, 16) -#define MyNodeInfo_CALLBACK NULL -#define MyNodeInfo_DEFAULT NULL - -#define LogRecord_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, STRING, message, 1) \ -X(a, STATIC, SINGULAR, FIXED32, time, 2) \ -X(a, STATIC, SINGULAR, STRING, source, 3) \ -X(a, STATIC, SINGULAR, UENUM, level, 4) -#define LogRecord_CALLBACK NULL -#define LogRecord_DEFAULT NULL - -#define QueueStatus_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, INT32, res, 1) \ -X(a, STATIC, SINGULAR, UINT32, free, 2) \ -X(a, STATIC, SINGULAR, UINT32, maxlen, 3) \ -X(a, STATIC, SINGULAR, UINT32, mesh_packet_id, 4) -#define QueueStatus_CALLBACK NULL -#define QueueStatus_DEFAULT NULL - -#define FromRadio_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, id, 1) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,packet,packet), 2) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,my_info,my_info), 3) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,node_info,node_info), 4) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,config,config), 5) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,log_record,log_record), 6) \ -X(a, STATIC, ONEOF, UINT32, (payload_variant,config_complete_id,config_complete_id), 7) \ -X(a, STATIC, ONEOF, BOOL, (payload_variant,rebooted,rebooted), 8) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,moduleConfig,moduleConfig), 9) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,channel,channel), 10) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,queueStatus,queueStatus), 11) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,xmodemPacket,xmodemPacket), 12) -#define FromRadio_CALLBACK NULL -#define FromRadio_DEFAULT NULL -#define FromRadio_payload_variant_packet_MSGTYPE MeshPacket -#define FromRadio_payload_variant_my_info_MSGTYPE MyNodeInfo -#define FromRadio_payload_variant_node_info_MSGTYPE NodeInfo -#define FromRadio_payload_variant_config_MSGTYPE Config -#define FromRadio_payload_variant_log_record_MSGTYPE LogRecord -#define FromRadio_payload_variant_moduleConfig_MSGTYPE ModuleConfig -#define FromRadio_payload_variant_channel_MSGTYPE Channel -#define FromRadio_payload_variant_queueStatus_MSGTYPE QueueStatus -#define FromRadio_payload_variant_xmodemPacket_MSGTYPE XModem - -#define ToRadio_FIELDLIST(X, a) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,packet,packet), 1) \ -X(a, STATIC, ONEOF, UINT32, (payload_variant,want_config_id,want_config_id), 3) \ -X(a, STATIC, ONEOF, BOOL, (payload_variant,disconnect,disconnect), 4) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,xmodemPacket,xmodemPacket), 5) -#define ToRadio_CALLBACK NULL -#define ToRadio_DEFAULT NULL -#define ToRadio_payload_variant_packet_MSGTYPE MeshPacket -#define ToRadio_payload_variant_xmodemPacket_MSGTYPE XModem - -#define Compressed_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UENUM, portnum, 1) \ -X(a, STATIC, SINGULAR, BYTES, data, 2) -#define Compressed_CALLBACK NULL -#define Compressed_DEFAULT NULL - -extern const pb_msgdesc_t Position_msg; -extern const pb_msgdesc_t User_msg; -extern const pb_msgdesc_t RouteDiscovery_msg; -extern const pb_msgdesc_t Routing_msg; -extern const pb_msgdesc_t Data_msg; -extern const pb_msgdesc_t Waypoint_msg; -extern const pb_msgdesc_t MeshPacket_msg; -extern const pb_msgdesc_t NodeInfo_msg; -extern const pb_msgdesc_t MyNodeInfo_msg; -extern const pb_msgdesc_t LogRecord_msg; -extern const pb_msgdesc_t QueueStatus_msg; -extern const pb_msgdesc_t FromRadio_msg; -extern const pb_msgdesc_t ToRadio_msg; -extern const pb_msgdesc_t Compressed_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define Position_fields &Position_msg -#define User_fields &User_msg -#define RouteDiscovery_fields &RouteDiscovery_msg -#define Routing_fields &Routing_msg -#define Data_fields &Data_msg -#define Waypoint_fields &Waypoint_msg -#define MeshPacket_fields &MeshPacket_msg -#define NodeInfo_fields &NodeInfo_msg -#define MyNodeInfo_fields &MyNodeInfo_msg -#define LogRecord_fields &LogRecord_msg -#define QueueStatus_fields &QueueStatus_msg -#define FromRadio_fields &FromRadio_msg -#define ToRadio_fields &ToRadio_msg -#define Compressed_fields &Compressed_msg - -/* Maximum encoded size of messages (where known) */ -#define Compressed_size 243 -#define Data_size 270 -#define FromRadio_size 330 -#define LogRecord_size 81 -#define MeshPacket_size 321 -#define MyNodeInfo_size 179 -#define NodeInfo_size 258 -#define Position_size 137 -#define QueueStatus_size 23 -#define RouteDiscovery_size 40 -#define Routing_size 42 -#define ToRadio_size 324 -#define User_size 77 -#define Waypoint_size 165 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/module_config.pb.c b/src/mesh/generated/module_config.pb.c deleted file mode 100644 index eb22a5ec3..000000000 --- a/src/mesh/generated/module_config.pb.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "module_config.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(ModuleConfig, ModuleConfig, AUTO) - - -PB_BIND(ModuleConfig_MQTTConfig, ModuleConfig_MQTTConfig, AUTO) - - -PB_BIND(ModuleConfig_RemoteHardwareConfig, ModuleConfig_RemoteHardwareConfig, AUTO) - - -PB_BIND(ModuleConfig_AudioConfig, ModuleConfig_AudioConfig, AUTO) - - -PB_BIND(ModuleConfig_SerialConfig, ModuleConfig_SerialConfig, AUTO) - - -PB_BIND(ModuleConfig_ExternalNotificationConfig, ModuleConfig_ExternalNotificationConfig, AUTO) - - -PB_BIND(ModuleConfig_StoreForwardConfig, ModuleConfig_StoreForwardConfig, AUTO) - - -PB_BIND(ModuleConfig_RangeTestConfig, ModuleConfig_RangeTestConfig, AUTO) - - -PB_BIND(ModuleConfig_TelemetryConfig, ModuleConfig_TelemetryConfig, AUTO) - - -PB_BIND(ModuleConfig_CannedMessageConfig, ModuleConfig_CannedMessageConfig, AUTO) - - - - - - - diff --git a/src/mesh/generated/module_config.pb.h b/src/mesh/generated/module_config.pb.h deleted file mode 100644 index bd4e90832..000000000 --- a/src/mesh/generated/module_config.pb.h +++ /dev/null @@ -1,568 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_MODULE_CONFIG_PB_H_INCLUDED -#define PB_MODULE_CONFIG_PB_H_INCLUDED -#include - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -/* Baudrate for codec2 voice */ -typedef enum _ModuleConfig_AudioConfig_Audio_Baud { - ModuleConfig_AudioConfig_Audio_Baud_CODEC2_DEFAULT = 0, - ModuleConfig_AudioConfig_Audio_Baud_CODEC2_3200 = 1, - ModuleConfig_AudioConfig_Audio_Baud_CODEC2_2400 = 2, - ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1600 = 3, - ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1400 = 4, - ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1300 = 5, - ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1200 = 6, - ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700 = 7, - ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B = 8 -} ModuleConfig_AudioConfig_Audio_Baud; - -/* TODO: REPLACE */ -typedef enum _ModuleConfig_SerialConfig_Serial_Baud { - ModuleConfig_SerialConfig_Serial_Baud_BAUD_DEFAULT = 0, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_110 = 1, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_300 = 2, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_600 = 3, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_1200 = 4, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_2400 = 5, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_4800 = 6, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_9600 = 7, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_19200 = 8, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_38400 = 9, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_57600 = 10, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_115200 = 11, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_230400 = 12, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_460800 = 13, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_576000 = 14, - ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600 = 15 -} ModuleConfig_SerialConfig_Serial_Baud; - -/* TODO: REPLACE */ -typedef enum _ModuleConfig_SerialConfig_Serial_Mode { - ModuleConfig_SerialConfig_Serial_Mode_DEFAULT = 0, - ModuleConfig_SerialConfig_Serial_Mode_SIMPLE = 1, - ModuleConfig_SerialConfig_Serial_Mode_PROTO = 2, - ModuleConfig_SerialConfig_Serial_Mode_TEXTMSG = 3, - ModuleConfig_SerialConfig_Serial_Mode_NMEA = 4 -} ModuleConfig_SerialConfig_Serial_Mode; - -/* TODO: REPLACE */ -typedef enum _ModuleConfig_CannedMessageConfig_InputEventChar { - /* TODO: REPLACE */ - ModuleConfig_CannedMessageConfig_InputEventChar_NONE = 0, - /* TODO: REPLACE */ - ModuleConfig_CannedMessageConfig_InputEventChar_UP = 17, - /* TODO: REPLACE */ - ModuleConfig_CannedMessageConfig_InputEventChar_DOWN = 18, - /* TODO: REPLACE */ - ModuleConfig_CannedMessageConfig_InputEventChar_LEFT = 19, - /* TODO: REPLACE */ - ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT = 20, - /* '\n' */ - ModuleConfig_CannedMessageConfig_InputEventChar_SELECT = 10, - /* TODO: REPLACE */ - ModuleConfig_CannedMessageConfig_InputEventChar_BACK = 27, - /* TODO: REPLACE */ - ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL = 24 -} ModuleConfig_CannedMessageConfig_InputEventChar; - -/* Struct definitions */ -/* MQTT Client Config */ -typedef struct _ModuleConfig_MQTTConfig { - /* If a meshtastic node is able to reach the internet it will normally attempt to gateway any channels that are marked as - is_uplink_enabled or is_downlink_enabled. */ - bool enabled; - /* The server to use for our MQTT global message gateway feature. - If not set, the default server will be used */ - char address[64]; - /* MQTT username to use (most useful for a custom MQTT server). - If using a custom server, this will be honoured even if empty. - If using the default server, this will only be honoured if set, otherwise the device will use the default username */ - char username[64]; - /* MQTT password to use (most useful for a custom MQTT server). - If using a custom server, this will be honoured even if empty. - If using the default server, this will only be honoured if set, otherwise the device will use the default password */ - char password[64]; - /* Whether to send encrypted or decrypted packets to MQTT. - This parameter is only honoured if you also set server - (the default official mqtt.meshtastic.org server can handle encrypted packets) - Decrypted packets may be useful for external systems that want to consume meshtastic packets */ - bool encryption_enabled; - /* Whether to send / consume json packets on MQTT */ - bool json_enabled; -} ModuleConfig_MQTTConfig; - -/* RemoteHardwareModule Config */ -typedef struct _ModuleConfig_RemoteHardwareConfig { - /* Whether the Module is enabled */ - bool enabled; -} ModuleConfig_RemoteHardwareConfig; - -/* Audio Config for codec2 voice */ -typedef struct _ModuleConfig_AudioConfig { - /* Whether Audio is enabled */ - bool codec2_enabled; - /* PTT Pin */ - uint8_t ptt_pin; - /* The audio sample rate to use for codec2 */ - ModuleConfig_AudioConfig_Audio_Baud bitrate; - /* I2S Word Select */ - uint8_t i2s_ws; - /* I2S Data IN */ - uint8_t i2s_sd; - /* I2S Data OUT */ - uint8_t i2s_din; - /* I2S Clock */ - uint8_t i2s_sck; -} ModuleConfig_AudioConfig; - -/* Serial Config */ -typedef struct _ModuleConfig_SerialConfig { - /* Preferences for the SerialModule - FIXME - Move this out of UserPreferences and into a section for module configuration. */ - bool enabled; - /* TODO: REPLACE */ - bool echo; - /* TODO: REPLACE */ - uint32_t rxd; - /* TODO: REPLACE */ - uint32_t txd; - /* TODO: REPLACE */ - ModuleConfig_SerialConfig_Serial_Baud baud; - /* TODO: REPLACE */ - uint32_t timeout; - /* TODO: REPLACE */ - ModuleConfig_SerialConfig_Serial_Mode mode; -} ModuleConfig_SerialConfig; - -/* External Notifications Config */ -typedef struct _ModuleConfig_ExternalNotificationConfig { - /* Enable the ExternalNotificationModule */ - bool enabled; - /* When using in On/Off mode, keep the output on for this many - milliseconds. Default 1000ms (1 second). */ - uint32_t output_ms; - /* Define the output pin GPIO setting Defaults to - EXT_NOTIFY_OUT if set for the board. - In standalone devices this pin should drive the LED to match the UI. */ - uint32_t output; - /* IF this is true, the 'output' Pin will be pulled active high, false - means active low. */ - bool active; - /* True: Alert when a text message arrives (output) */ - bool alert_message; - /* True: Alert when the bell character is received (output) */ - bool alert_bell; - /* use a PWM output instead of a simple on/off output. This will ignore - the 'output', 'output_ms' and 'active' settings and use the - device.buzzer_gpio instead. */ - bool use_pwm; - /* Optional: Define a secondary output pin for a vibra motor - This is used in standalone devices to match the UI. */ - uint8_t output_vibra; - /* Optional: Define a tertiary output pin for an active buzzer - This is used in standalone devices to to match the UI. */ - uint8_t output_buzzer; - /* True: Alert when a text message arrives (output_vibra) */ - bool alert_message_vibra; - /* True: Alert when a text message arrives (output_buzzer) */ - bool alert_message_buzzer; - /* True: Alert when the bell character is received (output_vibra) */ - bool alert_bell_vibra; - /* True: Alert when the bell character is received (output_buzzer) */ - bool alert_bell_buzzer; - /* The notification will toggle with 'output_ms' for this time of seconds. - Default is 0 which means don't repeat at all. 60 would mean blink - and/or beep for 60 seconds */ - uint16_t nag_timeout; -} ModuleConfig_ExternalNotificationConfig; - -/* Store and Forward Module Config */ -typedef struct _ModuleConfig_StoreForwardConfig { - /* Enable the Store and Forward Module */ - bool enabled; - /* TODO: REPLACE */ - bool heartbeat; - /* TODO: REPLACE */ - uint32_t records; - /* TODO: REPLACE */ - uint32_t history_return_max; - /* TODO: REPLACE */ - uint32_t history_return_window; -} ModuleConfig_StoreForwardConfig; - -/* Preferences for the RangeTestModule */ -typedef struct _ModuleConfig_RangeTestConfig { - /* Enable the Range Test Module */ - bool enabled; - /* Send out range test messages from this node */ - uint32_t sender; - /* Bool value indicating that this node should save a RangeTest.csv file. - ESP32 Only */ - bool save; -} ModuleConfig_RangeTestConfig; - -/* Configuration for both device and environment metrics */ -typedef struct _ModuleConfig_TelemetryConfig { - /* Interval in seconds of how often we should try to send our - device metrics to the mesh */ - uint32_t device_update_interval; - uint32_t environment_update_interval; - /* Preferences for the Telemetry Module (Environment) - Enable/Disable the telemetry measurement module measurement collection */ - bool environment_measurement_enabled; - /* Enable/Disable the telemetry measurement module on-device display */ - bool environment_screen_enabled; - /* We'll always read the sensor in Celsius, but sometimes we might want to - display the results in Fahrenheit as a "user preference". */ - bool environment_display_fahrenheit; -} ModuleConfig_TelemetryConfig; - -/* TODO: REPLACE */ -typedef struct _ModuleConfig_CannedMessageConfig { - /* Enable the rotary encoder #1. This is a 'dumb' encoder sending pulses on both A and B pins while rotating. */ - bool rotary1_enabled; - /* GPIO pin for rotary encoder A port. */ - uint32_t inputbroker_pin_a; - /* GPIO pin for rotary encoder B port. */ - uint32_t inputbroker_pin_b; - /* GPIO pin for rotary encoder Press port. */ - uint32_t inputbroker_pin_press; - /* Generate input event on CW of this kind. */ - ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_cw; - /* Generate input event on CCW of this kind. */ - ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_ccw; - /* Generate input event on Press of this kind. */ - ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_press; - /* Enable the Up/Down/Select input device. Can be RAK rotary encoder or 3 buttons. Uses the a/b/press definitions from inputbroker. */ - bool updown1_enabled; - /* Enable/disable CannedMessageModule. */ - bool enabled; - /* Input event origin accepted by the canned message module. - Can be e.g. "rotEnc1", "upDownEnc1" or keyword "_any" */ - char allow_input_source[16]; - /* CannedMessageModule also sends a bell character with the messages. - ExternalNotificationModule can benefit from this feature. */ - bool send_bell; -} ModuleConfig_CannedMessageConfig; - -/* Module Config */ -typedef struct _ModuleConfig { - pb_size_t which_payload_variant; - union { - /* TODO: REPLACE */ - ModuleConfig_MQTTConfig mqtt; - /* TODO: REPLACE */ - ModuleConfig_SerialConfig serial; - /* TODO: REPLACE */ - ModuleConfig_ExternalNotificationConfig external_notification; - /* TODO: REPLACE */ - ModuleConfig_StoreForwardConfig store_forward; - /* TODO: REPLACE */ - ModuleConfig_RangeTestConfig range_test; - /* TODO: REPLACE */ - ModuleConfig_TelemetryConfig telemetry; - /* TODO: REPLACE */ - ModuleConfig_CannedMessageConfig canned_message; - /* TODO: REPLACE */ - ModuleConfig_AudioConfig audio; - /* TODO: REPLACE */ - ModuleConfig_RemoteHardwareConfig remote_hardware; - } payload_variant; -} ModuleConfig; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Helper constants for enums */ -#define _ModuleConfig_AudioConfig_Audio_Baud_MIN ModuleConfig_AudioConfig_Audio_Baud_CODEC2_DEFAULT -#define _ModuleConfig_AudioConfig_Audio_Baud_MAX ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B -#define _ModuleConfig_AudioConfig_Audio_Baud_ARRAYSIZE ((ModuleConfig_AudioConfig_Audio_Baud)(ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B+1)) - -#define _ModuleConfig_SerialConfig_Serial_Baud_MIN ModuleConfig_SerialConfig_Serial_Baud_BAUD_DEFAULT -#define _ModuleConfig_SerialConfig_Serial_Baud_MAX ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600 -#define _ModuleConfig_SerialConfig_Serial_Baud_ARRAYSIZE ((ModuleConfig_SerialConfig_Serial_Baud)(ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600+1)) - -#define _ModuleConfig_SerialConfig_Serial_Mode_MIN ModuleConfig_SerialConfig_Serial_Mode_DEFAULT -#define _ModuleConfig_SerialConfig_Serial_Mode_MAX ModuleConfig_SerialConfig_Serial_Mode_NMEA -#define _ModuleConfig_SerialConfig_Serial_Mode_ARRAYSIZE ((ModuleConfig_SerialConfig_Serial_Mode)(ModuleConfig_SerialConfig_Serial_Mode_NMEA+1)) - -#define _ModuleConfig_CannedMessageConfig_InputEventChar_MIN ModuleConfig_CannedMessageConfig_InputEventChar_NONE -#define _ModuleConfig_CannedMessageConfig_InputEventChar_MAX ModuleConfig_CannedMessageConfig_InputEventChar_BACK -#define _ModuleConfig_CannedMessageConfig_InputEventChar_ARRAYSIZE ((ModuleConfig_CannedMessageConfig_InputEventChar)(ModuleConfig_CannedMessageConfig_InputEventChar_BACK+1)) - - - - -#define ModuleConfig_AudioConfig_bitrate_ENUMTYPE ModuleConfig_AudioConfig_Audio_Baud - -#define ModuleConfig_SerialConfig_baud_ENUMTYPE ModuleConfig_SerialConfig_Serial_Baud -#define ModuleConfig_SerialConfig_mode_ENUMTYPE ModuleConfig_SerialConfig_Serial_Mode - - - - - -#define ModuleConfig_CannedMessageConfig_inputbroker_event_cw_ENUMTYPE ModuleConfig_CannedMessageConfig_InputEventChar -#define ModuleConfig_CannedMessageConfig_inputbroker_event_ccw_ENUMTYPE ModuleConfig_CannedMessageConfig_InputEventChar -#define ModuleConfig_CannedMessageConfig_inputbroker_event_press_ENUMTYPE ModuleConfig_CannedMessageConfig_InputEventChar - - -/* Initializer values for message structs */ -#define ModuleConfig_init_default {0, {ModuleConfig_MQTTConfig_init_default}} -#define ModuleConfig_MQTTConfig_init_default {0, "", "", "", 0, 0} -#define ModuleConfig_RemoteHardwareConfig_init_default {0} -#define ModuleConfig_AudioConfig_init_default {0, 0, _ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0} -#define ModuleConfig_SerialConfig_init_default {0, 0, 0, 0, _ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _ModuleConfig_SerialConfig_Serial_Mode_MIN} -#define ModuleConfig_ExternalNotificationConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -#define ModuleConfig_StoreForwardConfig_init_default {0, 0, 0, 0, 0} -#define ModuleConfig_RangeTestConfig_init_default {0, 0, 0} -#define ModuleConfig_TelemetryConfig_init_default {0, 0, 0, 0, 0} -#define ModuleConfig_CannedMessageConfig_init_default {0, 0, 0, 0, _ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _ModuleConfig_CannedMessageConfig_InputEventChar_MIN, 0, 0, "", 0} -#define ModuleConfig_init_zero {0, {ModuleConfig_MQTTConfig_init_zero}} -#define ModuleConfig_MQTTConfig_init_zero {0, "", "", "", 0, 0} -#define ModuleConfig_RemoteHardwareConfig_init_zero {0} -#define ModuleConfig_AudioConfig_init_zero {0, 0, _ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0} -#define ModuleConfig_SerialConfig_init_zero {0, 0, 0, 0, _ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _ModuleConfig_SerialConfig_Serial_Mode_MIN} -#define ModuleConfig_ExternalNotificationConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -#define ModuleConfig_StoreForwardConfig_init_zero {0, 0, 0, 0, 0} -#define ModuleConfig_RangeTestConfig_init_zero {0, 0, 0} -#define ModuleConfig_TelemetryConfig_init_zero {0, 0, 0, 0, 0} -#define ModuleConfig_CannedMessageConfig_init_zero {0, 0, 0, 0, _ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _ModuleConfig_CannedMessageConfig_InputEventChar_MIN, 0, 0, "", 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define ModuleConfig_MQTTConfig_enabled_tag 1 -#define ModuleConfig_MQTTConfig_address_tag 2 -#define ModuleConfig_MQTTConfig_username_tag 3 -#define ModuleConfig_MQTTConfig_password_tag 4 -#define ModuleConfig_MQTTConfig_encryption_enabled_tag 5 -#define ModuleConfig_MQTTConfig_json_enabled_tag 6 -#define ModuleConfig_RemoteHardwareConfig_enabled_tag 1 -#define ModuleConfig_AudioConfig_codec2_enabled_tag 1 -#define ModuleConfig_AudioConfig_ptt_pin_tag 2 -#define ModuleConfig_AudioConfig_bitrate_tag 3 -#define ModuleConfig_AudioConfig_i2s_ws_tag 4 -#define ModuleConfig_AudioConfig_i2s_sd_tag 5 -#define ModuleConfig_AudioConfig_i2s_din_tag 6 -#define ModuleConfig_AudioConfig_i2s_sck_tag 7 -#define ModuleConfig_SerialConfig_enabled_tag 1 -#define ModuleConfig_SerialConfig_echo_tag 2 -#define ModuleConfig_SerialConfig_rxd_tag 3 -#define ModuleConfig_SerialConfig_txd_tag 4 -#define ModuleConfig_SerialConfig_baud_tag 5 -#define ModuleConfig_SerialConfig_timeout_tag 6 -#define ModuleConfig_SerialConfig_mode_tag 7 -#define ModuleConfig_ExternalNotificationConfig_enabled_tag 1 -#define ModuleConfig_ExternalNotificationConfig_output_ms_tag 2 -#define ModuleConfig_ExternalNotificationConfig_output_tag 3 -#define ModuleConfig_ExternalNotificationConfig_active_tag 4 -#define ModuleConfig_ExternalNotificationConfig_alert_message_tag 5 -#define ModuleConfig_ExternalNotificationConfig_alert_bell_tag 6 -#define ModuleConfig_ExternalNotificationConfig_use_pwm_tag 7 -#define ModuleConfig_ExternalNotificationConfig_output_vibra_tag 8 -#define ModuleConfig_ExternalNotificationConfig_output_buzzer_tag 9 -#define ModuleConfig_ExternalNotificationConfig_alert_message_vibra_tag 10 -#define ModuleConfig_ExternalNotificationConfig_alert_message_buzzer_tag 11 -#define ModuleConfig_ExternalNotificationConfig_alert_bell_vibra_tag 12 -#define ModuleConfig_ExternalNotificationConfig_alert_bell_buzzer_tag 13 -#define ModuleConfig_ExternalNotificationConfig_nag_timeout_tag 14 -#define ModuleConfig_StoreForwardConfig_enabled_tag 1 -#define ModuleConfig_StoreForwardConfig_heartbeat_tag 2 -#define ModuleConfig_StoreForwardConfig_records_tag 3 -#define ModuleConfig_StoreForwardConfig_history_return_max_tag 4 -#define ModuleConfig_StoreForwardConfig_history_return_window_tag 5 -#define ModuleConfig_RangeTestConfig_enabled_tag 1 -#define ModuleConfig_RangeTestConfig_sender_tag 2 -#define ModuleConfig_RangeTestConfig_save_tag 3 -#define ModuleConfig_TelemetryConfig_device_update_interval_tag 1 -#define ModuleConfig_TelemetryConfig_environment_update_interval_tag 2 -#define ModuleConfig_TelemetryConfig_environment_measurement_enabled_tag 3 -#define ModuleConfig_TelemetryConfig_environment_screen_enabled_tag 4 -#define ModuleConfig_TelemetryConfig_environment_display_fahrenheit_tag 5 -#define ModuleConfig_CannedMessageConfig_rotary1_enabled_tag 1 -#define ModuleConfig_CannedMessageConfig_inputbroker_pin_a_tag 2 -#define ModuleConfig_CannedMessageConfig_inputbroker_pin_b_tag 3 -#define ModuleConfig_CannedMessageConfig_inputbroker_pin_press_tag 4 -#define ModuleConfig_CannedMessageConfig_inputbroker_event_cw_tag 5 -#define ModuleConfig_CannedMessageConfig_inputbroker_event_ccw_tag 6 -#define ModuleConfig_CannedMessageConfig_inputbroker_event_press_tag 7 -#define ModuleConfig_CannedMessageConfig_updown1_enabled_tag 8 -#define ModuleConfig_CannedMessageConfig_enabled_tag 9 -#define ModuleConfig_CannedMessageConfig_allow_input_source_tag 10 -#define ModuleConfig_CannedMessageConfig_send_bell_tag 11 -#define ModuleConfig_mqtt_tag 1 -#define ModuleConfig_serial_tag 2 -#define ModuleConfig_external_notification_tag 3 -#define ModuleConfig_store_forward_tag 4 -#define ModuleConfig_range_test_tag 5 -#define ModuleConfig_telemetry_tag 6 -#define ModuleConfig_canned_message_tag 7 -#define ModuleConfig_audio_tag 8 -#define ModuleConfig_remote_hardware_tag 9 - -/* Struct field encoding specification for nanopb */ -#define ModuleConfig_FIELDLIST(X, a) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,mqtt,payload_variant.mqtt), 1) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,serial,payload_variant.serial), 2) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,external_notification,payload_variant.external_notification), 3) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,store_forward,payload_variant.store_forward), 4) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,range_test,payload_variant.range_test), 5) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,telemetry,payload_variant.telemetry), 6) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,canned_message,payload_variant.canned_message), 7) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,audio,payload_variant.audio), 8) \ -X(a, STATIC, ONEOF, MESSAGE, (payload_variant,remote_hardware,payload_variant.remote_hardware), 9) -#define ModuleConfig_CALLBACK NULL -#define ModuleConfig_DEFAULT NULL -#define ModuleConfig_payload_variant_mqtt_MSGTYPE ModuleConfig_MQTTConfig -#define ModuleConfig_payload_variant_serial_MSGTYPE ModuleConfig_SerialConfig -#define ModuleConfig_payload_variant_external_notification_MSGTYPE ModuleConfig_ExternalNotificationConfig -#define ModuleConfig_payload_variant_store_forward_MSGTYPE ModuleConfig_StoreForwardConfig -#define ModuleConfig_payload_variant_range_test_MSGTYPE ModuleConfig_RangeTestConfig -#define ModuleConfig_payload_variant_telemetry_MSGTYPE ModuleConfig_TelemetryConfig -#define ModuleConfig_payload_variant_canned_message_MSGTYPE ModuleConfig_CannedMessageConfig -#define ModuleConfig_payload_variant_audio_MSGTYPE ModuleConfig_AudioConfig -#define ModuleConfig_payload_variant_remote_hardware_MSGTYPE ModuleConfig_RemoteHardwareConfig - -#define ModuleConfig_MQTTConfig_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ -X(a, STATIC, SINGULAR, STRING, address, 2) \ -X(a, STATIC, SINGULAR, STRING, username, 3) \ -X(a, STATIC, SINGULAR, STRING, password, 4) \ -X(a, STATIC, SINGULAR, BOOL, encryption_enabled, 5) \ -X(a, STATIC, SINGULAR, BOOL, json_enabled, 6) -#define ModuleConfig_MQTTConfig_CALLBACK NULL -#define ModuleConfig_MQTTConfig_DEFAULT NULL - -#define ModuleConfig_RemoteHardwareConfig_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, BOOL, enabled, 1) -#define ModuleConfig_RemoteHardwareConfig_CALLBACK NULL -#define ModuleConfig_RemoteHardwareConfig_DEFAULT NULL - -#define ModuleConfig_AudioConfig_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, BOOL, codec2_enabled, 1) \ -X(a, STATIC, SINGULAR, UINT32, ptt_pin, 2) \ -X(a, STATIC, SINGULAR, UENUM, bitrate, 3) \ -X(a, STATIC, SINGULAR, UINT32, i2s_ws, 4) \ -X(a, STATIC, SINGULAR, UINT32, i2s_sd, 5) \ -X(a, STATIC, SINGULAR, UINT32, i2s_din, 6) \ -X(a, STATIC, SINGULAR, UINT32, i2s_sck, 7) -#define ModuleConfig_AudioConfig_CALLBACK NULL -#define ModuleConfig_AudioConfig_DEFAULT NULL - -#define ModuleConfig_SerialConfig_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ -X(a, STATIC, SINGULAR, BOOL, echo, 2) \ -X(a, STATIC, SINGULAR, UINT32, rxd, 3) \ -X(a, STATIC, SINGULAR, UINT32, txd, 4) \ -X(a, STATIC, SINGULAR, UENUM, baud, 5) \ -X(a, STATIC, SINGULAR, UINT32, timeout, 6) \ -X(a, STATIC, SINGULAR, UENUM, mode, 7) -#define ModuleConfig_SerialConfig_CALLBACK NULL -#define ModuleConfig_SerialConfig_DEFAULT NULL - -#define ModuleConfig_ExternalNotificationConfig_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ -X(a, STATIC, SINGULAR, UINT32, output_ms, 2) \ -X(a, STATIC, SINGULAR, UINT32, output, 3) \ -X(a, STATIC, SINGULAR, BOOL, active, 4) \ -X(a, STATIC, SINGULAR, BOOL, alert_message, 5) \ -X(a, STATIC, SINGULAR, BOOL, alert_bell, 6) \ -X(a, STATIC, SINGULAR, BOOL, use_pwm, 7) \ -X(a, STATIC, SINGULAR, UINT32, output_vibra, 8) \ -X(a, STATIC, SINGULAR, UINT32, output_buzzer, 9) \ -X(a, STATIC, SINGULAR, BOOL, alert_message_vibra, 10) \ -X(a, STATIC, SINGULAR, BOOL, alert_message_buzzer, 11) \ -X(a, STATIC, SINGULAR, BOOL, alert_bell_vibra, 12) \ -X(a, STATIC, SINGULAR, BOOL, alert_bell_buzzer, 13) \ -X(a, STATIC, SINGULAR, UINT32, nag_timeout, 14) -#define ModuleConfig_ExternalNotificationConfig_CALLBACK NULL -#define ModuleConfig_ExternalNotificationConfig_DEFAULT NULL - -#define ModuleConfig_StoreForwardConfig_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ -X(a, STATIC, SINGULAR, BOOL, heartbeat, 2) \ -X(a, STATIC, SINGULAR, UINT32, records, 3) \ -X(a, STATIC, SINGULAR, UINT32, history_return_max, 4) \ -X(a, STATIC, SINGULAR, UINT32, history_return_window, 5) -#define ModuleConfig_StoreForwardConfig_CALLBACK NULL -#define ModuleConfig_StoreForwardConfig_DEFAULT NULL - -#define ModuleConfig_RangeTestConfig_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ -X(a, STATIC, SINGULAR, UINT32, sender, 2) \ -X(a, STATIC, SINGULAR, BOOL, save, 3) -#define ModuleConfig_RangeTestConfig_CALLBACK NULL -#define ModuleConfig_RangeTestConfig_DEFAULT NULL - -#define ModuleConfig_TelemetryConfig_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, device_update_interval, 1) \ -X(a, STATIC, SINGULAR, UINT32, environment_update_interval, 2) \ -X(a, STATIC, SINGULAR, BOOL, environment_measurement_enabled, 3) \ -X(a, STATIC, SINGULAR, BOOL, environment_screen_enabled, 4) \ -X(a, STATIC, SINGULAR, BOOL, environment_display_fahrenheit, 5) -#define ModuleConfig_TelemetryConfig_CALLBACK NULL -#define ModuleConfig_TelemetryConfig_DEFAULT NULL - -#define ModuleConfig_CannedMessageConfig_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, BOOL, rotary1_enabled, 1) \ -X(a, STATIC, SINGULAR, UINT32, inputbroker_pin_a, 2) \ -X(a, STATIC, SINGULAR, UINT32, inputbroker_pin_b, 3) \ -X(a, STATIC, SINGULAR, UINT32, inputbroker_pin_press, 4) \ -X(a, STATIC, SINGULAR, UENUM, inputbroker_event_cw, 5) \ -X(a, STATIC, SINGULAR, UENUM, inputbroker_event_ccw, 6) \ -X(a, STATIC, SINGULAR, UENUM, inputbroker_event_press, 7) \ -X(a, STATIC, SINGULAR, BOOL, updown1_enabled, 8) \ -X(a, STATIC, SINGULAR, BOOL, enabled, 9) \ -X(a, STATIC, SINGULAR, STRING, allow_input_source, 10) \ -X(a, STATIC, SINGULAR, BOOL, send_bell, 11) -#define ModuleConfig_CannedMessageConfig_CALLBACK NULL -#define ModuleConfig_CannedMessageConfig_DEFAULT NULL - -extern const pb_msgdesc_t ModuleConfig_msg; -extern const pb_msgdesc_t ModuleConfig_MQTTConfig_msg; -extern const pb_msgdesc_t ModuleConfig_RemoteHardwareConfig_msg; -extern const pb_msgdesc_t ModuleConfig_AudioConfig_msg; -extern const pb_msgdesc_t ModuleConfig_SerialConfig_msg; -extern const pb_msgdesc_t ModuleConfig_ExternalNotificationConfig_msg; -extern const pb_msgdesc_t ModuleConfig_StoreForwardConfig_msg; -extern const pb_msgdesc_t ModuleConfig_RangeTestConfig_msg; -extern const pb_msgdesc_t ModuleConfig_TelemetryConfig_msg; -extern const pb_msgdesc_t ModuleConfig_CannedMessageConfig_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define ModuleConfig_fields &ModuleConfig_msg -#define ModuleConfig_MQTTConfig_fields &ModuleConfig_MQTTConfig_msg -#define ModuleConfig_RemoteHardwareConfig_fields &ModuleConfig_RemoteHardwareConfig_msg -#define ModuleConfig_AudioConfig_fields &ModuleConfig_AudioConfig_msg -#define ModuleConfig_SerialConfig_fields &ModuleConfig_SerialConfig_msg -#define ModuleConfig_ExternalNotificationConfig_fields &ModuleConfig_ExternalNotificationConfig_msg -#define ModuleConfig_StoreForwardConfig_fields &ModuleConfig_StoreForwardConfig_msg -#define ModuleConfig_RangeTestConfig_fields &ModuleConfig_RangeTestConfig_msg -#define ModuleConfig_TelemetryConfig_fields &ModuleConfig_TelemetryConfig_msg -#define ModuleConfig_CannedMessageConfig_fields &ModuleConfig_CannedMessageConfig_msg - -/* Maximum encoded size of messages (where known) */ -#define ModuleConfig_AudioConfig_size 19 -#define ModuleConfig_CannedMessageConfig_size 49 -#define ModuleConfig_ExternalNotificationConfig_size 40 -#define ModuleConfig_MQTTConfig_size 201 -#define ModuleConfig_RangeTestConfig_size 10 -#define ModuleConfig_RemoteHardwareConfig_size 2 -#define ModuleConfig_SerialConfig_size 26 -#define ModuleConfig_StoreForwardConfig_size 22 -#define ModuleConfig_TelemetryConfig_size 18 -#define ModuleConfig_size 204 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/mqtt.pb.c b/src/mesh/generated/mqtt.pb.c deleted file mode 100644 index 9c2a7eb63..000000000 --- a/src/mesh/generated/mqtt.pb.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "mqtt.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(ServiceEnvelope, ServiceEnvelope, AUTO) - - - diff --git a/src/mesh/generated/mqtt.pb.h b/src/mesh/generated/mqtt.pb.h deleted file mode 100644 index 36de161cc..000000000 --- a/src/mesh/generated/mqtt.pb.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_MQTT_PB_H_INCLUDED -#define PB_MQTT_PB_H_INCLUDED -#include -#include "mesh.pb.h" - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Struct definitions */ -/* This message wraps a MeshPacket with extra metadata about the sender and how it arrived. */ -typedef struct _ServiceEnvelope { - /* The (probably encrypted) packet */ - struct _MeshPacket *packet; - /* The global channel ID it was sent on */ - char *channel_id; - /* The sending gateway node ID. Can we use this to authenticate/prevent fake - nodeid impersonation for senders? - i.e. use gateway/mesh id (which is authenticated) + local node id as - the globally trusted nodenum */ - char *gateway_id; -} ServiceEnvelope; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initializer values for message structs */ -#define ServiceEnvelope_init_default {NULL, NULL, NULL} -#define ServiceEnvelope_init_zero {NULL, NULL, NULL} - -/* Field tags (for use in manual encoding/decoding) */ -#define ServiceEnvelope_packet_tag 1 -#define ServiceEnvelope_channel_id_tag 2 -#define ServiceEnvelope_gateway_id_tag 3 - -/* Struct field encoding specification for nanopb */ -#define ServiceEnvelope_FIELDLIST(X, a) \ -X(a, POINTER, OPTIONAL, MESSAGE, packet, 1) \ -X(a, POINTER, SINGULAR, STRING, channel_id, 2) \ -X(a, POINTER, SINGULAR, STRING, gateway_id, 3) -#define ServiceEnvelope_CALLBACK NULL -#define ServiceEnvelope_DEFAULT NULL -#define ServiceEnvelope_packet_MSGTYPE MeshPacket - -extern const pb_msgdesc_t ServiceEnvelope_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define ServiceEnvelope_fields &ServiceEnvelope_msg - -/* Maximum encoded size of messages (where known) */ -/* ServiceEnvelope_size depends on runtime parameters */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/portnums.pb.c b/src/mesh/generated/portnums.pb.c deleted file mode 100644 index 4e674aac5..000000000 --- a/src/mesh/generated/portnums.pb.c +++ /dev/null @@ -1,10 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "portnums.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - diff --git a/src/mesh/generated/portnums.pb.h b/src/mesh/generated/portnums.pb.h deleted file mode 100644 index 9e6a0b5b4..000000000 --- a/src/mesh/generated/portnums.pb.h +++ /dev/null @@ -1,112 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_PORTNUMS_PB_H_INCLUDED -#define PB_PORTNUMS_PB_H_INCLUDED -#include - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -/* For any new 'apps' that run on the device or via sister apps on phones/PCs they should pick and use a - unique 'portnum' for their application. - If you are making a new app using meshtastic, please send in a pull request to add your 'portnum' to this - master table. - PortNums should be assigned in the following range: - 0-63 Core Meshtastic use, do not use for third party apps - 64-127 Registered 3rd party apps, send in a pull request that adds a new entry to portnums.proto to register your application - 256-511 Use one of these portnums for your private applications that you don't want to register publically - All other values are reserved. - Note: This was formerly a Type enum named 'typ' with the same id # - We have change to this 'portnum' based scheme for specifying app handlers for particular payloads. - This change is backwards compatible by treating the legacy OPAQUE/CLEAR_TEXT values identically. */ -typedef enum _PortNum { - /* Deprecated: do not use in new code (formerly called OPAQUE) - A message sent from a device outside of the mesh, in a form the mesh does not understand - NOTE: This must be 0, because it is documented in IMeshService.aidl to be so */ - PortNum_UNKNOWN_APP = 0, - /* A simple UTF-8 text message, which even the little micros in the mesh - can understand and show on their screen eventually in some circumstances - even signal might send messages in this form (see below) */ - PortNum_TEXT_MESSAGE_APP = 1, - /* Reserved for built-in GPIO/example app. - See remote_hardware.proto/HardwareMessage for details on the message sent/received to this port number */ - PortNum_REMOTE_HARDWARE_APP = 2, - /* The built-in position messaging app. - Payload is a [Position](/docs/developers/protobufs/api#position) message */ - PortNum_POSITION_APP = 3, - /* The built-in user info app. - Payload is a [User](/docs/developers/protobufs/api#user) message */ - PortNum_NODEINFO_APP = 4, - /* Protocol control packets for mesh protocol use. - Payload is a [Routing](/docs/developers/protobufs/api#routing) message */ - PortNum_ROUTING_APP = 5, - /* Admin control packets. - Payload is a [AdminMessage](/docs/developers/protobufs/api#adminmessage) message */ - PortNum_ADMIN_APP = 6, - /* Compressed TEXT_MESSAGE payloads. */ - PortNum_TEXT_MESSAGE_COMPRESSED_APP = 7, - /* Waypoint payloads. - Payload is a [Waypoint](/docs/developers/protobufs/api#waypoint) message */ - PortNum_WAYPOINT_APP = 8, - /* Audio Payloads. - Encapsulated codec2 packets. On 2.4 GHZ Bandwidths only for now */ - PortNum_AUDIO_APP = 9, - /* Provides a 'ping' service that replies to any packet it receives. - Also serves as a small example module. */ - PortNum_REPLY_APP = 32, - /* Used for the python IP tunnel feature */ - PortNum_IP_TUNNEL_APP = 33, - /* Provides a hardware serial interface to send and receive from the Meshtastic network. - Connect to the RX/TX pins of a device with 38400 8N1. Packets received from the Meshtastic - network is forwarded to the RX pin while sending a packet to TX will go out to the Mesh network. - Maximum packet size of 240 bytes. - Module is disabled by default can be turned on by setting SERIAL_MODULE_ENABLED = 1 in SerialPlugh.cpp. */ - PortNum_SERIAL_APP = 64, - /* STORE_FORWARD_APP (Work in Progress) - Maintained by Jm Casler (MC Hamster) : jm@casler.org */ - PortNum_STORE_FORWARD_APP = 65, - /* Optional port for messages for the range test module. */ - PortNum_RANGE_TEST_APP = 66, - /* Provides a format to send and receive telemetry data from the Meshtastic network. - Maintained by Charles Crossan (crossan007) : crossan007@gmail.com */ - PortNum_TELEMETRY_APP = 67, - /* Experimental tools for estimating node position without a GPS - Maintained by Github user a-f-G-U-C (a Meshtastic contributor) - Project files at https://github.com/a-f-G-U-C/Meshtastic-ZPS */ - PortNum_ZPS_APP = 68, - /* Used to let multiple instances of Linux native applications communicate - as if they did using their LoRa chip. - Maintained by GitHub user GUVWAF. - Project files at https://github.com/GUVWAF/Meshtasticator */ - PortNum_SIMULATOR_APP = 69, - /* Provides a traceroute functionality to show the route a packet towards - a certain destination would take on the mesh. */ - PortNum_TRACEROUTE_APP = 70, - /* Private applications should use portnums >= 256. - To simplify initial development and testing you can use "PRIVATE_APP" - in your code without needing to rebuild protobuf files (via [regen-protos.sh](https://github.com/meshtastic/firmware/blob/master/bin/regen-protos.sh)) */ - PortNum_PRIVATE_APP = 256, - /* ATAK Forwarder Module https://github.com/paulmandal/atak-forwarder */ - PortNum_ATAK_FORWARDER = 257, - /* Currently we limit port nums to no higher than this value */ - PortNum_MAX = 511 -} PortNum; - -#ifdef __cplusplus -extern "C" { -#endif - -/* Helper constants for enums */ -#define _PortNum_MIN PortNum_UNKNOWN_APP -#define _PortNum_MAX PortNum_MAX -#define _PortNum_ARRAYSIZE ((PortNum)(PortNum_MAX+1)) - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/remote_hardware.pb.c b/src/mesh/generated/remote_hardware.pb.c deleted file mode 100644 index de6c4dc4b..000000000 --- a/src/mesh/generated/remote_hardware.pb.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "remote_hardware.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(HardwareMessage, HardwareMessage, AUTO) - - - - diff --git a/src/mesh/generated/remote_hardware.pb.h b/src/mesh/generated/remote_hardware.pb.h deleted file mode 100644 index 6c09809c5..000000000 --- a/src/mesh/generated/remote_hardware.pb.h +++ /dev/null @@ -1,93 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_REMOTE_HARDWARE_PB_H_INCLUDED -#define PB_REMOTE_HARDWARE_PB_H_INCLUDED -#include - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -/* TODO: REPLACE */ -typedef enum _HardwareMessage_Type { - /* Unset/unused */ - HardwareMessage_Type_UNSET = 0, - /* Set gpio gpios based on gpio_mask/gpio_value */ - HardwareMessage_Type_WRITE_GPIOS = 1, - /* We are now interested in watching the gpio_mask gpios. - If the selected gpios change, please broadcast GPIOS_CHANGED. - Will implicitly change the gpios requested to be INPUT gpios. */ - HardwareMessage_Type_WATCH_GPIOS = 2, - /* The gpios listed in gpio_mask have changed, the new values are listed in gpio_value */ - HardwareMessage_Type_GPIOS_CHANGED = 3, - /* Read the gpios specified in gpio_mask, send back a READ_GPIOS_REPLY reply with gpio_value populated */ - HardwareMessage_Type_READ_GPIOS = 4, - /* A reply to READ_GPIOS. gpio_mask and gpio_value will be populated */ - HardwareMessage_Type_READ_GPIOS_REPLY = 5 -} HardwareMessage_Type; - -/* Struct definitions */ -/* An example app to show off the module system. This message is used for - REMOTE_HARDWARE_APP PortNums. - Also provides easy remote access to any GPIO. - In the future other remote hardware operations can be added based on user interest - (i.e. serial output, spi/i2c input/output). - FIXME - currently this feature is turned on by default which is dangerous - because no security yet (beyond the channel mechanism). - It should be off by default and then protected based on some TBD mechanism - (a special channel once multichannel support is included?) */ -typedef struct _HardwareMessage { - /* What type of HardwareMessage is this? */ - HardwareMessage_Type type; - /* What gpios are we changing. Not used for all MessageTypes, see MessageType for details */ - uint64_t gpio_mask; - /* For gpios that were listed in gpio_mask as valid, what are the signal levels for those gpios. - Not used for all MessageTypes, see MessageType for details */ - uint64_t gpio_value; -} HardwareMessage; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Helper constants for enums */ -#define _HardwareMessage_Type_MIN HardwareMessage_Type_UNSET -#define _HardwareMessage_Type_MAX HardwareMessage_Type_READ_GPIOS_REPLY -#define _HardwareMessage_Type_ARRAYSIZE ((HardwareMessage_Type)(HardwareMessage_Type_READ_GPIOS_REPLY+1)) - -#define HardwareMessage_type_ENUMTYPE HardwareMessage_Type - - -/* Initializer values for message structs */ -#define HardwareMessage_init_default {_HardwareMessage_Type_MIN, 0, 0} -#define HardwareMessage_init_zero {_HardwareMessage_Type_MIN, 0, 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define HardwareMessage_type_tag 1 -#define HardwareMessage_gpio_mask_tag 2 -#define HardwareMessage_gpio_value_tag 3 - -/* Struct field encoding specification for nanopb */ -#define HardwareMessage_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UENUM, type, 1) \ -X(a, STATIC, SINGULAR, UINT64, gpio_mask, 2) \ -X(a, STATIC, SINGULAR, UINT64, gpio_value, 3) -#define HardwareMessage_CALLBACK NULL -#define HardwareMessage_DEFAULT NULL - -extern const pb_msgdesc_t HardwareMessage_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define HardwareMessage_fields &HardwareMessage_msg - -/* Maximum encoded size of messages (where known) */ -#define HardwareMessage_size 24 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/rtttl.pb.c b/src/mesh/generated/rtttl.pb.c deleted file mode 100644 index 960d1ebcd..000000000 --- a/src/mesh/generated/rtttl.pb.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "rtttl.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(RTTTLConfig, RTTTLConfig, AUTO) - - - diff --git a/src/mesh/generated/rtttl.pb.h b/src/mesh/generated/rtttl.pb.h deleted file mode 100644 index 7c4de8f73..000000000 --- a/src/mesh/generated/rtttl.pb.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_RTTTL_PB_H_INCLUDED -#define PB_RTTTL_PB_H_INCLUDED -#include - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Struct definitions */ -/* Canned message module configuration. */ -typedef struct _RTTTLConfig { - /* Ringtone for PWM Buzzer in RTTTL Format. */ - char ringtone[230]; -} RTTTLConfig; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initializer values for message structs */ -#define RTTTLConfig_init_default {""} -#define RTTTLConfig_init_zero {""} - -/* Field tags (for use in manual encoding/decoding) */ -#define RTTTLConfig_ringtone_tag 1 - -/* Struct field encoding specification for nanopb */ -#define RTTTLConfig_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, STRING, ringtone, 1) -#define RTTTLConfig_CALLBACK NULL -#define RTTTLConfig_DEFAULT NULL - -extern const pb_msgdesc_t RTTTLConfig_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define RTTTLConfig_fields &RTTTLConfig_msg - -/* Maximum encoded size of messages (where known) */ -#define RTTTLConfig_size 232 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/storeforward.pb.c b/src/mesh/generated/storeforward.pb.c deleted file mode 100644 index 69db0e3bf..000000000 --- a/src/mesh/generated/storeforward.pb.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "storeforward.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(StoreAndForward, StoreAndForward, AUTO) - - -PB_BIND(StoreAndForward_Statistics, StoreAndForward_Statistics, AUTO) - - -PB_BIND(StoreAndForward_History, StoreAndForward_History, AUTO) - - -PB_BIND(StoreAndForward_Heartbeat, StoreAndForward_Heartbeat, AUTO) - - - - diff --git a/src/mesh/generated/storeforward.pb.h b/src/mesh/generated/storeforward.pb.h deleted file mode 100644 index 0f0761949..000000000 --- a/src/mesh/generated/storeforward.pb.h +++ /dev/null @@ -1,213 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_STOREFORWARD_PB_H_INCLUDED -#define PB_STOREFORWARD_PB_H_INCLUDED -#include - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -/* 001 - 063 = From Router - 064 - 127 = From Client */ -typedef enum _StoreAndForward_RequestResponse { - /* Unset/unused */ - StoreAndForward_RequestResponse_UNSET = 0, - /* Router is an in error state. */ - StoreAndForward_RequestResponse_ROUTER_ERROR = 1, - /* Router heartbeat */ - StoreAndForward_RequestResponse_ROUTER_HEARTBEAT = 2, - /* Router has requested the client respond. This can work as a - "are you there" message. */ - StoreAndForward_RequestResponse_ROUTER_PING = 3, - /* The response to a "Ping" */ - StoreAndForward_RequestResponse_ROUTER_PONG = 4, - /* Router is currently busy. Please try again later. */ - StoreAndForward_RequestResponse_ROUTER_BUSY = 5, - /* Router is responding to a request for history. */ - StoreAndForward_RequestResponse_ROUTER_HISTORY = 6, - /* Router is responding to a request for stats. */ - StoreAndForward_RequestResponse_ROUTER_STATS = 7, - /* Client is an in error state. */ - StoreAndForward_RequestResponse_CLIENT_ERROR = 64, - /* Client has requested a replay from the router. */ - StoreAndForward_RequestResponse_CLIENT_HISTORY = 65, - /* Client has requested stats from the router. */ - StoreAndForward_RequestResponse_CLIENT_STATS = 66, - /* Client has requested the router respond. This can work as a - "are you there" message. */ - StoreAndForward_RequestResponse_CLIENT_PING = 67, - /* The response to a "Ping" */ - StoreAndForward_RequestResponse_CLIENT_PONG = 68, - /* Client has requested that the router abort processing the client's request */ - StoreAndForward_RequestResponse_CLIENT_ABORT = 106 -} StoreAndForward_RequestResponse; - -/* Struct definitions */ -/* TODO: REPLACE */ -typedef struct _StoreAndForward_Statistics { - /* Number of messages we have ever seen */ - uint32_t messages_total; - /* Number of messages we have currently saved our history. */ - uint32_t messages_saved; - /* Maximum number of messages we will save */ - uint32_t messages_max; - /* Router uptime in seconds */ - uint32_t up_time; - /* Number of times any client sent a request to the S&F. */ - uint32_t requests; - /* Number of times the history was requested. */ - uint32_t requests_history; - /* Is the heartbeat enabled on the server? */ - bool heartbeat; - /* Is the heartbeat enabled on the server? */ - uint32_t return_max; - /* Is the heartbeat enabled on the server? */ - uint32_t return_window; -} StoreAndForward_Statistics; - -/* TODO: REPLACE */ -typedef struct _StoreAndForward_History { - /* Number of that will be sent to the client */ - uint32_t history_messages; - /* The window of messages that was used to filter the history client requested */ - uint32_t window; - /* The window of messages that was used to filter the history client requested */ - uint32_t last_request; -} StoreAndForward_History; - -/* TODO: REPLACE */ -typedef struct _StoreAndForward_Heartbeat { - /* Number of that will be sent to the client */ - uint32_t period; - /* If set, this is not the primary Store & Forward router on the mesh */ - uint32_t secondary; -} StoreAndForward_Heartbeat; - -/* TODO: REPLACE */ -typedef struct _StoreAndForward { - /* TODO: REPLACE */ - StoreAndForward_RequestResponse rr; - pb_size_t which_variant; - union { - /* TODO: REPLACE */ - StoreAndForward_Statistics stats; - /* TODO: REPLACE */ - StoreAndForward_History history; - /* TODO: REPLACE */ - StoreAndForward_Heartbeat heartbeat; - /* Empty Payload */ - bool empty; - } variant; -} StoreAndForward; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Helper constants for enums */ -#define _StoreAndForward_RequestResponse_MIN StoreAndForward_RequestResponse_UNSET -#define _StoreAndForward_RequestResponse_MAX StoreAndForward_RequestResponse_CLIENT_ABORT -#define _StoreAndForward_RequestResponse_ARRAYSIZE ((StoreAndForward_RequestResponse)(StoreAndForward_RequestResponse_CLIENT_ABORT+1)) - -#define StoreAndForward_rr_ENUMTYPE StoreAndForward_RequestResponse - - - - - -/* Initializer values for message structs */ -#define StoreAndForward_init_default {_StoreAndForward_RequestResponse_MIN, 0, {StoreAndForward_Statistics_init_default}} -#define StoreAndForward_Statistics_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0} -#define StoreAndForward_History_init_default {0, 0, 0} -#define StoreAndForward_Heartbeat_init_default {0, 0} -#define StoreAndForward_init_zero {_StoreAndForward_RequestResponse_MIN, 0, {StoreAndForward_Statistics_init_zero}} -#define StoreAndForward_Statistics_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0} -#define StoreAndForward_History_init_zero {0, 0, 0} -#define StoreAndForward_Heartbeat_init_zero {0, 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define StoreAndForward_Statistics_messages_total_tag 1 -#define StoreAndForward_Statistics_messages_saved_tag 2 -#define StoreAndForward_Statistics_messages_max_tag 3 -#define StoreAndForward_Statistics_up_time_tag 4 -#define StoreAndForward_Statistics_requests_tag 5 -#define StoreAndForward_Statistics_requests_history_tag 6 -#define StoreAndForward_Statistics_heartbeat_tag 7 -#define StoreAndForward_Statistics_return_max_tag 8 -#define StoreAndForward_Statistics_return_window_tag 9 -#define StoreAndForward_History_history_messages_tag 1 -#define StoreAndForward_History_window_tag 2 -#define StoreAndForward_History_last_request_tag 3 -#define StoreAndForward_Heartbeat_period_tag 1 -#define StoreAndForward_Heartbeat_secondary_tag 2 -#define StoreAndForward_rr_tag 1 -#define StoreAndForward_stats_tag 2 -#define StoreAndForward_history_tag 3 -#define StoreAndForward_heartbeat_tag 4 -#define StoreAndForward_empty_tag 5 - -/* Struct field encoding specification for nanopb */ -#define StoreAndForward_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UENUM, rr, 1) \ -X(a, STATIC, ONEOF, MESSAGE, (variant,stats,variant.stats), 2) \ -X(a, STATIC, ONEOF, MESSAGE, (variant,history,variant.history), 3) \ -X(a, STATIC, ONEOF, MESSAGE, (variant,heartbeat,variant.heartbeat), 4) \ -X(a, STATIC, ONEOF, BOOL, (variant,empty,variant.empty), 5) -#define StoreAndForward_CALLBACK NULL -#define StoreAndForward_DEFAULT NULL -#define StoreAndForward_variant_stats_MSGTYPE StoreAndForward_Statistics -#define StoreAndForward_variant_history_MSGTYPE StoreAndForward_History -#define StoreAndForward_variant_heartbeat_MSGTYPE StoreAndForward_Heartbeat - -#define StoreAndForward_Statistics_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, messages_total, 1) \ -X(a, STATIC, SINGULAR, UINT32, messages_saved, 2) \ -X(a, STATIC, SINGULAR, UINT32, messages_max, 3) \ -X(a, STATIC, SINGULAR, UINT32, up_time, 4) \ -X(a, STATIC, SINGULAR, UINT32, requests, 5) \ -X(a, STATIC, SINGULAR, UINT32, requests_history, 6) \ -X(a, STATIC, SINGULAR, BOOL, heartbeat, 7) \ -X(a, STATIC, SINGULAR, UINT32, return_max, 8) \ -X(a, STATIC, SINGULAR, UINT32, return_window, 9) -#define StoreAndForward_Statistics_CALLBACK NULL -#define StoreAndForward_Statistics_DEFAULT NULL - -#define StoreAndForward_History_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, history_messages, 1) \ -X(a, STATIC, SINGULAR, UINT32, window, 2) \ -X(a, STATIC, SINGULAR, UINT32, last_request, 3) -#define StoreAndForward_History_CALLBACK NULL -#define StoreAndForward_History_DEFAULT NULL - -#define StoreAndForward_Heartbeat_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, period, 1) \ -X(a, STATIC, SINGULAR, UINT32, secondary, 2) -#define StoreAndForward_Heartbeat_CALLBACK NULL -#define StoreAndForward_Heartbeat_DEFAULT NULL - -extern const pb_msgdesc_t StoreAndForward_msg; -extern const pb_msgdesc_t StoreAndForward_Statistics_msg; -extern const pb_msgdesc_t StoreAndForward_History_msg; -extern const pb_msgdesc_t StoreAndForward_Heartbeat_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define StoreAndForward_fields &StoreAndForward_msg -#define StoreAndForward_Statistics_fields &StoreAndForward_Statistics_msg -#define StoreAndForward_History_fields &StoreAndForward_History_msg -#define StoreAndForward_Heartbeat_fields &StoreAndForward_Heartbeat_msg - -/* Maximum encoded size of messages (where known) */ -#define StoreAndForward_Heartbeat_size 12 -#define StoreAndForward_History_size 18 -#define StoreAndForward_Statistics_size 50 -#define StoreAndForward_size 54 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/telemetry.pb.c b/src/mesh/generated/telemetry.pb.c deleted file mode 100644 index 50202f4d6..000000000 --- a/src/mesh/generated/telemetry.pb.c +++ /dev/null @@ -1,19 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "telemetry.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(DeviceMetrics, DeviceMetrics, AUTO) - - -PB_BIND(EnvironmentMetrics, EnvironmentMetrics, AUTO) - - -PB_BIND(Telemetry, Telemetry, AUTO) - - - - diff --git a/src/mesh/generated/telemetry.pb.h b/src/mesh/generated/telemetry.pb.h deleted file mode 100644 index e5c71a2b7..000000000 --- a/src/mesh/generated/telemetry.pb.h +++ /dev/null @@ -1,172 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_TELEMETRY_PB_H_INCLUDED -#define PB_TELEMETRY_PB_H_INCLUDED -#include - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -/* TODO: REPLACE */ -typedef enum _TelemetrySensorType { - /* No external telemetry sensor explicitly set */ - TelemetrySensorType_SENSOR_UNSET = 0, - /* High accuracy temperature, pressure, humidity */ - TelemetrySensorType_BME280 = 1, - /* High accuracy temperature, pressure, humidity, and air resistance */ - TelemetrySensorType_BME680 = 2, - /* Very high accuracy temperature */ - TelemetrySensorType_MCP9808 = 3, - /* Moderate accuracy current and voltage */ - TelemetrySensorType_INA260 = 4, - /* Moderate accuracy current and voltage */ - TelemetrySensorType_INA219 = 5, - /* High accuracy temperature and pressure */ - TelemetrySensorType_BMP280 = 6, - /* High accuracy temperature and humidity */ - TelemetrySensorType_SHTC3 = 7, - /* High accuracy pressure */ - TelemetrySensorType_LPS22 = 8, - /* 3-Axis magnetic sensor */ - TelemetrySensorType_QMC6310 = 9, - /* 6-Axis inertial measurement sensor */ - TelemetrySensorType_QMI8658 = 10, - /* 3-Axis magnetic sensor */ - TelemetrySensorType_QMC5883L = 11, - /* High accuracy temperature and humidity */ - TelemetrySensorType_SHT31 = 12 -} TelemetrySensorType; - -/* Struct definitions */ -/* Key native device metrics such as battery level */ -typedef struct _DeviceMetrics { - /* 1-100 (0 means powered) */ - uint32_t battery_level; - /* Voltage measured */ - float voltage; - /* Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise). */ - float channel_utilization; - /* Percent of airtime for transmission used within the last hour. */ - float air_util_tx; -} DeviceMetrics; - -/* Weather station or other environmental metrics */ -typedef struct _EnvironmentMetrics { - /* Temperature measured */ - float temperature; - /* Relative humidity percent measured */ - float relative_humidity; - /* Barometric pressure in hPA measured */ - float barometric_pressure; - /* Gas resistance in mOhm measured */ - float gas_resistance; - /* Voltage measured */ - float voltage; - /* Current measured */ - float current; -} EnvironmentMetrics; - -/* Types of Measurements the telemetry module is equipped to handle */ -typedef struct _Telemetry { - /* This is usually not sent over the mesh (to save space), but it is sent - from the phone so that the local device can set its RTC If it is sent over - the mesh (because there are devices on the mesh without GPS), it will only - be sent by devices which has a hardware GPS clock (IE Mobile Phone). - seconds since 1970 */ - uint32_t time; - pb_size_t which_variant; - union { - /* Key native device metrics such as battery level */ - DeviceMetrics device_metrics; - /* Weather station or other environmental metrics */ - EnvironmentMetrics environment_metrics; - } variant; -} Telemetry; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Helper constants for enums */ -#define _TelemetrySensorType_MIN TelemetrySensorType_SENSOR_UNSET -#define _TelemetrySensorType_MAX TelemetrySensorType_SHT31 -#define _TelemetrySensorType_ARRAYSIZE ((TelemetrySensorType)(TelemetrySensorType_SHT31+1)) - - - - - -/* Initializer values for message structs */ -#define DeviceMetrics_init_default {0, 0, 0, 0} -#define EnvironmentMetrics_init_default {0, 0, 0, 0, 0, 0} -#define Telemetry_init_default {0, 0, {DeviceMetrics_init_default}} -#define DeviceMetrics_init_zero {0, 0, 0, 0} -#define EnvironmentMetrics_init_zero {0, 0, 0, 0, 0, 0} -#define Telemetry_init_zero {0, 0, {DeviceMetrics_init_zero}} - -/* Field tags (for use in manual encoding/decoding) */ -#define DeviceMetrics_battery_level_tag 1 -#define DeviceMetrics_voltage_tag 2 -#define DeviceMetrics_channel_utilization_tag 3 -#define DeviceMetrics_air_util_tx_tag 4 -#define EnvironmentMetrics_temperature_tag 1 -#define EnvironmentMetrics_relative_humidity_tag 2 -#define EnvironmentMetrics_barometric_pressure_tag 3 -#define EnvironmentMetrics_gas_resistance_tag 4 -#define EnvironmentMetrics_voltage_tag 5 -#define EnvironmentMetrics_current_tag 6 -#define Telemetry_time_tag 1 -#define Telemetry_device_metrics_tag 2 -#define Telemetry_environment_metrics_tag 3 - -/* Struct field encoding specification for nanopb */ -#define DeviceMetrics_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UINT32, battery_level, 1) \ -X(a, STATIC, SINGULAR, FLOAT, voltage, 2) \ -X(a, STATIC, SINGULAR, FLOAT, channel_utilization, 3) \ -X(a, STATIC, SINGULAR, FLOAT, air_util_tx, 4) -#define DeviceMetrics_CALLBACK NULL -#define DeviceMetrics_DEFAULT NULL - -#define EnvironmentMetrics_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, FLOAT, temperature, 1) \ -X(a, STATIC, SINGULAR, FLOAT, relative_humidity, 2) \ -X(a, STATIC, SINGULAR, FLOAT, barometric_pressure, 3) \ -X(a, STATIC, SINGULAR, FLOAT, gas_resistance, 4) \ -X(a, STATIC, SINGULAR, FLOAT, voltage, 5) \ -X(a, STATIC, SINGULAR, FLOAT, current, 6) -#define EnvironmentMetrics_CALLBACK NULL -#define EnvironmentMetrics_DEFAULT NULL - -#define Telemetry_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, FIXED32, time, 1) \ -X(a, STATIC, ONEOF, MESSAGE, (variant,device_metrics,variant.device_metrics), 2) \ -X(a, STATIC, ONEOF, MESSAGE, (variant,environment_metrics,variant.environment_metrics), 3) -#define Telemetry_CALLBACK NULL -#define Telemetry_DEFAULT NULL -#define Telemetry_variant_device_metrics_MSGTYPE DeviceMetrics -#define Telemetry_variant_environment_metrics_MSGTYPE EnvironmentMetrics - -extern const pb_msgdesc_t DeviceMetrics_msg; -extern const pb_msgdesc_t EnvironmentMetrics_msg; -extern const pb_msgdesc_t Telemetry_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define DeviceMetrics_fields &DeviceMetrics_msg -#define EnvironmentMetrics_fields &EnvironmentMetrics_msg -#define Telemetry_fields &Telemetry_msg - -/* Maximum encoded size of messages (where known) */ -#define DeviceMetrics_size 21 -#define EnvironmentMetrics_size 30 -#define Telemetry_size 37 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/mesh/generated/xmodem.pb.c b/src/mesh/generated/xmodem.pb.c deleted file mode 100644 index f210380fe..000000000 --- a/src/mesh/generated/xmodem.pb.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.7 */ - -#include "xmodem.pb.h" -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -PB_BIND(XModem, XModem, AUTO) - - - - diff --git a/src/mesh/generated/xmodem.pb.h b/src/mesh/generated/xmodem.pb.h deleted file mode 100644 index 453c8ce7c..000000000 --- a/src/mesh/generated/xmodem.pb.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.7 */ - -#ifndef PB_XMODEM_PB_H_INCLUDED -#define PB_XMODEM_PB_H_INCLUDED -#include - -#if PB_PROTO_HEADER_VERSION != 40 -#error Regenerate this file with the current version of nanopb generator. -#endif - -/* Enum definitions */ -typedef enum _XModem_Control { - XModem_Control_NUL = 0, - XModem_Control_SOH = 1, - XModem_Control_STX = 2, - XModem_Control_EOT = 4, - XModem_Control_ACK = 6, - XModem_Control_NAK = 21, - XModem_Control_CAN = 24, - XModem_Control_CTRLZ = 26 -} XModem_Control; - -/* Struct definitions */ -typedef PB_BYTES_ARRAY_T(128) XModem_buffer_t; -typedef struct _XModem { - XModem_Control control; - uint16_t seq; - uint16_t crc16; - XModem_buffer_t buffer; -} XModem; - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Helper constants for enums */ -#define _XModem_Control_MIN XModem_Control_NUL -#define _XModem_Control_MAX XModem_Control_CTRLZ -#define _XModem_Control_ARRAYSIZE ((XModem_Control)(XModem_Control_CTRLZ+1)) - -#define XModem_control_ENUMTYPE XModem_Control - - -/* Initializer values for message structs */ -#define XModem_init_default {_XModem_Control_MIN, 0, 0, {0, {0}}} -#define XModem_init_zero {_XModem_Control_MIN, 0, 0, {0, {0}}} - -/* Field tags (for use in manual encoding/decoding) */ -#define XModem_control_tag 1 -#define XModem_seq_tag 2 -#define XModem_crc16_tag 3 -#define XModem_buffer_tag 4 - -/* Struct field encoding specification for nanopb */ -#define XModem_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, UENUM, control, 1) \ -X(a, STATIC, SINGULAR, UINT32, seq, 2) \ -X(a, STATIC, SINGULAR, UINT32, crc16, 3) \ -X(a, STATIC, SINGULAR, BYTES, buffer, 4) -#define XModem_CALLBACK NULL -#define XModem_DEFAULT NULL - -extern const pb_msgdesc_t XModem_msg; - -/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define XModem_fields &XModem_msg - -/* Maximum encoded size of messages (where known) */ -#define XModem_size 141 - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif From 4d4af7de59d4b8785124c7e1b6454348c12c695e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 18 Jan 2023 08:56:47 -0600 Subject: [PATCH 10/20] generated paths experiment --- bin/regen-protos.sh | 6 +++++- src/detect/i2cScan.h | 2 +- src/error.h | 2 +- src/graphics/Screen.cpp | 2 +- src/main.h | 2 +- src/mesh/mesh-pb-constants.h | 8 ++++---- src/modules/CannedMessageModule.cpp | 2 +- src/modules/ExternalNotificationModule.cpp | 2 +- src/modules/RemoteHardwareModule.h | 2 +- src/modules/Telemetry/DeviceTelemetry.cpp | 2 +- src/modules/Telemetry/DeviceTelemetry.h | 2 +- src/modules/Telemetry/EnvironmentTelemetry.cpp | 2 +- src/modules/Telemetry/EnvironmentTelemetry.h | 2 +- src/modules/Telemetry/Sensor/BME280Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/BME280Sensor.h | 2 +- src/modules/Telemetry/Sensor/BME680Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/BME680Sensor.h | 2 +- src/modules/Telemetry/Sensor/BMP280Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/BMP280Sensor.h | 2 +- src/modules/Telemetry/Sensor/INA219Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/INA219Sensor.h | 2 +- src/modules/Telemetry/Sensor/INA260Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/INA260Sensor.h | 2 +- src/modules/Telemetry/Sensor/LPS22HBSensor.cpp | 2 +- src/modules/Telemetry/Sensor/LPS22HBSensor.h | 2 +- src/modules/Telemetry/Sensor/MCP9808Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/MCP9808Sensor.h | 2 +- src/modules/Telemetry/Sensor/SHT31Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/SHT31Sensor.h | 2 +- src/modules/Telemetry/Sensor/SHTC3Sensor.cpp | 2 +- src/modules/Telemetry/Sensor/SHTC3Sensor.h | 2 +- src/modules/Telemetry/Sensor/TelemetrySensor.cpp | 2 +- src/modules/Telemetry/Sensor/TelemetrySensor.h | 2 +- src/modules/esp32/StoreForwardModule.cpp | 2 +- src/modules/esp32/StoreForwardModule.h | 2 +- src/mqtt/MQTT.cpp | 4 ++-- src/mqtt/MQTT.h | 2 +- src/xmodem.h | 2 +- 38 files changed, 46 insertions(+), 42 deletions(-) diff --git a/bin/regen-protos.sh b/bin/regen-protos.sh index bf3cf7ca0..eae8a121c 100755 --- a/bin/regen-protos.sh +++ b/bin/regen-protos.sh @@ -8,7 +8,11 @@ echo "prebuilt binaries for your computer into nanopb-0.4.7" # the nanopb tool seems to require that the .options file be in the current directory! cd protobufs -../nanopb-0.4.7/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated/meshtastic -I=../protobufs meshtastic/*.proto +../nanopb-0.4.7/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated/ -I=../protobufs meshtastic/*.proto + +cd ../src/mesh/generated/meshtastic +sed -i 's/#include "meshtastic/#include "./g' * + #echo "Regenerating protobuf documentation - if you see an error message" #echo "you can ignore it unless doing a new protobuf release to github." diff --git a/src/detect/i2cScan.h b/src/detect/i2cScan.h index 77d1fff17..6efe6b4e5 100644 --- a/src/detect/i2cScan.h +++ b/src/detect/i2cScan.h @@ -1,7 +1,7 @@ #include "../configuration.h" #include "../main.h" #include -#include "mesh/generated/telemetry.pb.h" +#include "mesh/generated/meshtastic/telemetry.pb.h" // AXP192 and AXP2101 have the same device address, we just need to identify it in Power.cpp #ifndef XPOWERS_AXP192_AXP2101_ADDRESS diff --git a/src/error.h b/src/error.h index e57407bf8..4c309e395 100644 --- a/src/error.h +++ b/src/error.h @@ -2,7 +2,7 @@ #include -#include "mesh/generated/mesh.pb.h" // For CriticalErrorCode +#include "mesh/generated/meshtastic/mesh.pb.h" // For CriticalErrorCode /// A macro that include filename and line #define RECORD_CRITICALERROR(code) recordCriticalError(code, __LINE__, __FILE__) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 034ba3307..ad09368c4 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -33,7 +33,7 @@ along with this program. If not, see . #include "main.h" #include "mesh-pb-constants.h" #include "mesh/Channels.h" -#include "mesh/generated/deviceonly.pb.h" +#include "mesh/generated/meshtastic/deviceonly.pb.h" #include "modules/TextMessageModule.h" #include "modules/ExternalNotificationModule.h" #include "sleep.h" diff --git a/src/main.h b/src/main.h index 89a6bd059..1e02d7c79 100644 --- a/src/main.h +++ b/src/main.h @@ -5,7 +5,7 @@ #include "NodeStatus.h" #include "PowerStatus.h" #include "graphics/Screen.h" -#include "mesh/generated/telemetry.pb.h" +#include "mesh/generated/meshtastic/telemetry.pb.h" #if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) #include #endif diff --git a/src/mesh/mesh-pb-constants.h b/src/mesh/mesh-pb-constants.h index 59ccc9e16..2b0f7bd06 100644 --- a/src/mesh/mesh-pb-constants.h +++ b/src/mesh/mesh-pb-constants.h @@ -1,9 +1,9 @@ #pragma once -#include "mesh/generated/mesh.pb.h" -#include "mesh/generated/localonly.pb.h" -#include "mesh/generated/deviceonly.pb.h" -#include "mesh/generated/admin.pb.h" +#include "mesh/generated/meshtastic/mesh.pb.h" +#include "mesh/generated/meshtastic/localonly.pb.h" +#include "mesh/generated/meshtastic/deviceonly.pb.h" +#include "mesh/generated/meshtastic/admin.pb.h" // this file defines constants which come from mesh.options diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 9e42f8467..6e85a8c71 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -5,7 +5,7 @@ #include "NodeDB.h" #include "MeshService.h" #include "PowerFSM.h" // neede for button bypass -#include "mesh/generated/cannedmessages.pb.h" +#include "mesh/generated/meshtastic/cannedmessages.pb.h" #ifdef OLED_RU #include "graphics/fonts/OLEDDisplayFontsRU.h" diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index 3f2137ec8..05776bd44 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -5,7 +5,7 @@ #include "Router.h" #include "buzz/buzz.h" #include "configuration.h" -#include "mesh/generated/rtttl.pb.h" +#include "mesh/generated/meshtastic/rtttl.pb.h" #include #ifndef PIN_BUZZER diff --git a/src/modules/RemoteHardwareModule.h b/src/modules/RemoteHardwareModule.h index e9c7794fb..2e16d356d 100644 --- a/src/modules/RemoteHardwareModule.h +++ b/src/modules/RemoteHardwareModule.h @@ -1,6 +1,6 @@ #pragma once #include "ProtobufModule.h" -#include "mesh/generated/remote_hardware.pb.h" +#include "mesh/generated/meshtastic/remote_hardware.pb.h" #include "concurrency/OSThread.h" /** diff --git a/src/modules/Telemetry/DeviceTelemetry.cpp b/src/modules/Telemetry/DeviceTelemetry.cpp index 5f96661e5..1ae28fab3 100644 --- a/src/modules/Telemetry/DeviceTelemetry.cpp +++ b/src/modules/Telemetry/DeviceTelemetry.cpp @@ -1,5 +1,5 @@ #include "DeviceTelemetry.h" -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "MeshService.h" #include "NodeDB.h" #include "PowerFSM.h" diff --git a/src/modules/Telemetry/DeviceTelemetry.h b/src/modules/Telemetry/DeviceTelemetry.h index 0fb33ceee..199d00307 100644 --- a/src/modules/Telemetry/DeviceTelemetry.h +++ b/src/modules/Telemetry/DeviceTelemetry.h @@ -1,5 +1,5 @@ #pragma once -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "NodeDB.h" #include "ProtobufModule.h" #include diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index 2a29405d3..cc5f56310 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -1,5 +1,5 @@ #include "EnvironmentTelemetry.h" -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "MeshService.h" #include "NodeDB.h" #include "PowerFSM.h" diff --git a/src/modules/Telemetry/EnvironmentTelemetry.h b/src/modules/Telemetry/EnvironmentTelemetry.h index c081ead51..06621363f 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.h +++ b/src/modules/Telemetry/EnvironmentTelemetry.h @@ -1,5 +1,5 @@ #pragma once -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "NodeDB.h" #include "ProtobufModule.h" #include diff --git a/src/modules/Telemetry/Sensor/BME280Sensor.cpp b/src/modules/Telemetry/Sensor/BME280Sensor.cpp index 26f48f89d..93d882238 100644 --- a/src/modules/Telemetry/Sensor/BME280Sensor.cpp +++ b/src/modules/Telemetry/Sensor/BME280Sensor.cpp @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "configuration.h" #include "TelemetrySensor.h" #include "BME280Sensor.h" diff --git a/src/modules/Telemetry/Sensor/BME280Sensor.h b/src/modules/Telemetry/Sensor/BME280Sensor.h index 166796a37..606372707 100644 --- a/src/modules/Telemetry/Sensor/BME280Sensor.h +++ b/src/modules/Telemetry/Sensor/BME280Sensor.h @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" #include diff --git a/src/modules/Telemetry/Sensor/BME680Sensor.cpp b/src/modules/Telemetry/Sensor/BME680Sensor.cpp index 44690fbaa..e164ec28a 100644 --- a/src/modules/Telemetry/Sensor/BME680Sensor.cpp +++ b/src/modules/Telemetry/Sensor/BME680Sensor.cpp @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "configuration.h" #include "TelemetrySensor.h" #include "BME680Sensor.h" diff --git a/src/modules/Telemetry/Sensor/BME680Sensor.h b/src/modules/Telemetry/Sensor/BME680Sensor.h index a3c37203d..146730d2c 100644 --- a/src/modules/Telemetry/Sensor/BME680Sensor.h +++ b/src/modules/Telemetry/Sensor/BME680Sensor.h @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" #include diff --git a/src/modules/Telemetry/Sensor/BMP280Sensor.cpp b/src/modules/Telemetry/Sensor/BMP280Sensor.cpp index eddc30649..1f3f3a835 100644 --- a/src/modules/Telemetry/Sensor/BMP280Sensor.cpp +++ b/src/modules/Telemetry/Sensor/BMP280Sensor.cpp @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "configuration.h" #include "TelemetrySensor.h" #include "BMP280Sensor.h" diff --git a/src/modules/Telemetry/Sensor/BMP280Sensor.h b/src/modules/Telemetry/Sensor/BMP280Sensor.h index 3525f3fa3..ce41d2d20 100644 --- a/src/modules/Telemetry/Sensor/BMP280Sensor.h +++ b/src/modules/Telemetry/Sensor/BMP280Sensor.h @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" #include diff --git a/src/modules/Telemetry/Sensor/INA219Sensor.cpp b/src/modules/Telemetry/Sensor/INA219Sensor.cpp index 4a732e73d..bf36f73b5 100644 --- a/src/modules/Telemetry/Sensor/INA219Sensor.cpp +++ b/src/modules/Telemetry/Sensor/INA219Sensor.cpp @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "configuration.h" #include "TelemetrySensor.h" #include "INA219Sensor.h" diff --git a/src/modules/Telemetry/Sensor/INA219Sensor.h b/src/modules/Telemetry/Sensor/INA219Sensor.h index 7e0a3c17e..50ce0edbc 100644 --- a/src/modules/Telemetry/Sensor/INA219Sensor.h +++ b/src/modules/Telemetry/Sensor/INA219Sensor.h @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" #include diff --git a/src/modules/Telemetry/Sensor/INA260Sensor.cpp b/src/modules/Telemetry/Sensor/INA260Sensor.cpp index 5b3064e7d..d6b53f4a3 100644 --- a/src/modules/Telemetry/Sensor/INA260Sensor.cpp +++ b/src/modules/Telemetry/Sensor/INA260Sensor.cpp @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "configuration.h" #include "TelemetrySensor.h" #include "INA260Sensor.h" diff --git a/src/modules/Telemetry/Sensor/INA260Sensor.h b/src/modules/Telemetry/Sensor/INA260Sensor.h index 789b66c2d..8d451ddda 100644 --- a/src/modules/Telemetry/Sensor/INA260Sensor.h +++ b/src/modules/Telemetry/Sensor/INA260Sensor.h @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" #include diff --git a/src/modules/Telemetry/Sensor/LPS22HBSensor.cpp b/src/modules/Telemetry/Sensor/LPS22HBSensor.cpp index 1f75a9aa1..6647b2eac 100644 --- a/src/modules/Telemetry/Sensor/LPS22HBSensor.cpp +++ b/src/modules/Telemetry/Sensor/LPS22HBSensor.cpp @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "configuration.h" #include "TelemetrySensor.h" #include "LPS22HBSensor.h" diff --git a/src/modules/Telemetry/Sensor/LPS22HBSensor.h b/src/modules/Telemetry/Sensor/LPS22HBSensor.h index 1ded032fb..2e8593d2b 100644 --- a/src/modules/Telemetry/Sensor/LPS22HBSensor.h +++ b/src/modules/Telemetry/Sensor/LPS22HBSensor.h @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" #include #include diff --git a/src/modules/Telemetry/Sensor/MCP9808Sensor.cpp b/src/modules/Telemetry/Sensor/MCP9808Sensor.cpp index 4dd3be635..d8e14922a 100644 --- a/src/modules/Telemetry/Sensor/MCP9808Sensor.cpp +++ b/src/modules/Telemetry/Sensor/MCP9808Sensor.cpp @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "configuration.h" #include "TelemetrySensor.h" #include "MCP9808Sensor.h" diff --git a/src/modules/Telemetry/Sensor/MCP9808Sensor.h b/src/modules/Telemetry/Sensor/MCP9808Sensor.h index 81f50b886..aa3eadbe6 100644 --- a/src/modules/Telemetry/Sensor/MCP9808Sensor.h +++ b/src/modules/Telemetry/Sensor/MCP9808Sensor.h @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" #include diff --git a/src/modules/Telemetry/Sensor/SHT31Sensor.cpp b/src/modules/Telemetry/Sensor/SHT31Sensor.cpp index 528d5a030..22284d5c0 100644 --- a/src/modules/Telemetry/Sensor/SHT31Sensor.cpp +++ b/src/modules/Telemetry/Sensor/SHT31Sensor.cpp @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "configuration.h" #include "TelemetrySensor.h" #include "SHT31Sensor.h" diff --git a/src/modules/Telemetry/Sensor/SHT31Sensor.h b/src/modules/Telemetry/Sensor/SHT31Sensor.h index 5f236e21e..92ea9a05d 100644 --- a/src/modules/Telemetry/Sensor/SHT31Sensor.h +++ b/src/modules/Telemetry/Sensor/SHT31Sensor.h @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" #include diff --git a/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp b/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp index 3a20d37a1..99335d87c 100644 --- a/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp +++ b/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "configuration.h" #include "TelemetrySensor.h" #include "SHTC3Sensor.h" diff --git a/src/modules/Telemetry/Sensor/SHTC3Sensor.h b/src/modules/Telemetry/Sensor/SHTC3Sensor.h index 28a1648bb..d0cd33f03 100644 --- a/src/modules/Telemetry/Sensor/SHTC3Sensor.h +++ b/src/modules/Telemetry/Sensor/SHTC3Sensor.h @@ -1,4 +1,4 @@ -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "TelemetrySensor.h" #include diff --git a/src/modules/Telemetry/Sensor/TelemetrySensor.cpp b/src/modules/Telemetry/Sensor/TelemetrySensor.cpp index e811d7182..cd8fe2566 100644 --- a/src/modules/Telemetry/Sensor/TelemetrySensor.cpp +++ b/src/modules/Telemetry/Sensor/TelemetrySensor.cpp @@ -1,4 +1,4 @@ #include "TelemetrySensor.h" -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "NodeDB.h" #include "main.h" diff --git a/src/modules/Telemetry/Sensor/TelemetrySensor.h b/src/modules/Telemetry/Sensor/TelemetrySensor.h index 87f2d68ba..97582f9b4 100644 --- a/src/modules/Telemetry/Sensor/TelemetrySensor.h +++ b/src/modules/Telemetry/Sensor/TelemetrySensor.h @@ -1,5 +1,5 @@ #pragma once -#include "../mesh/generated/telemetry.pb.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" #include "NodeDB.h" #include "main.h" diff --git a/src/modules/esp32/StoreForwardModule.cpp b/src/modules/esp32/StoreForwardModule.cpp index ba0e7d6ee..825b0376b 100644 --- a/src/modules/esp32/StoreForwardModule.cpp +++ b/src/modules/esp32/StoreForwardModule.cpp @@ -6,7 +6,7 @@ #include "airtime.h" #include "configuration.h" #include "mesh-pb-constants.h" -#include "mesh/generated/storeforward.pb.h" +#include "mesh/generated/meshtastic/storeforward.pb.h" #include "modules/ModuleDev.h" #include #include diff --git a/src/modules/esp32/StoreForwardModule.h b/src/modules/esp32/StoreForwardModule.h index c9cb72a5b..4d9e080cf 100644 --- a/src/modules/esp32/StoreForwardModule.h +++ b/src/modules/esp32/StoreForwardModule.h @@ -2,7 +2,7 @@ #include "ProtobufModule.h" #include "concurrency/OSThread.h" -#include "mesh/generated/storeforward.pb.h" +#include "mesh/generated/meshtastic/storeforward.pb.h" #include "configuration.h" #include diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 34b75e5bb..f54ecd0b7 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -5,8 +5,8 @@ #include "main.h" #include "mesh/Channels.h" #include "mesh/Router.h" -#include "mesh/generated/mqtt.pb.h" -#include "mesh/generated/telemetry.pb.h" +#include "mesh/generated/meshtastic/mqtt.pb.h" +#include "mesh/generated/meshtastic/telemetry.pb.h" #include "mesh/http/WiFiAPClient.h" #include "sleep.h" #if HAS_WIFI diff --git a/src/mqtt/MQTT.h b/src/mqtt/MQTT.h index 16ce4c37a..563ba7164 100644 --- a/src/mqtt/MQTT.h +++ b/src/mqtt/MQTT.h @@ -4,7 +4,7 @@ #include "concurrency/OSThread.h" #include "mesh/Channels.h" -#include "mesh/generated/mqtt.pb.h" +#include "mesh/generated/meshtastic/mqtt.pb.h" #include #if HAS_WIFI #include diff --git a/src/xmodem.h b/src/xmodem.h index 6c2418926..3540c0649 100644 --- a/src/xmodem.h +++ b/src/xmodem.h @@ -33,7 +33,7 @@ #pragma once #include "configuration.h" -#include "mesh/generated/xmodem.pb.h" +#include "mesh/generated/meshtastic/xmodem.pb.h" #include "FSCommon.h" #define MAXRETRANS 25 From 5189e328b6f416eebe64f9f9b423101486a86660 Mon Sep 17 00:00:00 2001 From: thebentern Date: Wed, 18 Jan 2023 14:57:44 +0000 Subject: [PATCH 11/20] [create-pull-request] automated change --- src/mesh/generated/meshtastic/admin.pb.c | 2 +- src/mesh/generated/meshtastic/admin.pb.h | 10 +++++----- src/mesh/generated/meshtastic/apponly.pb.c | 2 +- src/mesh/generated/meshtastic/apponly.pb.h | 4 ++-- src/mesh/generated/meshtastic/cannedmessages.pb.c | 2 +- src/mesh/generated/meshtastic/channel.pb.c | 2 +- src/mesh/generated/meshtastic/config.pb.c | 2 +- src/mesh/generated/meshtastic/device_metadata.pb.c | 2 +- src/mesh/generated/meshtastic/device_metadata.pb.h | 2 +- src/mesh/generated/meshtastic/deviceonly.pb.c | 2 +- src/mesh/generated/meshtastic/deviceonly.pb.h | 4 ++-- src/mesh/generated/meshtastic/localonly.pb.c | 2 +- src/mesh/generated/meshtastic/localonly.pb.h | 4 ++-- src/mesh/generated/meshtastic/mesh.pb.c | 2 +- src/mesh/generated/meshtastic/mesh.pb.h | 12 ++++++------ src/mesh/generated/meshtastic/module_config.pb.c | 2 +- src/mesh/generated/meshtastic/mqtt.pb.c | 2 +- src/mesh/generated/meshtastic/mqtt.pb.h | 2 +- src/mesh/generated/meshtastic/portnums.pb.c | 2 +- src/mesh/generated/meshtastic/remote_hardware.pb.c | 2 +- src/mesh/generated/meshtastic/rtttl.pb.c | 2 +- src/mesh/generated/meshtastic/storeforward.pb.c | 2 +- src/mesh/generated/meshtastic/telemetry.pb.c | 2 +- src/mesh/generated/meshtastic/xmodem.pb.c | 2 +- 24 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/mesh/generated/meshtastic/admin.pb.c b/src/mesh/generated/meshtastic/admin.pb.c index 1f668dabc..7925075d6 100644 --- a/src/mesh/generated/meshtastic/admin.pb.c +++ b/src/mesh/generated/meshtastic/admin.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/admin.pb.h" +#include "./admin.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/admin.pb.h b/src/mesh/generated/meshtastic/admin.pb.h index 5caa22bb7..63f265a9c 100644 --- a/src/mesh/generated/meshtastic/admin.pb.h +++ b/src/mesh/generated/meshtastic/admin.pb.h @@ -4,11 +4,11 @@ #ifndef PB_MESHTASTIC_MESHTASTIC_ADMIN_PB_H_INCLUDED #define PB_MESHTASTIC_MESHTASTIC_ADMIN_PB_H_INCLUDED #include -#include "meshtastic/channel.pb.h" -#include "meshtastic/config.pb.h" -#include "meshtastic/device_metadata.pb.h" -#include "meshtastic/mesh.pb.h" -#include "meshtastic/module_config.pb.h" +#include "./channel.pb.h" +#include "./config.pb.h" +#include "./device_metadata.pb.h" +#include "./mesh.pb.h" +#include "./module_config.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/src/mesh/generated/meshtastic/apponly.pb.c b/src/mesh/generated/meshtastic/apponly.pb.c index 8c3801ed7..0f8c14d2b 100644 --- a/src/mesh/generated/meshtastic/apponly.pb.c +++ b/src/mesh/generated/meshtastic/apponly.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/apponly.pb.h" +#include "./apponly.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/apponly.pb.h b/src/mesh/generated/meshtastic/apponly.pb.h index 187df98d4..02230ee74 100644 --- a/src/mesh/generated/meshtastic/apponly.pb.h +++ b/src/mesh/generated/meshtastic/apponly.pb.h @@ -4,8 +4,8 @@ #ifndef PB_MESHTASTIC_MESHTASTIC_APPONLY_PB_H_INCLUDED #define PB_MESHTASTIC_MESHTASTIC_APPONLY_PB_H_INCLUDED #include -#include "meshtastic/channel.pb.h" -#include "meshtastic/config.pb.h" +#include "./channel.pb.h" +#include "./config.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/src/mesh/generated/meshtastic/cannedmessages.pb.c b/src/mesh/generated/meshtastic/cannedmessages.pb.c index fffa3fdf9..12d1e10cf 100644 --- a/src/mesh/generated/meshtastic/cannedmessages.pb.c +++ b/src/mesh/generated/meshtastic/cannedmessages.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/cannedmessages.pb.h" +#include "./cannedmessages.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/channel.pb.c b/src/mesh/generated/meshtastic/channel.pb.c index 62585fd17..f3b2e37a3 100644 --- a/src/mesh/generated/meshtastic/channel.pb.c +++ b/src/mesh/generated/meshtastic/channel.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/channel.pb.h" +#include "./channel.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/config.pb.c b/src/mesh/generated/meshtastic/config.pb.c index 7cbee2bb8..d12cdeb8a 100644 --- a/src/mesh/generated/meshtastic/config.pb.c +++ b/src/mesh/generated/meshtastic/config.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/config.pb.h" +#include "./config.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/device_metadata.pb.c b/src/mesh/generated/meshtastic/device_metadata.pb.c index 627ce3244..dd9084166 100644 --- a/src/mesh/generated/meshtastic/device_metadata.pb.c +++ b/src/mesh/generated/meshtastic/device_metadata.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/device_metadata.pb.h" +#include "./device_metadata.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/device_metadata.pb.h b/src/mesh/generated/meshtastic/device_metadata.pb.h index 758675925..5d61248c4 100644 --- a/src/mesh/generated/meshtastic/device_metadata.pb.h +++ b/src/mesh/generated/meshtastic/device_metadata.pb.h @@ -4,7 +4,7 @@ #ifndef PB_MESHTASTIC_MESHTASTIC_DEVICE_METADATA_PB_H_INCLUDED #define PB_MESHTASTIC_MESHTASTIC_DEVICE_METADATA_PB_H_INCLUDED #include -#include "meshtastic/config.pb.h" +#include "./config.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.c b/src/mesh/generated/meshtastic/deviceonly.pb.c index f3d27d086..4c7abf96f 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.c +++ b/src/mesh/generated/meshtastic/deviceonly.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/deviceonly.pb.h" +#include "./deviceonly.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index 842431b28..bc004d0aa 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -4,8 +4,8 @@ #ifndef PB_MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_INCLUDED #define PB_MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_INCLUDED #include -#include "meshtastic/channel.pb.h" -#include "meshtastic/mesh.pb.h" +#include "./channel.pb.h" +#include "./mesh.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/src/mesh/generated/meshtastic/localonly.pb.c b/src/mesh/generated/meshtastic/localonly.pb.c index 8fc3f1139..4b62403d6 100644 --- a/src/mesh/generated/meshtastic/localonly.pb.c +++ b/src/mesh/generated/meshtastic/localonly.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/localonly.pb.h" +#include "./localonly.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/localonly.pb.h b/src/mesh/generated/meshtastic/localonly.pb.h index 4d806ec12..582523abe 100644 --- a/src/mesh/generated/meshtastic/localonly.pb.h +++ b/src/mesh/generated/meshtastic/localonly.pb.h @@ -4,8 +4,8 @@ #ifndef PB_MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_INCLUDED #define PB_MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_INCLUDED #include -#include "meshtastic/config.pb.h" -#include "meshtastic/module_config.pb.h" +#include "./config.pb.h" +#include "./module_config.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/src/mesh/generated/meshtastic/mesh.pb.c b/src/mesh/generated/meshtastic/mesh.pb.c index 977e3916f..ec61edf7f 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.c +++ b/src/mesh/generated/meshtastic/mesh.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/mesh.pb.h" +#include "./mesh.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 0a8cf5cfe..0623a327c 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -4,12 +4,12 @@ #ifndef PB_MESHTASTIC_MESHTASTIC_MESH_PB_H_INCLUDED #define PB_MESHTASTIC_MESHTASTIC_MESH_PB_H_INCLUDED #include -#include "meshtastic/channel.pb.h" -#include "meshtastic/config.pb.h" -#include "meshtastic/module_config.pb.h" -#include "meshtastic/portnums.pb.h" -#include "meshtastic/telemetry.pb.h" -#include "meshtastic/xmodem.pb.h" +#include "./channel.pb.h" +#include "./config.pb.h" +#include "./module_config.pb.h" +#include "./portnums.pb.h" +#include "./telemetry.pb.h" +#include "./xmodem.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/src/mesh/generated/meshtastic/module_config.pb.c b/src/mesh/generated/meshtastic/module_config.pb.c index 0878be909..56f9b8dd3 100644 --- a/src/mesh/generated/meshtastic/module_config.pb.c +++ b/src/mesh/generated/meshtastic/module_config.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/module_config.pb.h" +#include "./module_config.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/mqtt.pb.c b/src/mesh/generated/meshtastic/mqtt.pb.c index 3046e6109..18f35f587 100644 --- a/src/mesh/generated/meshtastic/mqtt.pb.c +++ b/src/mesh/generated/meshtastic/mqtt.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/mqtt.pb.h" +#include "./mqtt.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/mqtt.pb.h b/src/mesh/generated/meshtastic/mqtt.pb.h index 12e83c724..cf753a061 100644 --- a/src/mesh/generated/meshtastic/mqtt.pb.h +++ b/src/mesh/generated/meshtastic/mqtt.pb.h @@ -4,7 +4,7 @@ #ifndef PB_MESHTASTIC_MESHTASTIC_MQTT_PB_H_INCLUDED #define PB_MESHTASTIC_MESHTASTIC_MQTT_PB_H_INCLUDED #include -#include "meshtastic/mesh.pb.h" +#include "./mesh.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/src/mesh/generated/meshtastic/portnums.pb.c b/src/mesh/generated/meshtastic/portnums.pb.c index dd0d00e20..663247bf8 100644 --- a/src/mesh/generated/meshtastic/portnums.pb.c +++ b/src/mesh/generated/meshtastic/portnums.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/portnums.pb.h" +#include "./portnums.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/remote_hardware.pb.c b/src/mesh/generated/meshtastic/remote_hardware.pb.c index f368ec1ef..cdea45550 100644 --- a/src/mesh/generated/meshtastic/remote_hardware.pb.c +++ b/src/mesh/generated/meshtastic/remote_hardware.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/remote_hardware.pb.h" +#include "./remote_hardware.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/rtttl.pb.c b/src/mesh/generated/meshtastic/rtttl.pb.c index 685bbde45..62586a11b 100644 --- a/src/mesh/generated/meshtastic/rtttl.pb.c +++ b/src/mesh/generated/meshtastic/rtttl.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/rtttl.pb.h" +#include "./rtttl.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/storeforward.pb.c b/src/mesh/generated/meshtastic/storeforward.pb.c index 44a1c70c1..6d4b78754 100644 --- a/src/mesh/generated/meshtastic/storeforward.pb.c +++ b/src/mesh/generated/meshtastic/storeforward.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/storeforward.pb.h" +#include "./storeforward.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/telemetry.pb.c b/src/mesh/generated/meshtastic/telemetry.pb.c index cdc01710a..3b664cd22 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.c +++ b/src/mesh/generated/meshtastic/telemetry.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/telemetry.pb.h" +#include "./telemetry.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/src/mesh/generated/meshtastic/xmodem.pb.c b/src/mesh/generated/meshtastic/xmodem.pb.c index 9692a5eb4..83bb6e51a 100644 --- a/src/mesh/generated/meshtastic/xmodem.pb.c +++ b/src/mesh/generated/meshtastic/xmodem.pb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.4.7 */ -#include "meshtastic/xmodem.pb.h" +#include "./xmodem.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif From 36b3bf22111d939e6b4a850521aaad0baadd484d Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 18 Jan 2023 10:16:15 -0600 Subject: [PATCH 12/20] Strip namspace prefix --- bin/regen-protos.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/regen-protos.sh b/bin/regen-protos.sh index eae8a121c..abfe7a141 100755 --- a/bin/regen-protos.sh +++ b/bin/regen-protos.sh @@ -13,6 +13,7 @@ cd protobufs cd ../src/mesh/generated/meshtastic sed -i 's/#include "meshtastic/#include "./g' * +sed -i 's/meshtastic_//g' * #echo "Regenerating protobuf documentation - if you see an error message" #echo "you can ignore it unless doing a new protobuf release to github." From 80f259cc6c4a91ae6a210a8b6d1ce45f29471e80 Mon Sep 17 00:00:00 2001 From: thebentern Date: Wed, 18 Jan 2023 16:19:47 +0000 Subject: [PATCH 13/20] [create-pull-request] automated change --- src/mesh/generated/meshtastic/admin.pb.c | 2 +- src/mesh/generated/meshtastic/admin.pb.h | 176 ++-- src/mesh/generated/meshtastic/apponly.pb.c | 2 +- src/mesh/generated/meshtastic/apponly.pb.h | 32 +- .../generated/meshtastic/cannedmessages.pb.c | 2 +- .../generated/meshtastic/cannedmessages.pb.h | 22 +- src/mesh/generated/meshtastic/channel.pb.c | 4 +- src/mesh/generated/meshtastic/channel.pb.h | 86 +- src/mesh/generated/meshtastic/config.pb.c | 18 +- src/mesh/generated/meshtastic/config.pb.h | 594 ++++++------ .../generated/meshtastic/device_metadata.pb.c | 2 +- .../generated/meshtastic/device_metadata.pb.h | 40 +- src/mesh/generated/meshtastic/deviceonly.pb.c | 6 +- src/mesh/generated/meshtastic/deviceonly.pb.h | 144 +-- src/mesh/generated/meshtastic/localonly.pb.c | 4 +- src/mesh/generated/meshtastic/localonly.pb.h | 140 +-- src/mesh/generated/meshtastic/mesh.pb.c | 28 +- src/mesh/generated/meshtastic/mesh.pb.h | 878 +++++++++--------- .../generated/meshtastic/module_config.pb.c | 20 +- .../generated/meshtastic/module_config.pb.h | 512 +++++----- src/mesh/generated/meshtastic/mqtt.pb.c | 2 +- src/mesh/generated/meshtastic/mqtt.pb.h | 30 +- src/mesh/generated/meshtastic/portnums.pb.h | 54 +- .../generated/meshtastic/remote_hardware.pb.c | 2 +- .../generated/meshtastic/remote_hardware.pb.h | 52 +- src/mesh/generated/meshtastic/rtttl.pb.c | 2 +- src/mesh/generated/meshtastic/rtttl.pb.h | 22 +- .../generated/meshtastic/storeforward.pb.c | 8 +- .../generated/meshtastic/storeforward.pb.h | 172 ++-- src/mesh/generated/meshtastic/telemetry.pb.c | 6 +- src/mesh/generated/meshtastic/telemetry.pb.h | 130 +-- src/mesh/generated/meshtastic/xmodem.pb.c | 2 +- src/mesh/generated/meshtastic/xmodem.pb.h | 62 +- 33 files changed, 1628 insertions(+), 1628 deletions(-) diff --git a/src/mesh/generated/meshtastic/admin.pb.c b/src/mesh/generated/meshtastic/admin.pb.c index 7925075d6..8677e0feb 100644 --- a/src/mesh/generated/meshtastic/admin.pb.c +++ b/src/mesh/generated/meshtastic/admin.pb.c @@ -6,7 +6,7 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_AdminMessage, meshtastic_AdminMessage, 2) +PB_BIND(AdminMessage, AdminMessage, 2) diff --git a/src/mesh/generated/meshtastic/admin.pb.h b/src/mesh/generated/meshtastic/admin.pb.h index 63f265a9c..83aa7bbff 100644 --- a/src/mesh/generated/meshtastic/admin.pb.h +++ b/src/mesh/generated/meshtastic/admin.pb.h @@ -16,69 +16,69 @@ /* Enum definitions */ /* TODO: REPLACE */ -typedef enum _meshtastic_AdminMessage_ConfigType { +typedef enum _AdminMessage_ConfigType { /* TODO: REPLACE */ - meshtastic_AdminMessage_ConfigType_DEVICE_CONFIG = 0, + AdminMessage_ConfigType_DEVICE_CONFIG = 0, /* TODO: REPLACE */ - meshtastic_AdminMessage_ConfigType_POSITION_CONFIG = 1, + AdminMessage_ConfigType_POSITION_CONFIG = 1, /* TODO: REPLACE */ - meshtastic_AdminMessage_ConfigType_POWER_CONFIG = 2, + AdminMessage_ConfigType_POWER_CONFIG = 2, /* TODO: REPLACE */ - meshtastic_AdminMessage_ConfigType_NETWORK_CONFIG = 3, + AdminMessage_ConfigType_NETWORK_CONFIG = 3, /* TODO: REPLACE */ - meshtastic_AdminMessage_ConfigType_DISPLAY_CONFIG = 4, + AdminMessage_ConfigType_DISPLAY_CONFIG = 4, /* TODO: REPLACE */ - meshtastic_AdminMessage_ConfigType_LORA_CONFIG = 5, + AdminMessage_ConfigType_LORA_CONFIG = 5, /* TODO: REPLACE */ - meshtastic_AdminMessage_ConfigType_BLUETOOTH_CONFIG = 6 -} meshtastic_AdminMessage_ConfigType; + AdminMessage_ConfigType_BLUETOOTH_CONFIG = 6 +} AdminMessage_ConfigType; /* TODO: REPLACE */ -typedef enum _meshtastic_AdminMessage_ModuleConfigType { +typedef enum _AdminMessage_ModuleConfigType { /* TODO: REPLACE */ - meshtastic_AdminMessage_ModuleConfigType_MQTT_CONFIG = 0, + AdminMessage_ModuleConfigType_MQTT_CONFIG = 0, /* TODO: REPLACE */ - meshtastic_AdminMessage_ModuleConfigType_SERIAL_CONFIG = 1, + AdminMessage_ModuleConfigType_SERIAL_CONFIG = 1, /* TODO: REPLACE */ - meshtastic_AdminMessage_ModuleConfigType_EXTNOTIF_CONFIG = 2, + AdminMessage_ModuleConfigType_EXTNOTIF_CONFIG = 2, /* TODO: REPLACE */ - meshtastic_AdminMessage_ModuleConfigType_STOREFORWARD_CONFIG = 3, + AdminMessage_ModuleConfigType_STOREFORWARD_CONFIG = 3, /* TODO: REPLACE */ - meshtastic_AdminMessage_ModuleConfigType_RANGETEST_CONFIG = 4, + AdminMessage_ModuleConfigType_RANGETEST_CONFIG = 4, /* TODO: REPLACE */ - meshtastic_AdminMessage_ModuleConfigType_TELEMETRY_CONFIG = 5, + AdminMessage_ModuleConfigType_TELEMETRY_CONFIG = 5, /* TODO: REPLACE */ - meshtastic_AdminMessage_ModuleConfigType_CANNEDMSG_CONFIG = 6, + AdminMessage_ModuleConfigType_CANNEDMSG_CONFIG = 6, /* TODO: REPLACE */ - meshtastic_AdminMessage_ModuleConfigType_AUDIO_CONFIG = 7, + AdminMessage_ModuleConfigType_AUDIO_CONFIG = 7, /* TODO: REPLACE */ - meshtastic_AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG = 8 -} meshtastic_AdminMessage_ModuleConfigType; + AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG = 8 +} AdminMessage_ModuleConfigType; /* Struct definitions */ /* This message is handled by the Admin module and is responsible for all settings/channel read/write operations. This message is used to do settings operations to both remote AND local nodes. (Prior to 1.2 these operations were done via special ToRadio operations) */ -typedef struct _meshtastic_AdminMessage { +typedef struct _AdminMessage { pb_size_t which_payload_variant; union { /* Send the specified channel in the response to this message NOTE: This field is sent with the channel index + 1 (to ensure we never try to send 'zero' - which protobufs treats as not present) */ uint32_t get_channel_request; /* TODO: REPLACE */ - meshtastic_Channel get_channel_response; + Channel get_channel_response; /* Send the current owner data in the response to this message. */ bool get_owner_request; /* TODO: REPLACE */ - meshtastic_User get_owner_response; + User get_owner_response; /* Ask for the following config data to be sent */ - meshtastic_AdminMessage_ConfigType get_config_request; + AdminMessage_ConfigType get_config_request; /* Send the current Config in the response to this message. */ - meshtastic_Config get_config_response; + Config get_config_response; /* Ask for the following config data to be sent */ - meshtastic_AdminMessage_ModuleConfigType get_module_config_request; + AdminMessage_ModuleConfigType get_module_config_request; /* Send the current Config in the response to this message. */ - meshtastic_ModuleConfig get_module_config_response; + ModuleConfig get_module_config_response; /* Get the Canned Message Module messages in the response to this message. */ bool get_canned_message_module_messages_request; /* Get the Canned Message Module messages in the response to this message. */ @@ -86,23 +86,23 @@ typedef struct _meshtastic_AdminMessage { /* Request the node to send device metadata (firmware, protobuf version, etc) */ bool get_device_metadata_request; /* Device metadata response */ - meshtastic_DeviceMetadata get_device_metadata_response; + DeviceMetadata get_device_metadata_response; /* Get the Ringtone in the response to this message. */ bool get_ringtone_request; /* Get the Ringtone in the response to this message. */ char get_ringtone_response[231]; /* Set the owner for this node */ - meshtastic_User set_owner; + User set_owner; /* Set channels (using the new API). A special channel is the "primary channel". The other records are secondary channels. Note: only one channel can be marked as primary. If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically. */ - meshtastic_Channel set_channel; + Channel set_channel; /* Set the current Config */ - meshtastic_Config set_config; + Config set_config; /* Set the current Config */ - meshtastic_ModuleConfig set_module_config; + ModuleConfig set_module_config; /* Set the Canned Message Module messages text. */ char set_canned_message_module_messages[201]; /* Set the ringtone for ExternalNotification. */ @@ -134,7 +134,7 @@ typedef struct _meshtastic_AdminMessage { /* Tell the node to reset the nodedb. */ int32_t nodedb_reset; }; -} meshtastic_AdminMessage; +} AdminMessage; #ifdef __cplusplus @@ -142,56 +142,56 @@ extern "C" { #endif /* Helper constants for enums */ -#define _meshtastic_AdminMessage_ConfigType_MIN meshtastic_AdminMessage_ConfigType_DEVICE_CONFIG -#define _meshtastic_AdminMessage_ConfigType_MAX meshtastic_AdminMessage_ConfigType_BLUETOOTH_CONFIG -#define _meshtastic_AdminMessage_ConfigType_ARRAYSIZE ((meshtastic_AdminMessage_ConfigType)(meshtastic_AdminMessage_ConfigType_BLUETOOTH_CONFIG+1)) +#define _AdminMessage_ConfigType_MIN AdminMessage_ConfigType_DEVICE_CONFIG +#define _AdminMessage_ConfigType_MAX AdminMessage_ConfigType_BLUETOOTH_CONFIG +#define _AdminMessage_ConfigType_ARRAYSIZE ((AdminMessage_ConfigType)(AdminMessage_ConfigType_BLUETOOTH_CONFIG+1)) -#define _meshtastic_AdminMessage_ModuleConfigType_MIN meshtastic_AdminMessage_ModuleConfigType_MQTT_CONFIG -#define _meshtastic_AdminMessage_ModuleConfigType_MAX meshtastic_AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG -#define _meshtastic_AdminMessage_ModuleConfigType_ARRAYSIZE ((meshtastic_AdminMessage_ModuleConfigType)(meshtastic_AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG+1)) +#define _AdminMessage_ModuleConfigType_MIN AdminMessage_ModuleConfigType_MQTT_CONFIG +#define _AdminMessage_ModuleConfigType_MAX AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG +#define _AdminMessage_ModuleConfigType_ARRAYSIZE ((AdminMessage_ModuleConfigType)(AdminMessage_ModuleConfigType_REMOTEHARDWARE_CONFIG+1)) -#define meshtastic_AdminMessage_payload_variant_get_config_request_ENUMTYPE meshtastic_AdminMessage_ConfigType -#define meshtastic_AdminMessage_payload_variant_get_module_config_request_ENUMTYPE meshtastic_AdminMessage_ModuleConfigType +#define AdminMessage_payload_variant_get_config_request_ENUMTYPE AdminMessage_ConfigType +#define AdminMessage_payload_variant_get_module_config_request_ENUMTYPE AdminMessage_ModuleConfigType /* Initializer values for message structs */ -#define meshtastic_AdminMessage_init_default {0, {0}} -#define meshtastic_AdminMessage_init_zero {0, {0}} +#define AdminMessage_init_default {0, {0}} +#define AdminMessage_init_zero {0, {0}} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_AdminMessage_get_channel_request_tag 1 -#define meshtastic_AdminMessage_get_channel_response_tag 2 -#define meshtastic_AdminMessage_get_owner_request_tag 3 -#define meshtastic_AdminMessage_get_owner_response_tag 4 -#define meshtastic_AdminMessage_get_config_request_tag 5 -#define meshtastic_AdminMessage_get_config_response_tag 6 -#define meshtastic_AdminMessage_get_module_config_request_tag 7 -#define meshtastic_AdminMessage_get_module_config_response_tag 8 -#define meshtastic_AdminMessage_get_canned_message_module_messages_request_tag 10 -#define meshtastic_AdminMessage_get_canned_message_module_messages_response_tag 11 -#define meshtastic_AdminMessage_get_device_metadata_request_tag 12 -#define meshtastic_AdminMessage_get_device_metadata_response_tag 13 -#define meshtastic_AdminMessage_get_ringtone_request_tag 14 -#define meshtastic_AdminMessage_get_ringtone_response_tag 15 -#define meshtastic_AdminMessage_set_owner_tag 32 -#define meshtastic_AdminMessage_set_channel_tag 33 -#define meshtastic_AdminMessage_set_config_tag 34 -#define meshtastic_AdminMessage_set_module_config_tag 35 -#define meshtastic_AdminMessage_set_canned_message_module_messages_tag 36 -#define meshtastic_AdminMessage_set_ringtone_message_tag 37 -#define meshtastic_AdminMessage_begin_edit_settings_tag 64 -#define meshtastic_AdminMessage_commit_edit_settings_tag 65 -#define meshtastic_AdminMessage_confirm_set_channel_tag 66 -#define meshtastic_AdminMessage_confirm_set_radio_tag 67 -#define meshtastic_AdminMessage_reboot_ota_seconds_tag 95 -#define meshtastic_AdminMessage_exit_simulator_tag 96 -#define meshtastic_AdminMessage_reboot_seconds_tag 97 -#define meshtastic_AdminMessage_shutdown_seconds_tag 98 -#define meshtastic_AdminMessage_factory_reset_tag 99 -#define meshtastic_AdminMessage_nodedb_reset_tag 100 +#define AdminMessage_get_channel_request_tag 1 +#define AdminMessage_get_channel_response_tag 2 +#define AdminMessage_get_owner_request_tag 3 +#define AdminMessage_get_owner_response_tag 4 +#define AdminMessage_get_config_request_tag 5 +#define AdminMessage_get_config_response_tag 6 +#define AdminMessage_get_module_config_request_tag 7 +#define AdminMessage_get_module_config_response_tag 8 +#define AdminMessage_get_canned_message_module_messages_request_tag 10 +#define AdminMessage_get_canned_message_module_messages_response_tag 11 +#define AdminMessage_get_device_metadata_request_tag 12 +#define AdminMessage_get_device_metadata_response_tag 13 +#define AdminMessage_get_ringtone_request_tag 14 +#define AdminMessage_get_ringtone_response_tag 15 +#define AdminMessage_set_owner_tag 32 +#define AdminMessage_set_channel_tag 33 +#define AdminMessage_set_config_tag 34 +#define AdminMessage_set_module_config_tag 35 +#define AdminMessage_set_canned_message_module_messages_tag 36 +#define AdminMessage_set_ringtone_message_tag 37 +#define AdminMessage_begin_edit_settings_tag 64 +#define AdminMessage_commit_edit_settings_tag 65 +#define AdminMessage_confirm_set_channel_tag 66 +#define AdminMessage_confirm_set_radio_tag 67 +#define AdminMessage_reboot_ota_seconds_tag 95 +#define AdminMessage_exit_simulator_tag 96 +#define AdminMessage_reboot_seconds_tag 97 +#define AdminMessage_shutdown_seconds_tag 98 +#define AdminMessage_factory_reset_tag 99 +#define AdminMessage_nodedb_reset_tag 100 /* Struct field encoding specification for nanopb */ -#define meshtastic_AdminMessage_FIELDLIST(X, a) \ +#define AdminMessage_FIELDLIST(X, a) \ X(a, STATIC, ONEOF, UINT32, (payload_variant,get_channel_request,get_channel_request), 1) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_channel_response,get_channel_response), 2) \ X(a, STATIC, ONEOF, BOOL, (payload_variant,get_owner_request,get_owner_request), 3) \ @@ -222,25 +222,25 @@ X(a, STATIC, ONEOF, INT32, (payload_variant,reboot_seconds,reboot_second X(a, STATIC, ONEOF, INT32, (payload_variant,shutdown_seconds,shutdown_seconds), 98) \ X(a, STATIC, ONEOF, INT32, (payload_variant,factory_reset,factory_reset), 99) \ X(a, STATIC, ONEOF, INT32, (payload_variant,nodedb_reset,nodedb_reset), 100) -#define meshtastic_AdminMessage_CALLBACK NULL -#define meshtastic_AdminMessage_DEFAULT NULL -#define meshtastic_AdminMessage_payload_variant_get_channel_response_MSGTYPE meshtastic_Channel -#define meshtastic_AdminMessage_payload_variant_get_owner_response_MSGTYPE meshtastic_User -#define meshtastic_AdminMessage_payload_variant_get_config_response_MSGTYPE meshtastic_Config -#define meshtastic_AdminMessage_payload_variant_get_module_config_response_MSGTYPE meshtastic_ModuleConfig -#define meshtastic_AdminMessage_payload_variant_get_device_metadata_response_MSGTYPE meshtastic_DeviceMetadata -#define meshtastic_AdminMessage_payload_variant_set_owner_MSGTYPE meshtastic_User -#define meshtastic_AdminMessage_payload_variant_set_channel_MSGTYPE meshtastic_Channel -#define meshtastic_AdminMessage_payload_variant_set_config_MSGTYPE meshtastic_Config -#define meshtastic_AdminMessage_payload_variant_set_module_config_MSGTYPE meshtastic_ModuleConfig +#define AdminMessage_CALLBACK NULL +#define AdminMessage_DEFAULT NULL +#define AdminMessage_payload_variant_get_channel_response_MSGTYPE Channel +#define AdminMessage_payload_variant_get_owner_response_MSGTYPE User +#define AdminMessage_payload_variant_get_config_response_MSGTYPE Config +#define AdminMessage_payload_variant_get_module_config_response_MSGTYPE ModuleConfig +#define AdminMessage_payload_variant_get_device_metadata_response_MSGTYPE DeviceMetadata +#define AdminMessage_payload_variant_set_owner_MSGTYPE User +#define AdminMessage_payload_variant_set_channel_MSGTYPE Channel +#define AdminMessage_payload_variant_set_config_MSGTYPE Config +#define AdminMessage_payload_variant_set_module_config_MSGTYPE ModuleConfig -extern const pb_msgdesc_t meshtastic_AdminMessage_msg; +extern const pb_msgdesc_t AdminMessage_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_AdminMessage_fields &meshtastic_AdminMessage_msg +#define AdminMessage_fields &AdminMessage_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_AdminMessage_size 234 +#define AdminMessage_size 234 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/apponly.pb.c b/src/mesh/generated/meshtastic/apponly.pb.c index 0f8c14d2b..8360eaa34 100644 --- a/src/mesh/generated/meshtastic/apponly.pb.c +++ b/src/mesh/generated/meshtastic/apponly.pb.c @@ -6,7 +6,7 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_ChannelSet, meshtastic_ChannelSet, 2) +PB_BIND(ChannelSet, ChannelSet, 2) diff --git a/src/mesh/generated/meshtastic/apponly.pb.h b/src/mesh/generated/meshtastic/apponly.pb.h index 02230ee74..a37ba8ab5 100644 --- a/src/mesh/generated/meshtastic/apponly.pb.h +++ b/src/mesh/generated/meshtastic/apponly.pb.h @@ -17,14 +17,14 @@ any SECONDARY channels. No DISABLED channels are included. This abstraction is used only on the the 'app side' of the world (ie python, javascript and android etc) to show a group of Channels as a (long) URL */ -typedef struct _meshtastic_ChannelSet { +typedef struct _ChannelSet { /* Channel list with settings */ pb_size_t settings_count; - meshtastic_ChannelSettings settings[8]; + ChannelSettings settings[8]; /* LoRa config */ bool has_lora_config; - meshtastic_Config_LoRaConfig lora_config; -} meshtastic_ChannelSet; + Config_LoRaConfig lora_config; +} ChannelSet; #ifdef __cplusplus @@ -32,29 +32,29 @@ extern "C" { #endif /* Initializer values for message structs */ -#define meshtastic_ChannelSet_init_default {0, {meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default, meshtastic_ChannelSettings_init_default}, false, meshtastic_Config_LoRaConfig_init_default} -#define meshtastic_ChannelSet_init_zero {0, {meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero, meshtastic_ChannelSettings_init_zero}, false, meshtastic_Config_LoRaConfig_init_zero} +#define ChannelSet_init_default {0, {ChannelSettings_init_default, ChannelSettings_init_default, ChannelSettings_init_default, ChannelSettings_init_default, ChannelSettings_init_default, ChannelSettings_init_default, ChannelSettings_init_default, ChannelSettings_init_default}, false, Config_LoRaConfig_init_default} +#define ChannelSet_init_zero {0, {ChannelSettings_init_zero, ChannelSettings_init_zero, ChannelSettings_init_zero, ChannelSettings_init_zero, ChannelSettings_init_zero, ChannelSettings_init_zero, ChannelSettings_init_zero, ChannelSettings_init_zero}, false, Config_LoRaConfig_init_zero} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_ChannelSet_settings_tag 1 -#define meshtastic_ChannelSet_lora_config_tag 2 +#define ChannelSet_settings_tag 1 +#define ChannelSet_lora_config_tag 2 /* Struct field encoding specification for nanopb */ -#define meshtastic_ChannelSet_FIELDLIST(X, a) \ +#define ChannelSet_FIELDLIST(X, a) \ X(a, STATIC, REPEATED, MESSAGE, settings, 1) \ X(a, STATIC, OPTIONAL, MESSAGE, lora_config, 2) -#define meshtastic_ChannelSet_CALLBACK NULL -#define meshtastic_ChannelSet_DEFAULT NULL -#define meshtastic_ChannelSet_settings_MSGTYPE meshtastic_ChannelSettings -#define meshtastic_ChannelSet_lora_config_MSGTYPE meshtastic_Config_LoRaConfig +#define ChannelSet_CALLBACK NULL +#define ChannelSet_DEFAULT NULL +#define ChannelSet_settings_MSGTYPE ChannelSettings +#define ChannelSet_lora_config_MSGTYPE Config_LoRaConfig -extern const pb_msgdesc_t meshtastic_ChannelSet_msg; +extern const pb_msgdesc_t ChannelSet_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_ChannelSet_fields &meshtastic_ChannelSet_msg +#define ChannelSet_fields &ChannelSet_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_ChannelSet_size 584 +#define ChannelSet_size 584 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/cannedmessages.pb.c b/src/mesh/generated/meshtastic/cannedmessages.pb.c index 12d1e10cf..5fb8adfd0 100644 --- a/src/mesh/generated/meshtastic/cannedmessages.pb.c +++ b/src/mesh/generated/meshtastic/cannedmessages.pb.c @@ -6,7 +6,7 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_CannedMessageModuleConfig, meshtastic_CannedMessageModuleConfig, AUTO) +PB_BIND(CannedMessageModuleConfig, CannedMessageModuleConfig, AUTO) diff --git a/src/mesh/generated/meshtastic/cannedmessages.pb.h b/src/mesh/generated/meshtastic/cannedmessages.pb.h index b81f65d0d..e2f0426f2 100644 --- a/src/mesh/generated/meshtastic/cannedmessages.pb.h +++ b/src/mesh/generated/meshtastic/cannedmessages.pb.h @@ -11,10 +11,10 @@ /* Struct definitions */ /* Canned message module configuration. */ -typedef struct _meshtastic_CannedMessageModuleConfig { +typedef struct _CannedMessageModuleConfig { /* Predefined messages for canned message module separated by '|' characters. */ char messages[201]; -} meshtastic_CannedMessageModuleConfig; +} CannedMessageModuleConfig; #ifdef __cplusplus @@ -22,25 +22,25 @@ extern "C" { #endif /* Initializer values for message structs */ -#define meshtastic_CannedMessageModuleConfig_init_default {""} -#define meshtastic_CannedMessageModuleConfig_init_zero {""} +#define CannedMessageModuleConfig_init_default {""} +#define CannedMessageModuleConfig_init_zero {""} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_CannedMessageModuleConfig_messages_tag 1 +#define CannedMessageModuleConfig_messages_tag 1 /* Struct field encoding specification for nanopb */ -#define meshtastic_CannedMessageModuleConfig_FIELDLIST(X, a) \ +#define CannedMessageModuleConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, STRING, messages, 1) -#define meshtastic_CannedMessageModuleConfig_CALLBACK NULL -#define meshtastic_CannedMessageModuleConfig_DEFAULT NULL +#define CannedMessageModuleConfig_CALLBACK NULL +#define CannedMessageModuleConfig_DEFAULT NULL -extern const pb_msgdesc_t meshtastic_CannedMessageModuleConfig_msg; +extern const pb_msgdesc_t CannedMessageModuleConfig_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_CannedMessageModuleConfig_fields &meshtastic_CannedMessageModuleConfig_msg +#define CannedMessageModuleConfig_fields &CannedMessageModuleConfig_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_CannedMessageModuleConfig_size 203 +#define CannedMessageModuleConfig_size 203 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/channel.pb.c b/src/mesh/generated/meshtastic/channel.pb.c index f3b2e37a3..b22ec0b36 100644 --- a/src/mesh/generated/meshtastic/channel.pb.c +++ b/src/mesh/generated/meshtastic/channel.pb.c @@ -6,10 +6,10 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_ChannelSettings, meshtastic_ChannelSettings, AUTO) +PB_BIND(ChannelSettings, ChannelSettings, AUTO) -PB_BIND(meshtastic_Channel, meshtastic_Channel, AUTO) +PB_BIND(Channel, Channel, AUTO) diff --git a/src/mesh/generated/meshtastic/channel.pb.h b/src/mesh/generated/meshtastic/channel.pb.h index 83ef7b5fc..8c287eca8 100644 --- a/src/mesh/generated/meshtastic/channel.pb.h +++ b/src/mesh/generated/meshtastic/channel.pb.h @@ -19,18 +19,18 @@ cross band routing as needed. If a device has only a single radio (the common case) only one channel can be PRIMARY at a time (but any number of SECONDARY channels can't be sent received on that common frequency) */ -typedef enum _meshtastic_Channel_Role { +typedef enum _Channel_Role { /* This channel is not in use right now */ - meshtastic_Channel_Role_DISABLED = 0, + Channel_Role_DISABLED = 0, /* This channel is used to set the frequency for the radio - all other enabled channels must be SECONDARY */ - meshtastic_Channel_Role_PRIMARY = 1, + Channel_Role_PRIMARY = 1, /* Secondary channels are only used for encryption/decryption/authentication purposes. Their radio settings (freq etc) are ignored, only psk is used. */ - meshtastic_Channel_Role_SECONDARY = 2 -} meshtastic_Channel_Role; + Channel_Role_SECONDARY = 2 +} Channel_Role; /* Struct definitions */ -typedef PB_BYTES_ARRAY_T(32) meshtastic_ChannelSettings_psk_t; +typedef PB_BYTES_ARRAY_T(32) ChannelSettings_psk_t; /* Full settings (center freq, spread factor, pre-shared secret key etc...) needed to configure a radio for speaking on a particular channel This information can be encoded as a QRcode/url so that other users can configure @@ -50,7 +50,7 @@ typedef PB_BYTES_ARRAY_T(32) meshtastic_ChannelSettings_psk_t; FIXME: Add description of multi-channel support and how primary vs secondary channels are used. FIXME: explain how apps use channels for security. explain how remote settings and remote gpio are managed as an example */ -typedef struct _meshtastic_ChannelSettings { +typedef struct _ChannelSettings { /* Deprecated in favor of LoraConfig.channel_num */ uint32_t channel_num; /* A simple pre-shared key for now for crypto. @@ -63,7 +63,7 @@ typedef struct _meshtastic_ChannelSettings { `1` = The special "default" channel key: {0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0x59, 0xf0, 0xbc, 0xff, 0xab, 0xcf, 0x4e, 0x69, 0xbf} `2` through 10 = The default channel key, except with 1 through 9 added to the last byte. Shown to user as simple1 through 10 */ - meshtastic_ChannelSettings_psk_t psk; + ChannelSettings_psk_t psk; /* A SHORT name that will be packed into the URL. Less than 12 bytes. Something for end users to call the channel @@ -89,20 +89,20 @@ typedef struct _meshtastic_ChannelSettings { bool uplink_enabled; /* If true, messages seen on the internet will be forwarded to the local mesh. */ bool downlink_enabled; -} meshtastic_ChannelSettings; +} ChannelSettings; /* A pair of a channel number, mode and the (sharable) settings for that channel */ -typedef struct _meshtastic_Channel { +typedef struct _Channel { /* The index of this channel in the channel table (from 0 to MAX_NUM_CHANNELS-1) (Someday - not currently implemented) An index of -1 could be used to mean "set by name", in which case the target node will find and set the channel by settings.name. */ int8_t index; /* The new settings, or NULL to disable that channel */ bool has_settings; - meshtastic_ChannelSettings settings; + ChannelSettings settings; /* TODO: REPLACE */ - meshtastic_Channel_Role role; -} meshtastic_Channel; + Channel_Role role; +} Channel; #ifdef __cplusplus @@ -110,60 +110,60 @@ extern "C" { #endif /* Helper constants for enums */ -#define _meshtastic_Channel_Role_MIN meshtastic_Channel_Role_DISABLED -#define _meshtastic_Channel_Role_MAX meshtastic_Channel_Role_SECONDARY -#define _meshtastic_Channel_Role_ARRAYSIZE ((meshtastic_Channel_Role)(meshtastic_Channel_Role_SECONDARY+1)) +#define _Channel_Role_MIN Channel_Role_DISABLED +#define _Channel_Role_MAX Channel_Role_SECONDARY +#define _Channel_Role_ARRAYSIZE ((Channel_Role)(Channel_Role_SECONDARY+1)) -#define meshtastic_Channel_role_ENUMTYPE meshtastic_Channel_Role +#define Channel_role_ENUMTYPE Channel_Role /* Initializer values for message structs */ -#define meshtastic_ChannelSettings_init_default {0, {0, {0}}, "", 0, 0, 0} -#define meshtastic_Channel_init_default {0, false, meshtastic_ChannelSettings_init_default, _meshtastic_Channel_Role_MIN} -#define meshtastic_ChannelSettings_init_zero {0, {0, {0}}, "", 0, 0, 0} -#define meshtastic_Channel_init_zero {0, false, meshtastic_ChannelSettings_init_zero, _meshtastic_Channel_Role_MIN} +#define ChannelSettings_init_default {0, {0, {0}}, "", 0, 0, 0} +#define Channel_init_default {0, false, ChannelSettings_init_default, _Channel_Role_MIN} +#define ChannelSettings_init_zero {0, {0, {0}}, "", 0, 0, 0} +#define Channel_init_zero {0, false, ChannelSettings_init_zero, _Channel_Role_MIN} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_ChannelSettings_channel_num_tag 1 -#define meshtastic_ChannelSettings_psk_tag 2 -#define meshtastic_ChannelSettings_name_tag 3 -#define meshtastic_ChannelSettings_id_tag 4 -#define meshtastic_ChannelSettings_uplink_enabled_tag 5 -#define meshtastic_ChannelSettings_downlink_enabled_tag 6 -#define meshtastic_Channel_index_tag 1 -#define meshtastic_Channel_settings_tag 2 -#define meshtastic_Channel_role_tag 3 +#define ChannelSettings_channel_num_tag 1 +#define ChannelSettings_psk_tag 2 +#define ChannelSettings_name_tag 3 +#define ChannelSettings_id_tag 4 +#define ChannelSettings_uplink_enabled_tag 5 +#define ChannelSettings_downlink_enabled_tag 6 +#define Channel_index_tag 1 +#define Channel_settings_tag 2 +#define Channel_role_tag 3 /* Struct field encoding specification for nanopb */ -#define meshtastic_ChannelSettings_FIELDLIST(X, a) \ +#define ChannelSettings_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, channel_num, 1) \ X(a, STATIC, SINGULAR, BYTES, psk, 2) \ X(a, STATIC, SINGULAR, STRING, name, 3) \ X(a, STATIC, SINGULAR, FIXED32, id, 4) \ X(a, STATIC, SINGULAR, BOOL, uplink_enabled, 5) \ X(a, STATIC, SINGULAR, BOOL, downlink_enabled, 6) -#define meshtastic_ChannelSettings_CALLBACK NULL -#define meshtastic_ChannelSettings_DEFAULT NULL +#define ChannelSettings_CALLBACK NULL +#define ChannelSettings_DEFAULT NULL -#define meshtastic_Channel_FIELDLIST(X, a) \ +#define Channel_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, INT32, index, 1) \ X(a, STATIC, OPTIONAL, MESSAGE, settings, 2) \ X(a, STATIC, SINGULAR, UENUM, role, 3) -#define meshtastic_Channel_CALLBACK NULL -#define meshtastic_Channel_DEFAULT NULL -#define meshtastic_Channel_settings_MSGTYPE meshtastic_ChannelSettings +#define Channel_CALLBACK NULL +#define Channel_DEFAULT NULL +#define Channel_settings_MSGTYPE ChannelSettings -extern const pb_msgdesc_t meshtastic_ChannelSettings_msg; -extern const pb_msgdesc_t meshtastic_Channel_msg; +extern const pb_msgdesc_t ChannelSettings_msg; +extern const pb_msgdesc_t Channel_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_ChannelSettings_fields &meshtastic_ChannelSettings_msg -#define meshtastic_Channel_fields &meshtastic_Channel_msg +#define ChannelSettings_fields &ChannelSettings_msg +#define Channel_fields &Channel_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_ChannelSettings_size 62 -#define meshtastic_Channel_size 77 +#define ChannelSettings_size 62 +#define Channel_size 77 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/config.pb.c b/src/mesh/generated/meshtastic/config.pb.c index d12cdeb8a..bd65fee30 100644 --- a/src/mesh/generated/meshtastic/config.pb.c +++ b/src/mesh/generated/meshtastic/config.pb.c @@ -6,31 +6,31 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_Config, meshtastic_Config, AUTO) +PB_BIND(Config, Config, AUTO) -PB_BIND(meshtastic_Config_DeviceConfig, meshtastic_Config_DeviceConfig, AUTO) +PB_BIND(Config_DeviceConfig, Config_DeviceConfig, AUTO) -PB_BIND(meshtastic_Config_PositionConfig, meshtastic_Config_PositionConfig, AUTO) +PB_BIND(Config_PositionConfig, Config_PositionConfig, AUTO) -PB_BIND(meshtastic_Config_PowerConfig, meshtastic_Config_PowerConfig, AUTO) +PB_BIND(Config_PowerConfig, Config_PowerConfig, AUTO) -PB_BIND(meshtastic_Config_NetworkConfig, meshtastic_Config_NetworkConfig, AUTO) +PB_BIND(Config_NetworkConfig, Config_NetworkConfig, AUTO) -PB_BIND(meshtastic_Config_NetworkConfig_IpV4Config, meshtastic_Config_NetworkConfig_IpV4Config, AUTO) +PB_BIND(Config_NetworkConfig_IpV4Config, Config_NetworkConfig_IpV4Config, AUTO) -PB_BIND(meshtastic_Config_DisplayConfig, meshtastic_Config_DisplayConfig, AUTO) +PB_BIND(Config_DisplayConfig, Config_DisplayConfig, AUTO) -PB_BIND(meshtastic_Config_LoRaConfig, meshtastic_Config_LoRaConfig, 2) +PB_BIND(Config_LoRaConfig, Config_LoRaConfig, 2) -PB_BIND(meshtastic_Config_BluetoothConfig, meshtastic_Config_BluetoothConfig, AUTO) +PB_BIND(Config_BluetoothConfig, Config_BluetoothConfig, AUTO) diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index ed8396d5f..52f3ed207 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -11,182 +11,182 @@ /* Enum definitions */ /* Defines the device's role on the Mesh network */ -typedef enum _meshtastic_Config_DeviceConfig_Role { +typedef enum _Config_DeviceConfig_Role { /* Client device role */ - meshtastic_Config_DeviceConfig_Role_CLIENT = 0, + Config_DeviceConfig_Role_CLIENT = 0, /* Client Mute device role Same as a client except packets will not hop over this node, does not contribute to routing packets for mesh. */ - meshtastic_Config_DeviceConfig_Role_CLIENT_MUTE = 1, + Config_DeviceConfig_Role_CLIENT_MUTE = 1, /* Router device role. Mesh packets will prefer to be routed over this node. This node will not be used by client apps. The wifi/ble radios and the oled screen will be put to sleep. */ - meshtastic_Config_DeviceConfig_Role_ROUTER = 2, + Config_DeviceConfig_Role_ROUTER = 2, /* Router Client device role Mesh packets will prefer to be routed over this node. The Router Client can be used as both a Router and an app connected Client. */ - meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT = 3 -} meshtastic_Config_DeviceConfig_Role; + Config_DeviceConfig_Role_ROUTER_CLIENT = 3 +} Config_DeviceConfig_Role; /* Bit field of boolean configuration options, indicating which optional fields to include when assembling POSITION messages Longitude and latitude are always included (also time if GPS-synced) NOTE: the more fields are included, the larger the message will be - leading to longer airtime and a higher risk of packet loss */ -typedef enum _meshtastic_Config_PositionConfig_PositionFlags { +typedef enum _Config_PositionConfig_PositionFlags { /* Required for compilation */ - meshtastic_Config_PositionConfig_PositionFlags_UNSET = 0, + Config_PositionConfig_PositionFlags_UNSET = 0, /* Include an altitude value (if available) */ - meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE = 1, + Config_PositionConfig_PositionFlags_ALTITUDE = 1, /* Altitude value is MSL */ - meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE_MSL = 2, + Config_PositionConfig_PositionFlags_ALTITUDE_MSL = 2, /* Include geoidal separation */ - meshtastic_Config_PositionConfig_PositionFlags_GEOIDAL_SEPARATION = 4, + Config_PositionConfig_PositionFlags_GEOIDAL_SEPARATION = 4, /* Include the DOP value ; PDOP used by default, see below */ - meshtastic_Config_PositionConfig_PositionFlags_DOP = 8, + Config_PositionConfig_PositionFlags_DOP = 8, /* If POS_DOP set, send separate HDOP / VDOP values instead of PDOP */ - meshtastic_Config_PositionConfig_PositionFlags_HVDOP = 16, + Config_PositionConfig_PositionFlags_HVDOP = 16, /* Include number of "satellites in view" */ - meshtastic_Config_PositionConfig_PositionFlags_SATINVIEW = 32, + Config_PositionConfig_PositionFlags_SATINVIEW = 32, /* Include a sequence number incremented per packet */ - meshtastic_Config_PositionConfig_PositionFlags_SEQ_NO = 64, + Config_PositionConfig_PositionFlags_SEQ_NO = 64, /* Include positional timestamp (from GPS solution) */ - meshtastic_Config_PositionConfig_PositionFlags_TIMESTAMP = 128, + Config_PositionConfig_PositionFlags_TIMESTAMP = 128, /* Include positional heading Intended for use with vehicle not walking speeds walking speeds are likely to be error prone like the compass */ - meshtastic_Config_PositionConfig_PositionFlags_HEADING = 256, + Config_PositionConfig_PositionFlags_HEADING = 256, /* Include positional speed Intended for use with vehicle not walking speeds walking speeds are likely to be error prone like the compass */ - meshtastic_Config_PositionConfig_PositionFlags_SPEED = 512 -} meshtastic_Config_PositionConfig_PositionFlags; + Config_PositionConfig_PositionFlags_SPEED = 512 +} Config_PositionConfig_PositionFlags; -typedef enum _meshtastic_Config_NetworkConfig_AddressMode { +typedef enum _Config_NetworkConfig_AddressMode { /* obtain ip address via DHCP */ - meshtastic_Config_NetworkConfig_AddressMode_DHCP = 0, + Config_NetworkConfig_AddressMode_DHCP = 0, /* use static ip address */ - meshtastic_Config_NetworkConfig_AddressMode_STATIC = 1 -} meshtastic_Config_NetworkConfig_AddressMode; + Config_NetworkConfig_AddressMode_STATIC = 1 +} Config_NetworkConfig_AddressMode; /* How the GPS coordinates are displayed on the OLED screen. */ -typedef enum _meshtastic_Config_DisplayConfig_GpsCoordinateFormat { +typedef enum _Config_DisplayConfig_GpsCoordinateFormat { /* GPS coordinates are displayed in the normal decimal degrees format: DD.DDDDDD DDD.DDDDDD */ - meshtastic_Config_DisplayConfig_GpsCoordinateFormat_DEC = 0, + Config_DisplayConfig_GpsCoordinateFormat_DEC = 0, /* GPS coordinates are displayed in the degrees minutes seconds format: DD°MM'SS"C DDD°MM'SS"C, where C is the compass point representing the locations quadrant */ - meshtastic_Config_DisplayConfig_GpsCoordinateFormat_DMS = 1, + Config_DisplayConfig_GpsCoordinateFormat_DMS = 1, /* Universal Transverse Mercator format: ZZB EEEEEE NNNNNNN, where Z is zone, B is band, E is easting, N is northing */ - meshtastic_Config_DisplayConfig_GpsCoordinateFormat_UTM = 2, + Config_DisplayConfig_GpsCoordinateFormat_UTM = 2, /* Military Grid Reference System format: ZZB CD EEEEE NNNNN, where Z is zone, B is band, C is the east 100k square, D is the north 100k square, E is easting, N is northing */ - meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MGRS = 3, + Config_DisplayConfig_GpsCoordinateFormat_MGRS = 3, /* Open Location Code (aka Plus Codes). */ - meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OLC = 4, + Config_DisplayConfig_GpsCoordinateFormat_OLC = 4, /* Ordnance Survey Grid Reference (the National Grid System of the UK). Format: AB EEEEE NNNNN, where A is the east 100k square, B is the north 100k square, E is the easting, N is the northing */ - meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OSGR = 5 -} meshtastic_Config_DisplayConfig_GpsCoordinateFormat; + Config_DisplayConfig_GpsCoordinateFormat_OSGR = 5 +} Config_DisplayConfig_GpsCoordinateFormat; /* Unit display preference */ -typedef enum _meshtastic_Config_DisplayConfig_DisplayUnits { +typedef enum _Config_DisplayConfig_DisplayUnits { /* Metric (Default) */ - meshtastic_Config_DisplayConfig_DisplayUnits_METRIC = 0, + Config_DisplayConfig_DisplayUnits_METRIC = 0, /* Imperial */ - meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL = 1 -} meshtastic_Config_DisplayConfig_DisplayUnits; + Config_DisplayConfig_DisplayUnits_IMPERIAL = 1 +} Config_DisplayConfig_DisplayUnits; /* Override OLED outo detect with this if it fails. */ -typedef enum _meshtastic_Config_DisplayConfig_OledType { +typedef enum _Config_DisplayConfig_OledType { /* Default / Auto */ - meshtastic_Config_DisplayConfig_OledType_OLED_AUTO = 0, + Config_DisplayConfig_OledType_OLED_AUTO = 0, /* Default / Auto */ - meshtastic_Config_DisplayConfig_OledType_OLED_SSD1306 = 1, + Config_DisplayConfig_OledType_OLED_SSD1306 = 1, /* Default / Auto */ - meshtastic_Config_DisplayConfig_OledType_OLED_SH1106 = 2 -} meshtastic_Config_DisplayConfig_OledType; + Config_DisplayConfig_OledType_OLED_SH1106 = 2 +} Config_DisplayConfig_OledType; -typedef enum _meshtastic_Config_DisplayConfig_DisplayMode { +typedef enum _Config_DisplayConfig_DisplayMode { /* Default. The old style for the 128x64 OLED screen */ - meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT = 0, + Config_DisplayConfig_DisplayMode_DEFAULT = 0, /* Rearrange display elements to cater for bicolor OLED displays */ - meshtastic_Config_DisplayConfig_DisplayMode_TWOCOLOR = 1, + Config_DisplayConfig_DisplayMode_TWOCOLOR = 1, /* Same as TwoColor, but with inverted top bar. Not so good for Epaper displays */ - meshtastic_Config_DisplayConfig_DisplayMode_INVERTED = 2, + Config_DisplayConfig_DisplayMode_INVERTED = 2, /* TFT Full Color Displays (not implemented yet) */ - meshtastic_Config_DisplayConfig_DisplayMode_COLOR = 3 -} meshtastic_Config_DisplayConfig_DisplayMode; + Config_DisplayConfig_DisplayMode_COLOR = 3 +} Config_DisplayConfig_DisplayMode; -typedef enum _meshtastic_Config_LoRaConfig_RegionCode { +typedef enum _Config_LoRaConfig_RegionCode { /* Region is not set */ - meshtastic_Config_LoRaConfig_RegionCode_UNSET = 0, + Config_LoRaConfig_RegionCode_UNSET = 0, /* United States */ - meshtastic_Config_LoRaConfig_RegionCode_US = 1, + Config_LoRaConfig_RegionCode_US = 1, /* European Union 433mhz */ - meshtastic_Config_LoRaConfig_RegionCode_EU_433 = 2, + Config_LoRaConfig_RegionCode_EU_433 = 2, /* European Union 433mhz */ - meshtastic_Config_LoRaConfig_RegionCode_EU_868 = 3, + Config_LoRaConfig_RegionCode_EU_868 = 3, /* China */ - meshtastic_Config_LoRaConfig_RegionCode_CN = 4, + Config_LoRaConfig_RegionCode_CN = 4, /* Japan */ - meshtastic_Config_LoRaConfig_RegionCode_JP = 5, + Config_LoRaConfig_RegionCode_JP = 5, /* Australia / New Zealand */ - meshtastic_Config_LoRaConfig_RegionCode_ANZ = 6, + Config_LoRaConfig_RegionCode_ANZ = 6, /* Korea */ - meshtastic_Config_LoRaConfig_RegionCode_KR = 7, + Config_LoRaConfig_RegionCode_KR = 7, /* Taiwan */ - meshtastic_Config_LoRaConfig_RegionCode_TW = 8, + Config_LoRaConfig_RegionCode_TW = 8, /* Russia */ - meshtastic_Config_LoRaConfig_RegionCode_RU = 9, + Config_LoRaConfig_RegionCode_RU = 9, /* India */ - meshtastic_Config_LoRaConfig_RegionCode_IN = 10, + Config_LoRaConfig_RegionCode_IN = 10, /* New Zealand 865mhz */ - meshtastic_Config_LoRaConfig_RegionCode_NZ_865 = 11, + Config_LoRaConfig_RegionCode_NZ_865 = 11, /* Thailand */ - meshtastic_Config_LoRaConfig_RegionCode_TH = 12, + Config_LoRaConfig_RegionCode_TH = 12, /* WLAN Band */ - meshtastic_Config_LoRaConfig_RegionCode_LORA_24 = 13, + Config_LoRaConfig_RegionCode_LORA_24 = 13, /* Ukraine 433mhz */ - meshtastic_Config_LoRaConfig_RegionCode_UA_433 = 14, + Config_LoRaConfig_RegionCode_UA_433 = 14, /* Ukraine 868mhz */ - meshtastic_Config_LoRaConfig_RegionCode_UA_868 = 15 -} meshtastic_Config_LoRaConfig_RegionCode; + Config_LoRaConfig_RegionCode_UA_868 = 15 +} Config_LoRaConfig_RegionCode; /* Standard predefined channel settings Note: these mappings must match ModemPreset Choice in the device code. */ -typedef enum _meshtastic_Config_LoRaConfig_ModemPreset { +typedef enum _Config_LoRaConfig_ModemPreset { /* Long Range - Fast */ - meshtastic_Config_LoRaConfig_ModemPreset_LONG_FAST = 0, + Config_LoRaConfig_ModemPreset_LONG_FAST = 0, /* Long Range - Slow */ - meshtastic_Config_LoRaConfig_ModemPreset_LONG_SLOW = 1, + Config_LoRaConfig_ModemPreset_LONG_SLOW = 1, /* Very Long Range - Slow */ - meshtastic_Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW = 2, + Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW = 2, /* Medium Range - Slow */ - meshtastic_Config_LoRaConfig_ModemPreset_MEDIUM_SLOW = 3, + Config_LoRaConfig_ModemPreset_MEDIUM_SLOW = 3, /* Medium Range - Fast */ - meshtastic_Config_LoRaConfig_ModemPreset_MEDIUM_FAST = 4, + Config_LoRaConfig_ModemPreset_MEDIUM_FAST = 4, /* Short Range - Slow */ - meshtastic_Config_LoRaConfig_ModemPreset_SHORT_SLOW = 5, + Config_LoRaConfig_ModemPreset_SHORT_SLOW = 5, /* Short Range - Fast */ - meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST = 6 -} meshtastic_Config_LoRaConfig_ModemPreset; + Config_LoRaConfig_ModemPreset_SHORT_FAST = 6 +} Config_LoRaConfig_ModemPreset; -typedef enum _meshtastic_Config_BluetoothConfig_PairingMode { +typedef enum _Config_BluetoothConfig_PairingMode { /* Device generates a random pin that will be shown on the screen of the device for pairing */ - meshtastic_Config_BluetoothConfig_PairingMode_RANDOM_PIN = 0, + Config_BluetoothConfig_PairingMode_RANDOM_PIN = 0, /* Device requires a specified fixed pin for pairing */ - meshtastic_Config_BluetoothConfig_PairingMode_FIXED_PIN = 1, + Config_BluetoothConfig_PairingMode_FIXED_PIN = 1, /* Device requires no pin for pairing */ - meshtastic_Config_BluetoothConfig_PairingMode_NO_PIN = 2 -} meshtastic_Config_BluetoothConfig_PairingMode; + Config_BluetoothConfig_PairingMode_NO_PIN = 2 +} Config_BluetoothConfig_PairingMode; /* Struct definitions */ /* Configuration */ -typedef struct _meshtastic_Config_DeviceConfig { +typedef struct _Config_DeviceConfig { /* Sets the role of node */ - meshtastic_Config_DeviceConfig_Role role; + Config_DeviceConfig_Role role; /* Disabling this will disable the SerialConsole by not initilizing the StreamAPI */ bool serial_enabled; /* By default we turn off logging as soon as an API client connects (to keep shared serial link quiet). @@ -198,10 +198,10 @@ typedef struct _meshtastic_Config_DeviceConfig { /* For boards without a PWM buzzer, this is the pin number that will be used Defaults to PIN_BUZZER if defined. */ uint32_t buzzer_gpio; -} meshtastic_Config_DeviceConfig; +} Config_DeviceConfig; /* Position Config */ -typedef struct _meshtastic_Config_PositionConfig { +typedef struct _Config_PositionConfig { /* We should send our position this often (but only if it has changed significantly) Defaults to 15 minutes */ uint32_t position_broadcast_secs; @@ -229,11 +229,11 @@ typedef struct _meshtastic_Config_PositionConfig { uint32_t rx_gpio; /* (Re)define GPS_TX_PIN for your board. */ uint32_t tx_gpio; -} meshtastic_Config_PositionConfig; +} Config_PositionConfig; /* Power Config\ See [Power Config](/docs/settings/config/power) for additional power config details. */ -typedef struct _meshtastic_Config_PowerConfig { +typedef struct _Config_PowerConfig { /* If set, we are powered from a low-current source (i.e. solar), so even if it looks like we have power flowing in we should try to minimize power consumption as much as possible. YOU DO NOT NEED TO SET THIS IF YOU'VE set is_router (it is implied in that case). @@ -269,9 +269,9 @@ typedef struct _meshtastic_Config_PowerConfig { While in light sleep when we receive packets on the LoRa radio we will wake and handle them and stay awake in no BLE mode for this value 0 for default of 10 seconds */ uint32_t min_wake_secs; -} meshtastic_Config_PowerConfig; +} Config_PowerConfig; -typedef struct _meshtastic_Config_NetworkConfig_IpV4Config { +typedef struct _Config_NetworkConfig_IpV4Config { /* Static IP address */ uint32_t ip; /* Static gateway address */ @@ -280,10 +280,10 @@ typedef struct _meshtastic_Config_NetworkConfig_IpV4Config { uint32_t subnet; /* Static DNS server address */ uint32_t dns; -} meshtastic_Config_NetworkConfig_IpV4Config; +} Config_NetworkConfig_IpV4Config; /* Network Config */ -typedef struct _meshtastic_Config_NetworkConfig { +typedef struct _Config_NetworkConfig { /* Enable WiFi (disables Bluetooth) */ bool wifi_enabled; /* If set, this node will try to join the specified wifi network and @@ -296,19 +296,19 @@ typedef struct _meshtastic_Config_NetworkConfig { /* Enable Ethernet */ bool eth_enabled; /* acquire an address via DHCP or assign static */ - meshtastic_Config_NetworkConfig_AddressMode address_mode; + Config_NetworkConfig_AddressMode address_mode; /* struct to keep static address */ bool has_ipv4_config; - meshtastic_Config_NetworkConfig_IpV4Config ipv4_config; -} meshtastic_Config_NetworkConfig; + Config_NetworkConfig_IpV4Config ipv4_config; +} Config_NetworkConfig; /* Display Config */ -typedef struct _meshtastic_Config_DisplayConfig { +typedef struct _Config_DisplayConfig { /* Number of seconds the screen stays on after pressing the user button or receiving a message 0 for default of one minute MAXUINT for always on */ uint32_t screen_on_secs; /* How the GPS coordinates are formatted on the OLED screen. */ - meshtastic_Config_DisplayConfig_GpsCoordinateFormat gps_format; + Config_DisplayConfig_GpsCoordinateFormat gps_format; /* Automatically toggles to the next page on the screen like a carousel, based the specified interval in seconds. Potentially useful for devices without user buttons. */ uint32_t auto_screen_carousel_secs; @@ -318,17 +318,17 @@ typedef struct _meshtastic_Config_DisplayConfig { /* Flip screen vertically, for cases that mount the screen upside down */ bool flip_screen; /* Perferred display units */ - meshtastic_Config_DisplayConfig_DisplayUnits units; + Config_DisplayConfig_DisplayUnits units; /* Override auto-detect in screen */ - meshtastic_Config_DisplayConfig_OledType oled; + Config_DisplayConfig_OledType oled; /* Display Mode */ - meshtastic_Config_DisplayConfig_DisplayMode displaymode; + Config_DisplayConfig_DisplayMode displaymode; /* Print first line in pseudo-bold? FALSE is original style, TRUE is bold */ bool heading_bold; -} meshtastic_Config_DisplayConfig; +} Config_DisplayConfig; /* Lora Config */ -typedef struct _meshtastic_Config_LoRaConfig { +typedef struct _Config_LoRaConfig { /* When enabled, the `modem_preset` fields will be adheared to, else the `bandwidth`/`spread_factor`/`coding_rate` will be taked from their respective manually defined fields */ bool use_preset; @@ -337,7 +337,7 @@ typedef struct _meshtastic_Config_LoRaConfig { Because protobufs take ZERO space when the value is zero this works out nicely. This value is replaced by bandwidth/spread_factor/coding_rate. If you'd like to experiment with other options add them to MeshRadio.cpp in the device code. */ - meshtastic_Config_LoRaConfig_ModemPreset modem_preset; + Config_LoRaConfig_ModemPreset modem_preset; /* Bandwidth in MHz Certain bandwidth numbers are 'special' and will be converted to the appropriate floating point value: 31 -> 31.25MHz */ @@ -353,7 +353,7 @@ typedef struct _meshtastic_Config_LoRaConfig { Used to correct for crystal calibration errors. */ float frequency_offset; /* The region code for the radio (US, CN, EU433, etc...) */ - meshtastic_Config_LoRaConfig_RegionCode region; + Config_LoRaConfig_RegionCode region; /* Maximum number of hops. This can't be greater than 7. Default of 3 */ uint32_t hop_limit; @@ -382,29 +382,29 @@ typedef struct _meshtastic_Config_LoRaConfig { in ignore_incoming will have packets they send droped on receive (by router.cpp) */ pb_size_t ignore_incoming_count; uint32_t ignore_incoming[3]; -} meshtastic_Config_LoRaConfig; +} Config_LoRaConfig; -typedef struct _meshtastic_Config_BluetoothConfig { +typedef struct _Config_BluetoothConfig { /* Enable Bluetooth on the device */ bool enabled; /* Determines the pairing strategy for the device */ - meshtastic_Config_BluetoothConfig_PairingMode mode; + Config_BluetoothConfig_PairingMode mode; /* Specified pin for PairingMode.FixedPin */ uint32_t fixed_pin; -} meshtastic_Config_BluetoothConfig; +} Config_BluetoothConfig; -typedef struct _meshtastic_Config { +typedef struct _Config { pb_size_t which_payload_variant; union { - meshtastic_Config_DeviceConfig device; - meshtastic_Config_PositionConfig position; - meshtastic_Config_PowerConfig power; - meshtastic_Config_NetworkConfig network; - meshtastic_Config_DisplayConfig display; - meshtastic_Config_LoRaConfig lora; - meshtastic_Config_BluetoothConfig bluetooth; + Config_DeviceConfig device; + Config_PositionConfig position; + Config_PowerConfig power; + Config_NetworkConfig network; + Config_DisplayConfig display; + Config_LoRaConfig lora; + Config_BluetoothConfig bluetooth; } payload_variant; -} meshtastic_Config; +} Config; #ifdef __cplusplus @@ -412,154 +412,154 @@ extern "C" { #endif /* Helper constants for enums */ -#define _meshtastic_Config_DeviceConfig_Role_MIN meshtastic_Config_DeviceConfig_Role_CLIENT -#define _meshtastic_Config_DeviceConfig_Role_MAX meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT -#define _meshtastic_Config_DeviceConfig_Role_ARRAYSIZE ((meshtastic_Config_DeviceConfig_Role)(meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT+1)) +#define _Config_DeviceConfig_Role_MIN Config_DeviceConfig_Role_CLIENT +#define _Config_DeviceConfig_Role_MAX Config_DeviceConfig_Role_ROUTER_CLIENT +#define _Config_DeviceConfig_Role_ARRAYSIZE ((Config_DeviceConfig_Role)(Config_DeviceConfig_Role_ROUTER_CLIENT+1)) -#define _meshtastic_Config_PositionConfig_PositionFlags_MIN meshtastic_Config_PositionConfig_PositionFlags_UNSET -#define _meshtastic_Config_PositionConfig_PositionFlags_MAX meshtastic_Config_PositionConfig_PositionFlags_SPEED -#define _meshtastic_Config_PositionConfig_PositionFlags_ARRAYSIZE ((meshtastic_Config_PositionConfig_PositionFlags)(meshtastic_Config_PositionConfig_PositionFlags_SPEED+1)) +#define _Config_PositionConfig_PositionFlags_MIN Config_PositionConfig_PositionFlags_UNSET +#define _Config_PositionConfig_PositionFlags_MAX Config_PositionConfig_PositionFlags_SPEED +#define _Config_PositionConfig_PositionFlags_ARRAYSIZE ((Config_PositionConfig_PositionFlags)(Config_PositionConfig_PositionFlags_SPEED+1)) -#define _meshtastic_Config_NetworkConfig_AddressMode_MIN meshtastic_Config_NetworkConfig_AddressMode_DHCP -#define _meshtastic_Config_NetworkConfig_AddressMode_MAX meshtastic_Config_NetworkConfig_AddressMode_STATIC -#define _meshtastic_Config_NetworkConfig_AddressMode_ARRAYSIZE ((meshtastic_Config_NetworkConfig_AddressMode)(meshtastic_Config_NetworkConfig_AddressMode_STATIC+1)) +#define _Config_NetworkConfig_AddressMode_MIN Config_NetworkConfig_AddressMode_DHCP +#define _Config_NetworkConfig_AddressMode_MAX Config_NetworkConfig_AddressMode_STATIC +#define _Config_NetworkConfig_AddressMode_ARRAYSIZE ((Config_NetworkConfig_AddressMode)(Config_NetworkConfig_AddressMode_STATIC+1)) -#define _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN meshtastic_Config_DisplayConfig_GpsCoordinateFormat_DEC -#define _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MAX meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OSGR -#define _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_ARRAYSIZE ((meshtastic_Config_DisplayConfig_GpsCoordinateFormat)(meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OSGR+1)) +#define _Config_DisplayConfig_GpsCoordinateFormat_MIN Config_DisplayConfig_GpsCoordinateFormat_DEC +#define _Config_DisplayConfig_GpsCoordinateFormat_MAX Config_DisplayConfig_GpsCoordinateFormat_OSGR +#define _Config_DisplayConfig_GpsCoordinateFormat_ARRAYSIZE ((Config_DisplayConfig_GpsCoordinateFormat)(Config_DisplayConfig_GpsCoordinateFormat_OSGR+1)) -#define _meshtastic_Config_DisplayConfig_DisplayUnits_MIN meshtastic_Config_DisplayConfig_DisplayUnits_METRIC -#define _meshtastic_Config_DisplayConfig_DisplayUnits_MAX meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL -#define _meshtastic_Config_DisplayConfig_DisplayUnits_ARRAYSIZE ((meshtastic_Config_DisplayConfig_DisplayUnits)(meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL+1)) +#define _Config_DisplayConfig_DisplayUnits_MIN Config_DisplayConfig_DisplayUnits_METRIC +#define _Config_DisplayConfig_DisplayUnits_MAX Config_DisplayConfig_DisplayUnits_IMPERIAL +#define _Config_DisplayConfig_DisplayUnits_ARRAYSIZE ((Config_DisplayConfig_DisplayUnits)(Config_DisplayConfig_DisplayUnits_IMPERIAL+1)) -#define _meshtastic_Config_DisplayConfig_OledType_MIN meshtastic_Config_DisplayConfig_OledType_OLED_AUTO -#define _meshtastic_Config_DisplayConfig_OledType_MAX meshtastic_Config_DisplayConfig_OledType_OLED_SH1106 -#define _meshtastic_Config_DisplayConfig_OledType_ARRAYSIZE ((meshtastic_Config_DisplayConfig_OledType)(meshtastic_Config_DisplayConfig_OledType_OLED_SH1106+1)) +#define _Config_DisplayConfig_OledType_MIN Config_DisplayConfig_OledType_OLED_AUTO +#define _Config_DisplayConfig_OledType_MAX Config_DisplayConfig_OledType_OLED_SH1106 +#define _Config_DisplayConfig_OledType_ARRAYSIZE ((Config_DisplayConfig_OledType)(Config_DisplayConfig_OledType_OLED_SH1106+1)) -#define _meshtastic_Config_DisplayConfig_DisplayMode_MIN meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT -#define _meshtastic_Config_DisplayConfig_DisplayMode_MAX meshtastic_Config_DisplayConfig_DisplayMode_COLOR -#define _meshtastic_Config_DisplayConfig_DisplayMode_ARRAYSIZE ((meshtastic_Config_DisplayConfig_DisplayMode)(meshtastic_Config_DisplayConfig_DisplayMode_COLOR+1)) +#define _Config_DisplayConfig_DisplayMode_MIN Config_DisplayConfig_DisplayMode_DEFAULT +#define _Config_DisplayConfig_DisplayMode_MAX Config_DisplayConfig_DisplayMode_COLOR +#define _Config_DisplayConfig_DisplayMode_ARRAYSIZE ((Config_DisplayConfig_DisplayMode)(Config_DisplayConfig_DisplayMode_COLOR+1)) -#define _meshtastic_Config_LoRaConfig_RegionCode_MIN meshtastic_Config_LoRaConfig_RegionCode_UNSET -#define _meshtastic_Config_LoRaConfig_RegionCode_MAX meshtastic_Config_LoRaConfig_RegionCode_UA_868 -#define _meshtastic_Config_LoRaConfig_RegionCode_ARRAYSIZE ((meshtastic_Config_LoRaConfig_RegionCode)(meshtastic_Config_LoRaConfig_RegionCode_UA_868+1)) +#define _Config_LoRaConfig_RegionCode_MIN Config_LoRaConfig_RegionCode_UNSET +#define _Config_LoRaConfig_RegionCode_MAX Config_LoRaConfig_RegionCode_UA_868 +#define _Config_LoRaConfig_RegionCode_ARRAYSIZE ((Config_LoRaConfig_RegionCode)(Config_LoRaConfig_RegionCode_UA_868+1)) -#define _meshtastic_Config_LoRaConfig_ModemPreset_MIN meshtastic_Config_LoRaConfig_ModemPreset_LONG_FAST -#define _meshtastic_Config_LoRaConfig_ModemPreset_MAX meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST -#define _meshtastic_Config_LoRaConfig_ModemPreset_ARRAYSIZE ((meshtastic_Config_LoRaConfig_ModemPreset)(meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST+1)) +#define _Config_LoRaConfig_ModemPreset_MIN Config_LoRaConfig_ModemPreset_LONG_FAST +#define _Config_LoRaConfig_ModemPreset_MAX Config_LoRaConfig_ModemPreset_SHORT_FAST +#define _Config_LoRaConfig_ModemPreset_ARRAYSIZE ((Config_LoRaConfig_ModemPreset)(Config_LoRaConfig_ModemPreset_SHORT_FAST+1)) -#define _meshtastic_Config_BluetoothConfig_PairingMode_MIN meshtastic_Config_BluetoothConfig_PairingMode_RANDOM_PIN -#define _meshtastic_Config_BluetoothConfig_PairingMode_MAX meshtastic_Config_BluetoothConfig_PairingMode_NO_PIN -#define _meshtastic_Config_BluetoothConfig_PairingMode_ARRAYSIZE ((meshtastic_Config_BluetoothConfig_PairingMode)(meshtastic_Config_BluetoothConfig_PairingMode_NO_PIN+1)) +#define _Config_BluetoothConfig_PairingMode_MIN Config_BluetoothConfig_PairingMode_RANDOM_PIN +#define _Config_BluetoothConfig_PairingMode_MAX Config_BluetoothConfig_PairingMode_NO_PIN +#define _Config_BluetoothConfig_PairingMode_ARRAYSIZE ((Config_BluetoothConfig_PairingMode)(Config_BluetoothConfig_PairingMode_NO_PIN+1)) -#define meshtastic_Config_DeviceConfig_role_ENUMTYPE meshtastic_Config_DeviceConfig_Role +#define Config_DeviceConfig_role_ENUMTYPE Config_DeviceConfig_Role -#define meshtastic_Config_NetworkConfig_address_mode_ENUMTYPE meshtastic_Config_NetworkConfig_AddressMode +#define Config_NetworkConfig_address_mode_ENUMTYPE Config_NetworkConfig_AddressMode -#define meshtastic_Config_DisplayConfig_gps_format_ENUMTYPE meshtastic_Config_DisplayConfig_GpsCoordinateFormat -#define meshtastic_Config_DisplayConfig_units_ENUMTYPE meshtastic_Config_DisplayConfig_DisplayUnits -#define meshtastic_Config_DisplayConfig_oled_ENUMTYPE meshtastic_Config_DisplayConfig_OledType -#define meshtastic_Config_DisplayConfig_displaymode_ENUMTYPE meshtastic_Config_DisplayConfig_DisplayMode +#define Config_DisplayConfig_gps_format_ENUMTYPE Config_DisplayConfig_GpsCoordinateFormat +#define Config_DisplayConfig_units_ENUMTYPE Config_DisplayConfig_DisplayUnits +#define Config_DisplayConfig_oled_ENUMTYPE Config_DisplayConfig_OledType +#define Config_DisplayConfig_displaymode_ENUMTYPE Config_DisplayConfig_DisplayMode -#define meshtastic_Config_LoRaConfig_modem_preset_ENUMTYPE meshtastic_Config_LoRaConfig_ModemPreset -#define meshtastic_Config_LoRaConfig_region_ENUMTYPE meshtastic_Config_LoRaConfig_RegionCode +#define Config_LoRaConfig_modem_preset_ENUMTYPE Config_LoRaConfig_ModemPreset +#define Config_LoRaConfig_region_ENUMTYPE Config_LoRaConfig_RegionCode -#define meshtastic_Config_BluetoothConfig_mode_ENUMTYPE meshtastic_Config_BluetoothConfig_PairingMode +#define Config_BluetoothConfig_mode_ENUMTYPE Config_BluetoothConfig_PairingMode /* Initializer values for message structs */ -#define meshtastic_Config_init_default {0, {meshtastic_Config_DeviceConfig_init_default}} -#define meshtastic_Config_DeviceConfig_init_default {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, 0} -#define meshtastic_Config_PositionConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_Config_PowerConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_Config_NetworkConfig_init_default {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_default} -#define meshtastic_Config_NetworkConfig_IpV4Config_init_default {0, 0, 0, 0} -#define meshtastic_Config_DisplayConfig_init_default {0, _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0} -#define meshtastic_Config_LoRaConfig_init_default {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, {0, 0, 0}} -#define meshtastic_Config_BluetoothConfig_init_default {0, _meshtastic_Config_BluetoothConfig_PairingMode_MIN, 0} -#define meshtastic_Config_init_zero {0, {meshtastic_Config_DeviceConfig_init_zero}} -#define meshtastic_Config_DeviceConfig_init_zero {_meshtastic_Config_DeviceConfig_Role_MIN, 0, 0, 0, 0} -#define meshtastic_Config_PositionConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_Config_PowerConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_Config_NetworkConfig_init_zero {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_zero} -#define meshtastic_Config_NetworkConfig_IpV4Config_init_zero {0, 0, 0, 0} -#define meshtastic_Config_DisplayConfig_init_zero {0, _meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0} -#define meshtastic_Config_LoRaConfig_init_zero {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, {0, 0, 0}} -#define meshtastic_Config_BluetoothConfig_init_zero {0, _meshtastic_Config_BluetoothConfig_PairingMode_MIN, 0} +#define Config_init_default {0, {Config_DeviceConfig_init_default}} +#define Config_DeviceConfig_init_default {_Config_DeviceConfig_Role_MIN, 0, 0, 0, 0} +#define Config_PositionConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0} +#define Config_PowerConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0} +#define Config_NetworkConfig_init_default {0, "", "", "", 0, _Config_NetworkConfig_AddressMode_MIN, false, Config_NetworkConfig_IpV4Config_init_default} +#define Config_NetworkConfig_IpV4Config_init_default {0, 0, 0, 0} +#define Config_DisplayConfig_init_default {0, _Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _Config_DisplayConfig_DisplayUnits_MIN, _Config_DisplayConfig_OledType_MIN, _Config_DisplayConfig_DisplayMode_MIN, 0} +#define Config_LoRaConfig_init_default {0, _Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, {0, 0, 0}} +#define Config_BluetoothConfig_init_default {0, _Config_BluetoothConfig_PairingMode_MIN, 0} +#define Config_init_zero {0, {Config_DeviceConfig_init_zero}} +#define Config_DeviceConfig_init_zero {_Config_DeviceConfig_Role_MIN, 0, 0, 0, 0} +#define Config_PositionConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0} +#define Config_PowerConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0} +#define Config_NetworkConfig_init_zero {0, "", "", "", 0, _Config_NetworkConfig_AddressMode_MIN, false, Config_NetworkConfig_IpV4Config_init_zero} +#define Config_NetworkConfig_IpV4Config_init_zero {0, 0, 0, 0} +#define Config_DisplayConfig_init_zero {0, _Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _Config_DisplayConfig_DisplayUnits_MIN, _Config_DisplayConfig_OledType_MIN, _Config_DisplayConfig_DisplayMode_MIN, 0} +#define Config_LoRaConfig_init_zero {0, _Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, {0, 0, 0}} +#define Config_BluetoothConfig_init_zero {0, _Config_BluetoothConfig_PairingMode_MIN, 0} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_Config_DeviceConfig_role_tag 1 -#define meshtastic_Config_DeviceConfig_serial_enabled_tag 2 -#define meshtastic_Config_DeviceConfig_debug_log_enabled_tag 3 -#define meshtastic_Config_DeviceConfig_button_gpio_tag 4 -#define meshtastic_Config_DeviceConfig_buzzer_gpio_tag 5 -#define meshtastic_Config_PositionConfig_position_broadcast_secs_tag 1 -#define meshtastic_Config_PositionConfig_position_broadcast_smart_enabled_tag 2 -#define meshtastic_Config_PositionConfig_fixed_position_tag 3 -#define meshtastic_Config_PositionConfig_gps_enabled_tag 4 -#define meshtastic_Config_PositionConfig_gps_update_interval_tag 5 -#define meshtastic_Config_PositionConfig_gps_attempt_time_tag 6 -#define meshtastic_Config_PositionConfig_position_flags_tag 7 -#define meshtastic_Config_PositionConfig_rx_gpio_tag 8 -#define meshtastic_Config_PositionConfig_tx_gpio_tag 9 -#define meshtastic_Config_PowerConfig_is_power_saving_tag 1 -#define meshtastic_Config_PowerConfig_on_battery_shutdown_after_secs_tag 2 -#define meshtastic_Config_PowerConfig_adc_multiplier_override_tag 3 -#define meshtastic_Config_PowerConfig_wait_bluetooth_secs_tag 4 -#define meshtastic_Config_PowerConfig_mesh_sds_timeout_secs_tag 5 -#define meshtastic_Config_PowerConfig_sds_secs_tag 6 -#define meshtastic_Config_PowerConfig_ls_secs_tag 7 -#define meshtastic_Config_PowerConfig_min_wake_secs_tag 8 -#define meshtastic_Config_NetworkConfig_IpV4Config_ip_tag 1 -#define meshtastic_Config_NetworkConfig_IpV4Config_gateway_tag 2 -#define meshtastic_Config_NetworkConfig_IpV4Config_subnet_tag 3 -#define meshtastic_Config_NetworkConfig_IpV4Config_dns_tag 4 -#define meshtastic_Config_NetworkConfig_wifi_enabled_tag 1 -#define meshtastic_Config_NetworkConfig_wifi_ssid_tag 3 -#define meshtastic_Config_NetworkConfig_wifi_psk_tag 4 -#define meshtastic_Config_NetworkConfig_ntp_server_tag 5 -#define meshtastic_Config_NetworkConfig_eth_enabled_tag 6 -#define meshtastic_Config_NetworkConfig_address_mode_tag 7 -#define meshtastic_Config_NetworkConfig_ipv4_config_tag 8 -#define meshtastic_Config_DisplayConfig_screen_on_secs_tag 1 -#define meshtastic_Config_DisplayConfig_gps_format_tag 2 -#define meshtastic_Config_DisplayConfig_auto_screen_carousel_secs_tag 3 -#define meshtastic_Config_DisplayConfig_compass_north_top_tag 4 -#define meshtastic_Config_DisplayConfig_flip_screen_tag 5 -#define meshtastic_Config_DisplayConfig_units_tag 6 -#define meshtastic_Config_DisplayConfig_oled_tag 7 -#define meshtastic_Config_DisplayConfig_displaymode_tag 8 -#define meshtastic_Config_DisplayConfig_heading_bold_tag 9 -#define meshtastic_Config_LoRaConfig_use_preset_tag 1 -#define meshtastic_Config_LoRaConfig_modem_preset_tag 2 -#define meshtastic_Config_LoRaConfig_bandwidth_tag 3 -#define meshtastic_Config_LoRaConfig_spread_factor_tag 4 -#define meshtastic_Config_LoRaConfig_coding_rate_tag 5 -#define meshtastic_Config_LoRaConfig_frequency_offset_tag 6 -#define meshtastic_Config_LoRaConfig_region_tag 7 -#define meshtastic_Config_LoRaConfig_hop_limit_tag 8 -#define meshtastic_Config_LoRaConfig_tx_enabled_tag 9 -#define meshtastic_Config_LoRaConfig_tx_power_tag 10 -#define meshtastic_Config_LoRaConfig_channel_num_tag 11 -#define meshtastic_Config_LoRaConfig_override_duty_cycle_tag 12 -#define meshtastic_Config_LoRaConfig_ignore_incoming_tag 103 -#define meshtastic_Config_BluetoothConfig_enabled_tag 1 -#define meshtastic_Config_BluetoothConfig_mode_tag 2 -#define meshtastic_Config_BluetoothConfig_fixed_pin_tag 3 -#define meshtastic_Config_device_tag 1 -#define meshtastic_Config_position_tag 2 -#define meshtastic_Config_power_tag 3 -#define meshtastic_Config_network_tag 4 -#define meshtastic_Config_display_tag 5 -#define meshtastic_Config_lora_tag 6 -#define meshtastic_Config_bluetooth_tag 7 +#define Config_DeviceConfig_role_tag 1 +#define Config_DeviceConfig_serial_enabled_tag 2 +#define Config_DeviceConfig_debug_log_enabled_tag 3 +#define Config_DeviceConfig_button_gpio_tag 4 +#define Config_DeviceConfig_buzzer_gpio_tag 5 +#define Config_PositionConfig_position_broadcast_secs_tag 1 +#define Config_PositionConfig_position_broadcast_smart_enabled_tag 2 +#define Config_PositionConfig_fixed_position_tag 3 +#define Config_PositionConfig_gps_enabled_tag 4 +#define Config_PositionConfig_gps_update_interval_tag 5 +#define Config_PositionConfig_gps_attempt_time_tag 6 +#define Config_PositionConfig_position_flags_tag 7 +#define Config_PositionConfig_rx_gpio_tag 8 +#define Config_PositionConfig_tx_gpio_tag 9 +#define Config_PowerConfig_is_power_saving_tag 1 +#define Config_PowerConfig_on_battery_shutdown_after_secs_tag 2 +#define Config_PowerConfig_adc_multiplier_override_tag 3 +#define Config_PowerConfig_wait_bluetooth_secs_tag 4 +#define Config_PowerConfig_mesh_sds_timeout_secs_tag 5 +#define Config_PowerConfig_sds_secs_tag 6 +#define Config_PowerConfig_ls_secs_tag 7 +#define Config_PowerConfig_min_wake_secs_tag 8 +#define Config_NetworkConfig_IpV4Config_ip_tag 1 +#define Config_NetworkConfig_IpV4Config_gateway_tag 2 +#define Config_NetworkConfig_IpV4Config_subnet_tag 3 +#define Config_NetworkConfig_IpV4Config_dns_tag 4 +#define Config_NetworkConfig_wifi_enabled_tag 1 +#define Config_NetworkConfig_wifi_ssid_tag 3 +#define Config_NetworkConfig_wifi_psk_tag 4 +#define Config_NetworkConfig_ntp_server_tag 5 +#define Config_NetworkConfig_eth_enabled_tag 6 +#define Config_NetworkConfig_address_mode_tag 7 +#define Config_NetworkConfig_ipv4_config_tag 8 +#define Config_DisplayConfig_screen_on_secs_tag 1 +#define Config_DisplayConfig_gps_format_tag 2 +#define Config_DisplayConfig_auto_screen_carousel_secs_tag 3 +#define Config_DisplayConfig_compass_north_top_tag 4 +#define Config_DisplayConfig_flip_screen_tag 5 +#define Config_DisplayConfig_units_tag 6 +#define Config_DisplayConfig_oled_tag 7 +#define Config_DisplayConfig_displaymode_tag 8 +#define Config_DisplayConfig_heading_bold_tag 9 +#define Config_LoRaConfig_use_preset_tag 1 +#define Config_LoRaConfig_modem_preset_tag 2 +#define Config_LoRaConfig_bandwidth_tag 3 +#define Config_LoRaConfig_spread_factor_tag 4 +#define Config_LoRaConfig_coding_rate_tag 5 +#define Config_LoRaConfig_frequency_offset_tag 6 +#define Config_LoRaConfig_region_tag 7 +#define Config_LoRaConfig_hop_limit_tag 8 +#define Config_LoRaConfig_tx_enabled_tag 9 +#define Config_LoRaConfig_tx_power_tag 10 +#define Config_LoRaConfig_channel_num_tag 11 +#define Config_LoRaConfig_override_duty_cycle_tag 12 +#define Config_LoRaConfig_ignore_incoming_tag 103 +#define Config_BluetoothConfig_enabled_tag 1 +#define Config_BluetoothConfig_mode_tag 2 +#define Config_BluetoothConfig_fixed_pin_tag 3 +#define Config_device_tag 1 +#define Config_position_tag 2 +#define Config_power_tag 3 +#define Config_network_tag 4 +#define Config_display_tag 5 +#define Config_lora_tag 6 +#define Config_bluetooth_tag 7 /* Struct field encoding specification for nanopb */ -#define meshtastic_Config_FIELDLIST(X, a) \ +#define Config_FIELDLIST(X, a) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,device,payload_variant.device), 1) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,position,payload_variant.position), 2) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,power,payload_variant.power), 3) \ @@ -567,26 +567,26 @@ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,network,payload_variant.netw X(a, STATIC, ONEOF, MESSAGE, (payload_variant,display,payload_variant.display), 5) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,lora,payload_variant.lora), 6) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,bluetooth,payload_variant.bluetooth), 7) -#define meshtastic_Config_CALLBACK NULL -#define meshtastic_Config_DEFAULT NULL -#define meshtastic_Config_payload_variant_device_MSGTYPE meshtastic_Config_DeviceConfig -#define meshtastic_Config_payload_variant_position_MSGTYPE meshtastic_Config_PositionConfig -#define meshtastic_Config_payload_variant_power_MSGTYPE meshtastic_Config_PowerConfig -#define meshtastic_Config_payload_variant_network_MSGTYPE meshtastic_Config_NetworkConfig -#define meshtastic_Config_payload_variant_display_MSGTYPE meshtastic_Config_DisplayConfig -#define meshtastic_Config_payload_variant_lora_MSGTYPE meshtastic_Config_LoRaConfig -#define meshtastic_Config_payload_variant_bluetooth_MSGTYPE meshtastic_Config_BluetoothConfig +#define Config_CALLBACK NULL +#define Config_DEFAULT NULL +#define Config_payload_variant_device_MSGTYPE Config_DeviceConfig +#define Config_payload_variant_position_MSGTYPE Config_PositionConfig +#define Config_payload_variant_power_MSGTYPE Config_PowerConfig +#define Config_payload_variant_network_MSGTYPE Config_NetworkConfig +#define Config_payload_variant_display_MSGTYPE Config_DisplayConfig +#define Config_payload_variant_lora_MSGTYPE Config_LoRaConfig +#define Config_payload_variant_bluetooth_MSGTYPE Config_BluetoothConfig -#define meshtastic_Config_DeviceConfig_FIELDLIST(X, a) \ +#define Config_DeviceConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UENUM, role, 1) \ X(a, STATIC, SINGULAR, BOOL, serial_enabled, 2) \ X(a, STATIC, SINGULAR, BOOL, debug_log_enabled, 3) \ X(a, STATIC, SINGULAR, UINT32, button_gpio, 4) \ X(a, STATIC, SINGULAR, UINT32, buzzer_gpio, 5) -#define meshtastic_Config_DeviceConfig_CALLBACK NULL -#define meshtastic_Config_DeviceConfig_DEFAULT NULL +#define Config_DeviceConfig_CALLBACK NULL +#define Config_DeviceConfig_DEFAULT NULL -#define meshtastic_Config_PositionConfig_FIELDLIST(X, a) \ +#define Config_PositionConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, position_broadcast_secs, 1) \ X(a, STATIC, SINGULAR, BOOL, position_broadcast_smart_enabled, 2) \ X(a, STATIC, SINGULAR, BOOL, fixed_position, 3) \ @@ -596,10 +596,10 @@ X(a, STATIC, SINGULAR, UINT32, gps_attempt_time, 6) \ X(a, STATIC, SINGULAR, UINT32, position_flags, 7) \ X(a, STATIC, SINGULAR, UINT32, rx_gpio, 8) \ X(a, STATIC, SINGULAR, UINT32, tx_gpio, 9) -#define meshtastic_Config_PositionConfig_CALLBACK NULL -#define meshtastic_Config_PositionConfig_DEFAULT NULL +#define Config_PositionConfig_CALLBACK NULL +#define Config_PositionConfig_DEFAULT NULL -#define meshtastic_Config_PowerConfig_FIELDLIST(X, a) \ +#define Config_PowerConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, is_power_saving, 1) \ X(a, STATIC, SINGULAR, UINT32, on_battery_shutdown_after_secs, 2) \ X(a, STATIC, SINGULAR, FLOAT, adc_multiplier_override, 3) \ @@ -608,10 +608,10 @@ X(a, STATIC, SINGULAR, UINT32, mesh_sds_timeout_secs, 5) \ X(a, STATIC, SINGULAR, UINT32, sds_secs, 6) \ X(a, STATIC, SINGULAR, UINT32, ls_secs, 7) \ X(a, STATIC, SINGULAR, UINT32, min_wake_secs, 8) -#define meshtastic_Config_PowerConfig_CALLBACK NULL -#define meshtastic_Config_PowerConfig_DEFAULT NULL +#define Config_PowerConfig_CALLBACK NULL +#define Config_PowerConfig_DEFAULT NULL -#define meshtastic_Config_NetworkConfig_FIELDLIST(X, a) \ +#define Config_NetworkConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, wifi_enabled, 1) \ X(a, STATIC, SINGULAR, STRING, wifi_ssid, 3) \ X(a, STATIC, SINGULAR, STRING, wifi_psk, 4) \ @@ -619,19 +619,19 @@ X(a, STATIC, SINGULAR, STRING, ntp_server, 5) \ X(a, STATIC, SINGULAR, BOOL, eth_enabled, 6) \ X(a, STATIC, SINGULAR, UENUM, address_mode, 7) \ X(a, STATIC, OPTIONAL, MESSAGE, ipv4_config, 8) -#define meshtastic_Config_NetworkConfig_CALLBACK NULL -#define meshtastic_Config_NetworkConfig_DEFAULT NULL -#define meshtastic_Config_NetworkConfig_ipv4_config_MSGTYPE meshtastic_Config_NetworkConfig_IpV4Config +#define Config_NetworkConfig_CALLBACK NULL +#define Config_NetworkConfig_DEFAULT NULL +#define Config_NetworkConfig_ipv4_config_MSGTYPE Config_NetworkConfig_IpV4Config -#define meshtastic_Config_NetworkConfig_IpV4Config_FIELDLIST(X, a) \ +#define Config_NetworkConfig_IpV4Config_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, FIXED32, ip, 1) \ X(a, STATIC, SINGULAR, FIXED32, gateway, 2) \ X(a, STATIC, SINGULAR, FIXED32, subnet, 3) \ X(a, STATIC, SINGULAR, FIXED32, dns, 4) -#define meshtastic_Config_NetworkConfig_IpV4Config_CALLBACK NULL -#define meshtastic_Config_NetworkConfig_IpV4Config_DEFAULT NULL +#define Config_NetworkConfig_IpV4Config_CALLBACK NULL +#define Config_NetworkConfig_IpV4Config_DEFAULT NULL -#define meshtastic_Config_DisplayConfig_FIELDLIST(X, a) \ +#define Config_DisplayConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, screen_on_secs, 1) \ X(a, STATIC, SINGULAR, UENUM, gps_format, 2) \ X(a, STATIC, SINGULAR, UINT32, auto_screen_carousel_secs, 3) \ @@ -641,10 +641,10 @@ X(a, STATIC, SINGULAR, UENUM, units, 6) \ X(a, STATIC, SINGULAR, UENUM, oled, 7) \ X(a, STATIC, SINGULAR, UENUM, displaymode, 8) \ X(a, STATIC, SINGULAR, BOOL, heading_bold, 9) -#define meshtastic_Config_DisplayConfig_CALLBACK NULL -#define meshtastic_Config_DisplayConfig_DEFAULT NULL +#define Config_DisplayConfig_CALLBACK NULL +#define Config_DisplayConfig_DEFAULT NULL -#define meshtastic_Config_LoRaConfig_FIELDLIST(X, a) \ +#define Config_LoRaConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, use_preset, 1) \ X(a, STATIC, SINGULAR, UENUM, modem_preset, 2) \ X(a, STATIC, SINGULAR, UINT32, bandwidth, 3) \ @@ -658,47 +658,47 @@ X(a, STATIC, SINGULAR, INT32, tx_power, 10) \ X(a, STATIC, SINGULAR, UINT32, channel_num, 11) \ X(a, STATIC, SINGULAR, BOOL, override_duty_cycle, 12) \ X(a, STATIC, REPEATED, UINT32, ignore_incoming, 103) -#define meshtastic_Config_LoRaConfig_CALLBACK NULL -#define meshtastic_Config_LoRaConfig_DEFAULT NULL +#define Config_LoRaConfig_CALLBACK NULL +#define Config_LoRaConfig_DEFAULT NULL -#define meshtastic_Config_BluetoothConfig_FIELDLIST(X, a) \ +#define Config_BluetoothConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ X(a, STATIC, SINGULAR, UENUM, mode, 2) \ X(a, STATIC, SINGULAR, UINT32, fixed_pin, 3) -#define meshtastic_Config_BluetoothConfig_CALLBACK NULL -#define meshtastic_Config_BluetoothConfig_DEFAULT NULL +#define Config_BluetoothConfig_CALLBACK NULL +#define Config_BluetoothConfig_DEFAULT NULL -extern const pb_msgdesc_t meshtastic_Config_msg; -extern const pb_msgdesc_t meshtastic_Config_DeviceConfig_msg; -extern const pb_msgdesc_t meshtastic_Config_PositionConfig_msg; -extern const pb_msgdesc_t meshtastic_Config_PowerConfig_msg; -extern const pb_msgdesc_t meshtastic_Config_NetworkConfig_msg; -extern const pb_msgdesc_t meshtastic_Config_NetworkConfig_IpV4Config_msg; -extern const pb_msgdesc_t meshtastic_Config_DisplayConfig_msg; -extern const pb_msgdesc_t meshtastic_Config_LoRaConfig_msg; -extern const pb_msgdesc_t meshtastic_Config_BluetoothConfig_msg; +extern const pb_msgdesc_t Config_msg; +extern const pb_msgdesc_t Config_DeviceConfig_msg; +extern const pb_msgdesc_t Config_PositionConfig_msg; +extern const pb_msgdesc_t Config_PowerConfig_msg; +extern const pb_msgdesc_t Config_NetworkConfig_msg; +extern const pb_msgdesc_t Config_NetworkConfig_IpV4Config_msg; +extern const pb_msgdesc_t Config_DisplayConfig_msg; +extern const pb_msgdesc_t Config_LoRaConfig_msg; +extern const pb_msgdesc_t Config_BluetoothConfig_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_Config_fields &meshtastic_Config_msg -#define meshtastic_Config_DeviceConfig_fields &meshtastic_Config_DeviceConfig_msg -#define meshtastic_Config_PositionConfig_fields &meshtastic_Config_PositionConfig_msg -#define meshtastic_Config_PowerConfig_fields &meshtastic_Config_PowerConfig_msg -#define meshtastic_Config_NetworkConfig_fields &meshtastic_Config_NetworkConfig_msg -#define meshtastic_Config_NetworkConfig_IpV4Config_fields &meshtastic_Config_NetworkConfig_IpV4Config_msg -#define meshtastic_Config_DisplayConfig_fields &meshtastic_Config_DisplayConfig_msg -#define meshtastic_Config_LoRaConfig_fields &meshtastic_Config_LoRaConfig_msg -#define meshtastic_Config_BluetoothConfig_fields &meshtastic_Config_BluetoothConfig_msg +#define Config_fields &Config_msg +#define Config_DeviceConfig_fields &Config_DeviceConfig_msg +#define Config_PositionConfig_fields &Config_PositionConfig_msg +#define Config_PowerConfig_fields &Config_PowerConfig_msg +#define Config_NetworkConfig_fields &Config_NetworkConfig_msg +#define Config_NetworkConfig_IpV4Config_fields &Config_NetworkConfig_IpV4Config_msg +#define Config_DisplayConfig_fields &Config_DisplayConfig_msg +#define Config_LoRaConfig_fields &Config_LoRaConfig_msg +#define Config_BluetoothConfig_fields &Config_BluetoothConfig_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_Config_BluetoothConfig_size 10 -#define meshtastic_Config_DeviceConfig_size 18 -#define meshtastic_Config_DisplayConfig_size 26 -#define meshtastic_Config_LoRaConfig_size 70 -#define meshtastic_Config_NetworkConfig_IpV4Config_size 20 -#define meshtastic_Config_NetworkConfig_size 161 -#define meshtastic_Config_PositionConfig_size 42 -#define meshtastic_Config_PowerConfig_size 43 -#define meshtastic_Config_size 164 +#define Config_BluetoothConfig_size 10 +#define Config_DeviceConfig_size 18 +#define Config_DisplayConfig_size 26 +#define Config_LoRaConfig_size 70 +#define Config_NetworkConfig_IpV4Config_size 20 +#define Config_NetworkConfig_size 161 +#define Config_PositionConfig_size 42 +#define Config_PowerConfig_size 43 +#define Config_size 164 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/device_metadata.pb.c b/src/mesh/generated/meshtastic/device_metadata.pb.c index dd9084166..725ac4c9f 100644 --- a/src/mesh/generated/meshtastic/device_metadata.pb.c +++ b/src/mesh/generated/meshtastic/device_metadata.pb.c @@ -6,7 +6,7 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_DeviceMetadata, meshtastic_DeviceMetadata, AUTO) +PB_BIND(DeviceMetadata, DeviceMetadata, AUTO) diff --git a/src/mesh/generated/meshtastic/device_metadata.pb.h b/src/mesh/generated/meshtastic/device_metadata.pb.h index 5d61248c4..53d99f66e 100644 --- a/src/mesh/generated/meshtastic/device_metadata.pb.h +++ b/src/mesh/generated/meshtastic/device_metadata.pb.h @@ -12,7 +12,7 @@ /* Struct definitions */ /* Device metadata response */ -typedef struct _meshtastic_DeviceMetadata { +typedef struct _DeviceMetadata { /* Device firmware version string */ char firmware_version[18]; /* Device state version */ @@ -26,10 +26,10 @@ typedef struct _meshtastic_DeviceMetadata { /* Indicates that the device has an ethernet peripheral */ bool hasEthernet; /* Indicates that the device's role in the mesh */ - meshtastic_Config_DeviceConfig_Role role; + Config_DeviceConfig_Role role; /* Indicates the device's current enabled position flags */ - meshtastic_Config_PositionConfig_PositionFlags position_flags; -} meshtastic_DeviceMetadata; + Config_PositionConfig_PositionFlags position_flags; +} DeviceMetadata; #ifdef __cplusplus @@ -37,21 +37,21 @@ extern "C" { #endif /* Initializer values for message structs */ -#define meshtastic_DeviceMetadata_init_default {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, _meshtastic_Config_PositionConfig_PositionFlags_MIN} -#define meshtastic_DeviceMetadata_init_zero {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, _meshtastic_Config_PositionConfig_PositionFlags_MIN} +#define DeviceMetadata_init_default {"", 0, 0, 0, 0, 0, _Config_DeviceConfig_Role_MIN, _Config_PositionConfig_PositionFlags_MIN} +#define DeviceMetadata_init_zero {"", 0, 0, 0, 0, 0, _Config_DeviceConfig_Role_MIN, _Config_PositionConfig_PositionFlags_MIN} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_DeviceMetadata_firmware_version_tag 1 -#define meshtastic_DeviceMetadata_device_state_version_tag 2 -#define meshtastic_DeviceMetadata_canShutdown_tag 3 -#define meshtastic_DeviceMetadata_hasWifi_tag 4 -#define meshtastic_DeviceMetadata_hasBluetooth_tag 5 -#define meshtastic_DeviceMetadata_hasEthernet_tag 6 -#define meshtastic_DeviceMetadata_role_tag 7 -#define meshtastic_DeviceMetadata_position_flags_tag 8 +#define DeviceMetadata_firmware_version_tag 1 +#define DeviceMetadata_device_state_version_tag 2 +#define DeviceMetadata_canShutdown_tag 3 +#define DeviceMetadata_hasWifi_tag 4 +#define DeviceMetadata_hasBluetooth_tag 5 +#define DeviceMetadata_hasEthernet_tag 6 +#define DeviceMetadata_role_tag 7 +#define DeviceMetadata_position_flags_tag 8 /* Struct field encoding specification for nanopb */ -#define meshtastic_DeviceMetadata_FIELDLIST(X, a) \ +#define DeviceMetadata_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, STRING, firmware_version, 1) \ X(a, STATIC, SINGULAR, UINT32, device_state_version, 2) \ X(a, STATIC, SINGULAR, BOOL, canShutdown, 3) \ @@ -60,16 +60,16 @@ X(a, STATIC, SINGULAR, BOOL, hasBluetooth, 5) \ X(a, STATIC, SINGULAR, BOOL, hasEthernet, 6) \ X(a, STATIC, SINGULAR, UENUM, role, 7) \ X(a, STATIC, SINGULAR, UENUM, position_flags, 8) -#define meshtastic_DeviceMetadata_CALLBACK NULL -#define meshtastic_DeviceMetadata_DEFAULT NULL +#define DeviceMetadata_CALLBACK NULL +#define DeviceMetadata_DEFAULT NULL -extern const pb_msgdesc_t meshtastic_DeviceMetadata_msg; +extern const pb_msgdesc_t DeviceMetadata_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_DeviceMetadata_fields &meshtastic_DeviceMetadata_msg +#define DeviceMetadata_fields &DeviceMetadata_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_DeviceMetadata_size 38 +#define DeviceMetadata_size 38 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.c b/src/mesh/generated/meshtastic/deviceonly.pb.c index 4c7abf96f..0b26e68d1 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.c +++ b/src/mesh/generated/meshtastic/deviceonly.pb.c @@ -6,13 +6,13 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_DeviceState, meshtastic_DeviceState, 4) +PB_BIND(DeviceState, DeviceState, 4) -PB_BIND(meshtastic_ChannelFile, meshtastic_ChannelFile, 2) +PB_BIND(ChannelFile, ChannelFile, 2) -PB_BIND(meshtastic_OEMStore, meshtastic_OEMStore, 2) +PB_BIND(OEMStore, OEMStore, 2) diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index bc004d0aa..234b65d00 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -13,14 +13,14 @@ /* Enum definitions */ /* TODO: REPLACE */ -typedef enum _meshtastic_ScreenFonts { +typedef enum _ScreenFonts { /* TODO: REPLACE */ - meshtastic_ScreenFonts_FONT_SMALL = 0, + ScreenFonts_FONT_SMALL = 0, /* TODO: REPLACE */ - meshtastic_ScreenFonts_FONT_MEDIUM = 1, + ScreenFonts_FONT_MEDIUM = 1, /* TODO: REPLACE */ - meshtastic_ScreenFonts_FONT_LARGE = 2 -} meshtastic_ScreenFonts; + ScreenFonts_FONT_LARGE = 2 +} ScreenFonts; /* Struct definitions */ /* This message is never sent over the wire, but it is used for serializing DB @@ -28,24 +28,24 @@ typedef enum _meshtastic_ScreenFonts { FIXME, since we write this each time we enter deep sleep (and have infinite flash) it would be better to use some sort of append only data structure for the receive queue and use the preferences store for the other stuff */ -typedef struct _meshtastic_DeviceState { +typedef struct _DeviceState { /* Read only settings/info about this node */ bool has_my_node; - meshtastic_MyNodeInfo my_node; + MyNodeInfo my_node; /* My owner info */ bool has_owner; - meshtastic_User owner; + User owner; /* TODO: REPLACE */ pb_size_t node_db_count; - meshtastic_NodeInfo node_db[80]; + NodeInfo node_db[80]; /* Received packets saved for delivery to the phone */ pb_size_t receive_queue_count; - meshtastic_MeshPacket receive_queue[1]; + MeshPacket receive_queue[1]; /* We keep the last received text message (only) stored in the device flash, so we can show it on the screen. Might be null */ bool has_rx_text_message; - meshtastic_MeshPacket rx_text_message; + MeshPacket rx_text_message; /* A version integer used to invalidate old save files when we make incompatible changes This integer is set at build time and is private to NodeDB.cpp in the device code. */ @@ -55,37 +55,37 @@ typedef struct _meshtastic_DeviceState { bool no_save; /* Some GPSes seem to have bogus settings from the factory, so we always do one factory reset. */ bool did_gps_reset; -} meshtastic_DeviceState; +} DeviceState; /* The on-disk saved channels */ -typedef struct _meshtastic_ChannelFile { +typedef struct _ChannelFile { /* The channels our node knows about */ pb_size_t channels_count; - meshtastic_Channel channels[8]; + Channel channels[8]; /* A version integer used to invalidate old save files when we make incompatible changes This integer is set at build time and is private to NodeDB.cpp in the device code. */ uint32_t version; -} meshtastic_ChannelFile; +} ChannelFile; -typedef PB_BYTES_ARRAY_T(2048) meshtastic_OEMStore_oem_icon_bits_t; -typedef PB_BYTES_ARRAY_T(32) meshtastic_OEMStore_oem_aes_key_t; +typedef PB_BYTES_ARRAY_T(2048) OEMStore_oem_icon_bits_t; +typedef PB_BYTES_ARRAY_T(32) OEMStore_oem_aes_key_t; /* This can be used for customizing the firmware distribution. If populated, show a secondary bootup screen with cuatom logo and text for 2.5 seconds. */ -typedef struct _meshtastic_OEMStore { +typedef struct _OEMStore { /* The Logo width in Px */ uint32_t oem_icon_width; /* The Logo height in Px */ uint32_t oem_icon_height; /* The Logo in xbm bytechar format */ - meshtastic_OEMStore_oem_icon_bits_t oem_icon_bits; + OEMStore_oem_icon_bits_t oem_icon_bits; /* Use this font for the OEM text. */ - meshtastic_ScreenFonts oem_font; + ScreenFonts oem_font; /* Use this font for the OEM text. */ char oem_text[40]; /* The default device encryption key, 16 or 32 byte */ - meshtastic_OEMStore_oem_aes_key_t oem_aes_key; -} meshtastic_OEMStore; + OEMStore_oem_aes_key_t oem_aes_key; +} OEMStore; #ifdef __cplusplus @@ -93,43 +93,43 @@ extern "C" { #endif /* Helper constants for enums */ -#define _meshtastic_ScreenFonts_MIN meshtastic_ScreenFonts_FONT_SMALL -#define _meshtastic_ScreenFonts_MAX meshtastic_ScreenFonts_FONT_LARGE -#define _meshtastic_ScreenFonts_ARRAYSIZE ((meshtastic_ScreenFonts)(meshtastic_ScreenFonts_FONT_LARGE+1)) +#define _ScreenFonts_MIN ScreenFonts_FONT_SMALL +#define _ScreenFonts_MAX ScreenFonts_FONT_LARGE +#define _ScreenFonts_ARRAYSIZE ((ScreenFonts)(ScreenFonts_FONT_LARGE+1)) -#define meshtastic_OEMStore_oem_font_ENUMTYPE meshtastic_ScreenFonts +#define OEMStore_oem_font_ENUMTYPE ScreenFonts /* Initializer values for message structs */ -#define meshtastic_DeviceState_init_default {false, meshtastic_MyNodeInfo_init_default, false, meshtastic_User_init_default, 0, {meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default, meshtastic_NodeInfo_init_default}, 0, {meshtastic_MeshPacket_init_default}, false, meshtastic_MeshPacket_init_default, 0, 0, 0} -#define meshtastic_ChannelFile_init_default {0, {meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default, meshtastic_Channel_init_default}, 0} -#define meshtastic_OEMStore_init_default {0, 0, {0, {0}}, _meshtastic_ScreenFonts_MIN, "", {0, {0}}} -#define meshtastic_DeviceState_init_zero {false, meshtastic_MyNodeInfo_init_zero, false, meshtastic_User_init_zero, 0, {meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero, meshtastic_NodeInfo_init_zero}, 0, {meshtastic_MeshPacket_init_zero}, false, meshtastic_MeshPacket_init_zero, 0, 0, 0} -#define meshtastic_ChannelFile_init_zero {0, {meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero, meshtastic_Channel_init_zero}, 0} -#define meshtastic_OEMStore_init_zero {0, 0, {0, {0}}, _meshtastic_ScreenFonts_MIN, "", {0, {0}}} +#define DeviceState_init_default {false, MyNodeInfo_init_default, false, User_init_default, 0, {NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default, NodeInfo_init_default}, 0, {MeshPacket_init_default}, false, MeshPacket_init_default, 0, 0, 0} +#define ChannelFile_init_default {0, {Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default, Channel_init_default}, 0} +#define OEMStore_init_default {0, 0, {0, {0}}, _ScreenFonts_MIN, "", {0, {0}}} +#define DeviceState_init_zero {false, MyNodeInfo_init_zero, false, User_init_zero, 0, {NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero, NodeInfo_init_zero}, 0, {MeshPacket_init_zero}, false, MeshPacket_init_zero, 0, 0, 0} +#define ChannelFile_init_zero {0, {Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero, Channel_init_zero}, 0} +#define OEMStore_init_zero {0, 0, {0, {0}}, _ScreenFonts_MIN, "", {0, {0}}} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_DeviceState_my_node_tag 2 -#define meshtastic_DeviceState_owner_tag 3 -#define meshtastic_DeviceState_node_db_tag 4 -#define meshtastic_DeviceState_receive_queue_tag 5 -#define meshtastic_DeviceState_rx_text_message_tag 7 -#define meshtastic_DeviceState_version_tag 8 -#define meshtastic_DeviceState_no_save_tag 9 -#define meshtastic_DeviceState_did_gps_reset_tag 11 -#define meshtastic_ChannelFile_channels_tag 1 -#define meshtastic_ChannelFile_version_tag 2 -#define meshtastic_OEMStore_oem_icon_width_tag 1 -#define meshtastic_OEMStore_oem_icon_height_tag 2 -#define meshtastic_OEMStore_oem_icon_bits_tag 3 -#define meshtastic_OEMStore_oem_font_tag 4 -#define meshtastic_OEMStore_oem_text_tag 5 -#define meshtastic_OEMStore_oem_aes_key_tag 6 +#define DeviceState_my_node_tag 2 +#define DeviceState_owner_tag 3 +#define DeviceState_node_db_tag 4 +#define DeviceState_receive_queue_tag 5 +#define DeviceState_rx_text_message_tag 7 +#define DeviceState_version_tag 8 +#define DeviceState_no_save_tag 9 +#define DeviceState_did_gps_reset_tag 11 +#define ChannelFile_channels_tag 1 +#define ChannelFile_version_tag 2 +#define OEMStore_oem_icon_width_tag 1 +#define OEMStore_oem_icon_height_tag 2 +#define OEMStore_oem_icon_bits_tag 3 +#define OEMStore_oem_font_tag 4 +#define OEMStore_oem_text_tag 5 +#define OEMStore_oem_aes_key_tag 6 /* Struct field encoding specification for nanopb */ -#define meshtastic_DeviceState_FIELDLIST(X, a) \ +#define DeviceState_FIELDLIST(X, a) \ X(a, STATIC, OPTIONAL, MESSAGE, my_node, 2) \ X(a, STATIC, OPTIONAL, MESSAGE, owner, 3) \ X(a, STATIC, REPEATED, MESSAGE, node_db, 4) \ @@ -138,44 +138,44 @@ X(a, STATIC, OPTIONAL, MESSAGE, rx_text_message, 7) \ X(a, STATIC, SINGULAR, UINT32, version, 8) \ X(a, STATIC, SINGULAR, BOOL, no_save, 9) \ X(a, STATIC, SINGULAR, BOOL, did_gps_reset, 11) -#define meshtastic_DeviceState_CALLBACK NULL -#define meshtastic_DeviceState_DEFAULT NULL -#define meshtastic_DeviceState_my_node_MSGTYPE meshtastic_MyNodeInfo -#define meshtastic_DeviceState_owner_MSGTYPE meshtastic_User -#define meshtastic_DeviceState_node_db_MSGTYPE meshtastic_NodeInfo -#define meshtastic_DeviceState_receive_queue_MSGTYPE meshtastic_MeshPacket -#define meshtastic_DeviceState_rx_text_message_MSGTYPE meshtastic_MeshPacket +#define DeviceState_CALLBACK NULL +#define DeviceState_DEFAULT NULL +#define DeviceState_my_node_MSGTYPE MyNodeInfo +#define DeviceState_owner_MSGTYPE User +#define DeviceState_node_db_MSGTYPE NodeInfo +#define DeviceState_receive_queue_MSGTYPE MeshPacket +#define DeviceState_rx_text_message_MSGTYPE MeshPacket -#define meshtastic_ChannelFile_FIELDLIST(X, a) \ +#define ChannelFile_FIELDLIST(X, a) \ X(a, STATIC, REPEATED, MESSAGE, channels, 1) \ X(a, STATIC, SINGULAR, UINT32, version, 2) -#define meshtastic_ChannelFile_CALLBACK NULL -#define meshtastic_ChannelFile_DEFAULT NULL -#define meshtastic_ChannelFile_channels_MSGTYPE meshtastic_Channel +#define ChannelFile_CALLBACK NULL +#define ChannelFile_DEFAULT NULL +#define ChannelFile_channels_MSGTYPE Channel -#define meshtastic_OEMStore_FIELDLIST(X, a) \ +#define OEMStore_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, oem_icon_width, 1) \ X(a, STATIC, SINGULAR, UINT32, oem_icon_height, 2) \ X(a, STATIC, SINGULAR, BYTES, oem_icon_bits, 3) \ X(a, STATIC, SINGULAR, UENUM, oem_font, 4) \ X(a, STATIC, SINGULAR, STRING, oem_text, 5) \ X(a, STATIC, SINGULAR, BYTES, oem_aes_key, 6) -#define meshtastic_OEMStore_CALLBACK NULL -#define meshtastic_OEMStore_DEFAULT NULL +#define OEMStore_CALLBACK NULL +#define OEMStore_DEFAULT NULL -extern const pb_msgdesc_t meshtastic_DeviceState_msg; -extern const pb_msgdesc_t meshtastic_ChannelFile_msg; -extern const pb_msgdesc_t meshtastic_OEMStore_msg; +extern const pb_msgdesc_t DeviceState_msg; +extern const pb_msgdesc_t ChannelFile_msg; +extern const pb_msgdesc_t OEMStore_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_DeviceState_fields &meshtastic_DeviceState_msg -#define meshtastic_ChannelFile_fields &meshtastic_ChannelFile_msg -#define meshtastic_OEMStore_fields &meshtastic_OEMStore_msg +#define DeviceState_fields &DeviceState_msg +#define ChannelFile_fields &ChannelFile_msg +#define OEMStore_fields &OEMStore_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_ChannelFile_size 638 -#define meshtastic_DeviceState_size 21800 -#define meshtastic_OEMStore_size 2140 +#define ChannelFile_size 638 +#define DeviceState_size 21800 +#define OEMStore_size 2140 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/localonly.pb.c b/src/mesh/generated/meshtastic/localonly.pb.c index 4b62403d6..b6be65c46 100644 --- a/src/mesh/generated/meshtastic/localonly.pb.c +++ b/src/mesh/generated/meshtastic/localonly.pb.c @@ -6,10 +6,10 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_LocalConfig, meshtastic_LocalConfig, 2) +PB_BIND(LocalConfig, LocalConfig, 2) -PB_BIND(meshtastic_LocalModuleConfig, meshtastic_LocalModuleConfig, 2) +PB_BIND(LocalModuleConfig, LocalModuleConfig, 2) diff --git a/src/mesh/generated/meshtastic/localonly.pb.h b/src/mesh/generated/meshtastic/localonly.pb.h index 582523abe..39d99157d 100644 --- a/src/mesh/generated/meshtastic/localonly.pb.h +++ b/src/mesh/generated/meshtastic/localonly.pb.h @@ -12,67 +12,67 @@ #endif /* Struct definitions */ -typedef struct _meshtastic_LocalConfig { +typedef struct _LocalConfig { /* The part of the config that is specific to the Device */ bool has_device; - meshtastic_Config_DeviceConfig device; + Config_DeviceConfig device; /* The part of the config that is specific to the GPS Position */ bool has_position; - meshtastic_Config_PositionConfig position; + Config_PositionConfig position; /* The part of the config that is specific to the Power settings */ bool has_power; - meshtastic_Config_PowerConfig power; + Config_PowerConfig power; /* The part of the config that is specific to the Wifi Settings */ bool has_network; - meshtastic_Config_NetworkConfig network; + Config_NetworkConfig network; /* The part of the config that is specific to the Display */ bool has_display; - meshtastic_Config_DisplayConfig display; + Config_DisplayConfig display; /* The part of the config that is specific to the Lora Radio */ bool has_lora; - meshtastic_Config_LoRaConfig lora; + Config_LoRaConfig lora; /* The part of the config that is specific to the Bluetooth settings */ bool has_bluetooth; - meshtastic_Config_BluetoothConfig bluetooth; + Config_BluetoothConfig bluetooth; /* A version integer used to invalidate old save files when we make incompatible changes This integer is set at build time and is private to NodeDB.cpp in the device code. */ uint32_t version; -} meshtastic_LocalConfig; +} LocalConfig; -typedef struct _meshtastic_LocalModuleConfig { +typedef struct _LocalModuleConfig { /* The part of the config that is specific to the MQTT module */ bool has_mqtt; - meshtastic_ModuleConfig_MQTTConfig mqtt; + ModuleConfig_MQTTConfig mqtt; /* The part of the config that is specific to the Serial module */ bool has_serial; - meshtastic_ModuleConfig_SerialConfig serial; + ModuleConfig_SerialConfig serial; /* The part of the config that is specific to the ExternalNotification module */ bool has_external_notification; - meshtastic_ModuleConfig_ExternalNotificationConfig external_notification; + ModuleConfig_ExternalNotificationConfig external_notification; /* The part of the config that is specific to the Store & Forward module */ bool has_store_forward; - meshtastic_ModuleConfig_StoreForwardConfig store_forward; + ModuleConfig_StoreForwardConfig store_forward; /* The part of the config that is specific to the RangeTest module */ bool has_range_test; - meshtastic_ModuleConfig_RangeTestConfig range_test; + ModuleConfig_RangeTestConfig range_test; /* The part of the config that is specific to the Telemetry module */ bool has_telemetry; - meshtastic_ModuleConfig_TelemetryConfig telemetry; + ModuleConfig_TelemetryConfig telemetry; /* The part of the config that is specific to the Canned Message module */ bool has_canned_message; - meshtastic_ModuleConfig_CannedMessageConfig canned_message; + ModuleConfig_CannedMessageConfig canned_message; /* A version integer used to invalidate old save files when we make incompatible changes This integer is set at build time and is private to NodeDB.cpp in the device code. */ uint32_t version; /* The part of the config that is specific to the Audio module */ bool has_audio; - meshtastic_ModuleConfig_AudioConfig audio; + ModuleConfig_AudioConfig audio; /* The part of the config that is specific to the Remote Hardware module */ bool has_remote_hardware; - meshtastic_ModuleConfig_RemoteHardwareConfig remote_hardware; -} meshtastic_LocalModuleConfig; + ModuleConfig_RemoteHardwareConfig remote_hardware; +} LocalModuleConfig; #ifdef __cplusplus @@ -80,33 +80,33 @@ extern "C" { #endif /* Initializer values for message structs */ -#define meshtastic_LocalConfig_init_default {false, meshtastic_Config_DeviceConfig_init_default, false, meshtastic_Config_PositionConfig_init_default, false, meshtastic_Config_PowerConfig_init_default, false, meshtastic_Config_NetworkConfig_init_default, false, meshtastic_Config_DisplayConfig_init_default, false, meshtastic_Config_LoRaConfig_init_default, false, meshtastic_Config_BluetoothConfig_init_default, 0} -#define meshtastic_LocalModuleConfig_init_default {false, meshtastic_ModuleConfig_MQTTConfig_init_default, false, meshtastic_ModuleConfig_SerialConfig_init_default, false, meshtastic_ModuleConfig_ExternalNotificationConfig_init_default, false, meshtastic_ModuleConfig_StoreForwardConfig_init_default, false, meshtastic_ModuleConfig_RangeTestConfig_init_default, false, meshtastic_ModuleConfig_TelemetryConfig_init_default, false, meshtastic_ModuleConfig_CannedMessageConfig_init_default, 0, false, meshtastic_ModuleConfig_AudioConfig_init_default, false, meshtastic_ModuleConfig_RemoteHardwareConfig_init_default} -#define meshtastic_LocalConfig_init_zero {false, meshtastic_Config_DeviceConfig_init_zero, false, meshtastic_Config_PositionConfig_init_zero, false, meshtastic_Config_PowerConfig_init_zero, false, meshtastic_Config_NetworkConfig_init_zero, false, meshtastic_Config_DisplayConfig_init_zero, false, meshtastic_Config_LoRaConfig_init_zero, false, meshtastic_Config_BluetoothConfig_init_zero, 0} -#define meshtastic_LocalModuleConfig_init_zero {false, meshtastic_ModuleConfig_MQTTConfig_init_zero, false, meshtastic_ModuleConfig_SerialConfig_init_zero, false, meshtastic_ModuleConfig_ExternalNotificationConfig_init_zero, false, meshtastic_ModuleConfig_StoreForwardConfig_init_zero, false, meshtastic_ModuleConfig_RangeTestConfig_init_zero, false, meshtastic_ModuleConfig_TelemetryConfig_init_zero, false, meshtastic_ModuleConfig_CannedMessageConfig_init_zero, 0, false, meshtastic_ModuleConfig_AudioConfig_init_zero, false, meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero} +#define LocalConfig_init_default {false, Config_DeviceConfig_init_default, false, Config_PositionConfig_init_default, false, Config_PowerConfig_init_default, false, Config_NetworkConfig_init_default, false, Config_DisplayConfig_init_default, false, Config_LoRaConfig_init_default, false, Config_BluetoothConfig_init_default, 0} +#define LocalModuleConfig_init_default {false, ModuleConfig_MQTTConfig_init_default, false, ModuleConfig_SerialConfig_init_default, false, ModuleConfig_ExternalNotificationConfig_init_default, false, ModuleConfig_StoreForwardConfig_init_default, false, ModuleConfig_RangeTestConfig_init_default, false, ModuleConfig_TelemetryConfig_init_default, false, ModuleConfig_CannedMessageConfig_init_default, 0, false, ModuleConfig_AudioConfig_init_default, false, ModuleConfig_RemoteHardwareConfig_init_default} +#define LocalConfig_init_zero {false, Config_DeviceConfig_init_zero, false, Config_PositionConfig_init_zero, false, Config_PowerConfig_init_zero, false, Config_NetworkConfig_init_zero, false, Config_DisplayConfig_init_zero, false, Config_LoRaConfig_init_zero, false, Config_BluetoothConfig_init_zero, 0} +#define LocalModuleConfig_init_zero {false, ModuleConfig_MQTTConfig_init_zero, false, ModuleConfig_SerialConfig_init_zero, false, ModuleConfig_ExternalNotificationConfig_init_zero, false, ModuleConfig_StoreForwardConfig_init_zero, false, ModuleConfig_RangeTestConfig_init_zero, false, ModuleConfig_TelemetryConfig_init_zero, false, ModuleConfig_CannedMessageConfig_init_zero, 0, false, ModuleConfig_AudioConfig_init_zero, false, ModuleConfig_RemoteHardwareConfig_init_zero} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_LocalConfig_device_tag 1 -#define meshtastic_LocalConfig_position_tag 2 -#define meshtastic_LocalConfig_power_tag 3 -#define meshtastic_LocalConfig_network_tag 4 -#define meshtastic_LocalConfig_display_tag 5 -#define meshtastic_LocalConfig_lora_tag 6 -#define meshtastic_LocalConfig_bluetooth_tag 7 -#define meshtastic_LocalConfig_version_tag 8 -#define meshtastic_LocalModuleConfig_mqtt_tag 1 -#define meshtastic_LocalModuleConfig_serial_tag 2 -#define meshtastic_LocalModuleConfig_external_notification_tag 3 -#define meshtastic_LocalModuleConfig_store_forward_tag 4 -#define meshtastic_LocalModuleConfig_range_test_tag 5 -#define meshtastic_LocalModuleConfig_telemetry_tag 6 -#define meshtastic_LocalModuleConfig_canned_message_tag 7 -#define meshtastic_LocalModuleConfig_version_tag 8 -#define meshtastic_LocalModuleConfig_audio_tag 9 -#define meshtastic_LocalModuleConfig_remote_hardware_tag 10 +#define LocalConfig_device_tag 1 +#define LocalConfig_position_tag 2 +#define LocalConfig_power_tag 3 +#define LocalConfig_network_tag 4 +#define LocalConfig_display_tag 5 +#define LocalConfig_lora_tag 6 +#define LocalConfig_bluetooth_tag 7 +#define LocalConfig_version_tag 8 +#define LocalModuleConfig_mqtt_tag 1 +#define LocalModuleConfig_serial_tag 2 +#define LocalModuleConfig_external_notification_tag 3 +#define LocalModuleConfig_store_forward_tag 4 +#define LocalModuleConfig_range_test_tag 5 +#define LocalModuleConfig_telemetry_tag 6 +#define LocalModuleConfig_canned_message_tag 7 +#define LocalModuleConfig_version_tag 8 +#define LocalModuleConfig_audio_tag 9 +#define LocalModuleConfig_remote_hardware_tag 10 /* Struct field encoding specification for nanopb */ -#define meshtastic_LocalConfig_FIELDLIST(X, a) \ +#define LocalConfig_FIELDLIST(X, a) \ X(a, STATIC, OPTIONAL, MESSAGE, device, 1) \ X(a, STATIC, OPTIONAL, MESSAGE, position, 2) \ X(a, STATIC, OPTIONAL, MESSAGE, power, 3) \ @@ -115,17 +115,17 @@ X(a, STATIC, OPTIONAL, MESSAGE, display, 5) \ X(a, STATIC, OPTIONAL, MESSAGE, lora, 6) \ X(a, STATIC, OPTIONAL, MESSAGE, bluetooth, 7) \ X(a, STATIC, SINGULAR, UINT32, version, 8) -#define meshtastic_LocalConfig_CALLBACK NULL -#define meshtastic_LocalConfig_DEFAULT NULL -#define meshtastic_LocalConfig_device_MSGTYPE meshtastic_Config_DeviceConfig -#define meshtastic_LocalConfig_position_MSGTYPE meshtastic_Config_PositionConfig -#define meshtastic_LocalConfig_power_MSGTYPE meshtastic_Config_PowerConfig -#define meshtastic_LocalConfig_network_MSGTYPE meshtastic_Config_NetworkConfig -#define meshtastic_LocalConfig_display_MSGTYPE meshtastic_Config_DisplayConfig -#define meshtastic_LocalConfig_lora_MSGTYPE meshtastic_Config_LoRaConfig -#define meshtastic_LocalConfig_bluetooth_MSGTYPE meshtastic_Config_BluetoothConfig +#define LocalConfig_CALLBACK NULL +#define LocalConfig_DEFAULT NULL +#define LocalConfig_device_MSGTYPE Config_DeviceConfig +#define LocalConfig_position_MSGTYPE Config_PositionConfig +#define LocalConfig_power_MSGTYPE Config_PowerConfig +#define LocalConfig_network_MSGTYPE Config_NetworkConfig +#define LocalConfig_display_MSGTYPE Config_DisplayConfig +#define LocalConfig_lora_MSGTYPE Config_LoRaConfig +#define LocalConfig_bluetooth_MSGTYPE Config_BluetoothConfig -#define meshtastic_LocalModuleConfig_FIELDLIST(X, a) \ +#define LocalModuleConfig_FIELDLIST(X, a) \ X(a, STATIC, OPTIONAL, MESSAGE, mqtt, 1) \ X(a, STATIC, OPTIONAL, MESSAGE, serial, 2) \ X(a, STATIC, OPTIONAL, MESSAGE, external_notification, 3) \ @@ -136,28 +136,28 @@ X(a, STATIC, OPTIONAL, MESSAGE, canned_message, 7) \ X(a, STATIC, SINGULAR, UINT32, version, 8) \ X(a, STATIC, OPTIONAL, MESSAGE, audio, 9) \ X(a, STATIC, OPTIONAL, MESSAGE, remote_hardware, 10) -#define meshtastic_LocalModuleConfig_CALLBACK NULL -#define meshtastic_LocalModuleConfig_DEFAULT NULL -#define meshtastic_LocalModuleConfig_mqtt_MSGTYPE meshtastic_ModuleConfig_MQTTConfig -#define meshtastic_LocalModuleConfig_serial_MSGTYPE meshtastic_ModuleConfig_SerialConfig -#define meshtastic_LocalModuleConfig_external_notification_MSGTYPE meshtastic_ModuleConfig_ExternalNotificationConfig -#define meshtastic_LocalModuleConfig_store_forward_MSGTYPE meshtastic_ModuleConfig_StoreForwardConfig -#define meshtastic_LocalModuleConfig_range_test_MSGTYPE meshtastic_ModuleConfig_RangeTestConfig -#define meshtastic_LocalModuleConfig_telemetry_MSGTYPE meshtastic_ModuleConfig_TelemetryConfig -#define meshtastic_LocalModuleConfig_canned_message_MSGTYPE meshtastic_ModuleConfig_CannedMessageConfig -#define meshtastic_LocalModuleConfig_audio_MSGTYPE meshtastic_ModuleConfig_AudioConfig -#define meshtastic_LocalModuleConfig_remote_hardware_MSGTYPE meshtastic_ModuleConfig_RemoteHardwareConfig +#define LocalModuleConfig_CALLBACK NULL +#define LocalModuleConfig_DEFAULT NULL +#define LocalModuleConfig_mqtt_MSGTYPE ModuleConfig_MQTTConfig +#define LocalModuleConfig_serial_MSGTYPE ModuleConfig_SerialConfig +#define LocalModuleConfig_external_notification_MSGTYPE ModuleConfig_ExternalNotificationConfig +#define LocalModuleConfig_store_forward_MSGTYPE ModuleConfig_StoreForwardConfig +#define LocalModuleConfig_range_test_MSGTYPE ModuleConfig_RangeTestConfig +#define LocalModuleConfig_telemetry_MSGTYPE ModuleConfig_TelemetryConfig +#define LocalModuleConfig_canned_message_MSGTYPE ModuleConfig_CannedMessageConfig +#define LocalModuleConfig_audio_MSGTYPE ModuleConfig_AudioConfig +#define LocalModuleConfig_remote_hardware_MSGTYPE ModuleConfig_RemoteHardwareConfig -extern const pb_msgdesc_t meshtastic_LocalConfig_msg; -extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg; +extern const pb_msgdesc_t LocalConfig_msg; +extern const pb_msgdesc_t LocalModuleConfig_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_LocalConfig_fields &meshtastic_LocalConfig_msg -#define meshtastic_LocalModuleConfig_fields &meshtastic_LocalModuleConfig_msg +#define LocalConfig_fields &LocalConfig_msg +#define LocalModuleConfig_fields &LocalModuleConfig_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_LocalConfig_size 391 -#define meshtastic_LocalModuleConfig_size 412 +#define LocalConfig_size 391 +#define LocalModuleConfig_size 412 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/mesh.pb.c b/src/mesh/generated/meshtastic/mesh.pb.c index ec61edf7f..bc9af848f 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.c +++ b/src/mesh/generated/meshtastic/mesh.pb.c @@ -6,46 +6,46 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_Position, meshtastic_Position, AUTO) +PB_BIND(Position, Position, AUTO) -PB_BIND(meshtastic_User, meshtastic_User, AUTO) +PB_BIND(User, User, AUTO) -PB_BIND(meshtastic_RouteDiscovery, meshtastic_RouteDiscovery, AUTO) +PB_BIND(RouteDiscovery, RouteDiscovery, AUTO) -PB_BIND(meshtastic_Routing, meshtastic_Routing, AUTO) +PB_BIND(Routing, Routing, AUTO) -PB_BIND(meshtastic_Data, meshtastic_Data, 2) +PB_BIND(Data, Data, 2) -PB_BIND(meshtastic_Waypoint, meshtastic_Waypoint, AUTO) +PB_BIND(Waypoint, Waypoint, AUTO) -PB_BIND(meshtastic_MeshPacket, meshtastic_MeshPacket, 2) +PB_BIND(MeshPacket, MeshPacket, 2) -PB_BIND(meshtastic_NodeInfo, meshtastic_NodeInfo, AUTO) +PB_BIND(NodeInfo, NodeInfo, AUTO) -PB_BIND(meshtastic_MyNodeInfo, meshtastic_MyNodeInfo, AUTO) +PB_BIND(MyNodeInfo, MyNodeInfo, AUTO) -PB_BIND(meshtastic_LogRecord, meshtastic_LogRecord, AUTO) +PB_BIND(LogRecord, LogRecord, AUTO) -PB_BIND(meshtastic_QueueStatus, meshtastic_QueueStatus, AUTO) +PB_BIND(QueueStatus, QueueStatus, AUTO) -PB_BIND(meshtastic_FromRadio, meshtastic_FromRadio, 2) +PB_BIND(FromRadio, FromRadio, 2) -PB_BIND(meshtastic_ToRadio, meshtastic_ToRadio, 2) +PB_BIND(ToRadio, ToRadio, 2) -PB_BIND(meshtastic_Compressed, meshtastic_Compressed, AUTO) +PB_BIND(Compressed, Compressed, AUTO) diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 0623a327c..98cf8238b 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -20,179 +20,179 @@ bin/build-all.sh script. Because they will be used to find firmware filenames in the android app for OTA updates. To match the old style filenames, _ is converted to -, p is converted to . */ -typedef enum _meshtastic_HardwareModel { +typedef enum _HardwareModel { /* TODO: REPLACE */ - meshtastic_HardwareModel_UNSET = 0, + HardwareModel_UNSET = 0, /* TODO: REPLACE */ - meshtastic_HardwareModel_TLORA_V2 = 1, + HardwareModel_TLORA_V2 = 1, /* TODO: REPLACE */ - meshtastic_HardwareModel_TLORA_V1 = 2, + HardwareModel_TLORA_V1 = 2, /* TODO: REPLACE */ - meshtastic_HardwareModel_TLORA_V2_1_1P6 = 3, + HardwareModel_TLORA_V2_1_1P6 = 3, /* TODO: REPLACE */ - meshtastic_HardwareModel_TBEAM = 4, + HardwareModel_TBEAM = 4, /* The original heltec WiFi_Lora_32_V2, which had battery voltage sensing hooked to GPIO 13 (see HELTEC_V2 for the new version). */ - meshtastic_HardwareModel_HELTEC_V2_0 = 5, + HardwareModel_HELTEC_V2_0 = 5, /* TODO: REPLACE */ - meshtastic_HardwareModel_TBEAM_V0P7 = 6, + HardwareModel_TBEAM_V0P7 = 6, /* TODO: REPLACE */ - meshtastic_HardwareModel_T_ECHO = 7, + HardwareModel_T_ECHO = 7, /* TODO: REPLACE */ - meshtastic_HardwareModel_TLORA_V1_1P3 = 8, + HardwareModel_TLORA_V1_1P3 = 8, /* TODO: REPLACE */ - meshtastic_HardwareModel_RAK4631 = 9, + HardwareModel_RAK4631 = 9, /* The new version of the heltec WiFi_Lora_32_V2 board that has battery sensing hooked to GPIO 37. Sadly they did not update anything on the silkscreen to identify this board */ - meshtastic_HardwareModel_HELTEC_V2_1 = 10, + HardwareModel_HELTEC_V2_1 = 10, /* Ancient heltec WiFi_Lora_32 board */ - meshtastic_HardwareModel_HELTEC_V1 = 11, + HardwareModel_HELTEC_V1 = 11, /* New T-BEAM with ESP32-S3 CPU */ - meshtastic_HardwareModel_LILYGO_TBEAM_S3_CORE = 12, + HardwareModel_LILYGO_TBEAM_S3_CORE = 12, /* RAK WisBlock ESP32 core: https://docs.rakwireless.com/Product-Categories/WisBlock/RAK11200/Overview/ */ - meshtastic_HardwareModel_RAK11200 = 13, + HardwareModel_RAK11200 = 13, /* B&Q Consulting Nano Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:nano */ - meshtastic_HardwareModel_NANO_G1 = 14, + HardwareModel_NANO_G1 = 14, /* TODO: REPLACE */ - meshtastic_HardwareModel_TLORA_V2_1_1P8 = 15, + HardwareModel_TLORA_V2_1_1P8 = 15, /* TODO: REPLACE */ - meshtastic_HardwareModel_TLORA_T3_S3 = 16, + HardwareModel_TLORA_T3_S3 = 16, /* B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station */ - meshtastic_HardwareModel_STATION_G1 = 25, + HardwareModel_STATION_G1 = 25, /* Less common/prototype boards listed here (needs one more byte over the air) */ - meshtastic_HardwareModel_LORA_RELAY_V1 = 32, + HardwareModel_LORA_RELAY_V1 = 32, /* TODO: REPLACE */ - meshtastic_HardwareModel_NRF52840DK = 33, + HardwareModel_NRF52840DK = 33, /* TODO: REPLACE */ - meshtastic_HardwareModel_PPR = 34, + HardwareModel_PPR = 34, /* TODO: REPLACE */ - meshtastic_HardwareModel_GENIEBLOCKS = 35, + HardwareModel_GENIEBLOCKS = 35, /* TODO: REPLACE */ - meshtastic_HardwareModel_NRF52_UNKNOWN = 36, + HardwareModel_NRF52_UNKNOWN = 36, /* TODO: REPLACE */ - meshtastic_HardwareModel_PORTDUINO = 37, + HardwareModel_PORTDUINO = 37, /* The simulator built into the android app */ - meshtastic_HardwareModel_ANDROID_SIM = 38, + HardwareModel_ANDROID_SIM = 38, /* Custom DIY device based on @NanoVHF schematics: https://github.com/NanoVHF/Meshtastic-DIY/tree/main/Schematics */ - meshtastic_HardwareModel_DIY_V1 = 39, + HardwareModel_DIY_V1 = 39, /* nRF52840 Dongle : https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle/ */ - meshtastic_HardwareModel_NRF52840_PCA10059 = 40, + HardwareModel_NRF52840_PCA10059 = 40, /* Custom Disaster Radio esp32 v3 device https://github.com/sudomesh/disaster-radio/tree/master/hardware/board_esp32_v3 */ - meshtastic_HardwareModel_DR_DEV = 41, + HardwareModel_DR_DEV = 41, /* M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, Paper) https://m5stack.com/ */ - meshtastic_HardwareModel_M5STACK = 42, + HardwareModel_M5STACK = 42, /* New Heltec LoRA32 with ESP32-S3 CPU */ - meshtastic_HardwareModel_HELTEC_V3 = 43, + HardwareModel_HELTEC_V3 = 43, /* New Heltec Wireless Stick Lite with ESP32-S3 CPU */ - meshtastic_HardwareModel_HELTEC_WSL_V3 = 44, + HardwareModel_HELTEC_WSL_V3 = 44, /* New BETAFPV ELRS Micro TX Module 2.4G with ESP32 CPU */ - meshtastic_HardwareModel_BETAFPV_2400_TX = 45, + HardwareModel_BETAFPV_2400_TX = 45, /* Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. */ - meshtastic_HardwareModel_PRIVATE_HW = 255 -} meshtastic_HardwareModel; + HardwareModel_PRIVATE_HW = 255 +} HardwareModel; /* Shared constants between device and phone */ -typedef enum _meshtastic_Constants { +typedef enum _Constants { /* First enum must be zero, and we are just using this enum to pass int constants between two very different environments */ - meshtastic_Constants_ZERO = 0, + Constants_ZERO = 0, /* From mesh.options note: this payload length is ONLY the bytes that are sent inside of the Data protobuf (excluding protobuf overhead). The 16 byte header is outside of this envelope */ - meshtastic_Constants_DATA_PAYLOAD_LEN = 237 -} meshtastic_Constants; + Constants_DATA_PAYLOAD_LEN = 237 +} Constants; /* Error codes for critical errors The device might report these fault codes on the screen. If you encounter a fault code, please post on the meshtastic.discourse.group and we'll try to help. */ -typedef enum _meshtastic_CriticalErrorCode { +typedef enum _CriticalErrorCode { /* TODO: REPLACE */ - meshtastic_CriticalErrorCode_NONE = 0, + CriticalErrorCode_NONE = 0, /* A software bug was detected while trying to send lora */ - meshtastic_CriticalErrorCode_TX_WATCHDOG = 1, + CriticalErrorCode_TX_WATCHDOG = 1, /* A software bug was detected on entry to sleep */ - meshtastic_CriticalErrorCode_SLEEP_ENTER_WAIT = 2, + CriticalErrorCode_SLEEP_ENTER_WAIT = 2, /* No Lora radio hardware could be found */ - meshtastic_CriticalErrorCode_NO_RADIO = 3, + CriticalErrorCode_NO_RADIO = 3, /* Not normally used */ - meshtastic_CriticalErrorCode_UNSPECIFIED = 4, + CriticalErrorCode_UNSPECIFIED = 4, /* We failed while configuring a UBlox GPS */ - meshtastic_CriticalErrorCode_UBLOX_UNIT_FAILED = 5, + CriticalErrorCode_UBLOX_UNIT_FAILED = 5, /* This board was expected to have a power management chip and it is missing or broken */ - meshtastic_CriticalErrorCode_NO_AXP192 = 6, + CriticalErrorCode_NO_AXP192 = 6, /* The channel tried to set a radio setting which is not supported by this chipset, radio comms settings are now undefined. */ - meshtastic_CriticalErrorCode_INVALID_RADIO_SETTING = 7, + CriticalErrorCode_INVALID_RADIO_SETTING = 7, /* Radio transmit hardware failure. We sent data to the radio chip, but it didn't reply with an interrupt. */ - meshtastic_CriticalErrorCode_TRANSMIT_FAILED = 8, + CriticalErrorCode_TRANSMIT_FAILED = 8, /* We detected that the main CPU voltage dropped below the minumum acceptable value */ - meshtastic_CriticalErrorCode_BROWNOUT = 9, + CriticalErrorCode_BROWNOUT = 9, /* Selftest of SX1262 radio chip failed */ - meshtastic_CriticalErrorCode_SX1262_FAILURE = 10, + CriticalErrorCode_SX1262_FAILURE = 10, /* A (likely software but possibly hardware) failure was detected while trying to send packets. If this occurs on your board, please post in the forum so that we can ask you to collect some information to allow fixing this bug */ - meshtastic_CriticalErrorCode_RADIO_SPI_BUG = 11 -} meshtastic_CriticalErrorCode; + CriticalErrorCode_RADIO_SPI_BUG = 11 +} CriticalErrorCode; /* How the location was acquired: manual, onboard GPS, external (EUD) GPS */ -typedef enum _meshtastic_Position_LocSource { +typedef enum _Position_LocSource { /* TODO: REPLACE */ - meshtastic_Position_LocSource_LOC_UNSET = 0, + Position_LocSource_LOC_UNSET = 0, /* TODO: REPLACE */ - meshtastic_Position_LocSource_LOC_MANUAL = 1, + Position_LocSource_LOC_MANUAL = 1, /* TODO: REPLACE */ - meshtastic_Position_LocSource_LOC_INTERNAL = 2, + Position_LocSource_LOC_INTERNAL = 2, /* TODO: REPLACE */ - meshtastic_Position_LocSource_LOC_EXTERNAL = 3 -} meshtastic_Position_LocSource; + Position_LocSource_LOC_EXTERNAL = 3 +} Position_LocSource; /* How the altitude was acquired: manual, GPS int/ext, etc Default: same as location_source if present */ -typedef enum _meshtastic_Position_AltSource { +typedef enum _Position_AltSource { /* TODO: REPLACE */ - meshtastic_Position_AltSource_ALT_UNSET = 0, + Position_AltSource_ALT_UNSET = 0, /* TODO: REPLACE */ - meshtastic_Position_AltSource_ALT_MANUAL = 1, + Position_AltSource_ALT_MANUAL = 1, /* TODO: REPLACE */ - meshtastic_Position_AltSource_ALT_INTERNAL = 2, + Position_AltSource_ALT_INTERNAL = 2, /* TODO: REPLACE */ - meshtastic_Position_AltSource_ALT_EXTERNAL = 3, + Position_AltSource_ALT_EXTERNAL = 3, /* TODO: REPLACE */ - meshtastic_Position_AltSource_ALT_BAROMETRIC = 4 -} meshtastic_Position_AltSource; + Position_AltSource_ALT_BAROMETRIC = 4 +} Position_AltSource; /* A failure in delivering a message (usually used for routing control messages, but might be provided in addition to ack.fail_id to provide details on the type of failure). */ -typedef enum _meshtastic_Routing_Error { +typedef enum _Routing_Error { /* This message is not a failure */ - meshtastic_Routing_Error_NONE = 0, + Routing_Error_NONE = 0, /* Our node doesn't have a route to the requested destination anymore. */ - meshtastic_Routing_Error_NO_ROUTE = 1, + Routing_Error_NO_ROUTE = 1, /* We received a nak while trying to forward on your behalf */ - meshtastic_Routing_Error_GOT_NAK = 2, + Routing_Error_GOT_NAK = 2, /* TODO: REPLACE */ - meshtastic_Routing_Error_TIMEOUT = 3, + Routing_Error_TIMEOUT = 3, /* No suitable interface could be found for delivering this packet */ - meshtastic_Routing_Error_NO_INTERFACE = 4, + Routing_Error_NO_INTERFACE = 4, /* We reached the max retransmission count (typically for naive flood routing) */ - meshtastic_Routing_Error_MAX_RETRANSMIT = 5, + Routing_Error_MAX_RETRANSMIT = 5, /* No suitable channel was found for sending this packet (i.e. was requested channel index disabled?) */ - meshtastic_Routing_Error_NO_CHANNEL = 6, + Routing_Error_NO_CHANNEL = 6, /* The packet was too big for sending (exceeds interface MTU after encoding) */ - meshtastic_Routing_Error_TOO_LARGE = 7, + Routing_Error_TOO_LARGE = 7, /* The request had want_response set, the request reached the destination node, but no service on that node wants to send a response (possibly due to bad channel permissions) */ - meshtastic_Routing_Error_NO_RESPONSE = 8, + Routing_Error_NO_RESPONSE = 8, /* Cannot send currently because duty cycle regulations will be violated. */ - meshtastic_Routing_Error_DUTY_CYCLE_LIMIT = 9, + Routing_Error_DUTY_CYCLE_LIMIT = 9, /* The application layer service on the remote node received your request, but considered your request somehow invalid */ - meshtastic_Routing_Error_BAD_REQUEST = 32, + Routing_Error_BAD_REQUEST = 32, /* The application layer service on the remote node received your request, but considered your request not authorized (i.e you did not send the request on the required bound channel) */ - meshtastic_Routing_Error_NOT_AUTHORIZED = 33 -} meshtastic_Routing_Error; + Routing_Error_NOT_AUTHORIZED = 33 +} Routing_Error; /* The priority of this message for sending. Higher priorities are sent first (when managing the transmit queue). @@ -212,57 +212,57 @@ typedef enum _meshtastic_Routing_Error { So I bit the bullet and implemented a new (internal - not sent over the air) field in MeshPacket called ‘priority’. And the transmission queue in the router object is now a priority queue. */ -typedef enum _meshtastic_MeshPacket_Priority { +typedef enum _MeshPacket_Priority { /* Treated as Priority.DEFAULT */ - meshtastic_MeshPacket_Priority_UNSET = 0, + MeshPacket_Priority_UNSET = 0, /* TODO: REPLACE */ - meshtastic_MeshPacket_Priority_MIN = 1, + MeshPacket_Priority_MIN = 1, /* Background position updates are sent with very low priority - if the link is super congested they might not go out at all */ - meshtastic_MeshPacket_Priority_BACKGROUND = 10, + MeshPacket_Priority_BACKGROUND = 10, /* This priority is used for most messages that don't have a priority set */ - meshtastic_MeshPacket_Priority_DEFAULT = 64, + MeshPacket_Priority_DEFAULT = 64, /* If priority is unset but the message is marked as want_ack, assume it is important and use a slightly higher priority */ - meshtastic_MeshPacket_Priority_RELIABLE = 70, + MeshPacket_Priority_RELIABLE = 70, /* Ack/naks are sent with very high priority to ensure that retransmission stops as soon as possible */ - meshtastic_MeshPacket_Priority_ACK = 120, + MeshPacket_Priority_ACK = 120, /* TODO: REPLACE */ - meshtastic_MeshPacket_Priority_MAX = 127 -} meshtastic_MeshPacket_Priority; + MeshPacket_Priority_MAX = 127 +} MeshPacket_Priority; /* Identify if this is a delayed packet */ -typedef enum _meshtastic_MeshPacket_Delayed { +typedef enum _MeshPacket_Delayed { /* If unset, the message is being sent in real time. */ - meshtastic_MeshPacket_Delayed_NO_DELAY = 0, + MeshPacket_Delayed_NO_DELAY = 0, /* The message is delayed and was originally a broadcast */ - meshtastic_MeshPacket_Delayed_DELAYED_BROADCAST = 1, + MeshPacket_Delayed_DELAYED_BROADCAST = 1, /* The message is delayed and was originally a direct message */ - meshtastic_MeshPacket_Delayed_DELAYED_DIRECT = 2 -} meshtastic_MeshPacket_Delayed; + MeshPacket_Delayed_DELAYED_DIRECT = 2 +} MeshPacket_Delayed; /* Log levels, chosen to match python logging conventions. */ -typedef enum _meshtastic_LogRecord_Level { +typedef enum _LogRecord_Level { /* Log levels, chosen to match python logging conventions. */ - meshtastic_LogRecord_Level_UNSET = 0, + LogRecord_Level_UNSET = 0, /* Log levels, chosen to match python logging conventions. */ - meshtastic_LogRecord_Level_CRITICAL = 50, + LogRecord_Level_CRITICAL = 50, /* Log levels, chosen to match python logging conventions. */ - meshtastic_LogRecord_Level_ERROR = 40, + LogRecord_Level_ERROR = 40, /* Log levels, chosen to match python logging conventions. */ - meshtastic_LogRecord_Level_WARNING = 30, + LogRecord_Level_WARNING = 30, /* Log levels, chosen to match python logging conventions. */ - meshtastic_LogRecord_Level_INFO = 20, + LogRecord_Level_INFO = 20, /* Log levels, chosen to match python logging conventions. */ - meshtastic_LogRecord_Level_DEBUG = 10, + LogRecord_Level_DEBUG = 10, /* Log levels, chosen to match python logging conventions. */ - meshtastic_LogRecord_Level_TRACE = 5 -} meshtastic_LogRecord_Level; + LogRecord_Level_TRACE = 5 +} LogRecord_Level; /* Struct definitions */ /* a gps position */ -typedef struct _meshtastic_Position { +typedef struct _Position { /* The new preferred location encoding, multiply by 1e-7 to get degrees in floating point */ int32_t latitude_i; @@ -277,9 +277,9 @@ typedef struct _meshtastic_Position { seconds since 1970 */ uint32_t time; /* TODO: REPLACE */ - meshtastic_Position_LocSource location_source; + Position_LocSource location_source; /* TODO: REPLACE */ - meshtastic_Position_AltSource altitude_source; + Position_AltSource altitude_source; /* Positional timestamp (actual timestamp of GPS solution) in integer epoch seconds */ uint32_t timestamp; /* Pos. timestamp milliseconds adjustment (rarely available or required) */ @@ -327,7 +327,7 @@ typedef struct _meshtastic_Position { /* A sequence number, incremented with each Position message to help detect lost updates if needed */ uint32_t seq_number; -} meshtastic_Position; +} Position; /* Broadcast when a newly powered mesh node wants to find a node num it can use Sent from the phone over bluetooth to set the user id for the owner of this node. @@ -349,7 +349,7 @@ typedef struct _meshtastic_Position { A few nodenums are reserved and will never be requested: 0xff - broadcast 0 through 3 - for future use */ -typedef struct _meshtastic_User { +typedef struct _User { /* A globally unique ID string for this user. In the case of Signal that would mean +16504442323, for the default macaddr derived id it would be !<8 hexidecimal bytes>. Note: app developers are encouraged to also use the following standard @@ -367,43 +367,43 @@ typedef struct _meshtastic_User { Starting in 1.2.11 moved to hw_model enum in the NodeInfo object. Apps will still need the string here for older builds (so OTA update can find the right image), but if the enum is available it will be used instead. */ - meshtastic_HardwareModel hw_model; + HardwareModel hw_model; /* In some regions Ham radio operators have different bandwidth limitations than others. If this user is a licensed operator, set this flag. Also, "long_name" should be their licence number. */ bool is_licensed; -} meshtastic_User; +} User; /* A message used in our Dynamic Source Routing protocol (RFC 4728 based) */ -typedef struct _meshtastic_RouteDiscovery { +typedef struct _RouteDiscovery { /* The list of nodenums this packet has visited so far */ pb_size_t route_count; uint32_t route[8]; -} meshtastic_RouteDiscovery; +} RouteDiscovery; /* A Routing control Data packet handled by the routing module */ -typedef struct _meshtastic_Routing { +typedef struct _Routing { pb_size_t which_variant; union { /* A route request going from the requester */ - meshtastic_RouteDiscovery route_request; + RouteDiscovery route_request; /* A route reply */ - meshtastic_RouteDiscovery route_reply; + RouteDiscovery route_reply; /* A failure in delivering a message (usually used for routing control messages, but might be provided in addition to ack.fail_id to provide details on the type of failure). */ - meshtastic_Routing_Error error_reason; + Routing_Error error_reason; }; -} meshtastic_Routing; +} Routing; -typedef PB_BYTES_ARRAY_T(237) meshtastic_Data_payload_t; +typedef PB_BYTES_ARRAY_T(237) Data_payload_t; /* (Formerly called SubPacket) The payload portion fo a packet, this is the actual bytes that are sent inside a radio packet (because from/to are broken out by the comms library) */ -typedef struct _meshtastic_Data { +typedef struct _Data { /* Formerly named typ and of type Type */ - meshtastic_PortNum portnum; + PortNum portnum; /* TODO: REPLACE */ - meshtastic_Data_payload_t payload; + Data_payload_t payload; /* Not normally used, but for testing a sender can request that recipient responds in kind (i.e. if it received a position, it should unicast back it's position). Note: that if you set this on a broadcast you will receive many replies. */ @@ -426,10 +426,10 @@ typedef struct _meshtastic_Data { /* Defaults to false. If true, then what is in the payload should be treated as an emoji like giving a message a heart or poop emoji. */ uint32_t emoji; -} meshtastic_Data; +} Data; /* Waypoint message, used to share arbitrary locations across the mesh */ -typedef struct _meshtastic_Waypoint { +typedef struct _Waypoint { /* Id of the waypoint */ uint32_t id; /* latitude_i */ @@ -447,13 +447,13 @@ typedef struct _meshtastic_Waypoint { char description[100]; /* Designator icon for the waypoint in the form of a unicode emoji */ uint32_t icon; -} meshtastic_Waypoint; +} Waypoint; -typedef PB_BYTES_ARRAY_T(256) meshtastic_MeshPacket_encrypted_t; +typedef PB_BYTES_ARRAY_T(256) MeshPacket_encrypted_t; /* A packet envelope sent/received over the mesh only payload_variant is sent in the payload portion of the LORA packet. The other fields are either not sent at all, or sent in the special 16 byte LORA header. */ -typedef struct _meshtastic_MeshPacket { +typedef struct _MeshPacket { /* The sending node number. Note: Our crypto implementation uses this field as well. See [crypto](/docs/overview/encryption) for details. @@ -473,9 +473,9 @@ typedef struct _meshtastic_MeshPacket { pb_size_t which_payload_variant; union { /* TODO: REPLACE */ - meshtastic_Data decoded; + Data decoded; /* TODO: REPLACE */ - meshtastic_MeshPacket_encrypted_t encrypted; + MeshPacket_encrypted_t encrypted; }; /* A unique ID for this packet. Always 0 for no-ack packets or non broadcast packets (and therefore take zero bytes of space). @@ -514,12 +514,12 @@ typedef struct _meshtastic_MeshPacket { bool want_ack; /* The priority of this message for sending. See MeshPacket.Priority description for more details. */ - meshtastic_MeshPacket_Priority priority; + MeshPacket_Priority priority; /* rssi of received packet. Only sent to phone for dispay purposes. */ int32_t rx_rssi; /* Describe if this message is delayed */ - meshtastic_MeshPacket_Delayed delayed; -} meshtastic_MeshPacket; + MeshPacket_Delayed delayed; +} MeshPacket; /* The bluetooth to device link: Old BTLE protocol docs from TODO, merge in above and make real docs... @@ -537,16 +537,16 @@ typedef struct _meshtastic_MeshPacket { level etc) SET_CONFIG (switches device to a new set of radio params and preshared key, drops all existing nodes, force our node to rejoin this new group) Full information about a node on the mesh */ -typedef struct _meshtastic_NodeInfo { +typedef struct _NodeInfo { /* The node number */ uint32_t num; /* The user info for this node */ bool has_user; - meshtastic_User user; + User user; /* This position data. Note: before 1.2.14 we would also store the last time we've heard from this node in position.time, that is no longer true. Position.time now indicates the last time we received a POSITION from that node. */ bool has_position; - meshtastic_Position position; + Position position; /* Returns the Signal-to-noise ratio (SNR) of the last received message, as measured by the receiver. Return SNR of the last received message in dB */ float snr; @@ -554,13 +554,13 @@ typedef struct _meshtastic_NodeInfo { uint32_t last_heard; /* The latest device metrics for the node. */ bool has_device_metrics; - meshtastic_DeviceMetrics device_metrics; -} meshtastic_NodeInfo; + DeviceMetrics device_metrics; +} NodeInfo; /* Unique local debugging info for this node Note: we don't include position or the user info, because that will come in the Sent to the phone in response to WantNodes. */ -typedef struct _meshtastic_MyNodeInfo { +typedef struct _MyNodeInfo { /* Tells the phone what our node number is, default starting value is lowbyte of macaddr, but it will be fixed if that is already in use */ uint32_t my_node_num; @@ -577,7 +577,7 @@ typedef struct _meshtastic_MyNodeInfo { This field will be cleared after the phone reads MyNodeInfo (i.e. it will only be reported once) a numeric error code to go with error message, zero means no error */ - meshtastic_CriticalErrorCode error_code; + CriticalErrorCode error_code; /* A numeric error address (nonzero if available) */ uint32_t error_address; /* The total number of errors this node has ever encountered @@ -608,14 +608,14 @@ typedef struct _meshtastic_MyNodeInfo { float channel_utilization; /* Percent of airtime for transmission used within the last hour. */ float air_util_tx; -} meshtastic_MyNodeInfo; +} MyNodeInfo; /* Debug output from the device. To minimize the size of records inside the device code, if a time/source/level is not set on the message it is assumed to be a continuation of the previously sent message. This allows the device code to use fixed maxlen 64 byte strings for messages, and then extend as needed by emitting multiple records. */ -typedef struct _meshtastic_LogRecord { +typedef struct _LogRecord { /* Log levels, chosen to match python logging conventions. */ char message[64]; /* Seconds since 1970 - or 0 for unknown/unset */ @@ -623,10 +623,10 @@ typedef struct _meshtastic_LogRecord { /* Usually based on thread name - if known */ char source[8]; /* Not yet set */ - meshtastic_LogRecord_Level level; -} meshtastic_LogRecord; + LogRecord_Level level; +} LogRecord; -typedef struct _meshtastic_QueueStatus { +typedef struct _QueueStatus { /* Last attempt to queue status, ErrorCode */ int8_t res; /* Free entries in the outgoing queue */ @@ -635,30 +635,30 @@ typedef struct _meshtastic_QueueStatus { uint8_t maxlen; /* What was mesh packet id that generated this response? */ uint32_t mesh_packet_id; -} meshtastic_QueueStatus; +} QueueStatus; /* Packets from the radio to the phone will appear on the fromRadio characteristic. It will support READ and NOTIFY. When a new packet arrives the device will BLE notify? It will sit in that descriptor until consumed by the phone, at which point the next item in the FIFO will be populated. */ -typedef struct _meshtastic_FromRadio { +typedef struct _FromRadio { /* The packet id, used to allow the phone to request missing read packets from the FIFO, see our bluetooth docs */ uint32_t id; pb_size_t which_payload_variant; union { /* Log levels, chosen to match python logging conventions. */ - meshtastic_MeshPacket packet; + MeshPacket packet; /* Tells the phone what our node number is, can be -1 if we've not yet joined a mesh. NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps. */ - meshtastic_MyNodeInfo my_info; + MyNodeInfo my_info; /* One packet is sent for each node in the on radio DB starts over with the first node in our DB */ - meshtastic_NodeInfo node_info; + NodeInfo node_info; /* Include a part of the config (was: RadioConfig radio) */ - meshtastic_Config config; + Config config; /* Set to send debug console output over our protobuf stream */ - meshtastic_LogRecord log_record; + LogRecord log_record; /* Sent as true once the device has finished sending all of the responses to want_config recipient should check if this ID matches our original request nonce, if not, it means your config responses haven't started yet. @@ -670,23 +670,23 @@ typedef struct _meshtastic_FromRadio { NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps. */ bool rebooted; /* Include module config */ - meshtastic_ModuleConfig moduleConfig; + ModuleConfig moduleConfig; /* One packet is sent for each channel */ - meshtastic_Channel channel; + Channel channel; /* Queue status info */ - meshtastic_QueueStatus queueStatus; + QueueStatus queueStatus; /* File Transfer Chunk */ - meshtastic_XModem xmodemPacket; + XModem xmodemPacket; }; -} meshtastic_FromRadio; +} FromRadio; /* Packets/commands to the radio will be written (reliably) to the toRadio characteristic. Once the write completes the phone can assume it is handled. */ -typedef struct _meshtastic_ToRadio { +typedef struct _ToRadio { pb_size_t which_payload_variant; union { /* Send this packet on the mesh */ - meshtastic_MeshPacket packet; + MeshPacket packet; /* Phone wants radio to send full node db to the phone, This is typically the first packet sent to the radio when the phone gets a bluetooth connection. The radio will respond by sending back a @@ -700,18 +700,18 @@ typedef struct _meshtastic_ToRadio { This is useful for serial links where there is no hardware/protocol based notification that the client has dropped the link. (Sending this message is optional for clients) */ bool disconnect; - meshtastic_XModem xmodemPacket; + XModem xmodemPacket; }; -} meshtastic_ToRadio; +} ToRadio; -typedef PB_BYTES_ARRAY_T(237) meshtastic_Compressed_data_t; +typedef PB_BYTES_ARRAY_T(237) Compressed_data_t; /* Compressed message payload */ -typedef struct _meshtastic_Compressed { +typedef struct _Compressed { /* PortNum to determine the how to handle the compressed payload. */ - meshtastic_PortNum portnum; + PortNum portnum; /* Compressed data. */ - meshtastic_Compressed_data_t data; -} meshtastic_Compressed; + Compressed_data_t data; +} Compressed; #ifdef __cplusplus @@ -719,210 +719,210 @@ extern "C" { #endif /* Helper constants for enums */ -#define _meshtastic_HardwareModel_MIN meshtastic_HardwareModel_UNSET -#define _meshtastic_HardwareModel_MAX meshtastic_HardwareModel_PRIVATE_HW -#define _meshtastic_HardwareModel_ARRAYSIZE ((meshtastic_HardwareModel)(meshtastic_HardwareModel_PRIVATE_HW+1)) +#define _HardwareModel_MIN HardwareModel_UNSET +#define _HardwareModel_MAX HardwareModel_PRIVATE_HW +#define _HardwareModel_ARRAYSIZE ((HardwareModel)(HardwareModel_PRIVATE_HW+1)) -#define _meshtastic_Constants_MIN meshtastic_Constants_ZERO -#define _meshtastic_Constants_MAX meshtastic_Constants_DATA_PAYLOAD_LEN -#define _meshtastic_Constants_ARRAYSIZE ((meshtastic_Constants)(meshtastic_Constants_DATA_PAYLOAD_LEN+1)) +#define _Constants_MIN Constants_ZERO +#define _Constants_MAX Constants_DATA_PAYLOAD_LEN +#define _Constants_ARRAYSIZE ((Constants)(Constants_DATA_PAYLOAD_LEN+1)) -#define _meshtastic_CriticalErrorCode_MIN meshtastic_CriticalErrorCode_NONE -#define _meshtastic_CriticalErrorCode_MAX meshtastic_CriticalErrorCode_RADIO_SPI_BUG -#define _meshtastic_CriticalErrorCode_ARRAYSIZE ((meshtastic_CriticalErrorCode)(meshtastic_CriticalErrorCode_RADIO_SPI_BUG+1)) +#define _CriticalErrorCode_MIN CriticalErrorCode_NONE +#define _CriticalErrorCode_MAX CriticalErrorCode_RADIO_SPI_BUG +#define _CriticalErrorCode_ARRAYSIZE ((CriticalErrorCode)(CriticalErrorCode_RADIO_SPI_BUG+1)) -#define _meshtastic_Position_LocSource_MIN meshtastic_Position_LocSource_LOC_UNSET -#define _meshtastic_Position_LocSource_MAX meshtastic_Position_LocSource_LOC_EXTERNAL -#define _meshtastic_Position_LocSource_ARRAYSIZE ((meshtastic_Position_LocSource)(meshtastic_Position_LocSource_LOC_EXTERNAL+1)) +#define _Position_LocSource_MIN Position_LocSource_LOC_UNSET +#define _Position_LocSource_MAX Position_LocSource_LOC_EXTERNAL +#define _Position_LocSource_ARRAYSIZE ((Position_LocSource)(Position_LocSource_LOC_EXTERNAL+1)) -#define _meshtastic_Position_AltSource_MIN meshtastic_Position_AltSource_ALT_UNSET -#define _meshtastic_Position_AltSource_MAX meshtastic_Position_AltSource_ALT_BAROMETRIC -#define _meshtastic_Position_AltSource_ARRAYSIZE ((meshtastic_Position_AltSource)(meshtastic_Position_AltSource_ALT_BAROMETRIC+1)) +#define _Position_AltSource_MIN Position_AltSource_ALT_UNSET +#define _Position_AltSource_MAX Position_AltSource_ALT_BAROMETRIC +#define _Position_AltSource_ARRAYSIZE ((Position_AltSource)(Position_AltSource_ALT_BAROMETRIC+1)) -#define _meshtastic_Routing_Error_MIN meshtastic_Routing_Error_NONE -#define _meshtastic_Routing_Error_MAX meshtastic_Routing_Error_NOT_AUTHORIZED -#define _meshtastic_Routing_Error_ARRAYSIZE ((meshtastic_Routing_Error)(meshtastic_Routing_Error_NOT_AUTHORIZED+1)) +#define _Routing_Error_MIN Routing_Error_NONE +#define _Routing_Error_MAX Routing_Error_NOT_AUTHORIZED +#define _Routing_Error_ARRAYSIZE ((Routing_Error)(Routing_Error_NOT_AUTHORIZED+1)) -#define _meshtastic_MeshPacket_Priority_MIN meshtastic_MeshPacket_Priority_UNSET -#define _meshtastic_MeshPacket_Priority_MAX meshtastic_MeshPacket_Priority_MAX -#define _meshtastic_MeshPacket_Priority_ARRAYSIZE ((meshtastic_MeshPacket_Priority)(meshtastic_MeshPacket_Priority_MAX+1)) +#define _MeshPacket_Priority_MIN MeshPacket_Priority_UNSET +#define _MeshPacket_Priority_MAX MeshPacket_Priority_MAX +#define _MeshPacket_Priority_ARRAYSIZE ((MeshPacket_Priority)(MeshPacket_Priority_MAX+1)) -#define _meshtastic_MeshPacket_Delayed_MIN meshtastic_MeshPacket_Delayed_NO_DELAY -#define _meshtastic_MeshPacket_Delayed_MAX meshtastic_MeshPacket_Delayed_DELAYED_DIRECT -#define _meshtastic_MeshPacket_Delayed_ARRAYSIZE ((meshtastic_MeshPacket_Delayed)(meshtastic_MeshPacket_Delayed_DELAYED_DIRECT+1)) +#define _MeshPacket_Delayed_MIN MeshPacket_Delayed_NO_DELAY +#define _MeshPacket_Delayed_MAX MeshPacket_Delayed_DELAYED_DIRECT +#define _MeshPacket_Delayed_ARRAYSIZE ((MeshPacket_Delayed)(MeshPacket_Delayed_DELAYED_DIRECT+1)) -#define _meshtastic_LogRecord_Level_MIN meshtastic_LogRecord_Level_UNSET -#define _meshtastic_LogRecord_Level_MAX meshtastic_LogRecord_Level_CRITICAL -#define _meshtastic_LogRecord_Level_ARRAYSIZE ((meshtastic_LogRecord_Level)(meshtastic_LogRecord_Level_CRITICAL+1)) +#define _LogRecord_Level_MIN LogRecord_Level_UNSET +#define _LogRecord_Level_MAX LogRecord_Level_CRITICAL +#define _LogRecord_Level_ARRAYSIZE ((LogRecord_Level)(LogRecord_Level_CRITICAL+1)) -#define meshtastic_Position_location_source_ENUMTYPE meshtastic_Position_LocSource -#define meshtastic_Position_altitude_source_ENUMTYPE meshtastic_Position_AltSource +#define Position_location_source_ENUMTYPE Position_LocSource +#define Position_altitude_source_ENUMTYPE Position_AltSource -#define meshtastic_User_hw_model_ENUMTYPE meshtastic_HardwareModel +#define User_hw_model_ENUMTYPE HardwareModel -#define meshtastic_Routing_variant_error_reason_ENUMTYPE meshtastic_Routing_Error +#define Routing_variant_error_reason_ENUMTYPE Routing_Error -#define meshtastic_Data_portnum_ENUMTYPE meshtastic_PortNum +#define Data_portnum_ENUMTYPE PortNum -#define meshtastic_MeshPacket_priority_ENUMTYPE meshtastic_MeshPacket_Priority -#define meshtastic_MeshPacket_delayed_ENUMTYPE meshtastic_MeshPacket_Delayed +#define MeshPacket_priority_ENUMTYPE MeshPacket_Priority +#define MeshPacket_delayed_ENUMTYPE MeshPacket_Delayed -#define meshtastic_MyNodeInfo_error_code_ENUMTYPE meshtastic_CriticalErrorCode +#define MyNodeInfo_error_code_ENUMTYPE CriticalErrorCode -#define meshtastic_LogRecord_level_ENUMTYPE meshtastic_LogRecord_Level +#define LogRecord_level_ENUMTYPE LogRecord_Level -#define meshtastic_Compressed_portnum_ENUMTYPE meshtastic_PortNum +#define Compressed_portnum_ENUMTYPE PortNum /* Initializer values for message structs */ -#define meshtastic_Position_init_default {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_User_init_default {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0} -#define meshtastic_RouteDiscovery_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}} -#define meshtastic_Routing_init_default {0, {meshtastic_RouteDiscovery_init_default}} -#define meshtastic_Data_init_default {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0} -#define meshtastic_Waypoint_init_default {0, 0, 0, 0, 0, "", "", 0} -#define meshtastic_MeshPacket_init_default {0, 0, 0, 0, {meshtastic_Data_init_default}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN} -#define meshtastic_NodeInfo_init_default {0, false, meshtastic_User_init_default, false, meshtastic_Position_init_default, 0, 0, false, meshtastic_DeviceMetrics_init_default} -#define meshtastic_MyNodeInfo_init_default {0, 0, 0, "", _meshtastic_CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} -#define meshtastic_LogRecord_init_default {"", 0, "", _meshtastic_LogRecord_Level_MIN} -#define meshtastic_QueueStatus_init_default {0, 0, 0, 0} -#define meshtastic_FromRadio_init_default {0, 0, {meshtastic_MeshPacket_init_default}} -#define meshtastic_ToRadio_init_default {0, {meshtastic_MeshPacket_init_default}} -#define meshtastic_Compressed_init_default {_meshtastic_PortNum_MIN, {0, {0}}} -#define meshtastic_Position_init_zero {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_User_init_zero {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0} -#define meshtastic_RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}} -#define meshtastic_Routing_init_zero {0, {meshtastic_RouteDiscovery_init_zero}} -#define meshtastic_Data_init_zero {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0} -#define meshtastic_Waypoint_init_zero {0, 0, 0, 0, 0, "", "", 0} -#define meshtastic_MeshPacket_init_zero {0, 0, 0, 0, {meshtastic_Data_init_zero}, 0, 0, 0, 0, 0, _meshtastic_MeshPacket_Priority_MIN, 0, _meshtastic_MeshPacket_Delayed_MIN} -#define meshtastic_NodeInfo_init_zero {0, false, meshtastic_User_init_zero, false, meshtastic_Position_init_zero, 0, 0, false, meshtastic_DeviceMetrics_init_zero} -#define meshtastic_MyNodeInfo_init_zero {0, 0, 0, "", _meshtastic_CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} -#define meshtastic_LogRecord_init_zero {"", 0, "", _meshtastic_LogRecord_Level_MIN} -#define meshtastic_QueueStatus_init_zero {0, 0, 0, 0} -#define meshtastic_FromRadio_init_zero {0, 0, {meshtastic_MeshPacket_init_zero}} -#define meshtastic_ToRadio_init_zero {0, {meshtastic_MeshPacket_init_zero}} -#define meshtastic_Compressed_init_zero {_meshtastic_PortNum_MIN, {0, {0}}} +#define Position_init_default {0, 0, 0, 0, _Position_LocSource_MIN, _Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define User_init_default {"", "", "", {0}, _HardwareModel_MIN, 0} +#define RouteDiscovery_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}} +#define Routing_init_default {0, {RouteDiscovery_init_default}} +#define Data_init_default {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0} +#define Waypoint_init_default {0, 0, 0, 0, 0, "", "", 0} +#define MeshPacket_init_default {0, 0, 0, 0, {Data_init_default}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN} +#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0, false, DeviceMetrics_init_default} +#define MyNodeInfo_init_default {0, 0, 0, "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} +#define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN} +#define QueueStatus_init_default {0, 0, 0, 0} +#define FromRadio_init_default {0, 0, {MeshPacket_init_default}} +#define ToRadio_init_default {0, {MeshPacket_init_default}} +#define Compressed_init_default {_PortNum_MIN, {0, {0}}} +#define Position_init_zero {0, 0, 0, 0, _Position_LocSource_MIN, _Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define User_init_zero {"", "", "", {0}, _HardwareModel_MIN, 0} +#define RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}} +#define Routing_init_zero {0, {RouteDiscovery_init_zero}} +#define Data_init_zero {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0} +#define Waypoint_init_zero {0, 0, 0, 0, 0, "", "", 0} +#define MeshPacket_init_zero {0, 0, 0, 0, {Data_init_zero}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN} +#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0, false, DeviceMetrics_init_zero} +#define MyNodeInfo_init_zero {0, 0, 0, "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} +#define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN} +#define QueueStatus_init_zero {0, 0, 0, 0} +#define FromRadio_init_zero {0, 0, {MeshPacket_init_zero}} +#define ToRadio_init_zero {0, {MeshPacket_init_zero}} +#define Compressed_init_zero {_PortNum_MIN, {0, {0}}} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_Position_latitude_i_tag 1 -#define meshtastic_Position_longitude_i_tag 2 -#define meshtastic_Position_altitude_tag 3 -#define meshtastic_Position_time_tag 4 -#define meshtastic_Position_location_source_tag 5 -#define meshtastic_Position_altitude_source_tag 6 -#define meshtastic_Position_timestamp_tag 7 -#define meshtastic_Position_timestamp_millis_adjust_tag 8 -#define meshtastic_Position_altitude_hae_tag 9 -#define meshtastic_Position_altitude_geoidal_separation_tag 10 -#define meshtastic_Position_PDOP_tag 11 -#define meshtastic_Position_HDOP_tag 12 -#define meshtastic_Position_VDOP_tag 13 -#define meshtastic_Position_gps_accuracy_tag 14 -#define meshtastic_Position_ground_speed_tag 15 -#define meshtastic_Position_ground_track_tag 16 -#define meshtastic_Position_fix_quality_tag 17 -#define meshtastic_Position_fix_type_tag 18 -#define meshtastic_Position_sats_in_view_tag 19 -#define meshtastic_Position_sensor_id_tag 20 -#define meshtastic_Position_next_update_tag 21 -#define meshtastic_Position_seq_number_tag 22 -#define meshtastic_User_id_tag 1 -#define meshtastic_User_long_name_tag 2 -#define meshtastic_User_short_name_tag 3 -#define meshtastic_User_macaddr_tag 4 -#define meshtastic_User_hw_model_tag 5 -#define meshtastic_User_is_licensed_tag 6 -#define meshtastic_RouteDiscovery_route_tag 1 -#define meshtastic_Routing_route_request_tag 1 -#define meshtastic_Routing_route_reply_tag 2 -#define meshtastic_Routing_error_reason_tag 3 -#define meshtastic_Data_portnum_tag 1 -#define meshtastic_Data_payload_tag 2 -#define meshtastic_Data_want_response_tag 3 -#define meshtastic_Data_dest_tag 4 -#define meshtastic_Data_source_tag 5 -#define meshtastic_Data_request_id_tag 6 -#define meshtastic_Data_reply_id_tag 7 -#define meshtastic_Data_emoji_tag 8 -#define meshtastic_Waypoint_id_tag 1 -#define meshtastic_Waypoint_latitude_i_tag 2 -#define meshtastic_Waypoint_longitude_i_tag 3 -#define meshtastic_Waypoint_expire_tag 4 -#define meshtastic_Waypoint_locked_to_tag 5 -#define meshtastic_Waypoint_name_tag 6 -#define meshtastic_Waypoint_description_tag 7 -#define meshtastic_Waypoint_icon_tag 8 -#define meshtastic_MeshPacket_from_tag 1 -#define meshtastic_MeshPacket_to_tag 2 -#define meshtastic_MeshPacket_channel_tag 3 -#define meshtastic_MeshPacket_decoded_tag 4 -#define meshtastic_MeshPacket_encrypted_tag 5 -#define meshtastic_MeshPacket_id_tag 6 -#define meshtastic_MeshPacket_rx_time_tag 7 -#define meshtastic_MeshPacket_rx_snr_tag 8 -#define meshtastic_MeshPacket_hop_limit_tag 9 -#define meshtastic_MeshPacket_want_ack_tag 10 -#define meshtastic_MeshPacket_priority_tag 11 -#define meshtastic_MeshPacket_rx_rssi_tag 12 -#define meshtastic_MeshPacket_delayed_tag 13 -#define meshtastic_NodeInfo_num_tag 1 -#define meshtastic_NodeInfo_user_tag 2 -#define meshtastic_NodeInfo_position_tag 3 -#define meshtastic_NodeInfo_snr_tag 4 -#define meshtastic_NodeInfo_last_heard_tag 5 -#define meshtastic_NodeInfo_device_metrics_tag 6 -#define meshtastic_MyNodeInfo_my_node_num_tag 1 -#define meshtastic_MyNodeInfo_has_gps_tag 2 -#define meshtastic_MyNodeInfo_max_channels_tag 3 -#define meshtastic_MyNodeInfo_firmware_version_tag 4 -#define meshtastic_MyNodeInfo_error_code_tag 5 -#define meshtastic_MyNodeInfo_error_address_tag 6 -#define meshtastic_MyNodeInfo_error_count_tag 7 -#define meshtastic_MyNodeInfo_reboot_count_tag 8 -#define meshtastic_MyNodeInfo_bitrate_tag 9 -#define meshtastic_MyNodeInfo_message_timeout_msec_tag 10 -#define meshtastic_MyNodeInfo_min_app_version_tag 11 -#define meshtastic_MyNodeInfo_air_period_tx_tag 12 -#define meshtastic_MyNodeInfo_air_period_rx_tag 13 -#define meshtastic_MyNodeInfo_has_wifi_tag 14 -#define meshtastic_MyNodeInfo_channel_utilization_tag 15 -#define meshtastic_MyNodeInfo_air_util_tx_tag 16 -#define meshtastic_LogRecord_message_tag 1 -#define meshtastic_LogRecord_time_tag 2 -#define meshtastic_LogRecord_source_tag 3 -#define meshtastic_LogRecord_level_tag 4 -#define meshtastic_QueueStatus_res_tag 1 -#define meshtastic_QueueStatus_free_tag 2 -#define meshtastic_QueueStatus_maxlen_tag 3 -#define meshtastic_QueueStatus_mesh_packet_id_tag 4 -#define meshtastic_FromRadio_id_tag 1 -#define meshtastic_FromRadio_packet_tag 2 -#define meshtastic_FromRadio_my_info_tag 3 -#define meshtastic_FromRadio_node_info_tag 4 -#define meshtastic_FromRadio_config_tag 5 -#define meshtastic_FromRadio_log_record_tag 6 -#define meshtastic_FromRadio_config_complete_id_tag 7 -#define meshtastic_FromRadio_rebooted_tag 8 -#define meshtastic_FromRadio_moduleConfig_tag 9 -#define meshtastic_FromRadio_channel_tag 10 -#define meshtastic_FromRadio_queueStatus_tag 11 -#define meshtastic_FromRadio_xmodemPacket_tag 12 -#define meshtastic_ToRadio_packet_tag 1 -#define meshtastic_ToRadio_want_config_id_tag 3 -#define meshtastic_ToRadio_disconnect_tag 4 -#define meshtastic_ToRadio_xmodemPacket_tag 5 -#define meshtastic_Compressed_portnum_tag 1 -#define meshtastic_Compressed_data_tag 2 +#define Position_latitude_i_tag 1 +#define Position_longitude_i_tag 2 +#define Position_altitude_tag 3 +#define Position_time_tag 4 +#define Position_location_source_tag 5 +#define Position_altitude_source_tag 6 +#define Position_timestamp_tag 7 +#define Position_timestamp_millis_adjust_tag 8 +#define Position_altitude_hae_tag 9 +#define Position_altitude_geoidal_separation_tag 10 +#define Position_PDOP_tag 11 +#define Position_HDOP_tag 12 +#define Position_VDOP_tag 13 +#define Position_gps_accuracy_tag 14 +#define Position_ground_speed_tag 15 +#define Position_ground_track_tag 16 +#define Position_fix_quality_tag 17 +#define Position_fix_type_tag 18 +#define Position_sats_in_view_tag 19 +#define Position_sensor_id_tag 20 +#define Position_next_update_tag 21 +#define Position_seq_number_tag 22 +#define User_id_tag 1 +#define User_long_name_tag 2 +#define User_short_name_tag 3 +#define User_macaddr_tag 4 +#define User_hw_model_tag 5 +#define User_is_licensed_tag 6 +#define RouteDiscovery_route_tag 1 +#define Routing_route_request_tag 1 +#define Routing_route_reply_tag 2 +#define Routing_error_reason_tag 3 +#define Data_portnum_tag 1 +#define Data_payload_tag 2 +#define Data_want_response_tag 3 +#define Data_dest_tag 4 +#define Data_source_tag 5 +#define Data_request_id_tag 6 +#define Data_reply_id_tag 7 +#define Data_emoji_tag 8 +#define Waypoint_id_tag 1 +#define Waypoint_latitude_i_tag 2 +#define Waypoint_longitude_i_tag 3 +#define Waypoint_expire_tag 4 +#define Waypoint_locked_to_tag 5 +#define Waypoint_name_tag 6 +#define Waypoint_description_tag 7 +#define Waypoint_icon_tag 8 +#define MeshPacket_from_tag 1 +#define MeshPacket_to_tag 2 +#define MeshPacket_channel_tag 3 +#define MeshPacket_decoded_tag 4 +#define MeshPacket_encrypted_tag 5 +#define MeshPacket_id_tag 6 +#define MeshPacket_rx_time_tag 7 +#define MeshPacket_rx_snr_tag 8 +#define MeshPacket_hop_limit_tag 9 +#define MeshPacket_want_ack_tag 10 +#define MeshPacket_priority_tag 11 +#define MeshPacket_rx_rssi_tag 12 +#define MeshPacket_delayed_tag 13 +#define NodeInfo_num_tag 1 +#define NodeInfo_user_tag 2 +#define NodeInfo_position_tag 3 +#define NodeInfo_snr_tag 4 +#define NodeInfo_last_heard_tag 5 +#define NodeInfo_device_metrics_tag 6 +#define MyNodeInfo_my_node_num_tag 1 +#define MyNodeInfo_has_gps_tag 2 +#define MyNodeInfo_max_channels_tag 3 +#define MyNodeInfo_firmware_version_tag 4 +#define MyNodeInfo_error_code_tag 5 +#define MyNodeInfo_error_address_tag 6 +#define MyNodeInfo_error_count_tag 7 +#define MyNodeInfo_reboot_count_tag 8 +#define MyNodeInfo_bitrate_tag 9 +#define MyNodeInfo_message_timeout_msec_tag 10 +#define MyNodeInfo_min_app_version_tag 11 +#define MyNodeInfo_air_period_tx_tag 12 +#define MyNodeInfo_air_period_rx_tag 13 +#define MyNodeInfo_has_wifi_tag 14 +#define MyNodeInfo_channel_utilization_tag 15 +#define MyNodeInfo_air_util_tx_tag 16 +#define LogRecord_message_tag 1 +#define LogRecord_time_tag 2 +#define LogRecord_source_tag 3 +#define LogRecord_level_tag 4 +#define QueueStatus_res_tag 1 +#define QueueStatus_free_tag 2 +#define QueueStatus_maxlen_tag 3 +#define QueueStatus_mesh_packet_id_tag 4 +#define FromRadio_id_tag 1 +#define FromRadio_packet_tag 2 +#define FromRadio_my_info_tag 3 +#define FromRadio_node_info_tag 4 +#define FromRadio_config_tag 5 +#define FromRadio_log_record_tag 6 +#define FromRadio_config_complete_id_tag 7 +#define FromRadio_rebooted_tag 8 +#define FromRadio_moduleConfig_tag 9 +#define FromRadio_channel_tag 10 +#define FromRadio_queueStatus_tag 11 +#define FromRadio_xmodemPacket_tag 12 +#define ToRadio_packet_tag 1 +#define ToRadio_want_config_id_tag 3 +#define ToRadio_disconnect_tag 4 +#define ToRadio_xmodemPacket_tag 5 +#define Compressed_portnum_tag 1 +#define Compressed_data_tag 2 /* Struct field encoding specification for nanopb */ -#define meshtastic_Position_FIELDLIST(X, a) \ +#define Position_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, SFIXED32, latitude_i, 1) \ X(a, STATIC, SINGULAR, SFIXED32, longitude_i, 2) \ X(a, STATIC, SINGULAR, INT32, altitude, 3) \ @@ -945,34 +945,34 @@ X(a, STATIC, SINGULAR, UINT32, sats_in_view, 19) \ X(a, STATIC, SINGULAR, UINT32, sensor_id, 20) \ X(a, STATIC, SINGULAR, UINT32, next_update, 21) \ X(a, STATIC, SINGULAR, UINT32, seq_number, 22) -#define meshtastic_Position_CALLBACK NULL -#define meshtastic_Position_DEFAULT NULL +#define Position_CALLBACK NULL +#define Position_DEFAULT NULL -#define meshtastic_User_FIELDLIST(X, a) \ +#define User_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, STRING, id, 1) \ X(a, STATIC, SINGULAR, STRING, long_name, 2) \ X(a, STATIC, SINGULAR, STRING, short_name, 3) \ X(a, STATIC, SINGULAR, FIXED_LENGTH_BYTES, macaddr, 4) \ X(a, STATIC, SINGULAR, UENUM, hw_model, 5) \ X(a, STATIC, SINGULAR, BOOL, is_licensed, 6) -#define meshtastic_User_CALLBACK NULL -#define meshtastic_User_DEFAULT NULL +#define User_CALLBACK NULL +#define User_DEFAULT NULL -#define meshtastic_RouteDiscovery_FIELDLIST(X, a) \ +#define RouteDiscovery_FIELDLIST(X, a) \ X(a, STATIC, REPEATED, FIXED32, route, 1) -#define meshtastic_RouteDiscovery_CALLBACK NULL -#define meshtastic_RouteDiscovery_DEFAULT NULL +#define RouteDiscovery_CALLBACK NULL +#define RouteDiscovery_DEFAULT NULL -#define meshtastic_Routing_FIELDLIST(X, a) \ +#define Routing_FIELDLIST(X, a) \ X(a, STATIC, ONEOF, MESSAGE, (variant,route_request,route_request), 1) \ X(a, STATIC, ONEOF, MESSAGE, (variant,route_reply,route_reply), 2) \ X(a, STATIC, ONEOF, UENUM, (variant,error_reason,error_reason), 3) -#define meshtastic_Routing_CALLBACK NULL -#define meshtastic_Routing_DEFAULT NULL -#define meshtastic_Routing_variant_route_request_MSGTYPE meshtastic_RouteDiscovery -#define meshtastic_Routing_variant_route_reply_MSGTYPE meshtastic_RouteDiscovery +#define Routing_CALLBACK NULL +#define Routing_DEFAULT NULL +#define Routing_variant_route_request_MSGTYPE RouteDiscovery +#define Routing_variant_route_reply_MSGTYPE RouteDiscovery -#define meshtastic_Data_FIELDLIST(X, a) \ +#define Data_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UENUM, portnum, 1) \ X(a, STATIC, SINGULAR, BYTES, payload, 2) \ X(a, STATIC, SINGULAR, BOOL, want_response, 3) \ @@ -981,10 +981,10 @@ X(a, STATIC, SINGULAR, FIXED32, source, 5) \ X(a, STATIC, SINGULAR, FIXED32, request_id, 6) \ X(a, STATIC, SINGULAR, FIXED32, reply_id, 7) \ X(a, STATIC, SINGULAR, FIXED32, emoji, 8) -#define meshtastic_Data_CALLBACK NULL -#define meshtastic_Data_DEFAULT NULL +#define Data_CALLBACK NULL +#define Data_DEFAULT NULL -#define meshtastic_Waypoint_FIELDLIST(X, a) \ +#define Waypoint_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, id, 1) \ X(a, STATIC, SINGULAR, SFIXED32, latitude_i, 2) \ X(a, STATIC, SINGULAR, SFIXED32, longitude_i, 3) \ @@ -993,10 +993,10 @@ X(a, STATIC, SINGULAR, UINT32, locked_to, 5) \ X(a, STATIC, SINGULAR, STRING, name, 6) \ X(a, STATIC, SINGULAR, STRING, description, 7) \ X(a, STATIC, SINGULAR, FIXED32, icon, 8) -#define meshtastic_Waypoint_CALLBACK NULL -#define meshtastic_Waypoint_DEFAULT NULL +#define Waypoint_CALLBACK NULL +#define Waypoint_DEFAULT NULL -#define meshtastic_MeshPacket_FIELDLIST(X, a) \ +#define MeshPacket_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, FIXED32, from, 1) \ X(a, STATIC, SINGULAR, FIXED32, to, 2) \ X(a, STATIC, SINGULAR, UINT32, channel, 3) \ @@ -1010,24 +1010,24 @@ X(a, STATIC, SINGULAR, BOOL, want_ack, 10) \ X(a, STATIC, SINGULAR, UENUM, priority, 11) \ X(a, STATIC, SINGULAR, INT32, rx_rssi, 12) \ X(a, STATIC, SINGULAR, UENUM, delayed, 13) -#define meshtastic_MeshPacket_CALLBACK NULL -#define meshtastic_MeshPacket_DEFAULT NULL -#define meshtastic_MeshPacket_payload_variant_decoded_MSGTYPE meshtastic_Data +#define MeshPacket_CALLBACK NULL +#define MeshPacket_DEFAULT NULL +#define MeshPacket_payload_variant_decoded_MSGTYPE Data -#define meshtastic_NodeInfo_FIELDLIST(X, a) \ +#define NodeInfo_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, num, 1) \ X(a, STATIC, OPTIONAL, MESSAGE, user, 2) \ X(a, STATIC, OPTIONAL, MESSAGE, position, 3) \ X(a, STATIC, SINGULAR, FLOAT, snr, 4) \ X(a, STATIC, SINGULAR, FIXED32, last_heard, 5) \ X(a, STATIC, OPTIONAL, MESSAGE, device_metrics, 6) -#define meshtastic_NodeInfo_CALLBACK NULL -#define meshtastic_NodeInfo_DEFAULT NULL -#define meshtastic_NodeInfo_user_MSGTYPE meshtastic_User -#define meshtastic_NodeInfo_position_MSGTYPE meshtastic_Position -#define meshtastic_NodeInfo_device_metrics_MSGTYPE meshtastic_DeviceMetrics +#define NodeInfo_CALLBACK NULL +#define NodeInfo_DEFAULT NULL +#define NodeInfo_user_MSGTYPE User +#define NodeInfo_position_MSGTYPE Position +#define NodeInfo_device_metrics_MSGTYPE DeviceMetrics -#define meshtastic_MyNodeInfo_FIELDLIST(X, a) \ +#define MyNodeInfo_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, my_node_num, 1) \ X(a, STATIC, SINGULAR, BOOL, has_gps, 2) \ X(a, STATIC, SINGULAR, UINT32, max_channels, 3) \ @@ -1044,26 +1044,26 @@ X(a, STATIC, REPEATED, UINT32, air_period_rx, 13) \ X(a, STATIC, SINGULAR, BOOL, has_wifi, 14) \ X(a, STATIC, SINGULAR, FLOAT, channel_utilization, 15) \ X(a, STATIC, SINGULAR, FLOAT, air_util_tx, 16) -#define meshtastic_MyNodeInfo_CALLBACK NULL -#define meshtastic_MyNodeInfo_DEFAULT NULL +#define MyNodeInfo_CALLBACK NULL +#define MyNodeInfo_DEFAULT NULL -#define meshtastic_LogRecord_FIELDLIST(X, a) \ +#define LogRecord_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, STRING, message, 1) \ X(a, STATIC, SINGULAR, FIXED32, time, 2) \ X(a, STATIC, SINGULAR, STRING, source, 3) \ X(a, STATIC, SINGULAR, UENUM, level, 4) -#define meshtastic_LogRecord_CALLBACK NULL -#define meshtastic_LogRecord_DEFAULT NULL +#define LogRecord_CALLBACK NULL +#define LogRecord_DEFAULT NULL -#define meshtastic_QueueStatus_FIELDLIST(X, a) \ +#define QueueStatus_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, INT32, res, 1) \ X(a, STATIC, SINGULAR, UINT32, free, 2) \ X(a, STATIC, SINGULAR, UINT32, maxlen, 3) \ X(a, STATIC, SINGULAR, UINT32, mesh_packet_id, 4) -#define meshtastic_QueueStatus_CALLBACK NULL -#define meshtastic_QueueStatus_DEFAULT NULL +#define QueueStatus_CALLBACK NULL +#define QueueStatus_DEFAULT NULL -#define meshtastic_FromRadio_FIELDLIST(X, a) \ +#define FromRadio_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, id, 1) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,packet,packet), 2) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,my_info,my_info), 3) \ @@ -1076,80 +1076,80 @@ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,moduleConfig,moduleConfig), X(a, STATIC, ONEOF, MESSAGE, (payload_variant,channel,channel), 10) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,queueStatus,queueStatus), 11) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,xmodemPacket,xmodemPacket), 12) -#define meshtastic_FromRadio_CALLBACK NULL -#define meshtastic_FromRadio_DEFAULT NULL -#define meshtastic_FromRadio_payload_variant_packet_MSGTYPE meshtastic_MeshPacket -#define meshtastic_FromRadio_payload_variant_my_info_MSGTYPE meshtastic_MyNodeInfo -#define meshtastic_FromRadio_payload_variant_node_info_MSGTYPE meshtastic_NodeInfo -#define meshtastic_FromRadio_payload_variant_config_MSGTYPE meshtastic_Config -#define meshtastic_FromRadio_payload_variant_log_record_MSGTYPE meshtastic_LogRecord -#define meshtastic_FromRadio_payload_variant_moduleConfig_MSGTYPE meshtastic_ModuleConfig -#define meshtastic_FromRadio_payload_variant_channel_MSGTYPE meshtastic_Channel -#define meshtastic_FromRadio_payload_variant_queueStatus_MSGTYPE meshtastic_QueueStatus -#define meshtastic_FromRadio_payload_variant_xmodemPacket_MSGTYPE meshtastic_XModem +#define FromRadio_CALLBACK NULL +#define FromRadio_DEFAULT NULL +#define FromRadio_payload_variant_packet_MSGTYPE MeshPacket +#define FromRadio_payload_variant_my_info_MSGTYPE MyNodeInfo +#define FromRadio_payload_variant_node_info_MSGTYPE NodeInfo +#define FromRadio_payload_variant_config_MSGTYPE Config +#define FromRadio_payload_variant_log_record_MSGTYPE LogRecord +#define FromRadio_payload_variant_moduleConfig_MSGTYPE ModuleConfig +#define FromRadio_payload_variant_channel_MSGTYPE Channel +#define FromRadio_payload_variant_queueStatus_MSGTYPE QueueStatus +#define FromRadio_payload_variant_xmodemPacket_MSGTYPE XModem -#define meshtastic_ToRadio_FIELDLIST(X, a) \ +#define ToRadio_FIELDLIST(X, a) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,packet,packet), 1) \ X(a, STATIC, ONEOF, UINT32, (payload_variant,want_config_id,want_config_id), 3) \ X(a, STATIC, ONEOF, BOOL, (payload_variant,disconnect,disconnect), 4) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,xmodemPacket,xmodemPacket), 5) -#define meshtastic_ToRadio_CALLBACK NULL -#define meshtastic_ToRadio_DEFAULT NULL -#define meshtastic_ToRadio_payload_variant_packet_MSGTYPE meshtastic_MeshPacket -#define meshtastic_ToRadio_payload_variant_xmodemPacket_MSGTYPE meshtastic_XModem +#define ToRadio_CALLBACK NULL +#define ToRadio_DEFAULT NULL +#define ToRadio_payload_variant_packet_MSGTYPE MeshPacket +#define ToRadio_payload_variant_xmodemPacket_MSGTYPE XModem -#define meshtastic_Compressed_FIELDLIST(X, a) \ +#define Compressed_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UENUM, portnum, 1) \ X(a, STATIC, SINGULAR, BYTES, data, 2) -#define meshtastic_Compressed_CALLBACK NULL -#define meshtastic_Compressed_DEFAULT NULL +#define Compressed_CALLBACK NULL +#define Compressed_DEFAULT NULL -extern const pb_msgdesc_t meshtastic_Position_msg; -extern const pb_msgdesc_t meshtastic_User_msg; -extern const pb_msgdesc_t meshtastic_RouteDiscovery_msg; -extern const pb_msgdesc_t meshtastic_Routing_msg; -extern const pb_msgdesc_t meshtastic_Data_msg; -extern const pb_msgdesc_t meshtastic_Waypoint_msg; -extern const pb_msgdesc_t meshtastic_MeshPacket_msg; -extern const pb_msgdesc_t meshtastic_NodeInfo_msg; -extern const pb_msgdesc_t meshtastic_MyNodeInfo_msg; -extern const pb_msgdesc_t meshtastic_LogRecord_msg; -extern const pb_msgdesc_t meshtastic_QueueStatus_msg; -extern const pb_msgdesc_t meshtastic_FromRadio_msg; -extern const pb_msgdesc_t meshtastic_ToRadio_msg; -extern const pb_msgdesc_t meshtastic_Compressed_msg; +extern const pb_msgdesc_t Position_msg; +extern const pb_msgdesc_t User_msg; +extern const pb_msgdesc_t RouteDiscovery_msg; +extern const pb_msgdesc_t Routing_msg; +extern const pb_msgdesc_t Data_msg; +extern const pb_msgdesc_t Waypoint_msg; +extern const pb_msgdesc_t MeshPacket_msg; +extern const pb_msgdesc_t NodeInfo_msg; +extern const pb_msgdesc_t MyNodeInfo_msg; +extern const pb_msgdesc_t LogRecord_msg; +extern const pb_msgdesc_t QueueStatus_msg; +extern const pb_msgdesc_t FromRadio_msg; +extern const pb_msgdesc_t ToRadio_msg; +extern const pb_msgdesc_t Compressed_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_Position_fields &meshtastic_Position_msg -#define meshtastic_User_fields &meshtastic_User_msg -#define meshtastic_RouteDiscovery_fields &meshtastic_RouteDiscovery_msg -#define meshtastic_Routing_fields &meshtastic_Routing_msg -#define meshtastic_Data_fields &meshtastic_Data_msg -#define meshtastic_Waypoint_fields &meshtastic_Waypoint_msg -#define meshtastic_MeshPacket_fields &meshtastic_MeshPacket_msg -#define meshtastic_NodeInfo_fields &meshtastic_NodeInfo_msg -#define meshtastic_MyNodeInfo_fields &meshtastic_MyNodeInfo_msg -#define meshtastic_LogRecord_fields &meshtastic_LogRecord_msg -#define meshtastic_QueueStatus_fields &meshtastic_QueueStatus_msg -#define meshtastic_FromRadio_fields &meshtastic_FromRadio_msg -#define meshtastic_ToRadio_fields &meshtastic_ToRadio_msg -#define meshtastic_Compressed_fields &meshtastic_Compressed_msg +#define Position_fields &Position_msg +#define User_fields &User_msg +#define RouteDiscovery_fields &RouteDiscovery_msg +#define Routing_fields &Routing_msg +#define Data_fields &Data_msg +#define Waypoint_fields &Waypoint_msg +#define MeshPacket_fields &MeshPacket_msg +#define NodeInfo_fields &NodeInfo_msg +#define MyNodeInfo_fields &MyNodeInfo_msg +#define LogRecord_fields &LogRecord_msg +#define QueueStatus_fields &QueueStatus_msg +#define FromRadio_fields &FromRadio_msg +#define ToRadio_fields &ToRadio_msg +#define Compressed_fields &Compressed_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_Compressed_size 243 -#define meshtastic_Data_size 270 -#define meshtastic_FromRadio_size 330 -#define meshtastic_LogRecord_size 81 -#define meshtastic_MeshPacket_size 321 -#define meshtastic_MyNodeInfo_size 179 -#define meshtastic_NodeInfo_size 258 -#define meshtastic_Position_size 137 -#define meshtastic_QueueStatus_size 23 -#define meshtastic_RouteDiscovery_size 40 -#define meshtastic_Routing_size 42 -#define meshtastic_ToRadio_size 324 -#define meshtastic_User_size 77 -#define meshtastic_Waypoint_size 165 +#define Compressed_size 243 +#define Data_size 270 +#define FromRadio_size 330 +#define LogRecord_size 81 +#define MeshPacket_size 321 +#define MyNodeInfo_size 179 +#define NodeInfo_size 258 +#define Position_size 137 +#define QueueStatus_size 23 +#define RouteDiscovery_size 40 +#define Routing_size 42 +#define ToRadio_size 324 +#define User_size 77 +#define Waypoint_size 165 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/module_config.pb.c b/src/mesh/generated/meshtastic/module_config.pb.c index 56f9b8dd3..a67bcfcc9 100644 --- a/src/mesh/generated/meshtastic/module_config.pb.c +++ b/src/mesh/generated/meshtastic/module_config.pb.c @@ -6,34 +6,34 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_ModuleConfig, meshtastic_ModuleConfig, AUTO) +PB_BIND(ModuleConfig, ModuleConfig, AUTO) -PB_BIND(meshtastic_ModuleConfig_MQTTConfig, meshtastic_ModuleConfig_MQTTConfig, AUTO) +PB_BIND(ModuleConfig_MQTTConfig, ModuleConfig_MQTTConfig, AUTO) -PB_BIND(meshtastic_ModuleConfig_RemoteHardwareConfig, meshtastic_ModuleConfig_RemoteHardwareConfig, AUTO) +PB_BIND(ModuleConfig_RemoteHardwareConfig, ModuleConfig_RemoteHardwareConfig, AUTO) -PB_BIND(meshtastic_ModuleConfig_AudioConfig, meshtastic_ModuleConfig_AudioConfig, AUTO) +PB_BIND(ModuleConfig_AudioConfig, ModuleConfig_AudioConfig, AUTO) -PB_BIND(meshtastic_ModuleConfig_SerialConfig, meshtastic_ModuleConfig_SerialConfig, AUTO) +PB_BIND(ModuleConfig_SerialConfig, ModuleConfig_SerialConfig, AUTO) -PB_BIND(meshtastic_ModuleConfig_ExternalNotificationConfig, meshtastic_ModuleConfig_ExternalNotificationConfig, AUTO) +PB_BIND(ModuleConfig_ExternalNotificationConfig, ModuleConfig_ExternalNotificationConfig, AUTO) -PB_BIND(meshtastic_ModuleConfig_StoreForwardConfig, meshtastic_ModuleConfig_StoreForwardConfig, AUTO) +PB_BIND(ModuleConfig_StoreForwardConfig, ModuleConfig_StoreForwardConfig, AUTO) -PB_BIND(meshtastic_ModuleConfig_RangeTestConfig, meshtastic_ModuleConfig_RangeTestConfig, AUTO) +PB_BIND(ModuleConfig_RangeTestConfig, ModuleConfig_RangeTestConfig, AUTO) -PB_BIND(meshtastic_ModuleConfig_TelemetryConfig, meshtastic_ModuleConfig_TelemetryConfig, AUTO) +PB_BIND(ModuleConfig_TelemetryConfig, ModuleConfig_TelemetryConfig, AUTO) -PB_BIND(meshtastic_ModuleConfig_CannedMessageConfig, meshtastic_ModuleConfig_CannedMessageConfig, AUTO) +PB_BIND(ModuleConfig_CannedMessageConfig, ModuleConfig_CannedMessageConfig, AUTO) diff --git a/src/mesh/generated/meshtastic/module_config.pb.h b/src/mesh/generated/meshtastic/module_config.pb.h index 50fed5197..84914285f 100644 --- a/src/mesh/generated/meshtastic/module_config.pb.h +++ b/src/mesh/generated/meshtastic/module_config.pb.h @@ -11,70 +11,70 @@ /* Enum definitions */ /* Baudrate for codec2 voice */ -typedef enum _meshtastic_ModuleConfig_AudioConfig_Audio_Baud { - meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_DEFAULT = 0, - meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_3200 = 1, - meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_2400 = 2, - meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1600 = 3, - meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1400 = 4, - meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1300 = 5, - meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1200 = 6, - meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700 = 7, - meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B = 8 -} meshtastic_ModuleConfig_AudioConfig_Audio_Baud; +typedef enum _ModuleConfig_AudioConfig_Audio_Baud { + ModuleConfig_AudioConfig_Audio_Baud_CODEC2_DEFAULT = 0, + ModuleConfig_AudioConfig_Audio_Baud_CODEC2_3200 = 1, + ModuleConfig_AudioConfig_Audio_Baud_CODEC2_2400 = 2, + ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1600 = 3, + ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1400 = 4, + ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1300 = 5, + ModuleConfig_AudioConfig_Audio_Baud_CODEC2_1200 = 6, + ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700 = 7, + ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B = 8 +} ModuleConfig_AudioConfig_Audio_Baud; /* TODO: REPLACE */ -typedef enum _meshtastic_ModuleConfig_SerialConfig_Serial_Baud { - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_DEFAULT = 0, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_110 = 1, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_300 = 2, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_600 = 3, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_1200 = 4, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_2400 = 5, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_4800 = 6, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_9600 = 7, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_19200 = 8, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_38400 = 9, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_57600 = 10, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_115200 = 11, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_230400 = 12, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_460800 = 13, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_576000 = 14, - meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600 = 15 -} meshtastic_ModuleConfig_SerialConfig_Serial_Baud; +typedef enum _ModuleConfig_SerialConfig_Serial_Baud { + ModuleConfig_SerialConfig_Serial_Baud_BAUD_DEFAULT = 0, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_110 = 1, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_300 = 2, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_600 = 3, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_1200 = 4, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_2400 = 5, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_4800 = 6, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_9600 = 7, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_19200 = 8, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_38400 = 9, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_57600 = 10, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_115200 = 11, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_230400 = 12, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_460800 = 13, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_576000 = 14, + ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600 = 15 +} ModuleConfig_SerialConfig_Serial_Baud; /* TODO: REPLACE */ -typedef enum _meshtastic_ModuleConfig_SerialConfig_Serial_Mode { - meshtastic_ModuleConfig_SerialConfig_Serial_Mode_DEFAULT = 0, - meshtastic_ModuleConfig_SerialConfig_Serial_Mode_SIMPLE = 1, - meshtastic_ModuleConfig_SerialConfig_Serial_Mode_PROTO = 2, - meshtastic_ModuleConfig_SerialConfig_Serial_Mode_TEXTMSG = 3, - meshtastic_ModuleConfig_SerialConfig_Serial_Mode_NMEA = 4 -} meshtastic_ModuleConfig_SerialConfig_Serial_Mode; +typedef enum _ModuleConfig_SerialConfig_Serial_Mode { + ModuleConfig_SerialConfig_Serial_Mode_DEFAULT = 0, + ModuleConfig_SerialConfig_Serial_Mode_SIMPLE = 1, + ModuleConfig_SerialConfig_Serial_Mode_PROTO = 2, + ModuleConfig_SerialConfig_Serial_Mode_TEXTMSG = 3, + ModuleConfig_SerialConfig_Serial_Mode_NMEA = 4 +} ModuleConfig_SerialConfig_Serial_Mode; /* TODO: REPLACE */ -typedef enum _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar { +typedef enum _ModuleConfig_CannedMessageConfig_InputEventChar { /* TODO: REPLACE */ - meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE = 0, + ModuleConfig_CannedMessageConfig_InputEventChar_NONE = 0, /* TODO: REPLACE */ - meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_UP = 17, + ModuleConfig_CannedMessageConfig_InputEventChar_UP = 17, /* TODO: REPLACE */ - meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_DOWN = 18, + ModuleConfig_CannedMessageConfig_InputEventChar_DOWN = 18, /* TODO: REPLACE */ - meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT = 19, + ModuleConfig_CannedMessageConfig_InputEventChar_LEFT = 19, /* TODO: REPLACE */ - meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT = 20, + ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT = 20, /* '\n' */ - meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT = 10, + ModuleConfig_CannedMessageConfig_InputEventChar_SELECT = 10, /* TODO: REPLACE */ - meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK = 27, + ModuleConfig_CannedMessageConfig_InputEventChar_BACK = 27, /* TODO: REPLACE */ - meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL = 24 -} meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar; + ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL = 24 +} ModuleConfig_CannedMessageConfig_InputEventChar; /* Struct definitions */ /* MQTT Client Config */ -typedef struct _meshtastic_ModuleConfig_MQTTConfig { +typedef struct _ModuleConfig_MQTTConfig { /* If a meshtastic node is able to reach the internet it will normally attempt to gateway any channels that are marked as is_uplink_enabled or is_downlink_enabled. */ bool enabled; @@ -96,22 +96,22 @@ typedef struct _meshtastic_ModuleConfig_MQTTConfig { bool encryption_enabled; /* Whether to send / consume json packets on MQTT */ bool json_enabled; -} meshtastic_ModuleConfig_MQTTConfig; +} ModuleConfig_MQTTConfig; /* RemoteHardwareModule Config */ -typedef struct _meshtastic_ModuleConfig_RemoteHardwareConfig { +typedef struct _ModuleConfig_RemoteHardwareConfig { /* Whether the Module is enabled */ bool enabled; -} meshtastic_ModuleConfig_RemoteHardwareConfig; +} ModuleConfig_RemoteHardwareConfig; /* Audio Config for codec2 voice */ -typedef struct _meshtastic_ModuleConfig_AudioConfig { +typedef struct _ModuleConfig_AudioConfig { /* Whether Audio is enabled */ bool codec2_enabled; /* PTT Pin */ uint8_t ptt_pin; /* The audio sample rate to use for codec2 */ - meshtastic_ModuleConfig_AudioConfig_Audio_Baud bitrate; + ModuleConfig_AudioConfig_Audio_Baud bitrate; /* I2S Word Select */ uint8_t i2s_ws; /* I2S Data IN */ @@ -120,10 +120,10 @@ typedef struct _meshtastic_ModuleConfig_AudioConfig { uint8_t i2s_din; /* I2S Clock */ uint8_t i2s_sck; -} meshtastic_ModuleConfig_AudioConfig; +} ModuleConfig_AudioConfig; /* Serial Config */ -typedef struct _meshtastic_ModuleConfig_SerialConfig { +typedef struct _ModuleConfig_SerialConfig { /* Preferences for the SerialModule FIXME - Move this out of UserPreferences and into a section for module configuration. */ bool enabled; @@ -134,15 +134,15 @@ typedef struct _meshtastic_ModuleConfig_SerialConfig { /* TODO: REPLACE */ uint32_t txd; /* TODO: REPLACE */ - meshtastic_ModuleConfig_SerialConfig_Serial_Baud baud; + ModuleConfig_SerialConfig_Serial_Baud baud; /* TODO: REPLACE */ uint32_t timeout; /* TODO: REPLACE */ - meshtastic_ModuleConfig_SerialConfig_Serial_Mode mode; -} meshtastic_ModuleConfig_SerialConfig; + ModuleConfig_SerialConfig_Serial_Mode mode; +} ModuleConfig_SerialConfig; /* External Notifications Config */ -typedef struct _meshtastic_ModuleConfig_ExternalNotificationConfig { +typedef struct _ModuleConfig_ExternalNotificationConfig { /* Enable the ExternalNotificationModule */ bool enabled; /* When using in On/Off mode, keep the output on for this many @@ -181,10 +181,10 @@ typedef struct _meshtastic_ModuleConfig_ExternalNotificationConfig { Default is 0 which means don't repeat at all. 60 would mean blink and/or beep for 60 seconds */ uint16_t nag_timeout; -} meshtastic_ModuleConfig_ExternalNotificationConfig; +} ModuleConfig_ExternalNotificationConfig; /* Store and Forward Module Config */ -typedef struct _meshtastic_ModuleConfig_StoreForwardConfig { +typedef struct _ModuleConfig_StoreForwardConfig { /* Enable the Store and Forward Module */ bool enabled; /* TODO: REPLACE */ @@ -195,10 +195,10 @@ typedef struct _meshtastic_ModuleConfig_StoreForwardConfig { uint32_t history_return_max; /* TODO: REPLACE */ uint32_t history_return_window; -} meshtastic_ModuleConfig_StoreForwardConfig; +} ModuleConfig_StoreForwardConfig; /* Preferences for the RangeTestModule */ -typedef struct _meshtastic_ModuleConfig_RangeTestConfig { +typedef struct _ModuleConfig_RangeTestConfig { /* Enable the Range Test Module */ bool enabled; /* Send out range test messages from this node */ @@ -206,10 +206,10 @@ typedef struct _meshtastic_ModuleConfig_RangeTestConfig { /* Bool value indicating that this node should save a RangeTest.csv file. ESP32 Only */ bool save; -} meshtastic_ModuleConfig_RangeTestConfig; +} ModuleConfig_RangeTestConfig; /* Configuration for both device and environment metrics */ -typedef struct _meshtastic_ModuleConfig_TelemetryConfig { +typedef struct _ModuleConfig_TelemetryConfig { /* Interval in seconds of how often we should try to send our device metrics to the mesh */ uint32_t device_update_interval; @@ -222,10 +222,10 @@ typedef struct _meshtastic_ModuleConfig_TelemetryConfig { /* We'll always read the sensor in Celsius, but sometimes we might want to display the results in Fahrenheit as a "user preference". */ bool environment_display_fahrenheit; -} meshtastic_ModuleConfig_TelemetryConfig; +} ModuleConfig_TelemetryConfig; /* TODO: REPLACE */ -typedef struct _meshtastic_ModuleConfig_CannedMessageConfig { +typedef struct _ModuleConfig_CannedMessageConfig { /* Enable the rotary encoder #1. This is a 'dumb' encoder sending pulses on both A and B pins while rotating. */ bool rotary1_enabled; /* GPIO pin for rotary encoder A port. */ @@ -235,11 +235,11 @@ typedef struct _meshtastic_ModuleConfig_CannedMessageConfig { /* GPIO pin for rotary encoder Press port. */ uint32_t inputbroker_pin_press; /* Generate input event on CW of this kind. */ - meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_cw; + ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_cw; /* Generate input event on CCW of this kind. */ - meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_ccw; + ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_ccw; /* Generate input event on Press of this kind. */ - meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_press; + ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_press; /* Enable the Up/Down/Select input device. Can be RAK rotary encoder or 3 buttons. Uses the a/b/press definitions from inputbroker. */ bool updown1_enabled; /* Enable/disable CannedMessageModule. */ @@ -250,32 +250,32 @@ typedef struct _meshtastic_ModuleConfig_CannedMessageConfig { /* CannedMessageModule also sends a bell character with the messages. ExternalNotificationModule can benefit from this feature. */ bool send_bell; -} meshtastic_ModuleConfig_CannedMessageConfig; +} ModuleConfig_CannedMessageConfig; /* Module Config */ -typedef struct _meshtastic_ModuleConfig { +typedef struct _ModuleConfig { pb_size_t which_payload_variant; union { /* TODO: REPLACE */ - meshtastic_ModuleConfig_MQTTConfig mqtt; + ModuleConfig_MQTTConfig mqtt; /* TODO: REPLACE */ - meshtastic_ModuleConfig_SerialConfig serial; + ModuleConfig_SerialConfig serial; /* TODO: REPLACE */ - meshtastic_ModuleConfig_ExternalNotificationConfig external_notification; + ModuleConfig_ExternalNotificationConfig external_notification; /* TODO: REPLACE */ - meshtastic_ModuleConfig_StoreForwardConfig store_forward; + ModuleConfig_StoreForwardConfig store_forward; /* TODO: REPLACE */ - meshtastic_ModuleConfig_RangeTestConfig range_test; + ModuleConfig_RangeTestConfig range_test; /* TODO: REPLACE */ - meshtastic_ModuleConfig_TelemetryConfig telemetry; + ModuleConfig_TelemetryConfig telemetry; /* TODO: REPLACE */ - meshtastic_ModuleConfig_CannedMessageConfig canned_message; + ModuleConfig_CannedMessageConfig canned_message; /* TODO: REPLACE */ - meshtastic_ModuleConfig_AudioConfig audio; + ModuleConfig_AudioConfig audio; /* TODO: REPLACE */ - meshtastic_ModuleConfig_RemoteHardwareConfig remote_hardware; + ModuleConfig_RemoteHardwareConfig remote_hardware; } payload_variant; -} meshtastic_ModuleConfig; +} ModuleConfig; #ifdef __cplusplus @@ -283,133 +283,133 @@ extern "C" { #endif /* Helper constants for enums */ -#define _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_DEFAULT -#define _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MAX meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B -#define _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_ARRAYSIZE ((meshtastic_ModuleConfig_AudioConfig_Audio_Baud)(meshtastic_ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B+1)) +#define _ModuleConfig_AudioConfig_Audio_Baud_MIN ModuleConfig_AudioConfig_Audio_Baud_CODEC2_DEFAULT +#define _ModuleConfig_AudioConfig_Audio_Baud_MAX ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B +#define _ModuleConfig_AudioConfig_Audio_Baud_ARRAYSIZE ((ModuleConfig_AudioConfig_Audio_Baud)(ModuleConfig_AudioConfig_Audio_Baud_CODEC2_700B+1)) -#define _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MIN meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_DEFAULT -#define _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MAX meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600 -#define _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Baud)(meshtastic_ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600+1)) +#define _ModuleConfig_SerialConfig_Serial_Baud_MIN ModuleConfig_SerialConfig_Serial_Baud_BAUD_DEFAULT +#define _ModuleConfig_SerialConfig_Serial_Baud_MAX ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600 +#define _ModuleConfig_SerialConfig_Serial_Baud_ARRAYSIZE ((ModuleConfig_SerialConfig_Serial_Baud)(ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600+1)) -#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN meshtastic_ModuleConfig_SerialConfig_Serial_Mode_DEFAULT -#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MAX meshtastic_ModuleConfig_SerialConfig_Serial_Mode_NMEA -#define _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_ARRAYSIZE ((meshtastic_ModuleConfig_SerialConfig_Serial_Mode)(meshtastic_ModuleConfig_SerialConfig_Serial_Mode_NMEA+1)) +#define _ModuleConfig_SerialConfig_Serial_Mode_MIN ModuleConfig_SerialConfig_Serial_Mode_DEFAULT +#define _ModuleConfig_SerialConfig_Serial_Mode_MAX ModuleConfig_SerialConfig_Serial_Mode_NMEA +#define _ModuleConfig_SerialConfig_Serial_Mode_ARRAYSIZE ((ModuleConfig_SerialConfig_Serial_Mode)(ModuleConfig_SerialConfig_Serial_Mode_NMEA+1)) -#define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_NONE -#define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MAX meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK -#define _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_ARRAYSIZE ((meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar)(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK+1)) +#define _ModuleConfig_CannedMessageConfig_InputEventChar_MIN ModuleConfig_CannedMessageConfig_InputEventChar_NONE +#define _ModuleConfig_CannedMessageConfig_InputEventChar_MAX ModuleConfig_CannedMessageConfig_InputEventChar_BACK +#define _ModuleConfig_CannedMessageConfig_InputEventChar_ARRAYSIZE ((ModuleConfig_CannedMessageConfig_InputEventChar)(ModuleConfig_CannedMessageConfig_InputEventChar_BACK+1)) -#define meshtastic_ModuleConfig_AudioConfig_bitrate_ENUMTYPE meshtastic_ModuleConfig_AudioConfig_Audio_Baud +#define ModuleConfig_AudioConfig_bitrate_ENUMTYPE ModuleConfig_AudioConfig_Audio_Baud -#define meshtastic_ModuleConfig_SerialConfig_baud_ENUMTYPE meshtastic_ModuleConfig_SerialConfig_Serial_Baud -#define meshtastic_ModuleConfig_SerialConfig_mode_ENUMTYPE meshtastic_ModuleConfig_SerialConfig_Serial_Mode +#define ModuleConfig_SerialConfig_baud_ENUMTYPE ModuleConfig_SerialConfig_Serial_Baud +#define ModuleConfig_SerialConfig_mode_ENUMTYPE ModuleConfig_SerialConfig_Serial_Mode -#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_cw_ENUMTYPE meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar -#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_ccw_ENUMTYPE meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar -#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_press_ENUMTYPE meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar +#define ModuleConfig_CannedMessageConfig_inputbroker_event_cw_ENUMTYPE ModuleConfig_CannedMessageConfig_InputEventChar +#define ModuleConfig_CannedMessageConfig_inputbroker_event_ccw_ENUMTYPE ModuleConfig_CannedMessageConfig_InputEventChar +#define ModuleConfig_CannedMessageConfig_inputbroker_event_press_ENUMTYPE ModuleConfig_CannedMessageConfig_InputEventChar /* Initializer values for message structs */ -#define meshtastic_ModuleConfig_init_default {0, {meshtastic_ModuleConfig_MQTTConfig_init_default}} -#define meshtastic_ModuleConfig_MQTTConfig_init_default {0, "", "", "", 0, 0} -#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_default {0} -#define meshtastic_ModuleConfig_AudioConfig_init_default {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0} -#define meshtastic_ModuleConfig_SerialConfig_init_default {0, 0, 0, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN} -#define meshtastic_ModuleConfig_ExternalNotificationConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_ModuleConfig_StoreForwardConfig_init_default {0, 0, 0, 0, 0} -#define meshtastic_ModuleConfig_RangeTestConfig_init_default {0, 0, 0} -#define meshtastic_ModuleConfig_TelemetryConfig_init_default {0, 0, 0, 0, 0} -#define meshtastic_ModuleConfig_CannedMessageConfig_init_default {0, 0, 0, 0, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, 0, 0, "", 0} -#define meshtastic_ModuleConfig_init_zero {0, {meshtastic_ModuleConfig_MQTTConfig_init_zero}} -#define meshtastic_ModuleConfig_MQTTConfig_init_zero {0, "", "", "", 0, 0} -#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero {0} -#define meshtastic_ModuleConfig_AudioConfig_init_zero {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0} -#define meshtastic_ModuleConfig_SerialConfig_init_zero {0, 0, 0, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _meshtastic_ModuleConfig_SerialConfig_Serial_Mode_MIN} -#define meshtastic_ModuleConfig_ExternalNotificationConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_ModuleConfig_StoreForwardConfig_init_zero {0, 0, 0, 0, 0} -#define meshtastic_ModuleConfig_RangeTestConfig_init_zero {0, 0, 0} -#define meshtastic_ModuleConfig_TelemetryConfig_init_zero {0, 0, 0, 0, 0} -#define meshtastic_ModuleConfig_CannedMessageConfig_init_zero {0, 0, 0, 0, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_MIN, 0, 0, "", 0} +#define ModuleConfig_init_default {0, {ModuleConfig_MQTTConfig_init_default}} +#define ModuleConfig_MQTTConfig_init_default {0, "", "", "", 0, 0} +#define ModuleConfig_RemoteHardwareConfig_init_default {0} +#define ModuleConfig_AudioConfig_init_default {0, 0, _ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0} +#define ModuleConfig_SerialConfig_init_default {0, 0, 0, 0, _ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _ModuleConfig_SerialConfig_Serial_Mode_MIN} +#define ModuleConfig_ExternalNotificationConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define ModuleConfig_StoreForwardConfig_init_default {0, 0, 0, 0, 0} +#define ModuleConfig_RangeTestConfig_init_default {0, 0, 0} +#define ModuleConfig_TelemetryConfig_init_default {0, 0, 0, 0, 0} +#define ModuleConfig_CannedMessageConfig_init_default {0, 0, 0, 0, _ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _ModuleConfig_CannedMessageConfig_InputEventChar_MIN, 0, 0, "", 0} +#define ModuleConfig_init_zero {0, {ModuleConfig_MQTTConfig_init_zero}} +#define ModuleConfig_MQTTConfig_init_zero {0, "", "", "", 0, 0} +#define ModuleConfig_RemoteHardwareConfig_init_zero {0} +#define ModuleConfig_AudioConfig_init_zero {0, 0, _ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0} +#define ModuleConfig_SerialConfig_init_zero {0, 0, 0, 0, _ModuleConfig_SerialConfig_Serial_Baud_MIN, 0, _ModuleConfig_SerialConfig_Serial_Mode_MIN} +#define ModuleConfig_ExternalNotificationConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define ModuleConfig_StoreForwardConfig_init_zero {0, 0, 0, 0, 0} +#define ModuleConfig_RangeTestConfig_init_zero {0, 0, 0} +#define ModuleConfig_TelemetryConfig_init_zero {0, 0, 0, 0, 0} +#define ModuleConfig_CannedMessageConfig_init_zero {0, 0, 0, 0, _ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _ModuleConfig_CannedMessageConfig_InputEventChar_MIN, _ModuleConfig_CannedMessageConfig_InputEventChar_MIN, 0, 0, "", 0} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_ModuleConfig_MQTTConfig_enabled_tag 1 -#define meshtastic_ModuleConfig_MQTTConfig_address_tag 2 -#define meshtastic_ModuleConfig_MQTTConfig_username_tag 3 -#define meshtastic_ModuleConfig_MQTTConfig_password_tag 4 -#define meshtastic_ModuleConfig_MQTTConfig_encryption_enabled_tag 5 -#define meshtastic_ModuleConfig_MQTTConfig_json_enabled_tag 6 -#define meshtastic_ModuleConfig_RemoteHardwareConfig_enabled_tag 1 -#define meshtastic_ModuleConfig_AudioConfig_codec2_enabled_tag 1 -#define meshtastic_ModuleConfig_AudioConfig_ptt_pin_tag 2 -#define meshtastic_ModuleConfig_AudioConfig_bitrate_tag 3 -#define meshtastic_ModuleConfig_AudioConfig_i2s_ws_tag 4 -#define meshtastic_ModuleConfig_AudioConfig_i2s_sd_tag 5 -#define meshtastic_ModuleConfig_AudioConfig_i2s_din_tag 6 -#define meshtastic_ModuleConfig_AudioConfig_i2s_sck_tag 7 -#define meshtastic_ModuleConfig_SerialConfig_enabled_tag 1 -#define meshtastic_ModuleConfig_SerialConfig_echo_tag 2 -#define meshtastic_ModuleConfig_SerialConfig_rxd_tag 3 -#define meshtastic_ModuleConfig_SerialConfig_txd_tag 4 -#define meshtastic_ModuleConfig_SerialConfig_baud_tag 5 -#define meshtastic_ModuleConfig_SerialConfig_timeout_tag 6 -#define meshtastic_ModuleConfig_SerialConfig_mode_tag 7 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_enabled_tag 1 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_output_ms_tag 2 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_output_tag 3 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_active_tag 4 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_alert_message_tag 5 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_alert_bell_tag 6 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_use_pwm_tag 7 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_output_vibra_tag 8 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_output_buzzer_tag 9 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_alert_message_vibra_tag 10 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_alert_message_buzzer_tag 11 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_alert_bell_vibra_tag 12 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_alert_bell_buzzer_tag 13 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_nag_timeout_tag 14 -#define meshtastic_ModuleConfig_StoreForwardConfig_enabled_tag 1 -#define meshtastic_ModuleConfig_StoreForwardConfig_heartbeat_tag 2 -#define meshtastic_ModuleConfig_StoreForwardConfig_records_tag 3 -#define meshtastic_ModuleConfig_StoreForwardConfig_history_return_max_tag 4 -#define meshtastic_ModuleConfig_StoreForwardConfig_history_return_window_tag 5 -#define meshtastic_ModuleConfig_RangeTestConfig_enabled_tag 1 -#define meshtastic_ModuleConfig_RangeTestConfig_sender_tag 2 -#define meshtastic_ModuleConfig_RangeTestConfig_save_tag 3 -#define meshtastic_ModuleConfig_TelemetryConfig_device_update_interval_tag 1 -#define meshtastic_ModuleConfig_TelemetryConfig_environment_update_interval_tag 2 -#define meshtastic_ModuleConfig_TelemetryConfig_environment_measurement_enabled_tag 3 -#define meshtastic_ModuleConfig_TelemetryConfig_environment_screen_enabled_tag 4 -#define meshtastic_ModuleConfig_TelemetryConfig_environment_display_fahrenheit_tag 5 -#define meshtastic_ModuleConfig_CannedMessageConfig_rotary1_enabled_tag 1 -#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_pin_a_tag 2 -#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_pin_b_tag 3 -#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_pin_press_tag 4 -#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_cw_tag 5 -#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_ccw_tag 6 -#define meshtastic_ModuleConfig_CannedMessageConfig_inputbroker_event_press_tag 7 -#define meshtastic_ModuleConfig_CannedMessageConfig_updown1_enabled_tag 8 -#define meshtastic_ModuleConfig_CannedMessageConfig_enabled_tag 9 -#define meshtastic_ModuleConfig_CannedMessageConfig_allow_input_source_tag 10 -#define meshtastic_ModuleConfig_CannedMessageConfig_send_bell_tag 11 -#define meshtastic_ModuleConfig_mqtt_tag 1 -#define meshtastic_ModuleConfig_serial_tag 2 -#define meshtastic_ModuleConfig_external_notification_tag 3 -#define meshtastic_ModuleConfig_store_forward_tag 4 -#define meshtastic_ModuleConfig_range_test_tag 5 -#define meshtastic_ModuleConfig_telemetry_tag 6 -#define meshtastic_ModuleConfig_canned_message_tag 7 -#define meshtastic_ModuleConfig_audio_tag 8 -#define meshtastic_ModuleConfig_remote_hardware_tag 9 +#define ModuleConfig_MQTTConfig_enabled_tag 1 +#define ModuleConfig_MQTTConfig_address_tag 2 +#define ModuleConfig_MQTTConfig_username_tag 3 +#define ModuleConfig_MQTTConfig_password_tag 4 +#define ModuleConfig_MQTTConfig_encryption_enabled_tag 5 +#define ModuleConfig_MQTTConfig_json_enabled_tag 6 +#define ModuleConfig_RemoteHardwareConfig_enabled_tag 1 +#define ModuleConfig_AudioConfig_codec2_enabled_tag 1 +#define ModuleConfig_AudioConfig_ptt_pin_tag 2 +#define ModuleConfig_AudioConfig_bitrate_tag 3 +#define ModuleConfig_AudioConfig_i2s_ws_tag 4 +#define ModuleConfig_AudioConfig_i2s_sd_tag 5 +#define ModuleConfig_AudioConfig_i2s_din_tag 6 +#define ModuleConfig_AudioConfig_i2s_sck_tag 7 +#define ModuleConfig_SerialConfig_enabled_tag 1 +#define ModuleConfig_SerialConfig_echo_tag 2 +#define ModuleConfig_SerialConfig_rxd_tag 3 +#define ModuleConfig_SerialConfig_txd_tag 4 +#define ModuleConfig_SerialConfig_baud_tag 5 +#define ModuleConfig_SerialConfig_timeout_tag 6 +#define ModuleConfig_SerialConfig_mode_tag 7 +#define ModuleConfig_ExternalNotificationConfig_enabled_tag 1 +#define ModuleConfig_ExternalNotificationConfig_output_ms_tag 2 +#define ModuleConfig_ExternalNotificationConfig_output_tag 3 +#define ModuleConfig_ExternalNotificationConfig_active_tag 4 +#define ModuleConfig_ExternalNotificationConfig_alert_message_tag 5 +#define ModuleConfig_ExternalNotificationConfig_alert_bell_tag 6 +#define ModuleConfig_ExternalNotificationConfig_use_pwm_tag 7 +#define ModuleConfig_ExternalNotificationConfig_output_vibra_tag 8 +#define ModuleConfig_ExternalNotificationConfig_output_buzzer_tag 9 +#define ModuleConfig_ExternalNotificationConfig_alert_message_vibra_tag 10 +#define ModuleConfig_ExternalNotificationConfig_alert_message_buzzer_tag 11 +#define ModuleConfig_ExternalNotificationConfig_alert_bell_vibra_tag 12 +#define ModuleConfig_ExternalNotificationConfig_alert_bell_buzzer_tag 13 +#define ModuleConfig_ExternalNotificationConfig_nag_timeout_tag 14 +#define ModuleConfig_StoreForwardConfig_enabled_tag 1 +#define ModuleConfig_StoreForwardConfig_heartbeat_tag 2 +#define ModuleConfig_StoreForwardConfig_records_tag 3 +#define ModuleConfig_StoreForwardConfig_history_return_max_tag 4 +#define ModuleConfig_StoreForwardConfig_history_return_window_tag 5 +#define ModuleConfig_RangeTestConfig_enabled_tag 1 +#define ModuleConfig_RangeTestConfig_sender_tag 2 +#define ModuleConfig_RangeTestConfig_save_tag 3 +#define ModuleConfig_TelemetryConfig_device_update_interval_tag 1 +#define ModuleConfig_TelemetryConfig_environment_update_interval_tag 2 +#define ModuleConfig_TelemetryConfig_environment_measurement_enabled_tag 3 +#define ModuleConfig_TelemetryConfig_environment_screen_enabled_tag 4 +#define ModuleConfig_TelemetryConfig_environment_display_fahrenheit_tag 5 +#define ModuleConfig_CannedMessageConfig_rotary1_enabled_tag 1 +#define ModuleConfig_CannedMessageConfig_inputbroker_pin_a_tag 2 +#define ModuleConfig_CannedMessageConfig_inputbroker_pin_b_tag 3 +#define ModuleConfig_CannedMessageConfig_inputbroker_pin_press_tag 4 +#define ModuleConfig_CannedMessageConfig_inputbroker_event_cw_tag 5 +#define ModuleConfig_CannedMessageConfig_inputbroker_event_ccw_tag 6 +#define ModuleConfig_CannedMessageConfig_inputbroker_event_press_tag 7 +#define ModuleConfig_CannedMessageConfig_updown1_enabled_tag 8 +#define ModuleConfig_CannedMessageConfig_enabled_tag 9 +#define ModuleConfig_CannedMessageConfig_allow_input_source_tag 10 +#define ModuleConfig_CannedMessageConfig_send_bell_tag 11 +#define ModuleConfig_mqtt_tag 1 +#define ModuleConfig_serial_tag 2 +#define ModuleConfig_external_notification_tag 3 +#define ModuleConfig_store_forward_tag 4 +#define ModuleConfig_range_test_tag 5 +#define ModuleConfig_telemetry_tag 6 +#define ModuleConfig_canned_message_tag 7 +#define ModuleConfig_audio_tag 8 +#define ModuleConfig_remote_hardware_tag 9 /* Struct field encoding specification for nanopb */ -#define meshtastic_ModuleConfig_FIELDLIST(X, a) \ +#define ModuleConfig_FIELDLIST(X, a) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,mqtt,payload_variant.mqtt), 1) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,serial,payload_variant.serial), 2) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,external_notification,payload_variant.external_notification), 3) \ @@ -419,34 +419,34 @@ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,telemetry,payload_variant.te X(a, STATIC, ONEOF, MESSAGE, (payload_variant,canned_message,payload_variant.canned_message), 7) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,audio,payload_variant.audio), 8) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,remote_hardware,payload_variant.remote_hardware), 9) -#define meshtastic_ModuleConfig_CALLBACK NULL -#define meshtastic_ModuleConfig_DEFAULT NULL -#define meshtastic_ModuleConfig_payload_variant_mqtt_MSGTYPE meshtastic_ModuleConfig_MQTTConfig -#define meshtastic_ModuleConfig_payload_variant_serial_MSGTYPE meshtastic_ModuleConfig_SerialConfig -#define meshtastic_ModuleConfig_payload_variant_external_notification_MSGTYPE meshtastic_ModuleConfig_ExternalNotificationConfig -#define meshtastic_ModuleConfig_payload_variant_store_forward_MSGTYPE meshtastic_ModuleConfig_StoreForwardConfig -#define meshtastic_ModuleConfig_payload_variant_range_test_MSGTYPE meshtastic_ModuleConfig_RangeTestConfig -#define meshtastic_ModuleConfig_payload_variant_telemetry_MSGTYPE meshtastic_ModuleConfig_TelemetryConfig -#define meshtastic_ModuleConfig_payload_variant_canned_message_MSGTYPE meshtastic_ModuleConfig_CannedMessageConfig -#define meshtastic_ModuleConfig_payload_variant_audio_MSGTYPE meshtastic_ModuleConfig_AudioConfig -#define meshtastic_ModuleConfig_payload_variant_remote_hardware_MSGTYPE meshtastic_ModuleConfig_RemoteHardwareConfig +#define ModuleConfig_CALLBACK NULL +#define ModuleConfig_DEFAULT NULL +#define ModuleConfig_payload_variant_mqtt_MSGTYPE ModuleConfig_MQTTConfig +#define ModuleConfig_payload_variant_serial_MSGTYPE ModuleConfig_SerialConfig +#define ModuleConfig_payload_variant_external_notification_MSGTYPE ModuleConfig_ExternalNotificationConfig +#define ModuleConfig_payload_variant_store_forward_MSGTYPE ModuleConfig_StoreForwardConfig +#define ModuleConfig_payload_variant_range_test_MSGTYPE ModuleConfig_RangeTestConfig +#define ModuleConfig_payload_variant_telemetry_MSGTYPE ModuleConfig_TelemetryConfig +#define ModuleConfig_payload_variant_canned_message_MSGTYPE ModuleConfig_CannedMessageConfig +#define ModuleConfig_payload_variant_audio_MSGTYPE ModuleConfig_AudioConfig +#define ModuleConfig_payload_variant_remote_hardware_MSGTYPE ModuleConfig_RemoteHardwareConfig -#define meshtastic_ModuleConfig_MQTTConfig_FIELDLIST(X, a) \ +#define ModuleConfig_MQTTConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ X(a, STATIC, SINGULAR, STRING, address, 2) \ X(a, STATIC, SINGULAR, STRING, username, 3) \ X(a, STATIC, SINGULAR, STRING, password, 4) \ X(a, STATIC, SINGULAR, BOOL, encryption_enabled, 5) \ X(a, STATIC, SINGULAR, BOOL, json_enabled, 6) -#define meshtastic_ModuleConfig_MQTTConfig_CALLBACK NULL -#define meshtastic_ModuleConfig_MQTTConfig_DEFAULT NULL +#define ModuleConfig_MQTTConfig_CALLBACK NULL +#define ModuleConfig_MQTTConfig_DEFAULT NULL -#define meshtastic_ModuleConfig_RemoteHardwareConfig_FIELDLIST(X, a) \ +#define ModuleConfig_RemoteHardwareConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, enabled, 1) -#define meshtastic_ModuleConfig_RemoteHardwareConfig_CALLBACK NULL -#define meshtastic_ModuleConfig_RemoteHardwareConfig_DEFAULT NULL +#define ModuleConfig_RemoteHardwareConfig_CALLBACK NULL +#define ModuleConfig_RemoteHardwareConfig_DEFAULT NULL -#define meshtastic_ModuleConfig_AudioConfig_FIELDLIST(X, a) \ +#define ModuleConfig_AudioConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, codec2_enabled, 1) \ X(a, STATIC, SINGULAR, UINT32, ptt_pin, 2) \ X(a, STATIC, SINGULAR, UENUM, bitrate, 3) \ @@ -454,10 +454,10 @@ X(a, STATIC, SINGULAR, UINT32, i2s_ws, 4) \ X(a, STATIC, SINGULAR, UINT32, i2s_sd, 5) \ X(a, STATIC, SINGULAR, UINT32, i2s_din, 6) \ X(a, STATIC, SINGULAR, UINT32, i2s_sck, 7) -#define meshtastic_ModuleConfig_AudioConfig_CALLBACK NULL -#define meshtastic_ModuleConfig_AudioConfig_DEFAULT NULL +#define ModuleConfig_AudioConfig_CALLBACK NULL +#define ModuleConfig_AudioConfig_DEFAULT NULL -#define meshtastic_ModuleConfig_SerialConfig_FIELDLIST(X, a) \ +#define ModuleConfig_SerialConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ X(a, STATIC, SINGULAR, BOOL, echo, 2) \ X(a, STATIC, SINGULAR, UINT32, rxd, 3) \ @@ -465,10 +465,10 @@ X(a, STATIC, SINGULAR, UINT32, txd, 4) \ X(a, STATIC, SINGULAR, UENUM, baud, 5) \ X(a, STATIC, SINGULAR, UINT32, timeout, 6) \ X(a, STATIC, SINGULAR, UENUM, mode, 7) -#define meshtastic_ModuleConfig_SerialConfig_CALLBACK NULL -#define meshtastic_ModuleConfig_SerialConfig_DEFAULT NULL +#define ModuleConfig_SerialConfig_CALLBACK NULL +#define ModuleConfig_SerialConfig_DEFAULT NULL -#define meshtastic_ModuleConfig_ExternalNotificationConfig_FIELDLIST(X, a) \ +#define ModuleConfig_ExternalNotificationConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ X(a, STATIC, SINGULAR, UINT32, output_ms, 2) \ X(a, STATIC, SINGULAR, UINT32, output, 3) \ @@ -483,35 +483,35 @@ X(a, STATIC, SINGULAR, BOOL, alert_message_buzzer, 11) \ X(a, STATIC, SINGULAR, BOOL, alert_bell_vibra, 12) \ X(a, STATIC, SINGULAR, BOOL, alert_bell_buzzer, 13) \ X(a, STATIC, SINGULAR, UINT32, nag_timeout, 14) -#define meshtastic_ModuleConfig_ExternalNotificationConfig_CALLBACK NULL -#define meshtastic_ModuleConfig_ExternalNotificationConfig_DEFAULT NULL +#define ModuleConfig_ExternalNotificationConfig_CALLBACK NULL +#define ModuleConfig_ExternalNotificationConfig_DEFAULT NULL -#define meshtastic_ModuleConfig_StoreForwardConfig_FIELDLIST(X, a) \ +#define ModuleConfig_StoreForwardConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ X(a, STATIC, SINGULAR, BOOL, heartbeat, 2) \ X(a, STATIC, SINGULAR, UINT32, records, 3) \ X(a, STATIC, SINGULAR, UINT32, history_return_max, 4) \ X(a, STATIC, SINGULAR, UINT32, history_return_window, 5) -#define meshtastic_ModuleConfig_StoreForwardConfig_CALLBACK NULL -#define meshtastic_ModuleConfig_StoreForwardConfig_DEFAULT NULL +#define ModuleConfig_StoreForwardConfig_CALLBACK NULL +#define ModuleConfig_StoreForwardConfig_DEFAULT NULL -#define meshtastic_ModuleConfig_RangeTestConfig_FIELDLIST(X, a) \ +#define ModuleConfig_RangeTestConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, enabled, 1) \ X(a, STATIC, SINGULAR, UINT32, sender, 2) \ X(a, STATIC, SINGULAR, BOOL, save, 3) -#define meshtastic_ModuleConfig_RangeTestConfig_CALLBACK NULL -#define meshtastic_ModuleConfig_RangeTestConfig_DEFAULT NULL +#define ModuleConfig_RangeTestConfig_CALLBACK NULL +#define ModuleConfig_RangeTestConfig_DEFAULT NULL -#define meshtastic_ModuleConfig_TelemetryConfig_FIELDLIST(X, a) \ +#define ModuleConfig_TelemetryConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, device_update_interval, 1) \ X(a, STATIC, SINGULAR, UINT32, environment_update_interval, 2) \ X(a, STATIC, SINGULAR, BOOL, environment_measurement_enabled, 3) \ X(a, STATIC, SINGULAR, BOOL, environment_screen_enabled, 4) \ X(a, STATIC, SINGULAR, BOOL, environment_display_fahrenheit, 5) -#define meshtastic_ModuleConfig_TelemetryConfig_CALLBACK NULL -#define meshtastic_ModuleConfig_TelemetryConfig_DEFAULT NULL +#define ModuleConfig_TelemetryConfig_CALLBACK NULL +#define ModuleConfig_TelemetryConfig_DEFAULT NULL -#define meshtastic_ModuleConfig_CannedMessageConfig_FIELDLIST(X, a) \ +#define ModuleConfig_CannedMessageConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, BOOL, rotary1_enabled, 1) \ X(a, STATIC, SINGULAR, UINT32, inputbroker_pin_a, 2) \ X(a, STATIC, SINGULAR, UINT32, inputbroker_pin_b, 3) \ @@ -523,43 +523,43 @@ X(a, STATIC, SINGULAR, BOOL, updown1_enabled, 8) \ X(a, STATIC, SINGULAR, BOOL, enabled, 9) \ X(a, STATIC, SINGULAR, STRING, allow_input_source, 10) \ X(a, STATIC, SINGULAR, BOOL, send_bell, 11) -#define meshtastic_ModuleConfig_CannedMessageConfig_CALLBACK NULL -#define meshtastic_ModuleConfig_CannedMessageConfig_DEFAULT NULL +#define ModuleConfig_CannedMessageConfig_CALLBACK NULL +#define ModuleConfig_CannedMessageConfig_DEFAULT NULL -extern const pb_msgdesc_t meshtastic_ModuleConfig_msg; -extern const pb_msgdesc_t meshtastic_ModuleConfig_MQTTConfig_msg; -extern const pb_msgdesc_t meshtastic_ModuleConfig_RemoteHardwareConfig_msg; -extern const pb_msgdesc_t meshtastic_ModuleConfig_AudioConfig_msg; -extern const pb_msgdesc_t meshtastic_ModuleConfig_SerialConfig_msg; -extern const pb_msgdesc_t meshtastic_ModuleConfig_ExternalNotificationConfig_msg; -extern const pb_msgdesc_t meshtastic_ModuleConfig_StoreForwardConfig_msg; -extern const pb_msgdesc_t meshtastic_ModuleConfig_RangeTestConfig_msg; -extern const pb_msgdesc_t meshtastic_ModuleConfig_TelemetryConfig_msg; -extern const pb_msgdesc_t meshtastic_ModuleConfig_CannedMessageConfig_msg; +extern const pb_msgdesc_t ModuleConfig_msg; +extern const pb_msgdesc_t ModuleConfig_MQTTConfig_msg; +extern const pb_msgdesc_t ModuleConfig_RemoteHardwareConfig_msg; +extern const pb_msgdesc_t ModuleConfig_AudioConfig_msg; +extern const pb_msgdesc_t ModuleConfig_SerialConfig_msg; +extern const pb_msgdesc_t ModuleConfig_ExternalNotificationConfig_msg; +extern const pb_msgdesc_t ModuleConfig_StoreForwardConfig_msg; +extern const pb_msgdesc_t ModuleConfig_RangeTestConfig_msg; +extern const pb_msgdesc_t ModuleConfig_TelemetryConfig_msg; +extern const pb_msgdesc_t ModuleConfig_CannedMessageConfig_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_ModuleConfig_fields &meshtastic_ModuleConfig_msg -#define meshtastic_ModuleConfig_MQTTConfig_fields &meshtastic_ModuleConfig_MQTTConfig_msg -#define meshtastic_ModuleConfig_RemoteHardwareConfig_fields &meshtastic_ModuleConfig_RemoteHardwareConfig_msg -#define meshtastic_ModuleConfig_AudioConfig_fields &meshtastic_ModuleConfig_AudioConfig_msg -#define meshtastic_ModuleConfig_SerialConfig_fields &meshtastic_ModuleConfig_SerialConfig_msg -#define meshtastic_ModuleConfig_ExternalNotificationConfig_fields &meshtastic_ModuleConfig_ExternalNotificationConfig_msg -#define meshtastic_ModuleConfig_StoreForwardConfig_fields &meshtastic_ModuleConfig_StoreForwardConfig_msg -#define meshtastic_ModuleConfig_RangeTestConfig_fields &meshtastic_ModuleConfig_RangeTestConfig_msg -#define meshtastic_ModuleConfig_TelemetryConfig_fields &meshtastic_ModuleConfig_TelemetryConfig_msg -#define meshtastic_ModuleConfig_CannedMessageConfig_fields &meshtastic_ModuleConfig_CannedMessageConfig_msg +#define ModuleConfig_fields &ModuleConfig_msg +#define ModuleConfig_MQTTConfig_fields &ModuleConfig_MQTTConfig_msg +#define ModuleConfig_RemoteHardwareConfig_fields &ModuleConfig_RemoteHardwareConfig_msg +#define ModuleConfig_AudioConfig_fields &ModuleConfig_AudioConfig_msg +#define ModuleConfig_SerialConfig_fields &ModuleConfig_SerialConfig_msg +#define ModuleConfig_ExternalNotificationConfig_fields &ModuleConfig_ExternalNotificationConfig_msg +#define ModuleConfig_StoreForwardConfig_fields &ModuleConfig_StoreForwardConfig_msg +#define ModuleConfig_RangeTestConfig_fields &ModuleConfig_RangeTestConfig_msg +#define ModuleConfig_TelemetryConfig_fields &ModuleConfig_TelemetryConfig_msg +#define ModuleConfig_CannedMessageConfig_fields &ModuleConfig_CannedMessageConfig_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_ModuleConfig_AudioConfig_size 19 -#define meshtastic_ModuleConfig_CannedMessageConfig_size 49 -#define meshtastic_ModuleConfig_ExternalNotificationConfig_size 40 -#define meshtastic_ModuleConfig_MQTTConfig_size 201 -#define meshtastic_ModuleConfig_RangeTestConfig_size 10 -#define meshtastic_ModuleConfig_RemoteHardwareConfig_size 2 -#define meshtastic_ModuleConfig_SerialConfig_size 26 -#define meshtastic_ModuleConfig_StoreForwardConfig_size 22 -#define meshtastic_ModuleConfig_TelemetryConfig_size 18 -#define meshtastic_ModuleConfig_size 204 +#define ModuleConfig_AudioConfig_size 19 +#define ModuleConfig_CannedMessageConfig_size 49 +#define ModuleConfig_ExternalNotificationConfig_size 40 +#define ModuleConfig_MQTTConfig_size 201 +#define ModuleConfig_RangeTestConfig_size 10 +#define ModuleConfig_RemoteHardwareConfig_size 2 +#define ModuleConfig_SerialConfig_size 26 +#define ModuleConfig_StoreForwardConfig_size 22 +#define ModuleConfig_TelemetryConfig_size 18 +#define ModuleConfig_size 204 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/mqtt.pb.c b/src/mesh/generated/meshtastic/mqtt.pb.c index 18f35f587..86a1e0075 100644 --- a/src/mesh/generated/meshtastic/mqtt.pb.c +++ b/src/mesh/generated/meshtastic/mqtt.pb.c @@ -6,7 +6,7 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_ServiceEnvelope, meshtastic_ServiceEnvelope, AUTO) +PB_BIND(ServiceEnvelope, ServiceEnvelope, AUTO) diff --git a/src/mesh/generated/meshtastic/mqtt.pb.h b/src/mesh/generated/meshtastic/mqtt.pb.h index cf753a061..644a771bb 100644 --- a/src/mesh/generated/meshtastic/mqtt.pb.h +++ b/src/mesh/generated/meshtastic/mqtt.pb.h @@ -12,16 +12,16 @@ /* Struct definitions */ /* This message wraps a MeshPacket with extra metadata about the sender and how it arrived. */ -typedef struct _meshtastic_ServiceEnvelope { +typedef struct _ServiceEnvelope { /* The (probably encrypted) packet */ - struct _meshtastic_MeshPacket *packet; + struct _MeshPacket *packet; /* The global channel ID it was sent on */ char *channel_id; /* The sending gateway node ID. Can we use this to authenticate/prevent fake nodeid impersonation for senders? - i.e. use gateway/mesh id (which is authenticated) + local node id as the globally trusted nodenum */ char *gateway_id; -} meshtastic_ServiceEnvelope; +} ServiceEnvelope; #ifdef __cplusplus @@ -29,30 +29,30 @@ extern "C" { #endif /* Initializer values for message structs */ -#define meshtastic_ServiceEnvelope_init_default {NULL, NULL, NULL} -#define meshtastic_ServiceEnvelope_init_zero {NULL, NULL, NULL} +#define ServiceEnvelope_init_default {NULL, NULL, NULL} +#define ServiceEnvelope_init_zero {NULL, NULL, NULL} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_ServiceEnvelope_packet_tag 1 -#define meshtastic_ServiceEnvelope_channel_id_tag 2 -#define meshtastic_ServiceEnvelope_gateway_id_tag 3 +#define ServiceEnvelope_packet_tag 1 +#define ServiceEnvelope_channel_id_tag 2 +#define ServiceEnvelope_gateway_id_tag 3 /* Struct field encoding specification for nanopb */ -#define meshtastic_ServiceEnvelope_FIELDLIST(X, a) \ +#define ServiceEnvelope_FIELDLIST(X, a) \ X(a, POINTER, OPTIONAL, MESSAGE, packet, 1) \ X(a, POINTER, SINGULAR, STRING, channel_id, 2) \ X(a, POINTER, SINGULAR, STRING, gateway_id, 3) -#define meshtastic_ServiceEnvelope_CALLBACK NULL -#define meshtastic_ServiceEnvelope_DEFAULT NULL -#define meshtastic_ServiceEnvelope_packet_MSGTYPE meshtastic_MeshPacket +#define ServiceEnvelope_CALLBACK NULL +#define ServiceEnvelope_DEFAULT NULL +#define ServiceEnvelope_packet_MSGTYPE MeshPacket -extern const pb_msgdesc_t meshtastic_ServiceEnvelope_msg; +extern const pb_msgdesc_t ServiceEnvelope_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_ServiceEnvelope_fields &meshtastic_ServiceEnvelope_msg +#define ServiceEnvelope_fields &ServiceEnvelope_msg /* Maximum encoded size of messages (where known) */ -/* meshtastic_ServiceEnvelope_size depends on runtime parameters */ +/* ServiceEnvelope_size depends on runtime parameters */ #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/portnums.pb.h b/src/mesh/generated/meshtastic/portnums.pb.h index 59cf0ebe5..27d2ab498 100644 --- a/src/mesh/generated/meshtastic/portnums.pb.h +++ b/src/mesh/generated/meshtastic/portnums.pb.h @@ -22,87 +22,87 @@ Note: This was formerly a Type enum named 'typ' with the same id # We have change to this 'portnum' based scheme for specifying app handlers for particular payloads. This change is backwards compatible by treating the legacy OPAQUE/CLEAR_TEXT values identically. */ -typedef enum _meshtastic_PortNum { +typedef enum _PortNum { /* Deprecated: do not use in new code (formerly called OPAQUE) A message sent from a device outside of the mesh, in a form the mesh does not understand NOTE: This must be 0, because it is documented in IMeshService.aidl to be so */ - meshtastic_PortNum_UNKNOWN_APP = 0, + PortNum_UNKNOWN_APP = 0, /* A simple UTF-8 text message, which even the little micros in the mesh can understand and show on their screen eventually in some circumstances even signal might send messages in this form (see below) */ - meshtastic_PortNum_TEXT_MESSAGE_APP = 1, + PortNum_TEXT_MESSAGE_APP = 1, /* Reserved for built-in GPIO/example app. See remote_hardware.proto/HardwareMessage for details on the message sent/received to this port number */ - meshtastic_PortNum_REMOTE_HARDWARE_APP = 2, + PortNum_REMOTE_HARDWARE_APP = 2, /* The built-in position messaging app. Payload is a [Position](/docs/developers/protobufs/api#position) message */ - meshtastic_PortNum_POSITION_APP = 3, + PortNum_POSITION_APP = 3, /* The built-in user info app. Payload is a [User](/docs/developers/protobufs/api#user) message */ - meshtastic_PortNum_NODEINFO_APP = 4, + PortNum_NODEINFO_APP = 4, /* Protocol control packets for mesh protocol use. Payload is a [Routing](/docs/developers/protobufs/api#routing) message */ - meshtastic_PortNum_ROUTING_APP = 5, + PortNum_ROUTING_APP = 5, /* Admin control packets. Payload is a [AdminMessage](/docs/developers/protobufs/api#adminmessage) message */ - meshtastic_PortNum_ADMIN_APP = 6, + PortNum_ADMIN_APP = 6, /* Compressed TEXT_MESSAGE payloads. */ - meshtastic_PortNum_TEXT_MESSAGE_COMPRESSED_APP = 7, + PortNum_TEXT_MESSAGE_COMPRESSED_APP = 7, /* Waypoint payloads. Payload is a [Waypoint](/docs/developers/protobufs/api#waypoint) message */ - meshtastic_PortNum_WAYPOINT_APP = 8, + PortNum_WAYPOINT_APP = 8, /* Audio Payloads. Encapsulated codec2 packets. On 2.4 GHZ Bandwidths only for now */ - meshtastic_PortNum_AUDIO_APP = 9, + PortNum_AUDIO_APP = 9, /* Provides a 'ping' service that replies to any packet it receives. Also serves as a small example module. */ - meshtastic_PortNum_REPLY_APP = 32, + PortNum_REPLY_APP = 32, /* Used for the python IP tunnel feature */ - meshtastic_PortNum_IP_TUNNEL_APP = 33, + PortNum_IP_TUNNEL_APP = 33, /* Provides a hardware serial interface to send and receive from the Meshtastic network. Connect to the RX/TX pins of a device with 38400 8N1. Packets received from the Meshtastic network is forwarded to the RX pin while sending a packet to TX will go out to the Mesh network. Maximum packet size of 240 bytes. Module is disabled by default can be turned on by setting SERIAL_MODULE_ENABLED = 1 in SerialPlugh.cpp. */ - meshtastic_PortNum_SERIAL_APP = 64, + PortNum_SERIAL_APP = 64, /* STORE_FORWARD_APP (Work in Progress) Maintained by Jm Casler (MC Hamster) : jm@casler.org */ - meshtastic_PortNum_STORE_FORWARD_APP = 65, + PortNum_STORE_FORWARD_APP = 65, /* Optional port for messages for the range test module. */ - meshtastic_PortNum_RANGE_TEST_APP = 66, + PortNum_RANGE_TEST_APP = 66, /* Provides a format to send and receive telemetry data from the Meshtastic network. Maintained by Charles Crossan (crossan007) : crossan007@gmail.com */ - meshtastic_PortNum_TELEMETRY_APP = 67, + PortNum_TELEMETRY_APP = 67, /* Experimental tools for estimating node position without a GPS Maintained by Github user a-f-G-U-C (a Meshtastic contributor) Project files at https://github.com/a-f-G-U-C/Meshtastic-ZPS */ - meshtastic_PortNum_ZPS_APP = 68, + PortNum_ZPS_APP = 68, /* Used to let multiple instances of Linux native applications communicate as if they did using their LoRa chip. Maintained by GitHub user GUVWAF. Project files at https://github.com/GUVWAF/Meshtasticator */ - meshtastic_PortNum_SIMULATOR_APP = 69, + PortNum_SIMULATOR_APP = 69, /* Provides a traceroute functionality to show the route a packet towards a certain destination would take on the mesh. */ - meshtastic_PortNum_TRACEROUTE_APP = 70, + PortNum_TRACEROUTE_APP = 70, /* Private applications should use portnums >= 256. To simplify initial development and testing you can use "PRIVATE_APP" in your code without needing to rebuild protobuf files (via [regen-protos.sh](https://github.com/meshtastic/firmware/blob/master/bin/regen-protos.sh)) */ - meshtastic_PortNum_PRIVATE_APP = 256, + PortNum_PRIVATE_APP = 256, /* ATAK Forwarder Module https://github.com/paulmandal/atak-forwarder */ - meshtastic_PortNum_ATAK_FORWARDER = 257, + PortNum_ATAK_FORWARDER = 257, /* Currently we limit port nums to no higher than this value */ - meshtastic_PortNum_MAX = 511 -} meshtastic_PortNum; + PortNum_MAX = 511 +} PortNum; #ifdef __cplusplus extern "C" { #endif /* Helper constants for enums */ -#define _meshtastic_PortNum_MIN meshtastic_PortNum_UNKNOWN_APP -#define _meshtastic_PortNum_MAX meshtastic_PortNum_MAX -#define _meshtastic_PortNum_ARRAYSIZE ((meshtastic_PortNum)(meshtastic_PortNum_MAX+1)) +#define _PortNum_MIN PortNum_UNKNOWN_APP +#define _PortNum_MAX PortNum_MAX +#define _PortNum_ARRAYSIZE ((PortNum)(PortNum_MAX+1)) #ifdef __cplusplus diff --git a/src/mesh/generated/meshtastic/remote_hardware.pb.c b/src/mesh/generated/meshtastic/remote_hardware.pb.c index cdea45550..e33884659 100644 --- a/src/mesh/generated/meshtastic/remote_hardware.pb.c +++ b/src/mesh/generated/meshtastic/remote_hardware.pb.c @@ -6,7 +6,7 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_HardwareMessage, meshtastic_HardwareMessage, AUTO) +PB_BIND(HardwareMessage, HardwareMessage, AUTO) diff --git a/src/mesh/generated/meshtastic/remote_hardware.pb.h b/src/mesh/generated/meshtastic/remote_hardware.pb.h index 26df97616..b76dbe0bc 100644 --- a/src/mesh/generated/meshtastic/remote_hardware.pb.h +++ b/src/mesh/generated/meshtastic/remote_hardware.pb.h @@ -11,22 +11,22 @@ /* Enum definitions */ /* TODO: REPLACE */ -typedef enum _meshtastic_HardwareMessage_Type { +typedef enum _HardwareMessage_Type { /* Unset/unused */ - meshtastic_HardwareMessage_Type_UNSET = 0, + HardwareMessage_Type_UNSET = 0, /* Set gpio gpios based on gpio_mask/gpio_value */ - meshtastic_HardwareMessage_Type_WRITE_GPIOS = 1, + HardwareMessage_Type_WRITE_GPIOS = 1, /* We are now interested in watching the gpio_mask gpios. If the selected gpios change, please broadcast GPIOS_CHANGED. Will implicitly change the gpios requested to be INPUT gpios. */ - meshtastic_HardwareMessage_Type_WATCH_GPIOS = 2, + HardwareMessage_Type_WATCH_GPIOS = 2, /* The gpios listed in gpio_mask have changed, the new values are listed in gpio_value */ - meshtastic_HardwareMessage_Type_GPIOS_CHANGED = 3, + HardwareMessage_Type_GPIOS_CHANGED = 3, /* Read the gpios specified in gpio_mask, send back a READ_GPIOS_REPLY reply with gpio_value populated */ - meshtastic_HardwareMessage_Type_READ_GPIOS = 4, + HardwareMessage_Type_READ_GPIOS = 4, /* A reply to READ_GPIOS. gpio_mask and gpio_value will be populated */ - meshtastic_HardwareMessage_Type_READ_GPIOS_REPLY = 5 -} meshtastic_HardwareMessage_Type; + HardwareMessage_Type_READ_GPIOS_REPLY = 5 +} HardwareMessage_Type; /* Struct definitions */ /* An example app to show off the module system. This message is used for @@ -38,15 +38,15 @@ typedef enum _meshtastic_HardwareMessage_Type { because no security yet (beyond the channel mechanism). It should be off by default and then protected based on some TBD mechanism (a special channel once multichannel support is included?) */ -typedef struct _meshtastic_HardwareMessage { +typedef struct _HardwareMessage { /* What type of HardwareMessage is this? */ - meshtastic_HardwareMessage_Type type; + HardwareMessage_Type type; /* What gpios are we changing. Not used for all MessageTypes, see MessageType for details */ uint64_t gpio_mask; /* For gpios that were listed in gpio_mask as valid, what are the signal levels for those gpios. Not used for all MessageTypes, see MessageType for details */ uint64_t gpio_value; -} meshtastic_HardwareMessage; +} HardwareMessage; #ifdef __cplusplus @@ -54,37 +54,37 @@ extern "C" { #endif /* Helper constants for enums */ -#define _meshtastic_HardwareMessage_Type_MIN meshtastic_HardwareMessage_Type_UNSET -#define _meshtastic_HardwareMessage_Type_MAX meshtastic_HardwareMessage_Type_READ_GPIOS_REPLY -#define _meshtastic_HardwareMessage_Type_ARRAYSIZE ((meshtastic_HardwareMessage_Type)(meshtastic_HardwareMessage_Type_READ_GPIOS_REPLY+1)) +#define _HardwareMessage_Type_MIN HardwareMessage_Type_UNSET +#define _HardwareMessage_Type_MAX HardwareMessage_Type_READ_GPIOS_REPLY +#define _HardwareMessage_Type_ARRAYSIZE ((HardwareMessage_Type)(HardwareMessage_Type_READ_GPIOS_REPLY+1)) -#define meshtastic_HardwareMessage_type_ENUMTYPE meshtastic_HardwareMessage_Type +#define HardwareMessage_type_ENUMTYPE HardwareMessage_Type /* Initializer values for message structs */ -#define meshtastic_HardwareMessage_init_default {_meshtastic_HardwareMessage_Type_MIN, 0, 0} -#define meshtastic_HardwareMessage_init_zero {_meshtastic_HardwareMessage_Type_MIN, 0, 0} +#define HardwareMessage_init_default {_HardwareMessage_Type_MIN, 0, 0} +#define HardwareMessage_init_zero {_HardwareMessage_Type_MIN, 0, 0} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_HardwareMessage_type_tag 1 -#define meshtastic_HardwareMessage_gpio_mask_tag 2 -#define meshtastic_HardwareMessage_gpio_value_tag 3 +#define HardwareMessage_type_tag 1 +#define HardwareMessage_gpio_mask_tag 2 +#define HardwareMessage_gpio_value_tag 3 /* Struct field encoding specification for nanopb */ -#define meshtastic_HardwareMessage_FIELDLIST(X, a) \ +#define HardwareMessage_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UENUM, type, 1) \ X(a, STATIC, SINGULAR, UINT64, gpio_mask, 2) \ X(a, STATIC, SINGULAR, UINT64, gpio_value, 3) -#define meshtastic_HardwareMessage_CALLBACK NULL -#define meshtastic_HardwareMessage_DEFAULT NULL +#define HardwareMessage_CALLBACK NULL +#define HardwareMessage_DEFAULT NULL -extern const pb_msgdesc_t meshtastic_HardwareMessage_msg; +extern const pb_msgdesc_t HardwareMessage_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_HardwareMessage_fields &meshtastic_HardwareMessage_msg +#define HardwareMessage_fields &HardwareMessage_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_HardwareMessage_size 24 +#define HardwareMessage_size 24 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/rtttl.pb.c b/src/mesh/generated/meshtastic/rtttl.pb.c index 62586a11b..5980cacf2 100644 --- a/src/mesh/generated/meshtastic/rtttl.pb.c +++ b/src/mesh/generated/meshtastic/rtttl.pb.c @@ -6,7 +6,7 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_RTTTLConfig, meshtastic_RTTTLConfig, AUTO) +PB_BIND(RTTTLConfig, RTTTLConfig, AUTO) diff --git a/src/mesh/generated/meshtastic/rtttl.pb.h b/src/mesh/generated/meshtastic/rtttl.pb.h index aa55d0b7d..8cca21f59 100644 --- a/src/mesh/generated/meshtastic/rtttl.pb.h +++ b/src/mesh/generated/meshtastic/rtttl.pb.h @@ -11,10 +11,10 @@ /* Struct definitions */ /* Canned message module configuration. */ -typedef struct _meshtastic_RTTTLConfig { +typedef struct _RTTTLConfig { /* Ringtone for PWM Buzzer in RTTTL Format. */ char ringtone[230]; -} meshtastic_RTTTLConfig; +} RTTTLConfig; #ifdef __cplusplus @@ -22,25 +22,25 @@ extern "C" { #endif /* Initializer values for message structs */ -#define meshtastic_RTTTLConfig_init_default {""} -#define meshtastic_RTTTLConfig_init_zero {""} +#define RTTTLConfig_init_default {""} +#define RTTTLConfig_init_zero {""} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_RTTTLConfig_ringtone_tag 1 +#define RTTTLConfig_ringtone_tag 1 /* Struct field encoding specification for nanopb */ -#define meshtastic_RTTTLConfig_FIELDLIST(X, a) \ +#define RTTTLConfig_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, STRING, ringtone, 1) -#define meshtastic_RTTTLConfig_CALLBACK NULL -#define meshtastic_RTTTLConfig_DEFAULT NULL +#define RTTTLConfig_CALLBACK NULL +#define RTTTLConfig_DEFAULT NULL -extern const pb_msgdesc_t meshtastic_RTTTLConfig_msg; +extern const pb_msgdesc_t RTTTLConfig_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_RTTTLConfig_fields &meshtastic_RTTTLConfig_msg +#define RTTTLConfig_fields &RTTTLConfig_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_RTTTLConfig_size 232 +#define RTTTLConfig_size 232 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/storeforward.pb.c b/src/mesh/generated/meshtastic/storeforward.pb.c index 6d4b78754..154e01db5 100644 --- a/src/mesh/generated/meshtastic/storeforward.pb.c +++ b/src/mesh/generated/meshtastic/storeforward.pb.c @@ -6,16 +6,16 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_StoreAndForward, meshtastic_StoreAndForward, AUTO) +PB_BIND(StoreAndForward, StoreAndForward, AUTO) -PB_BIND(meshtastic_StoreAndForward_Statistics, meshtastic_StoreAndForward_Statistics, AUTO) +PB_BIND(StoreAndForward_Statistics, StoreAndForward_Statistics, AUTO) -PB_BIND(meshtastic_StoreAndForward_History, meshtastic_StoreAndForward_History, AUTO) +PB_BIND(StoreAndForward_History, StoreAndForward_History, AUTO) -PB_BIND(meshtastic_StoreAndForward_Heartbeat, meshtastic_StoreAndForward_Heartbeat, AUTO) +PB_BIND(StoreAndForward_Heartbeat, StoreAndForward_Heartbeat, AUTO) diff --git a/src/mesh/generated/meshtastic/storeforward.pb.h b/src/mesh/generated/meshtastic/storeforward.pb.h index e6cb51f61..75b06fc4a 100644 --- a/src/mesh/generated/meshtastic/storeforward.pb.h +++ b/src/mesh/generated/meshtastic/storeforward.pb.h @@ -12,42 +12,42 @@ /* Enum definitions */ /* 001 - 063 = From Router 064 - 127 = From Client */ -typedef enum _meshtastic_StoreAndForward_RequestResponse { +typedef enum _StoreAndForward_RequestResponse { /* Unset/unused */ - meshtastic_StoreAndForward_RequestResponse_UNSET = 0, + StoreAndForward_RequestResponse_UNSET = 0, /* Router is an in error state. */ - meshtastic_StoreAndForward_RequestResponse_ROUTER_ERROR = 1, + StoreAndForward_RequestResponse_ROUTER_ERROR = 1, /* Router heartbeat */ - meshtastic_StoreAndForward_RequestResponse_ROUTER_HEARTBEAT = 2, + StoreAndForward_RequestResponse_ROUTER_HEARTBEAT = 2, /* Router has requested the client respond. This can work as a "are you there" message. */ - meshtastic_StoreAndForward_RequestResponse_ROUTER_PING = 3, + StoreAndForward_RequestResponse_ROUTER_PING = 3, /* The response to a "Ping" */ - meshtastic_StoreAndForward_RequestResponse_ROUTER_PONG = 4, + StoreAndForward_RequestResponse_ROUTER_PONG = 4, /* Router is currently busy. Please try again later. */ - meshtastic_StoreAndForward_RequestResponse_ROUTER_BUSY = 5, + StoreAndForward_RequestResponse_ROUTER_BUSY = 5, /* Router is responding to a request for history. */ - meshtastic_StoreAndForward_RequestResponse_ROUTER_HISTORY = 6, + StoreAndForward_RequestResponse_ROUTER_HISTORY = 6, /* Router is responding to a request for stats. */ - meshtastic_StoreAndForward_RequestResponse_ROUTER_STATS = 7, + StoreAndForward_RequestResponse_ROUTER_STATS = 7, /* Client is an in error state. */ - meshtastic_StoreAndForward_RequestResponse_CLIENT_ERROR = 64, + StoreAndForward_RequestResponse_CLIENT_ERROR = 64, /* Client has requested a replay from the router. */ - meshtastic_StoreAndForward_RequestResponse_CLIENT_HISTORY = 65, + StoreAndForward_RequestResponse_CLIENT_HISTORY = 65, /* Client has requested stats from the router. */ - meshtastic_StoreAndForward_RequestResponse_CLIENT_STATS = 66, + StoreAndForward_RequestResponse_CLIENT_STATS = 66, /* Client has requested the router respond. This can work as a "are you there" message. */ - meshtastic_StoreAndForward_RequestResponse_CLIENT_PING = 67, + StoreAndForward_RequestResponse_CLIENT_PING = 67, /* The response to a "Ping" */ - meshtastic_StoreAndForward_RequestResponse_CLIENT_PONG = 68, + StoreAndForward_RequestResponse_CLIENT_PONG = 68, /* Client has requested that the router abort processing the client's request */ - meshtastic_StoreAndForward_RequestResponse_CLIENT_ABORT = 106 -} meshtastic_StoreAndForward_RequestResponse; + StoreAndForward_RequestResponse_CLIENT_ABORT = 106 +} StoreAndForward_RequestResponse; /* Struct definitions */ /* TODO: REPLACE */ -typedef struct _meshtastic_StoreAndForward_Statistics { +typedef struct _StoreAndForward_Statistics { /* Number of messages we have ever seen */ uint32_t messages_total; /* Number of messages we have currently saved our history. */ @@ -66,42 +66,42 @@ typedef struct _meshtastic_StoreAndForward_Statistics { uint32_t return_max; /* Is the heartbeat enabled on the server? */ uint32_t return_window; -} meshtastic_StoreAndForward_Statistics; +} StoreAndForward_Statistics; /* TODO: REPLACE */ -typedef struct _meshtastic_StoreAndForward_History { +typedef struct _StoreAndForward_History { /* Number of that will be sent to the client */ uint32_t history_messages; /* The window of messages that was used to filter the history client requested */ uint32_t window; /* The window of messages that was used to filter the history client requested */ uint32_t last_request; -} meshtastic_StoreAndForward_History; +} StoreAndForward_History; /* TODO: REPLACE */ -typedef struct _meshtastic_StoreAndForward_Heartbeat { +typedef struct _StoreAndForward_Heartbeat { /* Number of that will be sent to the client */ uint32_t period; /* If set, this is not the primary Store & Forward router on the mesh */ uint32_t secondary; -} meshtastic_StoreAndForward_Heartbeat; +} StoreAndForward_Heartbeat; /* TODO: REPLACE */ -typedef struct _meshtastic_StoreAndForward { +typedef struct _StoreAndForward { /* TODO: REPLACE */ - meshtastic_StoreAndForward_RequestResponse rr; + StoreAndForward_RequestResponse rr; pb_size_t which_variant; union { /* TODO: REPLACE */ - meshtastic_StoreAndForward_Statistics stats; + StoreAndForward_Statistics stats; /* TODO: REPLACE */ - meshtastic_StoreAndForward_History history; + StoreAndForward_History history; /* TODO: REPLACE */ - meshtastic_StoreAndForward_Heartbeat heartbeat; + StoreAndForward_Heartbeat heartbeat; /* Empty Payload */ bool empty; } variant; -} meshtastic_StoreAndForward; +} StoreAndForward; #ifdef __cplusplus @@ -109,61 +109,61 @@ extern "C" { #endif /* Helper constants for enums */ -#define _meshtastic_StoreAndForward_RequestResponse_MIN meshtastic_StoreAndForward_RequestResponse_UNSET -#define _meshtastic_StoreAndForward_RequestResponse_MAX meshtastic_StoreAndForward_RequestResponse_CLIENT_ABORT -#define _meshtastic_StoreAndForward_RequestResponse_ARRAYSIZE ((meshtastic_StoreAndForward_RequestResponse)(meshtastic_StoreAndForward_RequestResponse_CLIENT_ABORT+1)) +#define _StoreAndForward_RequestResponse_MIN StoreAndForward_RequestResponse_UNSET +#define _StoreAndForward_RequestResponse_MAX StoreAndForward_RequestResponse_CLIENT_ABORT +#define _StoreAndForward_RequestResponse_ARRAYSIZE ((StoreAndForward_RequestResponse)(StoreAndForward_RequestResponse_CLIENT_ABORT+1)) -#define meshtastic_StoreAndForward_rr_ENUMTYPE meshtastic_StoreAndForward_RequestResponse +#define StoreAndForward_rr_ENUMTYPE StoreAndForward_RequestResponse /* Initializer values for message structs */ -#define meshtastic_StoreAndForward_init_default {_meshtastic_StoreAndForward_RequestResponse_MIN, 0, {meshtastic_StoreAndForward_Statistics_init_default}} -#define meshtastic_StoreAndForward_Statistics_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_StoreAndForward_History_init_default {0, 0, 0} -#define meshtastic_StoreAndForward_Heartbeat_init_default {0, 0} -#define meshtastic_StoreAndForward_init_zero {_meshtastic_StoreAndForward_RequestResponse_MIN, 0, {meshtastic_StoreAndForward_Statistics_init_zero}} -#define meshtastic_StoreAndForward_Statistics_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0} -#define meshtastic_StoreAndForward_History_init_zero {0, 0, 0} -#define meshtastic_StoreAndForward_Heartbeat_init_zero {0, 0} +#define StoreAndForward_init_default {_StoreAndForward_RequestResponse_MIN, 0, {StoreAndForward_Statistics_init_default}} +#define StoreAndForward_Statistics_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0} +#define StoreAndForward_History_init_default {0, 0, 0} +#define StoreAndForward_Heartbeat_init_default {0, 0} +#define StoreAndForward_init_zero {_StoreAndForward_RequestResponse_MIN, 0, {StoreAndForward_Statistics_init_zero}} +#define StoreAndForward_Statistics_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0} +#define StoreAndForward_History_init_zero {0, 0, 0} +#define StoreAndForward_Heartbeat_init_zero {0, 0} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_StoreAndForward_Statistics_messages_total_tag 1 -#define meshtastic_StoreAndForward_Statistics_messages_saved_tag 2 -#define meshtastic_StoreAndForward_Statistics_messages_max_tag 3 -#define meshtastic_StoreAndForward_Statistics_up_time_tag 4 -#define meshtastic_StoreAndForward_Statistics_requests_tag 5 -#define meshtastic_StoreAndForward_Statistics_requests_history_tag 6 -#define meshtastic_StoreAndForward_Statistics_heartbeat_tag 7 -#define meshtastic_StoreAndForward_Statistics_return_max_tag 8 -#define meshtastic_StoreAndForward_Statistics_return_window_tag 9 -#define meshtastic_StoreAndForward_History_history_messages_tag 1 -#define meshtastic_StoreAndForward_History_window_tag 2 -#define meshtastic_StoreAndForward_History_last_request_tag 3 -#define meshtastic_StoreAndForward_Heartbeat_period_tag 1 -#define meshtastic_StoreAndForward_Heartbeat_secondary_tag 2 -#define meshtastic_StoreAndForward_rr_tag 1 -#define meshtastic_StoreAndForward_stats_tag 2 -#define meshtastic_StoreAndForward_history_tag 3 -#define meshtastic_StoreAndForward_heartbeat_tag 4 -#define meshtastic_StoreAndForward_empty_tag 5 +#define StoreAndForward_Statistics_messages_total_tag 1 +#define StoreAndForward_Statistics_messages_saved_tag 2 +#define StoreAndForward_Statistics_messages_max_tag 3 +#define StoreAndForward_Statistics_up_time_tag 4 +#define StoreAndForward_Statistics_requests_tag 5 +#define StoreAndForward_Statistics_requests_history_tag 6 +#define StoreAndForward_Statistics_heartbeat_tag 7 +#define StoreAndForward_Statistics_return_max_tag 8 +#define StoreAndForward_Statistics_return_window_tag 9 +#define StoreAndForward_History_history_messages_tag 1 +#define StoreAndForward_History_window_tag 2 +#define StoreAndForward_History_last_request_tag 3 +#define StoreAndForward_Heartbeat_period_tag 1 +#define StoreAndForward_Heartbeat_secondary_tag 2 +#define StoreAndForward_rr_tag 1 +#define StoreAndForward_stats_tag 2 +#define StoreAndForward_history_tag 3 +#define StoreAndForward_heartbeat_tag 4 +#define StoreAndForward_empty_tag 5 /* Struct field encoding specification for nanopb */ -#define meshtastic_StoreAndForward_FIELDLIST(X, a) \ +#define StoreAndForward_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UENUM, rr, 1) \ X(a, STATIC, ONEOF, MESSAGE, (variant,stats,variant.stats), 2) \ X(a, STATIC, ONEOF, MESSAGE, (variant,history,variant.history), 3) \ X(a, STATIC, ONEOF, MESSAGE, (variant,heartbeat,variant.heartbeat), 4) \ X(a, STATIC, ONEOF, BOOL, (variant,empty,variant.empty), 5) -#define meshtastic_StoreAndForward_CALLBACK NULL -#define meshtastic_StoreAndForward_DEFAULT NULL -#define meshtastic_StoreAndForward_variant_stats_MSGTYPE meshtastic_StoreAndForward_Statistics -#define meshtastic_StoreAndForward_variant_history_MSGTYPE meshtastic_StoreAndForward_History -#define meshtastic_StoreAndForward_variant_heartbeat_MSGTYPE meshtastic_StoreAndForward_Heartbeat +#define StoreAndForward_CALLBACK NULL +#define StoreAndForward_DEFAULT NULL +#define StoreAndForward_variant_stats_MSGTYPE StoreAndForward_Statistics +#define StoreAndForward_variant_history_MSGTYPE StoreAndForward_History +#define StoreAndForward_variant_heartbeat_MSGTYPE StoreAndForward_Heartbeat -#define meshtastic_StoreAndForward_Statistics_FIELDLIST(X, a) \ +#define StoreAndForward_Statistics_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, messages_total, 1) \ X(a, STATIC, SINGULAR, UINT32, messages_saved, 2) \ X(a, STATIC, SINGULAR, UINT32, messages_max, 3) \ @@ -173,38 +173,38 @@ X(a, STATIC, SINGULAR, UINT32, requests_history, 6) \ X(a, STATIC, SINGULAR, BOOL, heartbeat, 7) \ X(a, STATIC, SINGULAR, UINT32, return_max, 8) \ X(a, STATIC, SINGULAR, UINT32, return_window, 9) -#define meshtastic_StoreAndForward_Statistics_CALLBACK NULL -#define meshtastic_StoreAndForward_Statistics_DEFAULT NULL +#define StoreAndForward_Statistics_CALLBACK NULL +#define StoreAndForward_Statistics_DEFAULT NULL -#define meshtastic_StoreAndForward_History_FIELDLIST(X, a) \ +#define StoreAndForward_History_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, history_messages, 1) \ X(a, STATIC, SINGULAR, UINT32, window, 2) \ X(a, STATIC, SINGULAR, UINT32, last_request, 3) -#define meshtastic_StoreAndForward_History_CALLBACK NULL -#define meshtastic_StoreAndForward_History_DEFAULT NULL +#define StoreAndForward_History_CALLBACK NULL +#define StoreAndForward_History_DEFAULT NULL -#define meshtastic_StoreAndForward_Heartbeat_FIELDLIST(X, a) \ +#define StoreAndForward_Heartbeat_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, period, 1) \ X(a, STATIC, SINGULAR, UINT32, secondary, 2) -#define meshtastic_StoreAndForward_Heartbeat_CALLBACK NULL -#define meshtastic_StoreAndForward_Heartbeat_DEFAULT NULL +#define StoreAndForward_Heartbeat_CALLBACK NULL +#define StoreAndForward_Heartbeat_DEFAULT NULL -extern const pb_msgdesc_t meshtastic_StoreAndForward_msg; -extern const pb_msgdesc_t meshtastic_StoreAndForward_Statistics_msg; -extern const pb_msgdesc_t meshtastic_StoreAndForward_History_msg; -extern const pb_msgdesc_t meshtastic_StoreAndForward_Heartbeat_msg; +extern const pb_msgdesc_t StoreAndForward_msg; +extern const pb_msgdesc_t StoreAndForward_Statistics_msg; +extern const pb_msgdesc_t StoreAndForward_History_msg; +extern const pb_msgdesc_t StoreAndForward_Heartbeat_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_StoreAndForward_fields &meshtastic_StoreAndForward_msg -#define meshtastic_StoreAndForward_Statistics_fields &meshtastic_StoreAndForward_Statistics_msg -#define meshtastic_StoreAndForward_History_fields &meshtastic_StoreAndForward_History_msg -#define meshtastic_StoreAndForward_Heartbeat_fields &meshtastic_StoreAndForward_Heartbeat_msg +#define StoreAndForward_fields &StoreAndForward_msg +#define StoreAndForward_Statistics_fields &StoreAndForward_Statistics_msg +#define StoreAndForward_History_fields &StoreAndForward_History_msg +#define StoreAndForward_Heartbeat_fields &StoreAndForward_Heartbeat_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_StoreAndForward_Heartbeat_size 12 -#define meshtastic_StoreAndForward_History_size 18 -#define meshtastic_StoreAndForward_Statistics_size 50 -#define meshtastic_StoreAndForward_size 54 +#define StoreAndForward_Heartbeat_size 12 +#define StoreAndForward_History_size 18 +#define StoreAndForward_Statistics_size 50 +#define StoreAndForward_size 54 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/telemetry.pb.c b/src/mesh/generated/meshtastic/telemetry.pb.c index 3b664cd22..1446be188 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.c +++ b/src/mesh/generated/meshtastic/telemetry.pb.c @@ -6,13 +6,13 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_DeviceMetrics, meshtastic_DeviceMetrics, AUTO) +PB_BIND(DeviceMetrics, DeviceMetrics, AUTO) -PB_BIND(meshtastic_EnvironmentMetrics, meshtastic_EnvironmentMetrics, AUTO) +PB_BIND(EnvironmentMetrics, EnvironmentMetrics, AUTO) -PB_BIND(meshtastic_Telemetry, meshtastic_Telemetry, AUTO) +PB_BIND(Telemetry, Telemetry, AUTO) diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index 511ae1229..7d4bb02eb 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -11,38 +11,38 @@ /* Enum definitions */ /* TODO: REPLACE */ -typedef enum _meshtastic_TelemetrySensorType { +typedef enum _TelemetrySensorType { /* No external telemetry sensor explicitly set */ - meshtastic_TelemetrySensorType_SENSOR_UNSET = 0, + TelemetrySensorType_SENSOR_UNSET = 0, /* High accuracy temperature, pressure, humidity */ - meshtastic_TelemetrySensorType_BME280 = 1, + TelemetrySensorType_BME280 = 1, /* High accuracy temperature, pressure, humidity, and air resistance */ - meshtastic_TelemetrySensorType_BME680 = 2, + TelemetrySensorType_BME680 = 2, /* Very high accuracy temperature */ - meshtastic_TelemetrySensorType_MCP9808 = 3, + TelemetrySensorType_MCP9808 = 3, /* Moderate accuracy current and voltage */ - meshtastic_TelemetrySensorType_INA260 = 4, + TelemetrySensorType_INA260 = 4, /* Moderate accuracy current and voltage */ - meshtastic_TelemetrySensorType_INA219 = 5, + TelemetrySensorType_INA219 = 5, /* High accuracy temperature and pressure */ - meshtastic_TelemetrySensorType_BMP280 = 6, + TelemetrySensorType_BMP280 = 6, /* High accuracy temperature and humidity */ - meshtastic_TelemetrySensorType_SHTC3 = 7, + TelemetrySensorType_SHTC3 = 7, /* High accuracy pressure */ - meshtastic_TelemetrySensorType_LPS22 = 8, + TelemetrySensorType_LPS22 = 8, /* 3-Axis magnetic sensor */ - meshtastic_TelemetrySensorType_QMC6310 = 9, + TelemetrySensorType_QMC6310 = 9, /* 6-Axis inertial measurement sensor */ - meshtastic_TelemetrySensorType_QMI8658 = 10, + TelemetrySensorType_QMI8658 = 10, /* 3-Axis magnetic sensor */ - meshtastic_TelemetrySensorType_QMC5883L = 11, + TelemetrySensorType_QMC5883L = 11, /* High accuracy temperature and humidity */ - meshtastic_TelemetrySensorType_SHT31 = 12 -} meshtastic_TelemetrySensorType; + TelemetrySensorType_SHT31 = 12 +} TelemetrySensorType; /* Struct definitions */ /* Key native device metrics such as battery level */ -typedef struct _meshtastic_DeviceMetrics { +typedef struct _DeviceMetrics { /* 1-100 (0 means powered) */ uint32_t battery_level; /* Voltage measured */ @@ -51,10 +51,10 @@ typedef struct _meshtastic_DeviceMetrics { float channel_utilization; /* Percent of airtime for transmission used within the last hour. */ float air_util_tx; -} meshtastic_DeviceMetrics; +} DeviceMetrics; /* Weather station or other environmental metrics */ -typedef struct _meshtastic_EnvironmentMetrics { +typedef struct _EnvironmentMetrics { /* Temperature measured */ float temperature; /* Relative humidity percent measured */ @@ -67,10 +67,10 @@ typedef struct _meshtastic_EnvironmentMetrics { float voltage; /* Current measured */ float current; -} meshtastic_EnvironmentMetrics; +} EnvironmentMetrics; /* Types of Measurements the telemetry module is equipped to handle */ -typedef struct _meshtastic_Telemetry { +typedef struct _Telemetry { /* This is usually not sent over the mesh (to save space), but it is sent from the phone so that the local device can set its RTC If it is sent over the mesh (because there are devices on the mesh without GPS), it will only @@ -80,11 +80,11 @@ typedef struct _meshtastic_Telemetry { pb_size_t which_variant; union { /* Key native device metrics such as battery level */ - meshtastic_DeviceMetrics device_metrics; + DeviceMetrics device_metrics; /* Weather station or other environmental metrics */ - meshtastic_EnvironmentMetrics environment_metrics; + EnvironmentMetrics environment_metrics; } variant; -} meshtastic_Telemetry; +} Telemetry; #ifdef __cplusplus @@ -92,78 +92,78 @@ extern "C" { #endif /* Helper constants for enums */ -#define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET -#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_SHT31 -#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_SHT31+1)) +#define _TelemetrySensorType_MIN TelemetrySensorType_SENSOR_UNSET +#define _TelemetrySensorType_MAX TelemetrySensorType_SHT31 +#define _TelemetrySensorType_ARRAYSIZE ((TelemetrySensorType)(TelemetrySensorType_SHT31+1)) /* Initializer values for message structs */ -#define meshtastic_DeviceMetrics_init_default {0, 0, 0, 0} -#define meshtastic_EnvironmentMetrics_init_default {0, 0, 0, 0, 0, 0} -#define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}} -#define meshtastic_DeviceMetrics_init_zero {0, 0, 0, 0} -#define meshtastic_EnvironmentMetrics_init_zero {0, 0, 0, 0, 0, 0} -#define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}} +#define DeviceMetrics_init_default {0, 0, 0, 0} +#define EnvironmentMetrics_init_default {0, 0, 0, 0, 0, 0} +#define Telemetry_init_default {0, 0, {DeviceMetrics_init_default}} +#define DeviceMetrics_init_zero {0, 0, 0, 0} +#define EnvironmentMetrics_init_zero {0, 0, 0, 0, 0, 0} +#define Telemetry_init_zero {0, 0, {DeviceMetrics_init_zero}} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_DeviceMetrics_battery_level_tag 1 -#define meshtastic_DeviceMetrics_voltage_tag 2 -#define meshtastic_DeviceMetrics_channel_utilization_tag 3 -#define meshtastic_DeviceMetrics_air_util_tx_tag 4 -#define meshtastic_EnvironmentMetrics_temperature_tag 1 -#define meshtastic_EnvironmentMetrics_relative_humidity_tag 2 -#define meshtastic_EnvironmentMetrics_barometric_pressure_tag 3 -#define meshtastic_EnvironmentMetrics_gas_resistance_tag 4 -#define meshtastic_EnvironmentMetrics_voltage_tag 5 -#define meshtastic_EnvironmentMetrics_current_tag 6 -#define meshtastic_Telemetry_time_tag 1 -#define meshtastic_Telemetry_device_metrics_tag 2 -#define meshtastic_Telemetry_environment_metrics_tag 3 +#define DeviceMetrics_battery_level_tag 1 +#define DeviceMetrics_voltage_tag 2 +#define DeviceMetrics_channel_utilization_tag 3 +#define DeviceMetrics_air_util_tx_tag 4 +#define EnvironmentMetrics_temperature_tag 1 +#define EnvironmentMetrics_relative_humidity_tag 2 +#define EnvironmentMetrics_barometric_pressure_tag 3 +#define EnvironmentMetrics_gas_resistance_tag 4 +#define EnvironmentMetrics_voltage_tag 5 +#define EnvironmentMetrics_current_tag 6 +#define Telemetry_time_tag 1 +#define Telemetry_device_metrics_tag 2 +#define Telemetry_environment_metrics_tag 3 /* Struct field encoding specification for nanopb */ -#define meshtastic_DeviceMetrics_FIELDLIST(X, a) \ +#define DeviceMetrics_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, battery_level, 1) \ X(a, STATIC, SINGULAR, FLOAT, voltage, 2) \ X(a, STATIC, SINGULAR, FLOAT, channel_utilization, 3) \ X(a, STATIC, SINGULAR, FLOAT, air_util_tx, 4) -#define meshtastic_DeviceMetrics_CALLBACK NULL -#define meshtastic_DeviceMetrics_DEFAULT NULL +#define DeviceMetrics_CALLBACK NULL +#define DeviceMetrics_DEFAULT NULL -#define meshtastic_EnvironmentMetrics_FIELDLIST(X, a) \ +#define EnvironmentMetrics_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, FLOAT, temperature, 1) \ X(a, STATIC, SINGULAR, FLOAT, relative_humidity, 2) \ X(a, STATIC, SINGULAR, FLOAT, barometric_pressure, 3) \ X(a, STATIC, SINGULAR, FLOAT, gas_resistance, 4) \ X(a, STATIC, SINGULAR, FLOAT, voltage, 5) \ X(a, STATIC, SINGULAR, FLOAT, current, 6) -#define meshtastic_EnvironmentMetrics_CALLBACK NULL -#define meshtastic_EnvironmentMetrics_DEFAULT NULL +#define EnvironmentMetrics_CALLBACK NULL +#define EnvironmentMetrics_DEFAULT NULL -#define meshtastic_Telemetry_FIELDLIST(X, a) \ +#define Telemetry_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, FIXED32, time, 1) \ X(a, STATIC, ONEOF, MESSAGE, (variant,device_metrics,variant.device_metrics), 2) \ X(a, STATIC, ONEOF, MESSAGE, (variant,environment_metrics,variant.environment_metrics), 3) -#define meshtastic_Telemetry_CALLBACK NULL -#define meshtastic_Telemetry_DEFAULT NULL -#define meshtastic_Telemetry_variant_device_metrics_MSGTYPE meshtastic_DeviceMetrics -#define meshtastic_Telemetry_variant_environment_metrics_MSGTYPE meshtastic_EnvironmentMetrics +#define Telemetry_CALLBACK NULL +#define Telemetry_DEFAULT NULL +#define Telemetry_variant_device_metrics_MSGTYPE DeviceMetrics +#define Telemetry_variant_environment_metrics_MSGTYPE EnvironmentMetrics -extern const pb_msgdesc_t meshtastic_DeviceMetrics_msg; -extern const pb_msgdesc_t meshtastic_EnvironmentMetrics_msg; -extern const pb_msgdesc_t meshtastic_Telemetry_msg; +extern const pb_msgdesc_t DeviceMetrics_msg; +extern const pb_msgdesc_t EnvironmentMetrics_msg; +extern const pb_msgdesc_t Telemetry_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_DeviceMetrics_fields &meshtastic_DeviceMetrics_msg -#define meshtastic_EnvironmentMetrics_fields &meshtastic_EnvironmentMetrics_msg -#define meshtastic_Telemetry_fields &meshtastic_Telemetry_msg +#define DeviceMetrics_fields &DeviceMetrics_msg +#define EnvironmentMetrics_fields &EnvironmentMetrics_msg +#define Telemetry_fields &Telemetry_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_DeviceMetrics_size 21 -#define meshtastic_EnvironmentMetrics_size 30 -#define meshtastic_Telemetry_size 37 +#define DeviceMetrics_size 21 +#define EnvironmentMetrics_size 30 +#define Telemetry_size 37 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/xmodem.pb.c b/src/mesh/generated/meshtastic/xmodem.pb.c index 83bb6e51a..f2b00401d 100644 --- a/src/mesh/generated/meshtastic/xmodem.pb.c +++ b/src/mesh/generated/meshtastic/xmodem.pb.c @@ -6,7 +6,7 @@ #error Regenerate this file with the current version of nanopb generator. #endif -PB_BIND(meshtastic_XModem, meshtastic_XModem, AUTO) +PB_BIND(XModem, XModem, AUTO) diff --git a/src/mesh/generated/meshtastic/xmodem.pb.h b/src/mesh/generated/meshtastic/xmodem.pb.h index 48d5aa5cd..4994fa97b 100644 --- a/src/mesh/generated/meshtastic/xmodem.pb.h +++ b/src/mesh/generated/meshtastic/xmodem.pb.h @@ -10,25 +10,25 @@ #endif /* Enum definitions */ -typedef enum _meshtastic_XModem_Control { - meshtastic_XModem_Control_NUL = 0, - meshtastic_XModem_Control_SOH = 1, - meshtastic_XModem_Control_STX = 2, - meshtastic_XModem_Control_EOT = 4, - meshtastic_XModem_Control_ACK = 6, - meshtastic_XModem_Control_NAK = 21, - meshtastic_XModem_Control_CAN = 24, - meshtastic_XModem_Control_CTRLZ = 26 -} meshtastic_XModem_Control; +typedef enum _XModem_Control { + XModem_Control_NUL = 0, + XModem_Control_SOH = 1, + XModem_Control_STX = 2, + XModem_Control_EOT = 4, + XModem_Control_ACK = 6, + XModem_Control_NAK = 21, + XModem_Control_CAN = 24, + XModem_Control_CTRLZ = 26 +} XModem_Control; /* Struct definitions */ -typedef PB_BYTES_ARRAY_T(128) meshtastic_XModem_buffer_t; -typedef struct _meshtastic_XModem { - meshtastic_XModem_Control control; +typedef PB_BYTES_ARRAY_T(128) XModem_buffer_t; +typedef struct _XModem { + XModem_Control control; uint16_t seq; uint16_t crc16; - meshtastic_XModem_buffer_t buffer; -} meshtastic_XModem; + XModem_buffer_t buffer; +} XModem; #ifdef __cplusplus @@ -36,39 +36,39 @@ extern "C" { #endif /* Helper constants for enums */ -#define _meshtastic_XModem_Control_MIN meshtastic_XModem_Control_NUL -#define _meshtastic_XModem_Control_MAX meshtastic_XModem_Control_CTRLZ -#define _meshtastic_XModem_Control_ARRAYSIZE ((meshtastic_XModem_Control)(meshtastic_XModem_Control_CTRLZ+1)) +#define _XModem_Control_MIN XModem_Control_NUL +#define _XModem_Control_MAX XModem_Control_CTRLZ +#define _XModem_Control_ARRAYSIZE ((XModem_Control)(XModem_Control_CTRLZ+1)) -#define meshtastic_XModem_control_ENUMTYPE meshtastic_XModem_Control +#define XModem_control_ENUMTYPE XModem_Control /* Initializer values for message structs */ -#define meshtastic_XModem_init_default {_meshtastic_XModem_Control_MIN, 0, 0, {0, {0}}} -#define meshtastic_XModem_init_zero {_meshtastic_XModem_Control_MIN, 0, 0, {0, {0}}} +#define XModem_init_default {_XModem_Control_MIN, 0, 0, {0, {0}}} +#define XModem_init_zero {_XModem_Control_MIN, 0, 0, {0, {0}}} /* Field tags (for use in manual encoding/decoding) */ -#define meshtastic_XModem_control_tag 1 -#define meshtastic_XModem_seq_tag 2 -#define meshtastic_XModem_crc16_tag 3 -#define meshtastic_XModem_buffer_tag 4 +#define XModem_control_tag 1 +#define XModem_seq_tag 2 +#define XModem_crc16_tag 3 +#define XModem_buffer_tag 4 /* Struct field encoding specification for nanopb */ -#define meshtastic_XModem_FIELDLIST(X, a) \ +#define XModem_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UENUM, control, 1) \ X(a, STATIC, SINGULAR, UINT32, seq, 2) \ X(a, STATIC, SINGULAR, UINT32, crc16, 3) \ X(a, STATIC, SINGULAR, BYTES, buffer, 4) -#define meshtastic_XModem_CALLBACK NULL -#define meshtastic_XModem_DEFAULT NULL +#define XModem_CALLBACK NULL +#define XModem_DEFAULT NULL -extern const pb_msgdesc_t meshtastic_XModem_msg; +extern const pb_msgdesc_t XModem_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ -#define meshtastic_XModem_fields &meshtastic_XModem_msg +#define XModem_fields &XModem_msg /* Maximum encoded size of messages (where known) */ -#define meshtastic_XModem_size 141 +#define XModem_size 141 #ifdef __cplusplus } /* extern "C" */ From b218ea9ec7f42acc0cffa6aec099664713b17e94 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 18 Jan 2023 11:04:06 -0600 Subject: [PATCH 14/20] Hopefully ignore generated files --- src/mesh/generated/.clang-format | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 src/mesh/generated/.clang-format diff --git a/src/mesh/generated/.clang-format b/src/mesh/generated/.clang-format new file mode 100644 index 000000000..a43d914ec --- /dev/null +++ b/src/mesh/generated/.clang-format @@ -0,0 +1,2 @@ +DisableFormat: true +SortIncludes: false \ No newline at end of file From 9046dacec86b8ee60999ece59dd401e36a694f39 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 18 Jan 2023 14:51:48 -0600 Subject: [PATCH 15/20] I don't like this formatting but I need trunk to STFU --- src/detect/i2cScan.h | 39 +-- src/error.h | 3 +- src/graphics/Screen.cpp | 158 ++++++----- src/main.h | 2 +- src/mesh/PhoneAPI.cpp | 4 +- src/mesh/PhoneAPI.h | 17 +- src/mesh/mesh-pb-constants.h | 12 +- src/modules/CannedMessageModule.cpp | 187 ++++++------- src/modules/ExternalNotificationModule.cpp | 97 ++++--- src/modules/RemoteHardwareModule.h | 7 +- src/modules/Telemetry/DeviceTelemetry.cpp | 24 +- src/modules/Telemetry/DeviceTelemetry.h | 4 +- .../Telemetry/EnvironmentTelemetry.cpp | 61 ++--- src/modules/Telemetry/EnvironmentTelemetry.h | 4 +- src/modules/Telemetry/Sensor/BME280Sensor.cpp | 38 ++- src/modules/Telemetry/Sensor/BME280Sensor.h | 11 +- src/modules/Telemetry/Sensor/BME680Sensor.cpp | 21 +- src/modules/Telemetry/Sensor/BME680Sensor.h | 13 +- src/modules/Telemetry/Sensor/BMP280Sensor.cpp | 32 +-- src/modules/Telemetry/Sensor/BMP280Sensor.h | 11 +- src/modules/Telemetry/Sensor/INA219Sensor.cpp | 23 +- src/modules/Telemetry/Sensor/INA219Sensor.h | 14 +- src/modules/Telemetry/Sensor/INA260Sensor.cpp | 23 +- src/modules/Telemetry/Sensor/INA260Sensor.h | 14 +- .../Telemetry/Sensor/LPS22HBSensor.cpp | 21 +- src/modules/Telemetry/Sensor/LPS22HBSensor.h | 13 +- .../Telemetry/Sensor/MCP9808Sensor.cpp | 22 +- src/modules/Telemetry/Sensor/MCP9808Sensor.h | 13 +- src/modules/Telemetry/Sensor/SHT31Sensor.cpp | 23 +- src/modules/Telemetry/Sensor/SHT31Sensor.h | 13 +- src/modules/Telemetry/Sensor/SHTC3Sensor.cpp | 23 +- src/modules/Telemetry/Sensor/SHTC3Sensor.h | 13 +- .../Telemetry/Sensor/TelemetrySensor.h | 7 +- src/modules/esp32/StoreForwardModule.cpp | 220 +++++++-------- src/modules/esp32/StoreForwardModule.h | 19 +- src/mqtt/MQTT.cpp | 70 +++-- src/mqtt/MQTT.h | 4 +- src/xmodem.cpp | 256 +++++++++--------- src/xmodem.h | 46 ++-- 39 files changed, 802 insertions(+), 780 deletions(-) diff --git a/src/detect/i2cScan.h b/src/detect/i2cScan.h index 6efe6b4e5..0189677bd 100644 --- a/src/detect/i2cScan.h +++ b/src/detect/i2cScan.h @@ -1,11 +1,11 @@ #include "../configuration.h" #include "../main.h" -#include #include "mesh/generated/meshtastic/telemetry.pb.h" +#include // AXP192 and AXP2101 have the same device address, we just need to identify it in Power.cpp #ifndef XPOWERS_AXP192_AXP2101_ADDRESS -#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34 +#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34 #endif #if HAS_WIRE @@ -16,27 +16,27 @@ void printATECCInfo() atecc.readConfigZone(false); LOG_DEBUG("ATECC608B Serial Number: "); - for (int i = 0 ; i < 9 ; i++) { - LOG_DEBUG("%02x",atecc.serialNumber[i]); + for (int i = 0; i < 9; i++) { + LOG_DEBUG("%02x", atecc.serialNumber[i]); } LOG_DEBUG(", Rev Number: "); - for (int i = 0 ; i < 4 ; i++) { - LOG_DEBUG("%02x",atecc.revisionNumber[i]); + for (int i = 0; i < 4; i++) { + LOG_DEBUG("%02x", atecc.revisionNumber[i]); } LOG_DEBUG("\n"); - LOG_DEBUG("ATECC608B Config %s",atecc.configLockStatus ? "Locked" : "Unlocked"); - LOG_DEBUG(", Data %s",atecc.dataOTPLockStatus ? "Locked" : "Unlocked"); - LOG_DEBUG(", Slot 0 %s\n",atecc.slot0LockStatus ? "Locked" : "Unlocked"); + LOG_DEBUG("ATECC608B Config %s", atecc.configLockStatus ? "Locked" : "Unlocked"); + LOG_DEBUG(", Data %s", atecc.dataOTPLockStatus ? "Locked" : "Unlocked"); + LOG_DEBUG(", Slot 0 %s\n", atecc.slot0LockStatus ? "Locked" : "Unlocked"); if (atecc.configLockStatus && atecc.dataOTPLockStatus && atecc.slot0LockStatus) { if (atecc.generatePublicKey() == false) { LOG_DEBUG("ATECC608B Error generating public key\n"); } else { LOG_DEBUG("ATECC608B Public Key: "); - for (int i = 0 ; i < 64 ; i++) { - LOG_DEBUG("%02x",atecc.publicKey64Bytes[i]); + for (int i = 0; i < 64; i++) { + LOG_DEBUG("%02x", atecc.publicKey64Bytes[i]); } LOG_DEBUG("\n"); } @@ -44,7 +44,8 @@ void printATECCInfo() #endif } -uint16_t getRegisterValue(uint8_t address, uint8_t reg, uint8_t length) { +uint16_t getRegisterValue(uint8_t address, uint8_t reg, uint8_t length) +{ uint16_t value = 0x00; Wire.beginTransmission(address); Wire.write(reg); @@ -54,7 +55,7 @@ uint16_t getRegisterValue(uint8_t address, uint8_t reg, uint8_t length) { LOG_DEBUG("Wire.available() = %d\n", Wire.available()); if (Wire.available() == 2) { // Read MSB, then LSB - value = (uint16_t)Wire.read() << 8; + value = (uint16_t)Wire.read() << 8; value |= Wire.read(); } else if (Wire.available()) { value = Wire.read(); @@ -81,7 +82,7 @@ uint8_t oled_probe(byte addr) if (r == 0x08 || r == 0x00) { o_probe = 2; // SH1106 - } else if ( r == 0x03 || r == 0x04 || r == 0x06 || r == 0x07) { + } else if (r == 0x03 || r == 0x04 || r == 0x06 || r == 0x07) { o_probe = 1; // SSD1306 } c++; @@ -126,17 +127,17 @@ void scanI2Cdevice() } #endif #ifdef RV3028_RTC - if (addr == RV3028_RTC){ + if (addr == RV3028_RTC) { rtc_found = addr; LOG_INFO("RV3028 RTC found\n"); Melopero_RV3028 rtc; rtc.initI2C(); - rtc.writeToRegister(0x35,0x07); // no Clkout - rtc.writeToRegister(0x37,0xB4); + rtc.writeToRegister(0x35, 0x07); // no Clkout + rtc.writeToRegister(0x37, 0xB4); } #endif #ifdef PCF8563_RTC - if (addr == PCF8563_RTC){ + if (addr == PCF8563_RTC) { rtc_found = addr; LOG_INFO("PCF8563 RTC found\n"); } @@ -225,7 +226,7 @@ void scanI2Cdevice() if (nDevices == 0) LOG_INFO("No I2C devices found\n"); else - LOG_INFO("%i I2C devices found\n",nDevices); + LOG_INFO("%i I2C devices found\n", nDevices); } #else void scanI2Cdevice() {} diff --git a/src/error.h b/src/error.h index 4c309e395..087215b1d 100644 --- a/src/error.h +++ b/src/error.h @@ -8,4 +8,5 @@ #define RECORD_CRITICALERROR(code) recordCriticalError(code, __LINE__, __FILE__) /// Record an error that should be reported via analytics -void recordCriticalError(CriticalErrorCode code = CriticalErrorCode_UNSPECIFIED, uint32_t address = 0, const char *filename = NULL); +void recordCriticalError(CriticalErrorCode code = CriticalErrorCode_UNSPECIFIED, uint32_t address = 0, + const char *filename = NULL); diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index ad09368c4..abaeec660 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -34,8 +34,8 @@ along with this program. If not, see . #include "mesh-pb-constants.h" #include "mesh/Channels.h" #include "mesh/generated/meshtastic/deviceonly.pb.h" -#include "modules/TextMessageModule.h" #include "modules/ExternalNotificationModule.h" +#include "modules/TextMessageModule.h" #include "sleep.h" #include "target_specific.h" #include "utils.h" @@ -69,7 +69,7 @@ static uint32_t targetFramerate = IDLE_FRAMERATE; static char btPIN[16] = "888888"; uint32_t logo_timeout = 5000; // 4 seconds for EACH logo - + // This image definition is here instead of images.h because it's modified dynamically by the drawBattery function uint8_t imgBattery[16] = {0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xE7, 0x3C}; @@ -97,9 +97,9 @@ static uint16_t displayWidth, displayHeight; #if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) // The screen is bigger so use bigger fonts -#define FONT_SMALL ArialMT_Plain_16 // Height: 19 +#define FONT_SMALL ArialMT_Plain_16 // Height: 19 #define FONT_MEDIUM ArialMT_Plain_24 // Height: 28 -#define FONT_LARGE ArialMT_Plain_24 // Height: 28 +#define FONT_LARGE ArialMT_Plain_24 // Height: 28 #else #ifdef OLED_RU #define FONT_SMALL ArialMT_Plain_10_RU @@ -107,7 +107,7 @@ static uint16_t displayWidth, displayHeight; #define FONT_SMALL ArialMT_Plain_10 // Height: 13 #endif #define FONT_MEDIUM ArialMT_Plain_16 // Height: 19 -#define FONT_LARGE ArialMT_Plain_24 // Height: 28 +#define FONT_LARGE ArialMT_Plain_24 // Height: 28 #endif #define fontHeight(font) ((font)[1] + 1) // height is position 1 @@ -118,7 +118,6 @@ static uint16_t displayWidth, displayHeight; #define getStringCenteredX(s) ((SCREEN_WIDTH - display->getStringWidth(s)) / 2) - /** * Draw the icon with extra info printed around the corners */ @@ -236,7 +235,7 @@ static void drawWelcomeScreen(OLEDDisplay *display, OLEDDisplayUiState *state, i display->drawString(64 + x, y, "//\\ E S H T /\\ S T / C"); display->drawString(64 + x, y + FONT_HEIGHT_SMALL, getDeviceName()); display->setTextAlignment(TEXT_ALIGN_LEFT); - + if ((millis() / 10000) % 2) { display->drawString(x, y + FONT_HEIGHT_SMALL * 2 - 3, "Set the region using the"); display->drawString(x, y + FONT_HEIGHT_SMALL * 3 - 3, "Meshtastic Android, iOS,"); @@ -292,7 +291,7 @@ static void drawFrameBluetooth(OLEDDisplay *display, OLEDDisplayUiState *state, display->drawString(x_offset + x, y_offset + y, "Bluetooth"); display->setFont(FONT_SMALL); - y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_MEDIUM -4 : y_offset + FONT_HEIGHT_MEDIUM + 5; + y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_MEDIUM - 4 : y_offset + FONT_HEIGHT_MEDIUM + 5; display->drawString(x_offset + x, y_offset + y, "Enter this code"); display->setFont(FONT_LARGE); @@ -302,7 +301,7 @@ static void drawFrameBluetooth(OLEDDisplay *display, OLEDDisplayUiState *state, display->drawString(x_offset + x, y_offset + y, pin); display->setFont(FONT_SMALL); - String deviceName = "Name: "; + String deviceName = "Name: "; deviceName.concat(getDeviceName()); y_offset = display->height() == 64 ? y_offset + FONT_HEIGHT_LARGE - 6 : y_offset + FONT_HEIGHT_LARGE + 5; display->drawString(x_offset + x, y_offset + y, deviceName); @@ -332,7 +331,8 @@ static void drawFrameFirmware(OLEDDisplay *display, OLEDDisplayUiState *state, i display->setFont(FONT_SMALL); display->setTextAlignment(TEXT_ALIGN_LEFT); - display->drawStringMaxWidth(0 + x, 2 + y + FONT_HEIGHT_SMALL *2, x + display->getWidth(), "Please be patient and do not power off."); + display->drawStringMaxWidth(0 + x, 2 + y + FONT_HEIGHT_SMALL * 2, x + display->getWidth(), + "Please be patient and do not power off."); } /// Draw the last text message we received @@ -354,8 +354,7 @@ static void drawCriticalFaultFrame(OLEDDisplay *display, OLEDDisplayUiState *sta // Ignore messages orginating from phone (from the current node 0x0) unless range test or store and forward module are enabled static bool shouldDrawMessage(const MeshPacket *packet) { - return packet->from != 0 && !moduleConfig.range_test.enabled && - !moduleConfig.store_forward.enabled; + return packet->from != 0 && !moduleConfig.range_test.enabled && !moduleConfig.store_forward.enabled; } /// Draw the last text message we received @@ -381,7 +380,7 @@ static void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state display->setColor(BLACK); } display->drawStringf(0 + x, 0 + y, tempBuf, "From: %s", (node && node->has_user) ? node->user.short_name : "???"); - if(config.display.heading_bold) { + if (config.display.heading_bold) { display->drawStringf(1 + x, 0 + y, tempBuf, "From: %s", (node && node->has_user) ? node->user.short_name : "???"); } display->setColor(WHITE); @@ -477,7 +476,7 @@ static void drawNodes(OLEDDisplay *display, int16_t x, int16_t y, NodeStatus *no display->drawFastImage(x, y, 8, 8, imgUser); #endif display->drawString(x + 10, y - 2, usersString); - if(config.display.heading_bold) + if (config.display.heading_bold) display->drawString(x + 11, y - 2, usersString); } @@ -487,20 +486,20 @@ static void drawGPS(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus if (config.position.fixed_position) { // GPS coordinates are currently fixed display->drawString(x - 1, y - 2, "Fixed GPS"); - if(config.display.heading_bold) + if (config.display.heading_bold) display->drawString(x, y - 2, "Fixed GPS"); return; } if (!gps->getIsConnected()) { display->drawString(x, y - 2, "No GPS"); - if(config.display.heading_bold) + if (config.display.heading_bold) display->drawString(x + 1, y - 2, "No GPS"); return; } display->drawFastImage(x, y, 6, 8, gps->getHasLock() ? imgPositionSolid : imgPositionEmpty); if (!gps->getHasLock()) { display->drawString(x + 8, y - 2, "No sats"); - if(config.display.heading_bold) + if (config.display.heading_bold) display->drawString(x + 9, y - 2, "No sats"); return; } else { @@ -523,24 +522,24 @@ static void drawGPS(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus // Draw the number of satellites snprintf(satsString, sizeof(satsString), "%u", gps->getNumSatellites()); display->drawString(x + 34, y - 2, satsString); - if(config.display.heading_bold) + if (config.display.heading_bold) display->drawString(x + 35, y - 2, satsString); } } -//Draw status when gps is disabled by PMU +// Draw status when gps is disabled by PMU static void drawGPSpowerstat(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus *gps) { -#ifdef HAS_PMU +#ifdef HAS_PMU String displayLine = "GPS disabled"; int16_t xPos = display->getStringWidth(displayLine); - if (!config.position.gps_enabled){ + if (!config.position.gps_enabled) { display->drawString(x + xPos, y, displayLine); -#ifdef GPS_POWER_TOGGLE +#ifdef GPS_POWER_TOGGLE display->drawString(x + xPos, y - 2 + FONT_HEIGHT_SMALL, " by button"); #endif - //display->drawString(x + xPos, y + 2, displayLine); + // display->drawString(x + xPos, y + 2, displayLine); } #endif } @@ -582,22 +581,23 @@ static void drawGPScoordinates(OLEDDisplay *display, int16_t x, int16_t y, const if (gpsFormat != Config_DisplayConfig_GpsCoordinateFormat_DMS) { char coordinateLine[22]; if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_DEC) { // Decimal Degrees - snprintf(coordinateLine, sizeof(coordinateLine), "%f %f", geoCoord.getLatitude() * 1e-7, geoCoord.getLongitude() * 1e-7); + snprintf(coordinateLine, sizeof(coordinateLine), "%f %f", geoCoord.getLatitude() * 1e-7, + geoCoord.getLongitude() * 1e-7); } else if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_UTM) { // Universal Transverse Mercator snprintf(coordinateLine, sizeof(coordinateLine), "%2i%1c %06u %07u", geoCoord.getUTMZone(), geoCoord.getUTMBand(), - geoCoord.getUTMEasting(), geoCoord.getUTMNorthing()); + geoCoord.getUTMEasting(), geoCoord.getUTMNorthing()); } else if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_MGRS) { // Military Grid Reference System - snprintf(coordinateLine, sizeof(coordinateLine), "%2i%1c %1c%1c %05u %05u", geoCoord.getMGRSZone(), geoCoord.getMGRSBand(), - geoCoord.getMGRSEast100k(), geoCoord.getMGRSNorth100k(), geoCoord.getMGRSEasting(), - geoCoord.getMGRSNorthing()); + snprintf(coordinateLine, sizeof(coordinateLine), "%2i%1c %1c%1c %05u %05u", geoCoord.getMGRSZone(), + geoCoord.getMGRSBand(), geoCoord.getMGRSEast100k(), geoCoord.getMGRSNorth100k(), + geoCoord.getMGRSEasting(), geoCoord.getMGRSNorthing()); } else if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_OLC) { // Open Location Code geoCoord.getOLCCode(coordinateLine); - } else if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_OSGR) { // Ordnance Survey Grid Reference + } else if (gpsFormat == Config_DisplayConfig_GpsCoordinateFormat_OSGR) { // Ordnance Survey Grid Reference if (geoCoord.getOSGRE100k() == 'I' || geoCoord.getOSGRN100k() == 'I') // OSGR is only valid around the UK region snprintf(coordinateLine, sizeof(coordinateLine), "%s", "Out of Boundary"); else - snprintf(coordinateLine, sizeof(coordinateLine), "%1c%1c %05u %05u", geoCoord.getOSGRE100k(), geoCoord.getOSGRN100k(), - geoCoord.getOSGREasting(), geoCoord.getOSGRNorthing()); + snprintf(coordinateLine, sizeof(coordinateLine), "%1c%1c %05u %05u", geoCoord.getOSGRE100k(), + geoCoord.getOSGRN100k(), geoCoord.getOSGREasting(), geoCoord.getOSGRNorthing()); } // If fixed position, display text "Fixed GPS" alternating with the coordinates. @@ -614,10 +614,10 @@ static void drawGPScoordinates(OLEDDisplay *display, int16_t x, int16_t y, const } else { char latLine[22]; char lonLine[22]; - snprintf(latLine, sizeof(latLine), "%2i° %2i' %2u\" %1c", geoCoord.getDMSLatDeg(), geoCoord.getDMSLatMin(), geoCoord.getDMSLatSec(), - geoCoord.getDMSLatCP()); - snprintf(lonLine, sizeof(lonLine), "%3i° %2i' %2u\" %1c", geoCoord.getDMSLonDeg(), geoCoord.getDMSLonMin(), geoCoord.getDMSLonSec(), - geoCoord.getDMSLonCP()); + snprintf(latLine, sizeof(latLine), "%2i° %2i' %2u\" %1c", geoCoord.getDMSLatDeg(), geoCoord.getDMSLatMin(), + geoCoord.getDMSLatSec(), geoCoord.getDMSLatCP()); + snprintf(lonLine, sizeof(lonLine), "%3i° %2i' %2u\" %1c", geoCoord.getDMSLonDeg(), geoCoord.getDMSLonMin(), + geoCoord.getDMSLonSec(), geoCoord.getDMSLonCP()); display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(latLine))) / 2, y - FONT_HEIGHT_SMALL * 1, latLine); display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(lonLine))) / 2, y, lonLine); } @@ -653,8 +653,8 @@ class Point void scale(float f) { - //We use -f here to counter the flip that happens - //on the y axis when drawing and rotating on screen + // We use -f here to counter the flip that happens + // on the y axis when drawing and rotating on screen x *= f; y *= -f; } @@ -713,7 +713,7 @@ static uint16_t getCompassDiam(OLEDDisplay *display) offset = FONT_HEIGHT_SMALL; // get the smaller of the 2 dimensions and subtract 20 - if(display->getWidth() > (display->getHeight() - offset)) { + if (display->getWidth() > (display->getHeight() - offset)) { diam = display->getHeight() - offset; // if 2/3 of the other size would be smaller, use that if (diam > (display->getWidth() * 2 / 3)) { @@ -725,7 +725,7 @@ static uint16_t getCompassDiam(OLEDDisplay *display) diam = (display->getHeight() - offset) * 2 / 3; } } - + return diam - 20; }; @@ -756,10 +756,10 @@ static void drawNodeHeading(OLEDDisplay *display, int16_t compassX, int16_t comp // Draw north static void drawCompassNorth(OLEDDisplay *display, int16_t compassX, int16_t compassY, float myHeading) { - //If north is supposed to be at the top of the compass we want rotation to be +0 - if(config.display.compass_north_top) + // If north is supposed to be at the top of the compass we want rotation to be +0 + if (config.display.compass_north_top) myHeading = -0; - + Point N1(-0.04f, 0.65f), N2(0.04f, 0.65f); Point N3(-0.04f, 0.55f), N4(0.04f, 0.55f); Point *rosePoints[] = {&N1, &N2, &N3, &N4}; @@ -874,7 +874,7 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_ GeoCoord::bearing(DegD(op.latitude_i), DegD(op.longitude_i), DegD(p.latitude_i), DegD(p.longitude_i)); // If the top of the compass is a static north then bearingToOther can be drawn on the compass directly // If the top of the compass is not a static north we need adjust bearingToOther based on heading - if(!config.display.compass_north_top) + if (!config.display.compass_north_top) bearingToOther -= myHeading; drawNodeHeading(display, compassX, compassY, bearingToOther); } @@ -1000,8 +1000,8 @@ void Screen::setup() #ifdef SCREEN_MIRROR dispdev.mirrorScreen(); #else - // Standard behaviour is to FLIP the screen (needed on T-Beam). If this config item is set, unflip it, and thereby logically flip it. - // If you have a headache now, you're welcome. + // Standard behaviour is to FLIP the screen (needed on T-Beam). If this config item is set, unflip it, and thereby logically + // flip it. If you have a headache now, you're welcome. if (!config.display.flip_screen) { dispdev.flipScreenVertically(); } @@ -1071,7 +1071,7 @@ int32_t Screen::runOnce() static const int bootOEMFrameCount = sizeof(bootOEMFrames) / sizeof(bootOEMFrames[0]); ui.setFrames(bootOEMFrames, bootOEMFrameCount); ui.update(); -#ifndef USE_EINK +#ifndef USE_EINK ui.update(); #endif showingOEMBootScreen = false; @@ -1414,7 +1414,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 // Display power status if (powerStatus->getHasBattery()) { if (config.display.displaymode == Config_DisplayConfig_DisplayMode_DEFAULT) { - drawBattery(display, x , y + 2, imgBattery, powerStatus); + drawBattery(display, x, y + 2, imgBattery, powerStatus); } else { drawBattery(display, x + 1, y + 3, imgBattery, powerStatus); } @@ -1432,7 +1432,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 drawNodes(display, x + (SCREEN_WIDTH * 0.25), y + 3, nodeStatus); } // Display GPS status - if (!config.position.gps_enabled){ + if (!config.position.gps_enabled) { int16_t yPos = y + 2; #ifdef GPS_POWER_TOGGLE yPos = (y + 10 + FONT_HEIGHT_SMALL); @@ -1451,27 +1451,36 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 display->drawString(x, y + FONT_HEIGHT_SMALL, channelStr); // Draw our hardware ID to assist with bluetooth pairing. Either prefix with Info or S&F Logo if (moduleConfig.store_forward.enabled) { -#ifdef ARCH_ESP32 - if (millis() - storeForwardModule->lastHeartbeat > (storeForwardModule->heartbeatInterval * 1200)) { //no heartbeat, overlap a bit +#ifdef ARCH_ESP32 + if (millis() - storeForwardModule->lastHeartbeat > + (storeForwardModule->heartbeatInterval * 1200)) { // no heartbeat, overlap a bit #if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) - display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, imgQuestionL1); - display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 12, 8, imgQuestionL2); + display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, + imgQuestionL1); + display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 12, 8, + imgQuestionL2); #else - display->drawFastImage(x + SCREEN_WIDTH - 10 - display->getStringWidth(ourId), y + 2 + FONT_HEIGHT_SMALL, 8, 8, imgQuestion); + display->drawFastImage(x + SCREEN_WIDTH - 10 - display->getStringWidth(ourId), y + 2 + FONT_HEIGHT_SMALL, 8, 8, + imgQuestion); #endif } else { #if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) - display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 16, 8, imgSFL1); - display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 16, 8, imgSFL2); + display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 16, 8, + imgSFL1); + display->drawFastImage(x + SCREEN_WIDTH - 18 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 16, 8, + imgSFL2); #else - display->drawFastImage(x + SCREEN_WIDTH - 13 - display->getStringWidth(ourId), y + 2 + FONT_HEIGHT_SMALL, 11, 8, imgSF); + display->drawFastImage(x + SCREEN_WIDTH - 13 - display->getStringWidth(ourId), y + 2 + FONT_HEIGHT_SMALL, 11, 8, + imgSF); #endif } -#endif +#endif } else { #if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS) - display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, imgInfoL1); - display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 12, 8, imgInfoL2); + display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 3 + FONT_HEIGHT_SMALL, 12, 8, + imgInfoL1); + display->drawFastImage(x + SCREEN_WIDTH - 14 - display->getStringWidth(ourId), y + 11 + FONT_HEIGHT_SMALL, 12, 8, + imgInfoL2); #else display->drawFastImage(x + SCREEN_WIDTH - 10 - display->getStringWidth(ourId), y + 2 + FONT_HEIGHT_SMALL, 8, 8, imgInfo); #endif @@ -1510,16 +1519,16 @@ void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, i if (WiFi.status() != WL_CONNECTED) { display->drawString(x, y, String("WiFi: Not Connected")); - if(config.display.heading_bold) + if (config.display.heading_bold) display->drawString(x + 1, y, String("WiFi: Not Connected")); } else { display->drawString(x, y, String("WiFi: Connected")); - if(config.display.heading_bold) + if (config.display.heading_bold) display->drawString(x + 1, y, String("WiFi: Connected")); display->drawString(x + SCREEN_WIDTH - display->getStringWidth("RSSI " + String(WiFi.RSSI())), y, "RSSI " + String(WiFi.RSSI())); - if(config.display.heading_bold) { + if (config.display.heading_bold) { display->drawString(x + SCREEN_WIDTH - display->getStringWidth("RSSI " + String(WiFi.RSSI())) - 1, y, "RSSI " + String(WiFi.RSSI())); } @@ -1650,12 +1659,12 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat // Line 1 display->drawString(x, y, batStr); - if(config.display.heading_bold) + if (config.display.heading_bold) display->drawString(x + 1, y, batStr); } else { // Line 1 display->drawString(x, y, String("USB")); - if(config.display.heading_bold) + if (config.display.heading_bold) display->drawString(x + 1, y, String("USB")); } @@ -1689,7 +1698,7 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat } display->drawString(x + SCREEN_WIDTH - display->getStringWidth(mode), y, mode); - if(config.display.heading_bold) + if (config.display.heading_bold) display->drawString(x + SCREEN_WIDTH - display->getStringWidth(mode) - 1, y, mode); // Line 2 @@ -1740,17 +1749,16 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat char chUtil[13]; snprintf(chUtil, sizeof(chUtil), "ChUtil %2.0f%%", airTime->channelUtilizationPercent()); display->drawString(x + SCREEN_WIDTH - display->getStringWidth(chUtil), y + FONT_HEIGHT_SMALL * 1, chUtil); -if (config.position.gps_enabled) { - // Line 3 - if (config.display.gps_format != - Config_DisplayConfig_GpsCoordinateFormat_DMS) // if DMS then don't draw altitude - drawGPSAltitude(display, x, y + FONT_HEIGHT_SMALL * 2, gpsStatus); + if (config.position.gps_enabled) { + // Line 3 + if (config.display.gps_format != Config_DisplayConfig_GpsCoordinateFormat_DMS) // if DMS then don't draw altitude + drawGPSAltitude(display, x, y + FONT_HEIGHT_SMALL * 2, gpsStatus); - // Line 4 - drawGPScoordinates(display, x, y + FONT_HEIGHT_SMALL * 3, gpsStatus); -} else { - drawGPSpowerstat(display, x - (SCREEN_WIDTH / 4), y + FONT_HEIGHT_SMALL * 2, gpsStatus); -} + // Line 4 + drawGPScoordinates(display, x, y + FONT_HEIGHT_SMALL * 3, gpsStatus); + } else { + drawGPSpowerstat(display, x - (SCREEN_WIDTH / 4), y + FONT_HEIGHT_SMALL * 2, gpsStatus); + } /* Display a heartbeat pixel that blinks every time the frame is redrawn */ #ifdef SHOW_REDRAWS if (heartbeat) diff --git a/src/main.h b/src/main.h index 1e02d7c79..27aa06d6c 100644 --- a/src/main.h +++ b/src/main.h @@ -1,11 +1,11 @@ #pragma once -#include #include "GPSStatus.h" #include "NodeStatus.h" #include "PowerStatus.h" #include "graphics/Screen.h" #include "mesh/generated/meshtastic/telemetry.pb.h" +#include #if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) #include #endif diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index f0b6edff1..7c5781879 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -157,7 +157,7 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) if (info) { LOG_INFO("Sending nodeinfo: num=0x%x, lastseen=%u, id=%s, name=%s\n", info->num, info->last_heard, info->user.id, - info->user.long_name); + info->user.long_name); fromRadioScratch.which_payload_variant = FromRadio_node_info_tag; fromRadioScratch.node_info = *info; // Stay in current state until done sending nodeinfos @@ -364,7 +364,7 @@ bool PhoneAPI::available() case STATE_SEND_MODULECONFIG: case STATE_SEND_COMPLETE_ID: return true; - + case STATE_SEND_NODEINFO: if (!nodeInfoForPhone) nodeInfoForPhone = nodeDB.readNextInfo(); diff --git a/src/mesh/PhoneAPI.h b/src/mesh/PhoneAPI.h index ff1e7347c..bed917af2 100644 --- a/src/mesh/PhoneAPI.h +++ b/src/mesh/PhoneAPI.h @@ -16,14 +16,15 @@ * Eventually there should be once instance of this class for each live connection (because it has a bit of state * for that connection) */ -class PhoneAPI : public Observer // FIXME, we shouldn't be inheriting from Observer, instead use CallbackObserver as a member +class PhoneAPI + : public Observer // FIXME, we shouldn't be inheriting from Observer, instead use CallbackObserver as a member { enum State { - STATE_SEND_NOTHING, // Initial state, don't send anything until the client starts asking for config - STATE_SEND_MY_INFO, // send our my info record - STATE_SEND_NODEINFO, // states progress in this order as the device sends to to the client - STATE_SEND_CHANNELS, // Send all channels - STATE_SEND_CONFIG, // Replacement for the old Radioconfig + STATE_SEND_NOTHING, // Initial state, don't send anything until the client starts asking for config + STATE_SEND_MY_INFO, // send our my info record + STATE_SEND_NODEINFO, // states progress in this order as the device sends to to the client + STATE_SEND_CHANNELS, // Send all channels + STATE_SEND_CONFIG, // Replacement for the old Radioconfig STATE_SEND_MODULECONFIG, // Send Module specific config STATE_SEND_COMPLETE_ID, STATE_SEND_PACKETS // send packets or debug strings @@ -65,7 +66,7 @@ class PhoneAPI : public Observer // FIXME, we shouldn't be inheriting // Call this when the client drops the connection, resets the state to STATE_SEND_NOTHING // Unregisters our observer. A closed connection **can** be reopened by calling init again. virtual void close(); - + /** * Handle a ToRadio protobuf * @return true true if a packet was queued for sending (so that caller can yield) @@ -95,7 +96,7 @@ class PhoneAPI : public Observer // FIXME, we shouldn't be inheriting /** the last msec we heard from the client on the other side of this link */ uint32_t lastContactMsec = 0; - + /// Hookable to find out when connection changes virtual void onConnectionChanged(bool connected) {} diff --git a/src/mesh/mesh-pb-constants.h b/src/mesh/mesh-pb-constants.h index 2b0f7bd06..aadfe1f54 100644 --- a/src/mesh/mesh-pb-constants.h +++ b/src/mesh/mesh-pb-constants.h @@ -1,9 +1,9 @@ #pragma once -#include "mesh/generated/meshtastic/mesh.pb.h" -#include "mesh/generated/meshtastic/localonly.pb.h" -#include "mesh/generated/meshtastic/deviceonly.pb.h" #include "mesh/generated/meshtastic/admin.pb.h" +#include "mesh/generated/meshtastic/deviceonly.pb.h" +#include "mesh/generated/meshtastic/localonly.pb.h" +#include "mesh/generated/meshtastic/mesh.pb.h" // this file defines constants which come from mesh.options @@ -11,8 +11,8 @@ #define member_size(type, member) sizeof(((type *)0)->member) /// max number of packets which can be waiting for delivery to android - note, this value comes from mesh.options protobuf -// FIXME - max_count is actually 32 but we save/load this as one long string of preencoded MeshPacket bytes - not a big array in RAM -// #define MAX_RX_TOPHONE (member_size(DeviceState, receive_queue) / member_size(DeviceState, receive_queue[0])) +// FIXME - max_count is actually 32 but we save/load this as one long string of preencoded MeshPacket bytes - not a big array in +// RAM #define MAX_RX_TOPHONE (member_size(DeviceState, receive_queue) / member_size(DeviceState, receive_queue[0])) #define MAX_RX_TOPHONE 32 /// max number of nodes allowed in the mesh @@ -36,7 +36,7 @@ bool writecb(pb_ostream_t *stream, const uint8_t *buf, size_t count); /** is_in_repeated is a macro/function that returns true if a specified word appears in a repeated protobuf array. * It relies on the following naming conventions from nanopb: - * + * * pb_size_t ignore_incoming_count; * uint32_t ignore_incoming[3]; */ diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 6e85a8c71..5e1550893 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -2,8 +2,8 @@ #if HAS_SCREEN #include "CannedMessageModule.h" #include "FSCommon.h" -#include "NodeDB.h" #include "MeshService.h" +#include "NodeDB.h" #include "PowerFSM.h" // neede for button bypass #include "mesh/generated/meshtastic/cannedmessages.pb.h" @@ -149,10 +149,10 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) this->lastTouchMillis = 0; validEvent = true; } - if ((event->inputEvent == static_cast(ModuleConfig_CannedMessageConfig_InputEventChar_BACK)) || + if ((event->inputEvent == static_cast(ModuleConfig_CannedMessageConfig_InputEventChar_BACK)) || (event->inputEvent == static_cast(ModuleConfig_CannedMessageConfig_InputEventChar_LEFT)) || (event->inputEvent == static_cast(ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT))) { - LOG_DEBUG("Canned message event (%x)\n",event->kbchar); + LOG_DEBUG("Canned message event (%x)\n", event->kbchar); if (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) { // pass the pressed key this->payload = event->kbchar; @@ -163,7 +163,8 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) if (event->inputEvent == static_cast(ANYKEY)) { LOG_DEBUG("Canned message event any key pressed\n"); // when inactive, this will switch to the freetext mode - if ((this->runState == CANNED_MESSAGE_RUN_STATE_INACTIVE) || (this->runState == CANNED_MESSAGE_RUN_STATE_ACTIVE) || (this->runState == CANNED_MESSAGE_RUN_STATE_DISABLED)) { + if ((this->runState == CANNED_MESSAGE_RUN_STATE_INACTIVE) || (this->runState == CANNED_MESSAGE_RUN_STATE_ACTIVE) || + (this->runState == CANNED_MESSAGE_RUN_STATE_DISABLED)) { this->runState = CANNED_MESSAGE_RUN_STATE_FREETEXT; } // pass the pressed key @@ -176,7 +177,7 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) // this will send the text immediately on matrix press this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT; this->payload = MATRIXKEY; - this->currentMessageIndex = event->kbchar -1; + this->currentMessageIndex = event->kbchar - 1; this->lastTouchMillis = millis(); validEvent = true; } @@ -224,7 +225,8 @@ int32_t CannedMessageModule::runOnce() this->cursor = 0; this->destSelect = false; this->notifyObservers(&e); - } else if (((this->runState == CANNED_MESSAGE_RUN_STATE_ACTIVE) || (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT)) && ((millis() - this->lastTouchMillis) > INACTIVATE_AFTER_MS)) { + } else if (((this->runState == CANNED_MESSAGE_RUN_STATE_ACTIVE) || (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT)) && + ((millis() - this->lastTouchMillis) > INACTIVATE_AFTER_MS)) { // Reset module LOG_DEBUG("Reset due to lack of activity.\n"); e.frameChanged = true; @@ -245,7 +247,7 @@ int32_t CannedMessageModule::runOnce() } } else { if ((this->messagesCount > this->currentMessageIndex) && (strlen(this->messages[this->currentMessageIndex]) > 0)) { - if(strcmp (this->messages[this->currentMessageIndex], "~") == 0) { + if (strcmp(this->messages[this->currentMessageIndex], "~") == 0) { powerFSM.trigger(EVENT_PRESS); return INT32_MAX; } else { @@ -264,7 +266,7 @@ int32_t CannedMessageModule::runOnce() this->destSelect = false; this->notifyObservers(&e); return 2000; - } else if ((this->runState != CANNED_MESSAGE_RUN_STATE_FREETEXT) && (this->currentMessageIndex == -1)) { + } else if ((this->runState != CANNED_MESSAGE_RUN_STATE_FREETEXT) && (this->currentMessageIndex == -1)) { this->currentMessageIndex = 0; LOG_DEBUG("First touch (%d):%s\n", this->currentMessageIndex, this->getCurrentMessage()); e.frameChanged = true; @@ -290,81 +292,81 @@ int32_t CannedMessageModule::runOnce() } else if (this->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) { e.frameChanged = true; switch (this->payload) { - case 0xb4: // left - if (this->destSelect){ - size_t numNodes = nodeDB.getNumNodes(); - if(this->dest == NODENUM_BROADCAST) { - this->dest = nodeDB.getNodeNum(); - } - for (unsigned int i = 0; i < numNodes; i++) { - if (nodeDB.getNodeByIndex(i)->num == this->dest) { - this->dest = (i > 0) ? nodeDB.getNodeByIndex(i-1)->num : nodeDB.getNodeByIndex(numNodes-1)->num; - break; - } - } - if(this->dest == nodeDB.getNodeNum()) { - this->dest = NODENUM_BROADCAST; - } - }else{ - if (this->cursor > 0) { - this->cursor--; + case 0xb4: // left + if (this->destSelect) { + size_t numNodes = nodeDB.getNumNodes(); + if (this->dest == NODENUM_BROADCAST) { + this->dest = nodeDB.getNodeNum(); + } + for (unsigned int i = 0; i < numNodes; i++) { + if (nodeDB.getNodeByIndex(i)->num == this->dest) { + this->dest = (i > 0) ? nodeDB.getNodeByIndex(i - 1)->num : nodeDB.getNodeByIndex(numNodes - 1)->num; + break; } } - break; - case 0xb7: // right - if (this->destSelect){ - size_t numNodes = nodeDB.getNumNodes(); - if(this->dest == NODENUM_BROADCAST) { - this->dest = nodeDB.getNodeNum(); - } - for (unsigned int i = 0; i < numNodes; i++) { - if (nodeDB.getNodeByIndex(i)->num == this->dest) { - this->dest = (i < numNodes-1) ? nodeDB.getNodeByIndex(i+1)->num : nodeDB.getNodeByIndex(0)->num; - break; - } - } - if(this->dest == nodeDB.getNodeNum()) { - this->dest = NODENUM_BROADCAST; - } - }else{ - if (this->cursor < this->freetext.length()) { - this->cursor++; - } + if (this->dest == nodeDB.getNodeNum()) { + this->dest = NODENUM_BROADCAST; } - break; - case 0x08: // backspace - if (this->freetext.length() > 0) { - if(this->cursor == this->freetext.length()) { - this->freetext = this->freetext.substring(0, this->freetext.length() - 1); - } else { - this->freetext = this->freetext.substring(0, this->cursor - 1) + this->freetext.substring(this->cursor, this->freetext.length()); - } + } else { + if (this->cursor > 0) { this->cursor--; } - break; - case 0x09: // tab - if(this->destSelect) { - this->destSelect = false; + } + break; + case 0xb7: // right + if (this->destSelect) { + size_t numNodes = nodeDB.getNumNodes(); + if (this->dest == NODENUM_BROADCAST) { + this->dest = nodeDB.getNodeNum(); + } + for (unsigned int i = 0; i < numNodes; i++) { + if (nodeDB.getNodeByIndex(i)->num == this->dest) { + this->dest = (i < numNodes - 1) ? nodeDB.getNodeByIndex(i + 1)->num : nodeDB.getNodeByIndex(0)->num; + break; + } + } + if (this->dest == nodeDB.getNodeNum()) { + this->dest = NODENUM_BROADCAST; + } + } else { + if (this->cursor < this->freetext.length()) { + this->cursor++; + } + } + break; + case 0x08: // backspace + if (this->freetext.length() > 0) { + if (this->cursor == this->freetext.length()) { + this->freetext = this->freetext.substring(0, this->freetext.length() - 1); } else { - this->destSelect = true; + this->freetext = this->freetext.substring(0, this->cursor - 1) + + this->freetext.substring(this->cursor, this->freetext.length()); } - break; - default: - if(this->cursor == this->freetext.length()) { - this->freetext += this->payload; - } else { - this->freetext = this->freetext.substring(0, this->cursor) - + this->payload - + this->freetext.substring(this->cursor); - } - this->cursor += 1; - if (this->freetext.length() > Constants_DATA_PAYLOAD_LEN) { - this->cursor = Constants_DATA_PAYLOAD_LEN; - this->freetext = this->freetext.substring(0, Constants_DATA_PAYLOAD_LEN); - } - break; + this->cursor--; + } + break; + case 0x09: // tab + if (this->destSelect) { + this->destSelect = false; + } else { + this->destSelect = true; + } + break; + default: + if (this->cursor == this->freetext.length()) { + this->freetext += this->payload; + } else { + this->freetext = + this->freetext.substring(0, this->cursor) + this->payload + this->freetext.substring(this->cursor); + } + this->cursor += 1; + if (this->freetext.length() > Constants_DATA_PAYLOAD_LEN) { + this->cursor = Constants_DATA_PAYLOAD_LEN; + this->freetext = this->freetext.substring(0, Constants_DATA_PAYLOAD_LEN); + } + break; } - + this->lastTouchMillis = millis(); this->notifyObservers(&e); return INACTIVATE_AFTER_MS; @@ -376,7 +378,7 @@ int32_t CannedMessageModule::runOnce() return INACTIVATE_AFTER_MS; } - return INT32_MAX; + return INT32_MAX; } const char *CannedMessageModule::getCurrentMessage() @@ -391,14 +393,15 @@ const char *CannedMessageModule::getNextMessage() { return this->messages[this->getNextIndex()]; } -const char* CannedMessageModule::getNodeName(NodeNum node) { - if (node == NODENUM_BROADCAST){ +const char *CannedMessageModule::getNodeName(NodeNum node) +{ + if (node == NODENUM_BROADCAST) { return "Broadcast"; - }else{ + } else { NodeInfo *info = nodeDB.getNode(node); - if(info != NULL) { + if (info != NULL) { return info->user.long_name; - }else{ + } else { return "Unknown"; } } @@ -444,7 +447,7 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); display->drawString(10 + x, 0 + y + FONT_HEIGHT_SMALL, "Canned Message\nModule disabled."); - }else if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) { + } else if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_FREETEXT) { display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); if (this->destSelect) { @@ -460,7 +463,9 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st display->drawString(x + display->getWidth() - display->getStringWidth(buffer) - 1, y + 0, buffer); } display->setColor(WHITE); - display->drawStringMaxWidth(0 + x, 0 + y + FONT_HEIGHT_SMALL, x + display->getWidth(), cannedMessageModule->drawWithCursor(cannedMessageModule->freetext, cannedMessageModule->cursor)); + display->drawStringMaxWidth( + 0 + x, 0 + y + FONT_HEIGHT_SMALL, x + display->getWidth(), + cannedMessageModule->drawWithCursor(cannedMessageModule->freetext, cannedMessageModule->cursor)); } else { if (this->messagesCount > 0) { display->setTextAlignment(TEXT_ALIGN_LEFT); @@ -479,7 +484,7 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st void CannedMessageModule::loadProtoForModule() { if (!nodeDB.loadProto(cannedMessagesConfigFile, CannedMessageModuleConfig_size, sizeof(CannedMessageModuleConfig), - &CannedMessageModuleConfig_msg, &cannedMessageModuleConfig)) { + &CannedMessageModuleConfig_msg, &cannedMessageModuleConfig)) { installDefaultCannedMessageModuleConfig(); } } @@ -498,8 +503,8 @@ bool CannedMessageModule::saveProtoForModule() FS.mkdir("/prefs"); #endif - okay &= nodeDB.saveProto(cannedMessagesConfigFile, CannedMessageModuleConfig_size, - &CannedMessageModuleConfig_msg, &cannedMessageModuleConfig); + okay &= nodeDB.saveProto(cannedMessagesConfigFile, CannedMessageModuleConfig_size, &CannedMessageModuleConfig_msg, + &cannedMessageModuleConfig); return okay; } @@ -549,13 +554,13 @@ AdminMessageHandleResult CannedMessageModule::handleAdminMessageForModule(const void CannedMessageModule::handleGetCannedMessageModuleMessages(const MeshPacket &req, AdminMessage *response) { LOG_DEBUG("*** handleGetCannedMessageModuleMessages\n"); - if(req.decoded.want_response) { + if (req.decoded.want_response) { response->which_payload_variant = AdminMessage_get_canned_message_module_messages_response_tag; - strncpy(response->get_canned_message_module_messages_response, cannedMessageModuleConfig.messages, sizeof(response->get_canned_message_module_messages_response)); + strncpy(response->get_canned_message_module_messages_response, cannedMessageModuleConfig.messages, + sizeof(response->get_canned_message_module_messages_response)); } // Don't send anything if not instructed to. Better than asserting. } - void CannedMessageModule::handleSetCannedMessageModuleMessages(const char *from_msg) { int changed = 0; @@ -573,9 +578,7 @@ void CannedMessageModule::handleSetCannedMessageModuleMessages(const char *from_ String CannedMessageModule::drawWithCursor(String text, int cursor) { - String result = text.substring(0, cursor) - + "_" - + text.substring(cursor); + String result = text.substring(0, cursor) + "_" + text.substring(cursor); return result; } diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index 05776bd44..1e379b65c 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -58,19 +58,19 @@ int32_t ExternalNotificationModule::runOnce() // If the output is turned on, turn it back off after the given period of time. if (isNagging) { - if (externalTurnedOn[0] + (moduleConfig.external_notification.output_ms - ? moduleConfig.external_notification.output_ms - : EXT_NOTIFICATION_MODULE_OUTPUT_MS) < millis()) { + if (externalTurnedOn[0] + (moduleConfig.external_notification.output_ms ? moduleConfig.external_notification.output_ms + : EXT_NOTIFICATION_MODULE_OUTPUT_MS) < + millis()) { getExternal(0) ? setExternalOff(0) : setExternalOn(0); } - if (externalTurnedOn[1] + (moduleConfig.external_notification.output_ms - ? moduleConfig.external_notification.output_ms - : EXT_NOTIFICATION_MODULE_OUTPUT_MS) < millis()) { + if (externalTurnedOn[1] + (moduleConfig.external_notification.output_ms ? moduleConfig.external_notification.output_ms + : EXT_NOTIFICATION_MODULE_OUTPUT_MS) < + millis()) { getExternal(1) ? setExternalOff(1) : setExternalOn(1); } - if (externalTurnedOn[2] + (moduleConfig.external_notification.output_ms - ? moduleConfig.external_notification.output_ms - : EXT_NOTIFICATION_MODULE_OUTPUT_MS) < millis()) { + if (externalTurnedOn[2] + (moduleConfig.external_notification.output_ms ? moduleConfig.external_notification.output_ms + : EXT_NOTIFICATION_MODULE_OUTPUT_MS) < + millis()) { getExternal(2) ? setExternalOff(2) : setExternalOn(2); } } @@ -93,18 +93,18 @@ void ExternalNotificationModule::setExternalOn(uint8_t index) externalCurrentState[index] = 1; externalTurnedOn[index] = millis(); - switch(index) { - case 1: - if(moduleConfig.external_notification.output_vibra) - digitalWrite(moduleConfig.external_notification.output_vibra, true); - break; - case 2: - if(moduleConfig.external_notification.output_buzzer) - digitalWrite(moduleConfig.external_notification.output_buzzer, true); - break; - default: - digitalWrite(output, (moduleConfig.external_notification.active ? true : false)); - break; + switch (index) { + case 1: + if (moduleConfig.external_notification.output_vibra) + digitalWrite(moduleConfig.external_notification.output_vibra, true); + break; + case 2: + if (moduleConfig.external_notification.output_buzzer) + digitalWrite(moduleConfig.external_notification.output_buzzer, true); + break; + default: + digitalWrite(output, (moduleConfig.external_notification.active ? true : false)); + break; } } @@ -113,18 +113,18 @@ void ExternalNotificationModule::setExternalOff(uint8_t index) externalCurrentState[index] = 0; externalTurnedOn[index] = millis(); - switch(index) { - case 1: - if(moduleConfig.external_notification.output_vibra) - digitalWrite(moduleConfig.external_notification.output_vibra, false); - break; - case 2: - if(moduleConfig.external_notification.output_buzzer) - digitalWrite(moduleConfig.external_notification.output_buzzer, false); - break; - default: - digitalWrite(output, (moduleConfig.external_notification.active ? false : true)); - break; + switch (index) { + case 1: + if (moduleConfig.external_notification.output_vibra) + digitalWrite(moduleConfig.external_notification.output_vibra, false); + break; + case 2: + if (moduleConfig.external_notification.output_buzzer) + digitalWrite(moduleConfig.external_notification.output_buzzer, false); + break; + default: + digitalWrite(output, (moduleConfig.external_notification.active ? false : true)); + break; } } @@ -133,7 +133,8 @@ bool ExternalNotificationModule::getExternal(uint8_t index) return externalCurrentState[index]; } -void ExternalNotificationModule::stopNow() { +void ExternalNotificationModule::stopNow() +{ rtttl::stop(); nagCycleCutoff = 1; // small value isNagging = false; @@ -161,40 +162,39 @@ ExternalNotificationModule::ExternalNotificationModule() // moduleConfig.external_notification.output_buzzer = 10; // RAK4631 IO6 // moduleConfig.external_notification.output_vibra = 28; // RAK4631 IO7 // moduleConfig.external_notification.nag_timeout = 300; - + if (moduleConfig.external_notification.enabled) { if (!nodeDB.loadProto(rtttlConfigFile, RTTTLConfig_size, sizeof(RTTTLConfig), &RTTTLConfig_msg, &rtttlConfig)) { memset(rtttlConfig.ringtone, 0, sizeof(rtttlConfig.ringtone)); - strncpy(rtttlConfig.ringtone, "a:d=8,o=5,b=125:4d#6,a#,2d#6,16p,g#,4a#,4d#.,p,16g,16a#,d#6,a#,f6,2d#6,16p,c#.6,16c6,16a#,g#.,2a#", sizeof(rtttlConfig.ringtone)); + strncpy(rtttlConfig.ringtone, + "a:d=8,o=5,b=125:4d#6,a#,2d#6,16p,g#,4a#,4d#.,p,16g,16a#,d#6,a#,f6,2d#6,16p,c#.6,16c6,16a#,g#.,2a#", + sizeof(rtttlConfig.ringtone)); } LOG_INFO("Initializing External Notification Module\n"); - output = moduleConfig.external_notification.output - ? moduleConfig.external_notification.output - : EXT_NOTIFICATION_MODULE_OUTPUT; + output = moduleConfig.external_notification.output ? moduleConfig.external_notification.output + : EXT_NOTIFICATION_MODULE_OUTPUT; // Set the direction of a pin LOG_INFO("Using Pin %i in digital mode\n", output); pinMode(output, OUTPUT); setExternalOff(0); externalTurnedOn[0] = 0; - if(moduleConfig.external_notification.output_vibra) { + if (moduleConfig.external_notification.output_vibra) { LOG_INFO("Using Pin %i for vibra motor\n", moduleConfig.external_notification.output_vibra); pinMode(moduleConfig.external_notification.output_vibra, OUTPUT); setExternalOff(1); externalTurnedOn[1] = 0; } - if(moduleConfig.external_notification.output_buzzer) { + if (moduleConfig.external_notification.output_buzzer) { if (!moduleConfig.external_notification.use_pwm) { LOG_INFO("Using Pin %i for buzzer\n", moduleConfig.external_notification.output_buzzer); pinMode(moduleConfig.external_notification.output_buzzer, OUTPUT); setExternalOff(2); externalTurnedOn[2] = 0; } else { - config.device.buzzer_gpio = config.device.buzzer_gpio - ? config.device.buzzer_gpio - : PIN_BUZZER; + config.device.buzzer_gpio = config.device.buzzer_gpio ? config.device.buzzer_gpio : PIN_BUZZER; // in PWM Mode we force the buzzer pin if it is set LOG_INFO("Using Pin %i in PWM mode\n", config.device.buzzer_gpio); } @@ -274,7 +274,6 @@ ProcessMessage ExternalNotificationModule::handleReceived(const MeshPacket &mp) } } - if (moduleConfig.external_notification.alert_message_vibra) { LOG_INFO("externalNotificationModule - Notification Module (Vibra)\n"); isNagging = true; @@ -300,7 +299,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const MeshPacket &mp) nagCycleCutoff = millis() + moduleConfig.external_notification.output_ms; } } - + setIntervalFromNow(0); // run once so we know if we should do something } @@ -320,7 +319,8 @@ ProcessMessage ExternalNotificationModule::handleReceived(const MeshPacket &mp) * @return AdminMessageHandleResult HANDLED if message was handled * HANDLED_WITH_RESULT if a result is also prepared. */ -AdminMessageHandleResult ExternalNotificationModule::handleAdminMessageForModule(const MeshPacket &mp, AdminMessage *request, AdminMessage *response) +AdminMessageHandleResult ExternalNotificationModule::handleAdminMessageForModule(const MeshPacket &mp, AdminMessage *request, + AdminMessage *response) { AdminMessageHandleResult result; @@ -347,13 +347,12 @@ AdminMessageHandleResult ExternalNotificationModule::handleAdminMessageForModule void ExternalNotificationModule::handleGetRingtone(const MeshPacket &req, AdminMessage *response) { LOG_INFO("*** handleGetRingtone\n"); - if(req.decoded.want_response) { + if (req.decoded.want_response) { response->which_payload_variant = AdminMessage_get_ringtone_response_tag; strncpy(response->get_ringtone_response, rtttlConfig.ringtone, sizeof(response->get_ringtone_response)); } // Don't send anything if not instructed to. Better than asserting. } - void ExternalNotificationModule::handleSetRingtone(const char *from_msg) { int changed = 0; diff --git a/src/modules/RemoteHardwareModule.h b/src/modules/RemoteHardwareModule.h index 2e16d356d..69733a87d 100644 --- a/src/modules/RemoteHardwareModule.h +++ b/src/modules/RemoteHardwareModule.h @@ -1,7 +1,7 @@ #pragma once #include "ProtobufModule.h" -#include "mesh/generated/meshtastic/remote_hardware.pb.h" #include "concurrency/OSThread.h" +#include "mesh/generated/meshtastic/remote_hardware.pb.h" /** * A module that provides easy low-level remote access to device hardware. @@ -9,13 +9,14 @@ class RemoteHardwareModule : public ProtobufModule, private concurrency::OSThread { /// The current set of GPIOs we've been asked to watch for changes - uint64_t watchGpios = 0; + uint64_t watchGpios = 0; /// The previously read value of watched pins uint64_t previousWatch = 0; /// The timestamp of our last watch event (we throttle watches to 1 change every 30 seconds) uint32_t lastWatchMsec = 0; + public: /** Constructor * name is for debugging output @@ -32,7 +33,7 @@ class RemoteHardwareModule : public ProtobufModule, private con /** * Periodically read the gpios we have been asked to WATCH, if they have changed, * broadcast a message with the change information. - * + * * The method that will be called each time our thread gets a chance to run * * Returns desired period for next invocation (or RUN_SAME for no change) diff --git a/src/modules/Telemetry/DeviceTelemetry.cpp b/src/modules/Telemetry/DeviceTelemetry.cpp index 1ae28fab3..3821ea445 100644 --- a/src/modules/Telemetry/DeviceTelemetry.cpp +++ b/src/modules/Telemetry/DeviceTelemetry.cpp @@ -9,13 +9,12 @@ #include "main.h" #include #include -#include "MeshService.h" int32_t DeviceTelemetryModule::runOnce() { uint32_t now = millis(); - if ((lastSentToMesh == 0 || - (now - lastSentToMesh) >= getConfiguredOrDefaultMs(moduleConfig.telemetry.device_update_interval)) && + if ((lastSentToMesh == 0 || + (now - lastSentToMesh) >= getConfiguredOrDefaultMs(moduleConfig.telemetry.device_update_interval)) && airTime->isTxAllowedChannelUtil() && airTime->isTxAllowedAirUtil()) { sendTelemetry(); lastSentToMesh = now; @@ -31,13 +30,10 @@ bool DeviceTelemetryModule::handleReceivedProtobuf(const MeshPacket &mp, Telemet { if (t->which_variant == Telemetry_device_metrics_tag) { const char *sender = getSenderShortName(mp); - - LOG_INFO("(Received from %s): air_util_tx=%f, channel_utilization=%f, battery_level=%i, voltage=%f\n", - sender, - t->variant.device_metrics.air_util_tx, - t->variant.device_metrics.channel_utilization, - t->variant.device_metrics.battery_level, - t->variant.device_metrics.voltage); + + LOG_INFO("(Received from %s): air_util_tx=%f, channel_utilization=%f, battery_level=%i, voltage=%f\n", sender, + t->variant.device_metrics.air_util_tx, t->variant.device_metrics.channel_utilization, + t->variant.device_metrics.battery_level, t->variant.device_metrics.voltage); lastMeasurementPacket = packetPool.allocCopy(mp); @@ -58,11 +54,9 @@ bool DeviceTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly) t.variant.device_metrics.channel_utilization = myNodeInfo.channel_utilization; t.variant.device_metrics.voltage = powerStatus->getBatteryVoltageMv() / 1000.0; - LOG_INFO("(Sending): air_util_tx=%f, channel_utilization=%f, battery_level=%i, voltage=%f\n", - t.variant.device_metrics.air_util_tx, - t.variant.device_metrics.channel_utilization, - t.variant.device_metrics.battery_level, - t.variant.device_metrics.voltage); + LOG_INFO("(Sending): air_util_tx=%f, channel_utilization=%f, battery_level=%i, voltage=%f\n", + t.variant.device_metrics.air_util_tx, t.variant.device_metrics.channel_utilization, + t.variant.device_metrics.battery_level, t.variant.device_metrics.voltage); MeshPacket *p = allocDataProtobuf(t); p->to = dest; diff --git a/src/modules/Telemetry/DeviceTelemetry.h b/src/modules/Telemetry/DeviceTelemetry.h index 199d00307..11506c71f 100644 --- a/src/modules/Telemetry/DeviceTelemetry.h +++ b/src/modules/Telemetry/DeviceTelemetry.h @@ -11,8 +11,8 @@ class DeviceTelemetryModule : private concurrency::OSThread, public ProtobufModu DeviceTelemetryModule() : concurrency::OSThread("DeviceTelemetryModule"), ProtobufModule("DeviceTelemetry", PortNum_TELEMETRY_APP, &Telemetry_msg) { - lastMeasurementPacket = nullptr; - setIntervalFromNow(10 * 1000); + lastMeasurementPacket = nullptr; + setIntervalFromNow(10 * 1000); } virtual bool wantUIFrame() { return false; } diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index cc5f56310..dce243b83 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -9,18 +9,17 @@ #include "main.h" #include #include -#include "MeshService.h" // Sensors -#include "Sensor/BMP280Sensor.h" #include "Sensor/BME280Sensor.h" #include "Sensor/BME680Sensor.h" -#include "Sensor/MCP9808Sensor.h" -#include "Sensor/INA260Sensor.h" +#include "Sensor/BMP280Sensor.h" #include "Sensor/INA219Sensor.h" -#include "Sensor/SHTC3Sensor.h" +#include "Sensor/INA260Sensor.h" #include "Sensor/LPS22HBSensor.h" +#include "Sensor/MCP9808Sensor.h" #include "Sensor/SHT31Sensor.h" +#include "Sensor/SHTC3Sensor.h" BMP280Sensor bmp280Sensor; BME280Sensor bme280Sensor; @@ -59,13 +58,12 @@ int32_t EnvironmentTelemetryModule::runOnce() Uncomment the preferences below if you want to use the module without having to configure it from the PythonAPI or WebUI. */ - + // moduleConfig.telemetry.environment_measurement_enabled = 1; // moduleConfig.telemetry.environment_screen_enabled = 1; // moduleConfig.telemetry.environment_update_interval = 45; - if (!(moduleConfig.telemetry.environment_measurement_enabled || - moduleConfig.telemetry.environment_screen_enabled)) { + if (!(moduleConfig.telemetry.environment_measurement_enabled || moduleConfig.telemetry.environment_screen_enabled)) { // If this module is not enabled, and the user doesn't want the display screen don't waste any OSThread time on it return disable(); } @@ -78,15 +76,15 @@ int32_t EnvironmentTelemetryModule::runOnce() LOG_INFO("Environment Telemetry: Initializing\n"); // it's possible to have this module enabled, only for displaying values on the screen. // therefore, we should only enable the sensor loop if measurement is also enabled - if (bmp280Sensor.hasSensor()) + if (bmp280Sensor.hasSensor()) result = bmp280Sensor.runOnce(); - if (bme280Sensor.hasSensor()) + if (bme280Sensor.hasSensor()) result = bme280Sensor.runOnce(); - if (bme680Sensor.hasSensor()) + if (bme680Sensor.hasSensor()) result = bme680Sensor.runOnce(); - if (mcp9808Sensor.hasSensor()) + if (mcp9808Sensor.hasSensor()) result = mcp9808Sensor.runOnce(); - if (ina260Sensor.hasSensor()) + if (ina260Sensor.hasSensor()) result = ina260Sensor.runOnce(); if (ina219Sensor.hasSensor()) result = ina219Sensor.runOnce(); @@ -105,8 +103,8 @@ int32_t EnvironmentTelemetryModule::runOnce() return result; uint32_t now = millis(); - if ((lastSentToMesh == 0 || - (now - lastSentToMesh) >= getConfiguredOrDefaultMs(moduleConfig.telemetry.environment_update_interval)) && + if ((lastSentToMesh == 0 || + (now - lastSentToMesh) >= getConfiguredOrDefaultMs(moduleConfig.telemetry.environment_update_interval)) && airTime->isTxAllowedAirUtil()) { sendTelemetry(); lastSentToMesh = now; @@ -173,13 +171,15 @@ void EnvironmentTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiSt } display->drawString(x, y += fontHeight(FONT_MEDIUM) - 2, "From: " + String(lastSender) + "(" + String(agoSecs) + "s)"); display->drawString(x, y += fontHeight(FONT_SMALL) - 2, - "Temp/Hum: " + last_temp + " / " + String(lastMeasurement.variant.environment_metrics.relative_humidity, 0) + "%"); + "Temp/Hum: " + last_temp + " / " + + String(lastMeasurement.variant.environment_metrics.relative_humidity, 0) + "%"); if (lastMeasurement.variant.environment_metrics.barometric_pressure != 0) display->drawString(x, y += fontHeight(FONT_SMALL), - "Press: " + String(lastMeasurement.variant.environment_metrics.barometric_pressure, 0) + "hPA"); + "Press: " + String(lastMeasurement.variant.environment_metrics.barometric_pressure, 0) + "hPA"); if (lastMeasurement.variant.environment_metrics.voltage != 0) display->drawString(x, y += fontHeight(FONT_SMALL), - "Volt/Cur: " + String(lastMeasurement.variant.environment_metrics.voltage, 0) + "V / " + String(lastMeasurement.variant.environment_metrics.current, 0) + "mA"); + "Volt/Cur: " + String(lastMeasurement.variant.environment_metrics.voltage, 0) + "V / " + + String(lastMeasurement.variant.environment_metrics.current, 0) + "mA"); } bool EnvironmentTelemetryModule::handleReceivedProtobuf(const MeshPacket &mp, Telemetry *t) @@ -187,14 +187,11 @@ bool EnvironmentTelemetryModule::handleReceivedProtobuf(const MeshPacket &mp, Te if (t->which_variant == Telemetry_environment_metrics_tag) { const char *sender = getSenderShortName(mp); - LOG_INFO("(Received from %s): barometric_pressure=%f, current=%f, gas_resistance=%f, relative_humidity=%f, temperature=%f, voltage=%f\n", - sender, - t->variant.environment_metrics.barometric_pressure, - t->variant.environment_metrics.current, - t->variant.environment_metrics.gas_resistance, - t->variant.environment_metrics.relative_humidity, - t->variant.environment_metrics.temperature, - t->variant.environment_metrics.voltage); + LOG_INFO("(Received from %s): barometric_pressure=%f, current=%f, gas_resistance=%f, relative_humidity=%f, " + "temperature=%f, voltage=%f\n", + sender, t->variant.environment_metrics.barometric_pressure, t->variant.environment_metrics.current, + t->variant.environment_metrics.gas_resistance, t->variant.environment_metrics.relative_humidity, + t->variant.environment_metrics.temperature, t->variant.environment_metrics.voltage); lastMeasurementPacket = packetPool.allocCopy(mp); } @@ -234,13 +231,11 @@ bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly) if (ina260Sensor.hasSensor()) ina260Sensor.getMetrics(&m); - LOG_INFO("(Sending): barometric_pressure=%f, current=%f, gas_resistance=%f, relative_humidity=%f, temperature=%f, voltage=%f\n", - m.variant.environment_metrics.barometric_pressure, - m.variant.environment_metrics.current, - m.variant.environment_metrics.gas_resistance, - m.variant.environment_metrics.relative_humidity, - m.variant.environment_metrics.temperature, - m.variant.environment_metrics.voltage); + LOG_INFO( + "(Sending): barometric_pressure=%f, current=%f, gas_resistance=%f, relative_humidity=%f, temperature=%f, voltage=%f\n", + m.variant.environment_metrics.barometric_pressure, m.variant.environment_metrics.current, + m.variant.environment_metrics.gas_resistance, m.variant.environment_metrics.relative_humidity, + m.variant.environment_metrics.temperature, m.variant.environment_metrics.voltage); sensor_read_error_count = 0; diff --git a/src/modules/Telemetry/EnvironmentTelemetry.h b/src/modules/Telemetry/EnvironmentTelemetry.h index 06621363f..5dce19c57 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.h +++ b/src/modules/Telemetry/EnvironmentTelemetry.h @@ -12,8 +12,8 @@ class EnvironmentTelemetryModule : private concurrency::OSThread, public Protobu : concurrency::OSThread("EnvironmentTelemetryModule"), ProtobufModule("EnvironmentTelemetry", PortNum_TELEMETRY_APP, &Telemetry_msg) { - lastMeasurementPacket = nullptr; - setIntervalFromNow(10 * 1000); + lastMeasurementPacket = nullptr; + setIntervalFromNow(10 * 1000); } virtual bool wantUIFrame() override; #if !HAS_SCREEN diff --git a/src/modules/Telemetry/Sensor/BME280Sensor.cpp b/src/modules/Telemetry/Sensor/BME280Sensor.cpp index 93d882238..6c173eaec 100644 --- a/src/modules/Telemetry/Sensor/BME280Sensor.cpp +++ b/src/modules/Telemetry/Sensor/BME280Sensor.cpp @@ -1,35 +1,33 @@ -#include "../mesh/generated/meshtastic/telemetry.pb.h" -#include "configuration.h" -#include "TelemetrySensor.h" #include "BME280Sensor.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include "configuration.h" #include #include -BME280Sensor::BME280Sensor() : - TelemetrySensor(TelemetrySensorType_BME280, "BME280") -{ -} +BME280Sensor::BME280Sensor() : TelemetrySensor(TelemetrySensorType_BME280, "BME280") {} -int32_t BME280Sensor::runOnce() { +int32_t BME280Sensor::runOnce() +{ LOG_INFO("Init sensor: %s\n", sensorName); if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; } - status = bme280.begin(nodeTelemetrySensorsMap[sensorType]); - - bme280.setSampling( Adafruit_BME280::MODE_FORCED, - Adafruit_BME280::SAMPLING_X1, // Temp. oversampling - Adafruit_BME280::SAMPLING_X1, // Pressure oversampling - Adafruit_BME280::SAMPLING_X1, // Humidity oversampling - Adafruit_BME280::FILTER_OFF, - Adafruit_BME280::STANDBY_MS_1000); - + status = bme280.begin(nodeTelemetrySensorsMap[sensorType]); + + bme280.setSampling(Adafruit_BME280::MODE_FORCED, + Adafruit_BME280::SAMPLING_X1, // Temp. oversampling + Adafruit_BME280::SAMPLING_X1, // Pressure oversampling + Adafruit_BME280::SAMPLING_X1, // Humidity oversampling + Adafruit_BME280::FILTER_OFF, Adafruit_BME280::STANDBY_MS_1000); + return initI2CSensor(); } -void BME280Sensor::setup() { } +void BME280Sensor::setup() {} -bool BME280Sensor::getMetrics(Telemetry *measurement) { +bool BME280Sensor::getMetrics(Telemetry *measurement) +{ LOG_DEBUG("BME280Sensor::getMetrics\n"); bme280.takeForcedMeasurement(); measurement->variant.environment_metrics.temperature = bme280.readTemperature(); @@ -37,4 +35,4 @@ bool BME280Sensor::getMetrics(Telemetry *measurement) { measurement->variant.environment_metrics.barometric_pressure = bme280.readPressure() / 100.0F; return true; -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/BME280Sensor.h b/src/modules/Telemetry/Sensor/BME280Sensor.h index 606372707..c75b9ef59 100644 --- a/src/modules/Telemetry/Sensor/BME280Sensor.h +++ b/src/modules/Telemetry/Sensor/BME280Sensor.h @@ -2,15 +2,16 @@ #include "TelemetrySensor.h" #include -class BME280Sensor : virtual public TelemetrySensor { -private: +class BME280Sensor : virtual public TelemetrySensor +{ + private: Adafruit_BME280 bme280; -protected: + protected: virtual void setup() override; -public: + public: BME280Sensor(); virtual int32_t runOnce() override; virtual bool getMetrics(Telemetry *measurement) override; -}; \ No newline at end of file +}; \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/BME680Sensor.cpp b/src/modules/Telemetry/Sensor/BME680Sensor.cpp index e164ec28a..e3266450a 100644 --- a/src/modules/Telemetry/Sensor/BME680Sensor.cpp +++ b/src/modules/Telemetry/Sensor/BME680Sensor.cpp @@ -1,15 +1,13 @@ -#include "../mesh/generated/meshtastic/telemetry.pb.h" -#include "configuration.h" -#include "TelemetrySensor.h" #include "BME680Sensor.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include "configuration.h" #include -BME680Sensor::BME680Sensor() : - TelemetrySensor(TelemetrySensorType_BME680, "BME680") -{ -} +BME680Sensor::BME680Sensor() : TelemetrySensor(TelemetrySensorType_BME680, "BME680") {} -int32_t BME680Sensor::runOnce() { +int32_t BME680Sensor::runOnce() +{ LOG_INFO("Init sensor: %s\n", sensorName); if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; @@ -19,9 +17,10 @@ int32_t BME680Sensor::runOnce() { return initI2CSensor(); } -void BME680Sensor::setup() { } +void BME680Sensor::setup() {} -bool BME680Sensor::getMetrics(Telemetry *measurement) { +bool BME680Sensor::getMetrics(Telemetry *measurement) +{ bme680.performReading(); measurement->variant.environment_metrics.temperature = bme680.temperature; measurement->variant.environment_metrics.relative_humidity = bme680.humidity; @@ -29,4 +28,4 @@ bool BME680Sensor::getMetrics(Telemetry *measurement) { measurement->variant.environment_metrics.gas_resistance = bme680.gas_resistance / 1000.0; return true; -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/BME680Sensor.h b/src/modules/Telemetry/Sensor/BME680Sensor.h index 146730d2c..e66eba75c 100644 --- a/src/modules/Telemetry/Sensor/BME680Sensor.h +++ b/src/modules/Telemetry/Sensor/BME680Sensor.h @@ -2,15 +2,16 @@ #include "TelemetrySensor.h" #include -class BME680Sensor : virtual public TelemetrySensor { -private: +class BME680Sensor : virtual public TelemetrySensor +{ + private: Adafruit_BME680 bme680; -protected: + protected: virtual void setup() override; - -public: + + public: BME680Sensor(); virtual int32_t runOnce() override; virtual bool getMetrics(Telemetry *measurement) override; -}; \ No newline at end of file +}; \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/BMP280Sensor.cpp b/src/modules/Telemetry/Sensor/BMP280Sensor.cpp index 1f3f3a835..267656c4c 100644 --- a/src/modules/Telemetry/Sensor/BMP280Sensor.cpp +++ b/src/modules/Telemetry/Sensor/BMP280Sensor.cpp @@ -1,38 +1,36 @@ -#include "../mesh/generated/meshtastic/telemetry.pb.h" -#include "configuration.h" -#include "TelemetrySensor.h" #include "BMP280Sensor.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include "configuration.h" #include #include -BMP280Sensor::BMP280Sensor() : - TelemetrySensor(TelemetrySensorType_BMP280, "BMP280") -{ -} +BMP280Sensor::BMP280Sensor() : TelemetrySensor(TelemetrySensorType_BMP280, "BMP280") {} -int32_t BMP280Sensor::runOnce() { +int32_t BMP280Sensor::runOnce() +{ LOG_INFO("Init sensor: %s\n", sensorName); if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; } - status = bmp280.begin(nodeTelemetrySensorsMap[sensorType]); + status = bmp280.begin(nodeTelemetrySensorsMap[sensorType]); - bmp280.setSampling( Adafruit_BMP280::MODE_FORCED, - Adafruit_BMP280::SAMPLING_X1, // Temp. oversampling - Adafruit_BMP280::SAMPLING_X1, // Pressure oversampling - Adafruit_BMP280::FILTER_OFF, - Adafruit_BMP280::STANDBY_MS_1000); + bmp280.setSampling(Adafruit_BMP280::MODE_FORCED, + Adafruit_BMP280::SAMPLING_X1, // Temp. oversampling + Adafruit_BMP280::SAMPLING_X1, // Pressure oversampling + Adafruit_BMP280::FILTER_OFF, Adafruit_BMP280::STANDBY_MS_1000); return initI2CSensor(); } -void BMP280Sensor::setup() { } +void BMP280Sensor::setup() {} -bool BMP280Sensor::getMetrics(Telemetry *measurement) { +bool BMP280Sensor::getMetrics(Telemetry *measurement) +{ LOG_DEBUG("BMP280Sensor::getMetrics\n"); bmp280.takeForcedMeasurement(); measurement->variant.environment_metrics.temperature = bmp280.readTemperature(); measurement->variant.environment_metrics.barometric_pressure = bmp280.readPressure() / 100.0F; return true; -} +} diff --git a/src/modules/Telemetry/Sensor/BMP280Sensor.h b/src/modules/Telemetry/Sensor/BMP280Sensor.h index ce41d2d20..769f4e4ba 100644 --- a/src/modules/Telemetry/Sensor/BMP280Sensor.h +++ b/src/modules/Telemetry/Sensor/BMP280Sensor.h @@ -2,15 +2,16 @@ #include "TelemetrySensor.h" #include -class BMP280Sensor : virtual public TelemetrySensor { -private: +class BMP280Sensor : virtual public TelemetrySensor +{ + private: Adafruit_BMP280 bmp280; -protected: + protected: virtual void setup() override; -public: + public: BMP280Sensor(); virtual int32_t runOnce() override; virtual bool getMetrics(Telemetry *measurement) override; -}; \ No newline at end of file +}; \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/INA219Sensor.cpp b/src/modules/Telemetry/Sensor/INA219Sensor.cpp index bf36f73b5..69a67ad4b 100644 --- a/src/modules/Telemetry/Sensor/INA219Sensor.cpp +++ b/src/modules/Telemetry/Sensor/INA219Sensor.cpp @@ -1,15 +1,13 @@ -#include "../mesh/generated/meshtastic/telemetry.pb.h" -#include "configuration.h" -#include "TelemetrySensor.h" #include "INA219Sensor.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include "configuration.h" #include -INA219Sensor::INA219Sensor() : - TelemetrySensor(TelemetrySensorType_INA219, "INA219") -{ -} +INA219Sensor::INA219Sensor() : TelemetrySensor(TelemetrySensorType_INA219, "INA219") {} -int32_t INA219Sensor::runOnce() { +int32_t INA219Sensor::runOnce() +{ LOG_INFO("Init sensor: %s\n", sensorName); if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; @@ -19,12 +17,11 @@ int32_t INA219Sensor::runOnce() { return initI2CSensor(); } -void INA219Sensor::setup() -{ -} +void INA219Sensor::setup() {} -bool INA219Sensor::getMetrics(Telemetry *measurement) { +bool INA219Sensor::getMetrics(Telemetry *measurement) +{ measurement->variant.environment_metrics.voltage = ina219.getBusVoltage_V(); measurement->variant.environment_metrics.current = ina219.getCurrent_mA(); return true; -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/INA219Sensor.h b/src/modules/Telemetry/Sensor/INA219Sensor.h index 50ce0edbc..7288dac8a 100644 --- a/src/modules/Telemetry/Sensor/INA219Sensor.h +++ b/src/modules/Telemetry/Sensor/INA219Sensor.h @@ -2,16 +2,16 @@ #include "TelemetrySensor.h" #include - -class INA219Sensor : virtual public TelemetrySensor { -private: +class INA219Sensor : virtual public TelemetrySensor +{ + private: Adafruit_INA219 ina219; -protected: + protected: virtual void setup() override; - -public: + + public: INA219Sensor(); virtual int32_t runOnce() override; virtual bool getMetrics(Telemetry *measurement) override; -}; \ No newline at end of file +}; \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/INA260Sensor.cpp b/src/modules/Telemetry/Sensor/INA260Sensor.cpp index d6b53f4a3..d69d25a75 100644 --- a/src/modules/Telemetry/Sensor/INA260Sensor.cpp +++ b/src/modules/Telemetry/Sensor/INA260Sensor.cpp @@ -1,15 +1,13 @@ -#include "../mesh/generated/meshtastic/telemetry.pb.h" -#include "configuration.h" -#include "TelemetrySensor.h" #include "INA260Sensor.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include "configuration.h" #include -INA260Sensor::INA260Sensor() : - TelemetrySensor(TelemetrySensorType_INA260, "INA260") -{ -} +INA260Sensor::INA260Sensor() : TelemetrySensor(TelemetrySensorType_INA260, "INA260") {} -int32_t INA260Sensor::runOnce() { +int32_t INA260Sensor::runOnce() +{ LOG_INFO("Init sensor: %s\n", sensorName); if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; @@ -18,13 +16,12 @@ int32_t INA260Sensor::runOnce() { return initI2CSensor(); } -void INA260Sensor::setup() -{ -} +void INA260Sensor::setup() {} -bool INA260Sensor::getMetrics(Telemetry *measurement) { +bool INA260Sensor::getMetrics(Telemetry *measurement) +{ // mV conversion to V measurement->variant.environment_metrics.voltage = ina260.readBusVoltage() / 1000; measurement->variant.environment_metrics.current = ina260.readCurrent(); return true; -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/INA260Sensor.h b/src/modules/Telemetry/Sensor/INA260Sensor.h index 8d451ddda..de1fe0ad7 100644 --- a/src/modules/Telemetry/Sensor/INA260Sensor.h +++ b/src/modules/Telemetry/Sensor/INA260Sensor.h @@ -2,16 +2,16 @@ #include "TelemetrySensor.h" #include - -class INA260Sensor : virtual public TelemetrySensor { -private: +class INA260Sensor : virtual public TelemetrySensor +{ + private: Adafruit_INA260 ina260 = Adafruit_INA260(); -protected: + protected: virtual void setup() override; - -public: + + public: INA260Sensor(); virtual int32_t runOnce() override; virtual bool getMetrics(Telemetry *measurement) override; -}; \ No newline at end of file +}; \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/LPS22HBSensor.cpp b/src/modules/Telemetry/Sensor/LPS22HBSensor.cpp index 6647b2eac..ac77bdb40 100644 --- a/src/modules/Telemetry/Sensor/LPS22HBSensor.cpp +++ b/src/modules/Telemetry/Sensor/LPS22HBSensor.cpp @@ -1,16 +1,14 @@ -#include "../mesh/generated/meshtastic/telemetry.pb.h" -#include "configuration.h" -#include "TelemetrySensor.h" #include "LPS22HBSensor.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include "configuration.h" #include #include -LPS22HBSensor::LPS22HBSensor() : - TelemetrySensor(TelemetrySensorType_LPS22, "LPS22HB") -{ -} +LPS22HBSensor::LPS22HBSensor() : TelemetrySensor(TelemetrySensorType_LPS22, "LPS22HB") {} -int32_t LPS22HBSensor::runOnce() { +int32_t LPS22HBSensor::runOnce() +{ LOG_INFO("Init sensor: %s\n", sensorName); if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; @@ -19,12 +17,13 @@ int32_t LPS22HBSensor::runOnce() { return initI2CSensor(); } -void LPS22HBSensor::setup() +void LPS22HBSensor::setup() { lps22hb.setDataRate(LPS22_RATE_10_HZ); } -bool LPS22HBSensor::getMetrics(Telemetry *measurement) { +bool LPS22HBSensor::getMetrics(Telemetry *measurement) +{ sensors_event_t temp; sensors_event_t pressure; lps22hb.getEvent(&pressure, &temp); @@ -33,4 +32,4 @@ bool LPS22HBSensor::getMetrics(Telemetry *measurement) { measurement->variant.environment_metrics.barometric_pressure = pressure.pressure; return true; -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/LPS22HBSensor.h b/src/modules/Telemetry/Sensor/LPS22HBSensor.h index 2e8593d2b..7472950b8 100644 --- a/src/modules/Telemetry/Sensor/LPS22HBSensor.h +++ b/src/modules/Telemetry/Sensor/LPS22HBSensor.h @@ -3,15 +3,16 @@ #include #include -class LPS22HBSensor : virtual public TelemetrySensor { -private: +class LPS22HBSensor : virtual public TelemetrySensor +{ + private: Adafruit_LPS22 lps22hb; -protected: + protected: virtual void setup() override; - -public: + + public: LPS22HBSensor(); virtual int32_t runOnce() override; virtual bool getMetrics(Telemetry *measurement) override; -}; \ No newline at end of file +}; \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/MCP9808Sensor.cpp b/src/modules/Telemetry/Sensor/MCP9808Sensor.cpp index d8e14922a..7bac18d9a 100644 --- a/src/modules/Telemetry/Sensor/MCP9808Sensor.cpp +++ b/src/modules/Telemetry/Sensor/MCP9808Sensor.cpp @@ -1,15 +1,13 @@ -#include "../mesh/generated/meshtastic/telemetry.pb.h" -#include "configuration.h" -#include "TelemetrySensor.h" #include "MCP9808Sensor.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include "configuration.h" #include -MCP9808Sensor::MCP9808Sensor() : - TelemetrySensor(TelemetrySensorType_MCP9808, "MCP9808") -{ -} +MCP9808Sensor::MCP9808Sensor() : TelemetrySensor(TelemetrySensorType_MCP9808, "MCP9808") {} -int32_t MCP9808Sensor::runOnce() { +int32_t MCP9808Sensor::runOnce() +{ LOG_INFO("Init sensor: %s\n", sensorName); if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; @@ -18,12 +16,14 @@ int32_t MCP9808Sensor::runOnce() { return initI2CSensor(); } -void MCP9808Sensor::setup() { +void MCP9808Sensor::setup() +{ mcp9808.setResolution(2); } -bool MCP9808Sensor::getMetrics(Telemetry *measurement) { +bool MCP9808Sensor::getMetrics(Telemetry *measurement) +{ LOG_DEBUG("MCP9808Sensor::getMetrics\n"); measurement->variant.environment_metrics.temperature = mcp9808.readTempC(); return true; -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/MCP9808Sensor.h b/src/modules/Telemetry/Sensor/MCP9808Sensor.h index aa3eadbe6..150b76237 100644 --- a/src/modules/Telemetry/Sensor/MCP9808Sensor.h +++ b/src/modules/Telemetry/Sensor/MCP9808Sensor.h @@ -2,15 +2,16 @@ #include "TelemetrySensor.h" #include -class MCP9808Sensor : virtual public TelemetrySensor { -private: +class MCP9808Sensor : virtual public TelemetrySensor +{ + private: Adafruit_MCP9808 mcp9808; -protected: + protected: virtual void setup() override; - -public: + + public: MCP9808Sensor(); virtual int32_t runOnce() override; virtual bool getMetrics(Telemetry *measurement) override; -}; \ No newline at end of file +}; \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/SHT31Sensor.cpp b/src/modules/Telemetry/Sensor/SHT31Sensor.cpp index 22284d5c0..940a94d46 100644 --- a/src/modules/Telemetry/Sensor/SHT31Sensor.cpp +++ b/src/modules/Telemetry/Sensor/SHT31Sensor.cpp @@ -1,31 +1,30 @@ -#include "../mesh/generated/meshtastic/telemetry.pb.h" -#include "configuration.h" -#include "TelemetrySensor.h" #include "SHT31Sensor.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include "configuration.h" #include -SHT31Sensor::SHT31Sensor() : - TelemetrySensor(TelemetrySensorType_SHT31, "SHT31") -{ -} +SHT31Sensor::SHT31Sensor() : TelemetrySensor(TelemetrySensorType_SHT31, "SHT31") {} -int32_t SHT31Sensor::runOnce() { +int32_t SHT31Sensor::runOnce() +{ LOG_INFO("Init sensor: %s\n", sensorName); if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; } - status = sht31.begin(); + status = sht31.begin(); return initI2CSensor(); } -void SHT31Sensor::setup() +void SHT31Sensor::setup() { // Set up oversampling and filter initialization } -bool SHT31Sensor::getMetrics(Telemetry *measurement) { +bool SHT31Sensor::getMetrics(Telemetry *measurement) +{ measurement->variant.environment_metrics.temperature = sht31.readTemperature(); measurement->variant.environment_metrics.relative_humidity = sht31.readHumidity(); return true; -} +} diff --git a/src/modules/Telemetry/Sensor/SHT31Sensor.h b/src/modules/Telemetry/Sensor/SHT31Sensor.h index 92ea9a05d..ca574a5cd 100644 --- a/src/modules/Telemetry/Sensor/SHT31Sensor.h +++ b/src/modules/Telemetry/Sensor/SHT31Sensor.h @@ -2,15 +2,16 @@ #include "TelemetrySensor.h" #include -class SHT31Sensor : virtual public TelemetrySensor { -private: +class SHT31Sensor : virtual public TelemetrySensor +{ + private: Adafruit_SHT31 sht31 = Adafruit_SHT31(); -protected: + protected: virtual void setup() override; - -public: + + public: SHT31Sensor(); virtual int32_t runOnce() override; virtual bool getMetrics(Telemetry *measurement) override; -}; +}; diff --git a/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp b/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp index 99335d87c..1ed16cc11 100644 --- a/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp +++ b/src/modules/Telemetry/Sensor/SHTC3Sensor.cpp @@ -1,29 +1,28 @@ -#include "../mesh/generated/meshtastic/telemetry.pb.h" -#include "configuration.h" -#include "TelemetrySensor.h" #include "SHTC3Sensor.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include "configuration.h" #include -SHTC3Sensor::SHTC3Sensor() : - TelemetrySensor(TelemetrySensorType_SHTC3, "SHTC3") -{ -} +SHTC3Sensor::SHTC3Sensor() : TelemetrySensor(TelemetrySensorType_SHTC3, "SHTC3") {} -int32_t SHTC3Sensor::runOnce() { +int32_t SHTC3Sensor::runOnce() +{ LOG_INFO("Init sensor: %s\n", sensorName); if (!hasSensor()) { return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; } - status = shtc3.begin(); + status = shtc3.begin(); return initI2CSensor(); } -void SHTC3Sensor::setup() +void SHTC3Sensor::setup() { // Set up oversampling and filter initialization } -bool SHTC3Sensor::getMetrics(Telemetry *measurement) { +bool SHTC3Sensor::getMetrics(Telemetry *measurement) +{ sensors_event_t humidity, temp; shtc3.getEvent(&humidity, &temp); @@ -31,4 +30,4 @@ bool SHTC3Sensor::getMetrics(Telemetry *measurement) { measurement->variant.environment_metrics.relative_humidity = humidity.relative_humidity; return true; -} \ No newline at end of file +} \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/SHTC3Sensor.h b/src/modules/Telemetry/Sensor/SHTC3Sensor.h index d0cd33f03..f391580a6 100644 --- a/src/modules/Telemetry/Sensor/SHTC3Sensor.h +++ b/src/modules/Telemetry/Sensor/SHTC3Sensor.h @@ -2,15 +2,16 @@ #include "TelemetrySensor.h" #include -class SHTC3Sensor : virtual public TelemetrySensor { -private: +class SHTC3Sensor : virtual public TelemetrySensor +{ + private: Adafruit_SHTC3 shtc3 = Adafruit_SHTC3(); -protected: + protected: virtual void setup() override; - -public: + + public: SHTC3Sensor(); virtual int32_t runOnce() override; virtual bool getMetrics(Telemetry *measurement) override; -}; \ No newline at end of file +}; \ No newline at end of file diff --git a/src/modules/Telemetry/Sensor/TelemetrySensor.h b/src/modules/Telemetry/Sensor/TelemetrySensor.h index 97582f9b4..79dfbf312 100644 --- a/src/modules/Telemetry/Sensor/TelemetrySensor.h +++ b/src/modules/Telemetry/Sensor/TelemetrySensor.h @@ -19,7 +19,8 @@ class TelemetrySensor TelemetrySensorType sensorType; unsigned status; - int32_t initI2CSensor() { + int32_t initI2CSensor() + { if (!status) { LOG_WARN("Could not connect to detected %s sensor.\n Removing from nodeTelemetrySensorsMap.\n", sensorName); nodeTelemetrySensorsMap[sensorType] = 0; @@ -32,9 +33,7 @@ class TelemetrySensor virtual void setup(); public: - bool hasSensor() { - return sensorType < sizeof(nodeTelemetrySensorsMap) && nodeTelemetrySensorsMap[sensorType] > 0; - } + bool hasSensor() { return sensorType < sizeof(nodeTelemetrySensorsMap) && nodeTelemetrySensorsMap[sensorType] > 0; } virtual int32_t runOnce() = 0; virtual bool getMetrics(Telemetry *measurement) = 0; diff --git a/src/modules/esp32/StoreForwardModule.cpp b/src/modules/esp32/StoreForwardModule.cpp index 825b0376b..36d023162 100644 --- a/src/modules/esp32/StoreForwardModule.cpp +++ b/src/modules/esp32/StoreForwardModule.cpp @@ -63,7 +63,8 @@ void StoreForwardModule::populatePSRAM() https://learn.upesy.com/en/programmation/psram.html#psram-tab */ - LOG_DEBUG("*** Before PSRAM initilization: heap %d/%d PSRAM %d/%d\n", ESP.getFreeHeap(), ESP.getHeapSize(), ESP.getFreePsram(), ESP.getPsramSize()); + LOG_DEBUG("*** Before PSRAM initilization: heap %d/%d PSRAM %d/%d\n", ESP.getFreeHeap(), ESP.getHeapSize(), + ESP.getFreePsram(), ESP.getPsramSize()); this->packetHistoryTXQueue = static_cast(ps_calloc(this->historyReturnMax, sizeof(PacketHistoryStruct))); @@ -76,7 +77,8 @@ void StoreForwardModule::populatePSRAM() this->packetHistory = static_cast(ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct))); - LOG_DEBUG("*** After PSRAM initilization: heap %d/%d PSRAM %d/%d\n", ESP.getFreeHeap(), ESP.getHeapSize(), ESP.getFreePsram(), ESP.getPsramSize()); + LOG_DEBUG("*** After PSRAM initilization: heap %d/%d PSRAM %d/%d\n", ESP.getFreeHeap(), ESP.getHeapSize(), ESP.getFreePsram(), + ESP.getPsramSize()); LOG_DEBUG("*** numberOfPackets for packetHistory - %u\n", numberOfPackets); } @@ -296,123 +298,125 @@ bool StoreForwardModule::handleReceivedProtobuf(const MeshPacket &mp, StoreAndFo requests++; switch (p->rr) { - case StoreAndForward_RequestResponse_CLIENT_ERROR: - case StoreAndForward_RequestResponse_CLIENT_ABORT: - if(is_server) { - // stop sending stuff, the client wants to abort or has another error - if ((this->busy) && (this->busyTo == getFrom(&mp))) { - LOG_ERROR("*** Client in ERROR or ABORT requested\n"); - this->packetHistoryTXQueue_index = 0; - this->busy = false; - } + case StoreAndForward_RequestResponse_CLIENT_ERROR: + case StoreAndForward_RequestResponse_CLIENT_ABORT: + if (is_server) { + // stop sending stuff, the client wants to abort or has another error + if ((this->busy) && (this->busyTo == getFrom(&mp))) { + LOG_ERROR("*** Client in ERROR or ABORT requested\n"); + this->packetHistoryTXQueue_index = 0; + this->busy = false; } - break; + } + break; - case StoreAndForward_RequestResponse_CLIENT_HISTORY: - if(is_server) { - requests_history++; - LOG_INFO("*** Client Request to send HISTORY\n"); - // Send the last 60 minutes of messages. - if (this->busy) { - storeForwardModule->sendMessage(getFrom(&mp), StoreAndForward_RequestResponse_ROUTER_BUSY); - LOG_INFO("*** S&F - Busy. Try again shortly.\n"); + case StoreAndForward_RequestResponse_CLIENT_HISTORY: + if (is_server) { + requests_history++; + LOG_INFO("*** Client Request to send HISTORY\n"); + // Send the last 60 minutes of messages. + if (this->busy) { + storeForwardModule->sendMessage(getFrom(&mp), StoreAndForward_RequestResponse_ROUTER_BUSY); + LOG_INFO("*** S&F - Busy. Try again shortly.\n"); + } else { + if ((p->which_variant == StoreAndForward_history_tag) && (p->variant.history.window > 0)) { + storeForwardModule->historySend(p->variant.history.window * 60000, getFrom(&mp)); // window is in minutes } else { - if ((p->which_variant == StoreAndForward_history_tag) && (p->variant.history.window > 0)){ - storeForwardModule->historySend(p->variant.history.window * 60000, getFrom(&mp)); // window is in minutes - } else { - storeForwardModule->historySend(historyReturnWindow * 60000, getFrom(&mp)); // defaults to 4 hours - } + storeForwardModule->historySend(historyReturnWindow * 60000, getFrom(&mp)); // defaults to 4 hours } } - break; + } + break; - case StoreAndForward_RequestResponse_CLIENT_PING: - if(is_server) { - LOG_INFO("*** StoreAndForward_RequestResponse_CLIENT_PING\n"); - // respond with a ROUTER PONG - storeForwardModule->sendMessage(getFrom(&mp), StoreAndForward_RequestResponse_ROUTER_PONG); + case StoreAndForward_RequestResponse_CLIENT_PING: + if (is_server) { + LOG_INFO("*** StoreAndForward_RequestResponse_CLIENT_PING\n"); + // respond with a ROUTER PONG + storeForwardModule->sendMessage(getFrom(&mp), StoreAndForward_RequestResponse_ROUTER_PONG); + } + break; + + case StoreAndForward_RequestResponse_CLIENT_PONG: + if (is_server) { + LOG_INFO("*** StoreAndForward_RequestResponse_CLIENT_PONG\n"); + // The Client is alive, update NodeDB + nodeDB.updateFrom(mp); + } + break; + + case StoreAndForward_RequestResponse_CLIENT_STATS: + if (is_server) { + LOG_INFO("*** Client Request to send STATS\n"); + if (this->busy) { + storeForwardModule->sendMessage(getFrom(&mp), StoreAndForward_RequestResponse_ROUTER_BUSY); + LOG_INFO("*** S&F - Busy. Try again shortly.\n"); + } else { + storeForwardModule->statsSend(getFrom(&mp)); } - break; + } + break; - case StoreAndForward_RequestResponse_CLIENT_PONG: - if(is_server) { - LOG_INFO("*** StoreAndForward_RequestResponse_CLIENT_PONG\n"); - // The Client is alive, update NodeDB - nodeDB.updateFrom(mp); + case StoreAndForward_RequestResponse_ROUTER_ERROR: + case StoreAndForward_RequestResponse_ROUTER_BUSY: + if (is_client) { + LOG_DEBUG("*** StoreAndForward_RequestResponse_ROUTER_BUSY\n"); + // retry in messages_saved * packetTimeMax ms + retry_delay = + millis() + packetHistoryCurrent * packetTimeMax * (StoreAndForward_RequestResponse_ROUTER_ERROR ? 2 : 1); + } + break; + + case StoreAndForward_RequestResponse_ROUTER_PONG: + // A router responded, this is equal to receiving a heartbeat + case StoreAndForward_RequestResponse_ROUTER_HEARTBEAT: + if (is_client) { + // register heartbeat and interval + if (p->which_variant == StoreAndForward_heartbeat_tag) { + heartbeatInterval = p->variant.heartbeat.period; } - break; + lastHeartbeat = millis(); + LOG_INFO("*** StoreAndForward Heartbeat received\n"); + } + break; - case StoreAndForward_RequestResponse_CLIENT_STATS: - if(is_server) { - LOG_INFO("*** Client Request to send STATS\n"); - if (this->busy) { - storeForwardModule->sendMessage(getFrom(&mp), StoreAndForward_RequestResponse_ROUTER_BUSY); - LOG_INFO("*** S&F - Busy. Try again shortly.\n"); - } else { - storeForwardModule->statsSend(getFrom(&mp)); - } + case StoreAndForward_RequestResponse_ROUTER_PING: + if (is_client) { + LOG_DEBUG("*** StoreAndForward_RequestResponse_ROUTER_PING\n"); + // respond with a CLIENT PONG + storeForwardModule->sendMessage(getFrom(&mp), StoreAndForward_RequestResponse_CLIENT_PONG); + } + break; + + case StoreAndForward_RequestResponse_ROUTER_STATS: + if (is_client) { + LOG_DEBUG("*** Router Response STATS\n"); + // These fields only have informational purpose on a client. Fill them to consume later. + if (p->which_variant == StoreAndForward_stats_tag) { + this->packetHistoryMax = p->variant.stats.messages_total; + this->packetHistoryCurrent = p->variant.stats.messages_saved; + this->records = p->variant.stats.messages_max; + this->requests = p->variant.stats.requests; + this->requests_history = p->variant.stats.requests_history; + this->heartbeat = p->variant.stats.heartbeat; + this->historyReturnMax = p->variant.stats.return_max; + this->historyReturnWindow = p->variant.stats.return_window; } - break; + } + break; - case StoreAndForward_RequestResponse_ROUTER_ERROR: - case StoreAndForward_RequestResponse_ROUTER_BUSY: - if(is_client) { - LOG_DEBUG("*** StoreAndForward_RequestResponse_ROUTER_BUSY\n"); - // retry in messages_saved * packetTimeMax ms - retry_delay = millis() + packetHistoryCurrent * packetTimeMax * (StoreAndForward_RequestResponse_ROUTER_ERROR ? 2 : 1); + case StoreAndForward_RequestResponse_ROUTER_HISTORY: + if (is_client) { + // These fields only have informational purpose on a client. Fill them to consume later. + if (p->which_variant == StoreAndForward_history_tag) { + this->historyReturnWindow = p->variant.history.window / 60000; + LOG_INFO("*** Router Response HISTORY - Sending %d messages from last %d minutes\n", + p->variant.history.history_messages, this->historyReturnWindow); } - break; + } + break; - case StoreAndForward_RequestResponse_ROUTER_PONG: - // A router responded, this is equal to receiving a heartbeat - case StoreAndForward_RequestResponse_ROUTER_HEARTBEAT: - if(is_client) { - // register heartbeat and interval - if (p->which_variant == StoreAndForward_heartbeat_tag) { - heartbeatInterval = p->variant.heartbeat.period; - } - lastHeartbeat = millis(); - LOG_INFO("*** StoreAndForward Heartbeat received\n"); - } - break; - - case StoreAndForward_RequestResponse_ROUTER_PING: - if(is_client) { - LOG_DEBUG("*** StoreAndForward_RequestResponse_ROUTER_PING\n"); - // respond with a CLIENT PONG - storeForwardModule->sendMessage(getFrom(&mp), StoreAndForward_RequestResponse_CLIENT_PONG); - } - break; - - case StoreAndForward_RequestResponse_ROUTER_STATS: - if(is_client) { - LOG_DEBUG("*** Router Response STATS\n"); - // These fields only have informational purpose on a client. Fill them to consume later. - if (p->which_variant == StoreAndForward_stats_tag) { - this->packetHistoryMax = p->variant.stats.messages_total; - this->packetHistoryCurrent = p->variant.stats.messages_saved; - this->records = p->variant.stats.messages_max; - this->requests = p->variant.stats.requests; - this->requests_history = p->variant.stats.requests_history; - this->heartbeat = p->variant.stats.heartbeat; - this->historyReturnMax = p->variant.stats.return_max; - this->historyReturnWindow = p->variant.stats.return_window; - } - } - break; - - case StoreAndForward_RequestResponse_ROUTER_HISTORY: - if(is_client) { - // These fields only have informational purpose on a client. Fill them to consume later. - if (p->which_variant == StoreAndForward_history_tag) { - this->historyReturnWindow = p->variant.history.window / 60000; - LOG_INFO("*** Router Response HISTORY - Sending %d messages from last %d minutes\n", p->variant.history.history_messages, this->historyReturnWindow); - } - } - break; - - default: - assert(0); // unexpected state + default: + assert(0); // unexpected state } return true; // There's no need for others to look at this message. } @@ -437,7 +441,8 @@ StoreForwardModule::StoreForwardModule() if (moduleConfig.store_forward.enabled) { // Router - if ((config.device.role == Config_DeviceConfig_Role_ROUTER) || (config.device.role == Config_DeviceConfig_Role_ROUTER_CLIENT)) { + if ((config.device.role == Config_DeviceConfig_Role_ROUTER) || + (config.device.role == Config_DeviceConfig_Role_ROUTER_CLIENT)) { LOG_INFO("*** Initializing Store & Forward Module in Router mode\n"); if (ESP.getPsramSize() > 0) { if (ESP.getFreePsram() >= 1024 * 1024) { @@ -474,7 +479,8 @@ StoreForwardModule::StoreForwardModule() // Client } - if ((config.device.role == Config_DeviceConfig_Role_CLIENT) || (config.device.role == Config_DeviceConfig_Role_ROUTER_CLIENT)) { + if ((config.device.role == Config_DeviceConfig_Role_CLIENT) || + (config.device.role == Config_DeviceConfig_Role_ROUTER_CLIENT)) { is_client = true; LOG_INFO("*** Initializing Store & Forward Module in Client mode\n"); } diff --git a/src/modules/esp32/StoreForwardModule.h b/src/modules/esp32/StoreForwardModule.h index 4d9e080cf..b1c4084f3 100644 --- a/src/modules/esp32/StoreForwardModule.h +++ b/src/modules/esp32/StoreForwardModule.h @@ -66,12 +66,12 @@ class StoreForwardModule : private concurrency::OSThread, public ProtobufModule< */ virtual bool wantPacket(const MeshPacket *p) override { - switch(p->decoded.portnum) { - case PortNum_TEXT_MESSAGE_APP: - case PortNum_STORE_FORWARD_APP: - return true; - default: - return false; + switch (p->decoded.portnum) { + case PortNum_TEXT_MESSAGE_APP: + case PortNum_STORE_FORWARD_APP: + return true; + default: + return false; } } @@ -79,10 +79,10 @@ class StoreForwardModule : private concurrency::OSThread, public ProtobufModule< void populatePSRAM(); // S&F Defaults - uint32_t historyReturnMax = 250; // 250 records + uint32_t historyReturnMax = 250; // 250 records uint32_t historyReturnWindow = 240; // 4 hours - uint32_t records = 0; // Calculated - bool heartbeat = false; // No heartbeat. + uint32_t records = 0; // Calculated + bool heartbeat = false; // No heartbeat. // stats uint32_t requests = 0; @@ -100,7 +100,6 @@ class StoreForwardModule : private concurrency::OSThread, public ProtobufModule< */ virtual ProcessMessage handleReceived(const MeshPacket &mp) override; virtual bool handleReceivedProtobuf(const MeshPacket &mp, StoreAndForward *p); - }; extern StoreForwardModule *storeForwardModule; diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index f54ecd0b7..a6073af3b 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -12,8 +12,8 @@ #if HAS_WIFI #include #endif -#include #include "mqtt/JSON.h" +#include MQTT *mqtt; @@ -55,11 +55,15 @@ void MQTT::onPublish(char *topic, byte *payload, unsigned int length) } LOG_DEBUG("Looking for Channel name: %s\n", ptr); Channel sendChannel = channels.getByName(ptr); - LOG_DEBUG("Found Channel name: %s (Index %d)\n", channels.getGlobalId(sendChannel.settings.channel_num), sendChannel.settings.channel_num); + LOG_DEBUG("Found Channel name: %s (Index %d)\n", channels.getGlobalId(sendChannel.settings.channel_num), + sendChannel.settings.channel_num); - if ((json.find("sender") != json.end()) && (json.find("payload") != json.end()) && (json.find("type") != json.end()) && json["type"]->IsString() && (json["type"]->AsString().compare("sendtext") == 0)) { + if ((json.find("sender") != json.end()) && (json.find("payload") != json.end()) && + (json.find("type") != json.end()) && json["type"]->IsString() && + (json["type"]->AsString().compare("sendtext") == 0)) { // this is a valid envelope - if (json["payload"]->IsString() && json["type"]->IsString() && (json["sender"]->AsString().compare(owner.id) != 0)) { + if (json["payload"]->IsString() && json["type"]->IsString() && + (json["sender"]->AsString().compare(owner.id) != 0)) { std::string jsonPayloadStr = json["payload"]->AsString(); LOG_INFO("JSON payload %s, length %u\n", jsonPayloadStr.c_str(), jsonPayloadStr.length()); @@ -77,16 +81,20 @@ void MQTT::onPublish(char *topic, byte *payload, unsigned int length) LOG_WARN("Received MQTT json payload too long, dropping\n"); } } else { - LOG_WARN("Received MQTT json payload on channel %s, but downlink is disabled, dropping\n", sendChannel.settings.name); + LOG_WARN("Received MQTT json payload on channel %s, but downlink is disabled, dropping\n", + sendChannel.settings.name); } } else { LOG_DEBUG("JSON Ignoring downlink message we originally sent.\n"); } - } else if ((json.find("sender") != json.end()) && (json.find("payload") != json.end()) && (json.find("type") != json.end()) && json["type"]->IsString() && (json["type"]->AsString().compare("sendposition") == 0)) { - //invent the "sendposition" type for a valid envelope - if (json["payload"]->IsObject() && json["type"]->IsString() && (json["sender"]->AsString().compare(owner.id) != 0)) { + } else if ((json.find("sender") != json.end()) && (json.find("payload") != json.end()) && + (json.find("type") != json.end()) && json["type"]->IsString() && + (json["type"]->AsString().compare("sendposition") == 0)) { + // invent the "sendposition" type for a valid envelope + if (json["payload"]->IsObject() && json["type"]->IsString() && + (json["sender"]->AsString().compare(owner.id) != 0)) { JSONObject posit; - posit = json["payload"]->AsObject(); //get nested JSON Position + posit = json["payload"]->AsObject(); // get nested JSON Position Position pos = Position_init_default; pos.latitude_i = posit["latitude_i"]->AsNumber(); pos.longitude_i = posit["longitude_i"]->AsNumber(); @@ -98,15 +106,17 @@ void MQTT::onPublish(char *topic, byte *payload, unsigned int length) p->decoded.portnum = PortNum_POSITION_APP; p->channel = sendChannel.settings.channel_num; if (sendChannel.settings.downlink_enabled) { - p->decoded.payload.size = pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &Position_msg, &pos); //make the Data protobuf from position + p->decoded.payload.size = pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), + &Position_msg, &pos); // make the Data protobuf from position service.sendToMesh(p, RX_SRC_LOCAL); } else { - LOG_WARN("Received MQTT json payload on channel %s, but downlink is disabled, dropping\n", sendChannel.settings.name); + LOG_WARN("Received MQTT json payload on channel %s, but downlink is disabled, dropping\n", + sendChannel.settings.name); } } else { LOG_DEBUG("JSON Ignoring downlink message we originally sent.\n"); } - } else{ + } else { LOG_ERROR("JSON Received payload on MQTT but not a valid envelope\n"); } } else { @@ -118,7 +128,7 @@ void MQTT::onPublish(char *topic, byte *payload, unsigned int length) if (!pb_decode_from_bytes(payload, length, &ServiceEnvelope_msg, &e)) { LOG_ERROR("Invalid MQTT service envelope, topic %s, len %u!\n", topic, length); return; - }else { + } else { if (strcmp(e.gateway_id, owner.id) == 0) LOG_INFO("Ignoring downlink message we originally sent.\n"); else { @@ -148,7 +158,7 @@ void mqttInit() MQTT::MQTT() : concurrency::OSThread("mqtt"), pubSub(mqttClient), mqttQueue(MAX_MQTT_QUEUE) { - if(moduleConfig.mqtt.enabled) { + if (moduleConfig.mqtt.enabled) { assert(!mqtt); mqtt = this; @@ -170,7 +180,7 @@ void MQTT::reconnect() { if (wantsLink()) { // Defaults - int serverPort = 1883; + int serverPort = 1883; const char *serverAddr = default_mqtt_address; const char *mqttUsername = default_mqtt_username; const char *mqttPassword = default_mqtt_password; @@ -192,7 +202,8 @@ void MQTT::reconnect() pubSub.setServer(serverAddr, serverPort); pubSub.setBufferSize(512); - LOG_INFO("Connecting to MQTT server %s, port: %d, username: %s, password: %s\n", serverAddr, serverPort, mqttUsername, mqttPassword); + LOG_INFO("Connecting to MQTT server %s, port: %d, username: %s, password: %s\n", serverAddr, serverPort, mqttUsername, + mqttPassword); auto myStatus = (statusTopic + owner.id); bool connected = pubSub.connect(owner.id, mqttUsername, mqttPassword, myStatus.c_str(), 1, true, "offline"); if (connected) { @@ -208,7 +219,7 @@ void MQTT::reconnect() sendSubscriptions(); } else { #if HAS_WIFI && !defined(ARCH_PORTDUINO) - LOG_ERROR("Failed to contact MQTT server (%d/5)...\n",reconnectCount + 1); + LOG_ERROR("Failed to contact MQTT server (%d/5)...\n", reconnectCount + 1); if (reconnectCount >= 4) { needReconnect = true; wifiReconnect->setIntervalFromNow(0); @@ -216,7 +227,7 @@ void MQTT::reconnect() } else { reconnectCount++; } - + #endif } } @@ -267,7 +278,7 @@ bool MQTT::wantsLink() const int32_t MQTT::runOnce() { - if(!moduleConfig.mqtt.enabled) { + if (!moduleConfig.mqtt.enabled) { return disable(); } bool wantConnection = wantsLink(); @@ -277,7 +288,8 @@ int32_t MQTT::runOnce() if (wantConnection) { reconnect(); - // If we succeeded, empty the queue one by one and start reading rapidly, else try again in 30 seconds (TCP connections are EXPENSIVE so try rarely) + // If we succeeded, empty the queue one by one and start reading rapidly, else try again in 30 seconds (TCP + // connections are EXPENSIVE so try rarely) if (pubSub.connected()) { if (!mqttQueue.isEmpty()) { // FIXME - this size calculation is super sloppy, but it will go away once we dynamically alloc meshpackets @@ -295,7 +307,8 @@ int32_t MQTT::runOnce() auto jsonString = this->downstreamPacketToJson(env->packet); if (jsonString.length() != 0) { String topicJson = jsonTopic + env->channel_id + "/" + owner.id; - LOG_INFO("JSON publish message to %s, %u bytes: %s\n", topicJson.c_str(), jsonString.length(), jsonString.c_str()); + LOG_INFO("JSON publish message to %s, %u bytes: %s\n", topicJson.c_str(), jsonString.length(), + jsonString.c_str()); pubSub.publish(topicJson.c_str(), jsonString.c_str(), false); } } @@ -348,7 +361,8 @@ void MQTT::onSend(const MeshPacket &mp, ChannelIndex chIndex) auto jsonString = this->downstreamPacketToJson((MeshPacket *)&mp); if (jsonString.length() != 0) { String topicJson = jsonTopic + channelId + "/" + owner.id; - LOG_INFO("JSON publish message to %s, %u bytes: %s\n", topicJson.c_str(), jsonString.length(), jsonString.c_str()); + LOG_INFO("JSON publish message to %s, %u bytes: %s\n", topicJson.c_str(), jsonString.length(), + jsonString.c_str()); pubSub.publish(topicJson.c_str(), jsonString.c_str(), false); } } @@ -453,11 +467,17 @@ std::string MQTT::downstreamPacketToJson(MeshPacket *mp) memset(&scratch, 0, sizeof(scratch)); if (pb_decode_from_bytes(mp->decoded.payload.bytes, mp->decoded.payload.size, &Position_msg, &scratch)) { decoded = &scratch; - if((int)decoded->time){msgPayload["time"] = new JSONValue((int)decoded->time);} - if ((int)decoded->timestamp){msgPayload["timestamp"] = new JSONValue((int)decoded->timestamp);} + if ((int)decoded->time) { + msgPayload["time"] = new JSONValue((int)decoded->time); + } + if ((int)decoded->timestamp) { + msgPayload["timestamp"] = new JSONValue((int)decoded->timestamp); + } msgPayload["latitude_i"] = new JSONValue((int)decoded->latitude_i); msgPayload["longitude_i"] = new JSONValue((int)decoded->longitude_i); - if((int)decoded->altitude){msgPayload["altitude"] = new JSONValue((int)decoded->altitude);} + if ((int)decoded->altitude) { + msgPayload["altitude"] = new JSONValue((int)decoded->altitude); + } jsonObj["payload"] = new JSONValue(msgPayload); } else { LOG_ERROR("Error decoding protobuf for position message!\n"); diff --git a/src/mqtt/MQTT.h b/src/mqtt/MQTT.h index 563ba7164..3f2cf2de6 100644 --- a/src/mqtt/MQTT.h +++ b/src/mqtt/MQTT.h @@ -53,7 +53,7 @@ class MQTT : private concurrency::OSThread void reconnect(); bool connected(); - + protected: PointerQueue mqttQueue; @@ -80,7 +80,7 @@ class MQTT : private concurrency::OSThread std::string downstreamPacketToJson(MeshPacket *mp); /// Return 0 if sleep is okay, veto sleep if we are connected to pubsub server - // int preflightSleepCb(void *unused = NULL) { return pubSub.connected() ? 1 : 0; } + // int preflightSleepCb(void *unused = NULL) { return pubSub.connected() ? 1 : 0; } }; void mqttInit(); diff --git a/src/xmodem.cpp b/src/xmodem.cpp index 4f61c6c96..aed551795 100644 --- a/src/xmodem.cpp +++ b/src/xmodem.cpp @@ -3,9 +3,9 @@ *********************************************************************************************************************** * Copyright 2001-2019 Georges Menie (www.menie.org) * All rights reserved. - * + * * Adapted for protobuf encapsulation. this is not really Xmodem any more. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -36,14 +36,14 @@ XModemAdapter xModem; XModemAdapter::XModemAdapter() { - xmodemStore = (XModem*)malloc(XModem_size); + xmodemStore = (XModem *)malloc(XModem_size); } unsigned short XModemAdapter::crc16_ccitt(const pb_byte_t *buffer, int length) { unsigned short crc16 = 0; - while(length != 0) { - crc16 = (unsigned char)(crc16 >> 8) | (crc16 << 8); + while (length != 0) { + crc16 = (unsigned char)(crc16 >> 8) | (crc16 << 8); crc16 ^= *buffer; crc16 ^= (unsigned char)(crc16 & 0xff) >> 4; crc16 ^= (crc16 << 8) << 4; @@ -64,7 +64,8 @@ int XModemAdapter::check(const pb_byte_t *buf, int sz, unsigned short tcrc) return 0; } -void XModemAdapter::sendControl(XModem_Control c) { +void XModemAdapter::sendControl(XModem_Control c) +{ memset(xmodemStore, 0, XModem_size); xmodemStore->control = c; LOG_DEBUG("XModem: Notify Sending control %d.\n", c); @@ -73,7 +74,7 @@ void XModemAdapter::sendControl(XModem_Control c) { XModem *XModemAdapter::getForPhone() { - if(xmodemStore) { + if (xmodemStore) { return xmodemStore; } else { return NULL; @@ -82,138 +83,139 @@ XModem *XModemAdapter::getForPhone() void XModemAdapter::handlePacket(XModem xmodemPacket) { - switch(xmodemPacket.control) { - case XModem_Control_SOH: - case XModem_Control_STX: - if ((xmodemPacket.seq == 0) && !isReceiving && !isTransmitting) { - // NULL packet has the destination filename - memcpy(filename, &xmodemPacket.buffer.bytes, xmodemPacket.buffer.size); - if(xmodemPacket.control == XModem_Control_SOH) { // Receive this file and put to Flash - file = FSCom.open(filename, FILE_O_WRITE); - if(file) { - sendControl(XModem_Control_ACK); - isReceiving = true; - packetno = 1; - break; - } - sendControl(XModem_Control_NAK); - isReceiving = false; - break; - } else { // Transmit this file from Flash - LOG_INFO("XModem: Transmitting file %s\n", filename); - file = FSCom.open(filename, FILE_O_READ); - if (file) { - packetno = 1; - isTransmitting = true; - memset(xmodemStore, 0, XModem_size); - xmodemStore->control = XModem_Control_SOH; - xmodemStore->seq = packetno; - xmodemStore->buffer.size = file.read(xmodemStore->buffer.bytes, sizeof(XModem_buffer_t::bytes)); - xmodemStore->crc16 = crc16_ccitt(xmodemStore->buffer.bytes, xmodemStore->buffer.size); - LOG_DEBUG("XModem: STX Notify Sending packet %d, %d Bytes.\n", packetno, xmodemStore->buffer.size); - if (xmodemStore->buffer.size < sizeof(XModem_buffer_t::bytes)) { - isEOT = true; - // send EOT on next Ack - } - packetReady.notifyObservers(packetno); - break; - } - sendControl(XModem_Control_NAK); - isTransmitting = false; + switch (xmodemPacket.control) { + case XModem_Control_SOH: + case XModem_Control_STX: + if ((xmodemPacket.seq == 0) && !isReceiving && !isTransmitting) { + // NULL packet has the destination filename + memcpy(filename, &xmodemPacket.buffer.bytes, xmodemPacket.buffer.size); + if (xmodemPacket.control == XModem_Control_SOH) { // Receive this file and put to Flash + file = FSCom.open(filename, FILE_O_WRITE); + if (file) { + sendControl(XModem_Control_ACK); + isReceiving = true; + packetno = 1; break; } - } else { - if (isReceiving) { - // normal file data packet - if ((xmodemPacket.seq == packetno) && check(xmodemPacket.buffer.bytes, xmodemPacket.buffer.size, xmodemPacket.crc16)) { - // valid packet - file.write(xmodemPacket.buffer.bytes, xmodemPacket.buffer.size); - sendControl(XModem_Control_ACK); - packetno++; - break; + sendControl(XModem_Control_NAK); + isReceiving = false; + break; + } else { // Transmit this file from Flash + LOG_INFO("XModem: Transmitting file %s\n", filename); + file = FSCom.open(filename, FILE_O_READ); + if (file) { + packetno = 1; + isTransmitting = true; + memset(xmodemStore, 0, XModem_size); + xmodemStore->control = XModem_Control_SOH; + xmodemStore->seq = packetno; + xmodemStore->buffer.size = file.read(xmodemStore->buffer.bytes, sizeof(XModem_buffer_t::bytes)); + xmodemStore->crc16 = crc16_ccitt(xmodemStore->buffer.bytes, xmodemStore->buffer.size); + LOG_DEBUG("XModem: STX Notify Sending packet %d, %d Bytes.\n", packetno, xmodemStore->buffer.size); + if (xmodemStore->buffer.size < sizeof(XModem_buffer_t::bytes)) { + isEOT = true; + // send EOT on next Ack } - // invalid packet - sendControl(XModem_Control_NAK); - break; - } else if (isTransmitting) { - // just received something weird. - sendControl(XModem_Control_CAN); - isTransmitting = false; + packetReady.notifyObservers(packetno); break; } + sendControl(XModem_Control_NAK); + isTransmitting = false; + break; } - break; - case XModem_Control_EOT: - // End of transmission - sendControl(XModem_Control_ACK); - file.close(); - isReceiving = false; - break; - case XModem_Control_CAN: - // Cancel transmission and remove file - sendControl(XModem_Control_ACK); - file.close(); - FSCom.remove(filename); - isReceiving = false; - break; - case XModem_Control_ACK: - // Acknowledge Send the next packet - if (isTransmitting) { - if (isEOT) { - sendControl(XModem_Control_EOT); - file.close(); - LOG_INFO("XModem: Finished sending file %s\n", filename); - isTransmitting = false; - isEOT = false; + } else { + if (isReceiving) { + // normal file data packet + if ((xmodemPacket.seq == packetno) && + check(xmodemPacket.buffer.bytes, xmodemPacket.buffer.size, xmodemPacket.crc16)) { + // valid packet + file.write(xmodemPacket.buffer.bytes, xmodemPacket.buffer.size); + sendControl(XModem_Control_ACK); + packetno++; break; } - retrans = MAXRETRANS; // reset retransmit counter - packetno++; - memset(xmodemStore, 0, XModem_size); - xmodemStore->control = XModem_Control_SOH; - xmodemStore->seq = packetno; - xmodemStore->buffer.size = file.read(xmodemStore->buffer.bytes, sizeof(XModem_buffer_t::bytes)); - xmodemStore->crc16 = crc16_ccitt(xmodemStore->buffer.bytes, xmodemStore->buffer.size); - LOG_DEBUG("XModem: ACK Notify Sending packet %d, %d Bytes.\n", packetno, xmodemStore->buffer.size); - if (xmodemStore->buffer.size < sizeof(XModem_buffer_t::bytes)) { - isEOT = true; - // send EOT on next Ack - } - packetReady.notifyObservers(packetno); - } else { + // invalid packet + sendControl(XModem_Control_NAK); + break; + } else if (isTransmitting) { // just received something weird. sendControl(XModem_Control_CAN); + isTransmitting = false; + break; } - break; - case XModem_Control_NAK: - // Negative acknowledge. Send the same buffer again - if (isTransmitting) { - if (--retrans <= 0) { - sendControl(XModem_Control_CAN); - file.close(); - LOG_INFO("XModem: Retransmit timeout, cancelling file %s\n", filename); - isTransmitting = false; - break; - } - memset(xmodemStore, 0, XModem_size); - xmodemStore->control = XModem_Control_SOH; - xmodemStore->seq = packetno; - file.seek((packetno-1) * sizeof(XModem_buffer_t::bytes)); - xmodemStore->buffer.size = file.read(xmodemStore->buffer.bytes, sizeof(XModem_buffer_t::bytes)); - xmodemStore->crc16 = crc16_ccitt(xmodemStore->buffer.bytes, xmodemStore->buffer.size); - LOG_DEBUG("XModem: NAK Notify Sending packet %d, %d Bytes.\n", packetno, xmodemStore->buffer.size); - if (xmodemStore->buffer.size < sizeof(XModem_buffer_t::bytes)) { - isEOT = true; - // send EOT on next Ack - } - packetReady.notifyObservers(packetno); - } else { - // just received something weird. + } + break; + case XModem_Control_EOT: + // End of transmission + sendControl(XModem_Control_ACK); + file.close(); + isReceiving = false; + break; + case XModem_Control_CAN: + // Cancel transmission and remove file + sendControl(XModem_Control_ACK); + file.close(); + FSCom.remove(filename); + isReceiving = false; + break; + case XModem_Control_ACK: + // Acknowledge Send the next packet + if (isTransmitting) { + if (isEOT) { + sendControl(XModem_Control_EOT); + file.close(); + LOG_INFO("XModem: Finished sending file %s\n", filename); + isTransmitting = false; + isEOT = false; + break; + } + retrans = MAXRETRANS; // reset retransmit counter + packetno++; + memset(xmodemStore, 0, XModem_size); + xmodemStore->control = XModem_Control_SOH; + xmodemStore->seq = packetno; + xmodemStore->buffer.size = file.read(xmodemStore->buffer.bytes, sizeof(XModem_buffer_t::bytes)); + xmodemStore->crc16 = crc16_ccitt(xmodemStore->buffer.bytes, xmodemStore->buffer.size); + LOG_DEBUG("XModem: ACK Notify Sending packet %d, %d Bytes.\n", packetno, xmodemStore->buffer.size); + if (xmodemStore->buffer.size < sizeof(XModem_buffer_t::bytes)) { + isEOT = true; + // send EOT on next Ack + } + packetReady.notifyObservers(packetno); + } else { + // just received something weird. + sendControl(XModem_Control_CAN); + } + break; + case XModem_Control_NAK: + // Negative acknowledge. Send the same buffer again + if (isTransmitting) { + if (--retrans <= 0) { sendControl(XModem_Control_CAN); + file.close(); + LOG_INFO("XModem: Retransmit timeout, cancelling file %s\n", filename); + isTransmitting = false; + break; } - break; - default: - // Unknown control character - break; + memset(xmodemStore, 0, XModem_size); + xmodemStore->control = XModem_Control_SOH; + xmodemStore->seq = packetno; + file.seek((packetno - 1) * sizeof(XModem_buffer_t::bytes)); + xmodemStore->buffer.size = file.read(xmodemStore->buffer.bytes, sizeof(XModem_buffer_t::bytes)); + xmodemStore->crc16 = crc16_ccitt(xmodemStore->buffer.bytes, xmodemStore->buffer.size); + LOG_DEBUG("XModem: NAK Notify Sending packet %d, %d Bytes.\n", packetno, xmodemStore->buffer.size); + if (xmodemStore->buffer.size < sizeof(XModem_buffer_t::bytes)) { + isEOT = true; + // send EOT on next Ack + } + packetReady.notifyObservers(packetno); + } else { + // just received something weird. + sendControl(XModem_Control_CAN); + } + break; + default: + // Unknown control character + break; } } diff --git a/src/xmodem.h b/src/xmodem.h index 3540c0649..8a9c08db6 100644 --- a/src/xmodem.h +++ b/src/xmodem.h @@ -3,9 +3,9 @@ *********************************************************************************************************************** * Copyright 2001-2019 Georges Menie (www.menie.org) * All rights reserved. - * + * * Adapted for protobuf encapsulation. this is not really Xmodem any more. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -32,45 +32,45 @@ #pragma once +#include "FSCommon.h" #include "configuration.h" #include "mesh/generated/meshtastic/xmodem.pb.h" -#include "FSCommon.h" #define MAXRETRANS 25 class XModemAdapter { - public: - // Called when we put a fragment in the outgoing memory - Observable packetReady; + public: + // Called when we put a fragment in the outgoing memory + Observable packetReady; - XModemAdapter(); + XModemAdapter(); - void handlePacket(XModem xmodemPacket); - XModem *getForPhone(); + void handlePacket(XModem xmodemPacket); + XModem *getForPhone(); - private: - bool isReceiving = false; - bool isTransmitting = false; - bool isEOT = false; + private: + bool isReceiving = false; + bool isTransmitting = false; + bool isEOT = false; - int retrans = MAXRETRANS; + int retrans = MAXRETRANS; - uint16_t packetno = 0; + uint16_t packetno = 0; #ifdef ARCH_NRF52 - File file = File(FSCom); + File file = File(FSCom); #else - File file; + File file; #endif - char filename[sizeof(XModem_buffer_t::bytes)] = {0}; + char filename[sizeof(XModem_buffer_t::bytes)] = {0}; - protected: - XModem *xmodemStore = NULL; - unsigned short crc16_ccitt(const pb_byte_t *buffer, int length); - int check(const pb_byte_t *buf, int sz, unsigned short tcrc); - void sendControl(XModem_Control c); + protected: + XModem *xmodemStore = NULL; + unsigned short crc16_ccitt(const pb_byte_t *buffer, int length); + int check(const pb_byte_t *buf, int sz, unsigned short tcrc); + void sendControl(XModem_Control c); }; extern XModemAdapter xModem; From ee25a488ef4223d12912b22f824e5ea3dacde754 Mon Sep 17 00:00:00 2001 From: thebentern Date: Wed, 18 Jan 2023 21:12:03 +0000 Subject: [PATCH 16/20] [create-pull-request] automated change --- protobufs | 2 +- src/mesh/generated/meshtastic/config.pb.h | 14 +++++++++----- src/mesh/generated/meshtastic/device_metadata.pb.h | 10 +++++----- src/mesh/generated/meshtastic/localonly.pb.h | 2 +- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/protobufs b/protobufs index 2b391ff8a..aaa6e08b2 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 2b391ff8a76bfc07662faa007bb4fd6e01691ba8 +Subproject commit aaa6e08b2e00127d4396f3a994cede4a749cff9c diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index 52f3ed207..f49c330d9 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -300,6 +300,8 @@ typedef struct _Config_NetworkConfig { /* struct to keep static address */ bool has_ipv4_config; Config_NetworkConfig_IpV4Config ipv4_config; + /* rsyslog Server and Port */ + char rsyslog_server[33]; } Config_NetworkConfig; /* Display Config */ @@ -476,7 +478,7 @@ extern "C" { #define Config_DeviceConfig_init_default {_Config_DeviceConfig_Role_MIN, 0, 0, 0, 0} #define Config_PositionConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0} #define Config_PowerConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0} -#define Config_NetworkConfig_init_default {0, "", "", "", 0, _Config_NetworkConfig_AddressMode_MIN, false, Config_NetworkConfig_IpV4Config_init_default} +#define Config_NetworkConfig_init_default {0, "", "", "", 0, _Config_NetworkConfig_AddressMode_MIN, false, Config_NetworkConfig_IpV4Config_init_default, ""} #define Config_NetworkConfig_IpV4Config_init_default {0, 0, 0, 0} #define Config_DisplayConfig_init_default {0, _Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _Config_DisplayConfig_DisplayUnits_MIN, _Config_DisplayConfig_OledType_MIN, _Config_DisplayConfig_DisplayMode_MIN, 0} #define Config_LoRaConfig_init_default {0, _Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, {0, 0, 0}} @@ -485,7 +487,7 @@ extern "C" { #define Config_DeviceConfig_init_zero {_Config_DeviceConfig_Role_MIN, 0, 0, 0, 0} #define Config_PositionConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0} #define Config_PowerConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0} -#define Config_NetworkConfig_init_zero {0, "", "", "", 0, _Config_NetworkConfig_AddressMode_MIN, false, Config_NetworkConfig_IpV4Config_init_zero} +#define Config_NetworkConfig_init_zero {0, "", "", "", 0, _Config_NetworkConfig_AddressMode_MIN, false, Config_NetworkConfig_IpV4Config_init_zero, ""} #define Config_NetworkConfig_IpV4Config_init_zero {0, 0, 0, 0} #define Config_DisplayConfig_init_zero {0, _Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0, 0, _Config_DisplayConfig_DisplayUnits_MIN, _Config_DisplayConfig_OledType_MIN, _Config_DisplayConfig_DisplayMode_MIN, 0} #define Config_LoRaConfig_init_zero {0, _Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, {0, 0, 0}} @@ -525,6 +527,7 @@ extern "C" { #define Config_NetworkConfig_eth_enabled_tag 6 #define Config_NetworkConfig_address_mode_tag 7 #define Config_NetworkConfig_ipv4_config_tag 8 +#define Config_NetworkConfig_rsyslog_server_tag 9 #define Config_DisplayConfig_screen_on_secs_tag 1 #define Config_DisplayConfig_gps_format_tag 2 #define Config_DisplayConfig_auto_screen_carousel_secs_tag 3 @@ -618,7 +621,8 @@ X(a, STATIC, SINGULAR, STRING, wifi_psk, 4) \ X(a, STATIC, SINGULAR, STRING, ntp_server, 5) \ X(a, STATIC, SINGULAR, BOOL, eth_enabled, 6) \ X(a, STATIC, SINGULAR, UENUM, address_mode, 7) \ -X(a, STATIC, OPTIONAL, MESSAGE, ipv4_config, 8) +X(a, STATIC, OPTIONAL, MESSAGE, ipv4_config, 8) \ +X(a, STATIC, SINGULAR, STRING, rsyslog_server, 9) #define Config_NetworkConfig_CALLBACK NULL #define Config_NetworkConfig_DEFAULT NULL #define Config_NetworkConfig_ipv4_config_MSGTYPE Config_NetworkConfig_IpV4Config @@ -695,10 +699,10 @@ extern const pb_msgdesc_t Config_BluetoothConfig_msg; #define Config_DisplayConfig_size 26 #define Config_LoRaConfig_size 70 #define Config_NetworkConfig_IpV4Config_size 20 -#define Config_NetworkConfig_size 161 +#define Config_NetworkConfig_size 195 #define Config_PositionConfig_size 42 #define Config_PowerConfig_size 43 -#define Config_size 164 +#define Config_size 198 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/device_metadata.pb.h b/src/mesh/generated/meshtastic/device_metadata.pb.h index 53d99f66e..cf6314e19 100644 --- a/src/mesh/generated/meshtastic/device_metadata.pb.h +++ b/src/mesh/generated/meshtastic/device_metadata.pb.h @@ -28,7 +28,7 @@ typedef struct _DeviceMetadata { /* Indicates that the device's role in the mesh */ Config_DeviceConfig_Role role; /* Indicates the device's current enabled position flags */ - Config_PositionConfig_PositionFlags position_flags; + uint32_t position_flags; } DeviceMetadata; @@ -37,8 +37,8 @@ extern "C" { #endif /* Initializer values for message structs */ -#define DeviceMetadata_init_default {"", 0, 0, 0, 0, 0, _Config_DeviceConfig_Role_MIN, _Config_PositionConfig_PositionFlags_MIN} -#define DeviceMetadata_init_zero {"", 0, 0, 0, 0, 0, _Config_DeviceConfig_Role_MIN, _Config_PositionConfig_PositionFlags_MIN} +#define DeviceMetadata_init_default {"", 0, 0, 0, 0, 0, _Config_DeviceConfig_Role_MIN, 0} +#define DeviceMetadata_init_zero {"", 0, 0, 0, 0, 0, _Config_DeviceConfig_Role_MIN, 0} /* Field tags (for use in manual encoding/decoding) */ #define DeviceMetadata_firmware_version_tag 1 @@ -59,7 +59,7 @@ X(a, STATIC, SINGULAR, BOOL, hasWifi, 4) \ X(a, STATIC, SINGULAR, BOOL, hasBluetooth, 5) \ X(a, STATIC, SINGULAR, BOOL, hasEthernet, 6) \ X(a, STATIC, SINGULAR, UENUM, role, 7) \ -X(a, STATIC, SINGULAR, UENUM, position_flags, 8) +X(a, STATIC, SINGULAR, UINT32, position_flags, 8) #define DeviceMetadata_CALLBACK NULL #define DeviceMetadata_DEFAULT NULL @@ -69,7 +69,7 @@ extern const pb_msgdesc_t DeviceMetadata_msg; #define DeviceMetadata_fields &DeviceMetadata_msg /* Maximum encoded size of messages (where known) */ -#define DeviceMetadata_size 38 +#define DeviceMetadata_size 41 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/localonly.pb.h b/src/mesh/generated/meshtastic/localonly.pb.h index 39d99157d..fbaa06666 100644 --- a/src/mesh/generated/meshtastic/localonly.pb.h +++ b/src/mesh/generated/meshtastic/localonly.pb.h @@ -156,7 +156,7 @@ extern const pb_msgdesc_t LocalModuleConfig_msg; #define LocalModuleConfig_fields &LocalModuleConfig_msg /* Maximum encoded size of messages (where known) */ -#define LocalConfig_size 391 +#define LocalConfig_size 425 #define LocalModuleConfig_size 412 #ifdef __cplusplus From 9cda2e9058deef4376ca9f8956a231cf553d62ed Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 18 Jan 2023 15:15:02 -0600 Subject: [PATCH 17/20] Add role and position flags to metadata --- src/modules/AdminModule.cpp | 215 ++++++++++++++++++------------------ 1 file changed, 108 insertions(+), 107 deletions(-) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 0bef684f2..ac13f273a 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -109,11 +109,11 @@ bool AdminModule::handleReceivedProtobuf(const MeshPacket &mp, AdminMessage *r) } case AdminMessage_reboot_ota_seconds_tag: { int32_t s = r->reboot_ota_seconds; -#ifdef ARCH_ESP32 +#ifdef ARCH_ESP32 if (BleOta::getOtaAppVersion().isEmpty()) { LOG_INFO("No OTA firmware available, scheduling regular reboot in %d seconds\n", s); screen->startRebootScreen(); - }else{ + } else { screen->startFirmwareUpdateScreen(); BleOta::switchToOtaApp(); LOG_INFO("Rebooting to OTA in %d seconds\n", s); @@ -141,7 +141,8 @@ bool AdminModule::handleReceivedProtobuf(const MeshPacket &mp, AdminMessage *r) nodeDB.factoryReset(); reboot(DEFAULT_REBOOT_SECONDS); break; - } case AdminMessage_nodedb_reset_tag: { + } + case AdminMessage_nodedb_reset_tag: { LOG_INFO("Initiating node-db reset\n"); nodeDB.resetNodes(); reboot(DEFAULT_REBOOT_SECONDS); @@ -179,7 +180,7 @@ bool AdminModule::handleReceivedProtobuf(const MeshPacket &mp, AdminMessage *r) } break; } - + // If asked for a response and it is not yet set, generate an 'ACK' response if (mp.decoded.want_response && !myReply) { myReply = allocErrorResponse(Routing_Error_NONE, &mp); @@ -213,7 +214,7 @@ void AdminModule::handleSetOwner(const User &o) changed = 1; licensed_changed = true; owner.is_licensed = o.is_licensed; - config.lora.override_duty_cycle = owner.is_licensed; // override duty cycle for licensed operators + config.lora.override_duty_cycle = owner.is_licensed; // override duty cycle for licensed operators } if (changed) { // If nothing really changed, don't broadcast on the network or write to flash @@ -228,106 +229,104 @@ void AdminModule::handleSetConfig(const Config &c) bool isRegionUnset = (config.lora.region == Config_LoRaConfig_RegionCode_UNSET); switch (c.which_payload_variant) { - case Config_device_tag: - LOG_INFO("Setting config: Device\n"); - config.has_device = true; - config.device = c.payload_variant.device; - // If we're setting router role for the first time, install its intervals - if (!isRouter && - c.payload_variant.device.role == Config_DeviceConfig_Role_ROUTER) { - nodeDB.initConfigIntervals(); - nodeDB.initModuleConfigIntervals(); - } - break; - case Config_position_tag: - LOG_INFO("Setting config: Position\n"); - config.has_position = true; - config.position = c.payload_variant.position; - // Save nodedb as well in case we got a fixed position packet - saveChanges(SEGMENT_DEVICESTATE, false); - break; - case Config_power_tag: - LOG_INFO("Setting config: Power\n"); - config.has_power = true; - config.power = c.payload_variant.power; - break; - case Config_network_tag: - LOG_INFO("Setting config: WiFi\n"); - config.has_network = true; - config.network = c.payload_variant.network; - break; - case Config_display_tag: - LOG_INFO("Setting config: Display\n"); - config.has_display = true; - config.display = c.payload_variant.display; - break; - case Config_lora_tag: - LOG_INFO("Setting config: LoRa\n"); - config.has_lora = true; - config.lora = c.payload_variant.lora; - if (isRegionUnset && - config.lora.region > Config_LoRaConfig_RegionCode_UNSET) { - config.lora.tx_enabled = true; - } - break; - case Config_bluetooth_tag: - LOG_INFO("Setting config: Bluetooth\n"); - config.has_bluetooth = true; - config.bluetooth = c.payload_variant.bluetooth; - break; + case Config_device_tag: + LOG_INFO("Setting config: Device\n"); + config.has_device = true; + config.device = c.payload_variant.device; + // If we're setting router role for the first time, install its intervals + if (!isRouter && c.payload_variant.device.role == Config_DeviceConfig_Role_ROUTER) { + nodeDB.initConfigIntervals(); + nodeDB.initModuleConfigIntervals(); + } + break; + case Config_position_tag: + LOG_INFO("Setting config: Position\n"); + config.has_position = true; + config.position = c.payload_variant.position; + // Save nodedb as well in case we got a fixed position packet + saveChanges(SEGMENT_DEVICESTATE, false); + break; + case Config_power_tag: + LOG_INFO("Setting config: Power\n"); + config.has_power = true; + config.power = c.payload_variant.power; + break; + case Config_network_tag: + LOG_INFO("Setting config: WiFi\n"); + config.has_network = true; + config.network = c.payload_variant.network; + break; + case Config_display_tag: + LOG_INFO("Setting config: Display\n"); + config.has_display = true; + config.display = c.payload_variant.display; + break; + case Config_lora_tag: + LOG_INFO("Setting config: LoRa\n"); + config.has_lora = true; + config.lora = c.payload_variant.lora; + if (isRegionUnset && config.lora.region > Config_LoRaConfig_RegionCode_UNSET) { + config.lora.tx_enabled = true; + } + break; + case Config_bluetooth_tag: + LOG_INFO("Setting config: Bluetooth\n"); + config.has_bluetooth = true; + config.bluetooth = c.payload_variant.bluetooth; + break; } - + saveChanges(SEGMENT_CONFIG); } void AdminModule::handleSetModuleConfig(const ModuleConfig &c) { switch (c.which_payload_variant) { - case ModuleConfig_mqtt_tag: - LOG_INFO("Setting module config: MQTT\n"); - moduleConfig.has_mqtt = true; - moduleConfig.mqtt = c.payload_variant.mqtt; - break; - case ModuleConfig_serial_tag: - LOG_INFO("Setting module config: Serial\n"); - moduleConfig.has_serial = true; - moduleConfig.serial = c.payload_variant.serial; - break; - case ModuleConfig_external_notification_tag: - LOG_INFO("Setting module config: External Notification\n"); - moduleConfig.has_external_notification = true; - moduleConfig.external_notification = c.payload_variant.external_notification; - break; - case ModuleConfig_store_forward_tag: - LOG_INFO("Setting module config: Store & Forward\n"); - moduleConfig.has_store_forward = true; - moduleConfig.store_forward = c.payload_variant.store_forward; - break; - case ModuleConfig_range_test_tag: - LOG_INFO("Setting module config: Range Test\n"); - moduleConfig.has_range_test = true; - moduleConfig.range_test = c.payload_variant.range_test; - break; - case ModuleConfig_telemetry_tag: - LOG_INFO("Setting module config: Telemetry\n"); - moduleConfig.has_telemetry = true; - moduleConfig.telemetry = c.payload_variant.telemetry; - break; - case ModuleConfig_canned_message_tag: - LOG_INFO("Setting module config: Canned Message\n"); - moduleConfig.has_canned_message = true; - moduleConfig.canned_message = c.payload_variant.canned_message; - break; - case ModuleConfig_audio_tag: - LOG_INFO("Setting module config: Audio\n"); - moduleConfig.has_audio = true; - moduleConfig.audio = c.payload_variant.audio; - break; - case ModuleConfig_remote_hardware_tag: - LOG_INFO("Setting module config: Remote Hardware\n"); - moduleConfig.has_remote_hardware = true; - moduleConfig.remote_hardware = c.payload_variant.remote_hardware; - break; + case ModuleConfig_mqtt_tag: + LOG_INFO("Setting module config: MQTT\n"); + moduleConfig.has_mqtt = true; + moduleConfig.mqtt = c.payload_variant.mqtt; + break; + case ModuleConfig_serial_tag: + LOG_INFO("Setting module config: Serial\n"); + moduleConfig.has_serial = true; + moduleConfig.serial = c.payload_variant.serial; + break; + case ModuleConfig_external_notification_tag: + LOG_INFO("Setting module config: External Notification\n"); + moduleConfig.has_external_notification = true; + moduleConfig.external_notification = c.payload_variant.external_notification; + break; + case ModuleConfig_store_forward_tag: + LOG_INFO("Setting module config: Store & Forward\n"); + moduleConfig.has_store_forward = true; + moduleConfig.store_forward = c.payload_variant.store_forward; + break; + case ModuleConfig_range_test_tag: + LOG_INFO("Setting module config: Range Test\n"); + moduleConfig.has_range_test = true; + moduleConfig.range_test = c.payload_variant.range_test; + break; + case ModuleConfig_telemetry_tag: + LOG_INFO("Setting module config: Telemetry\n"); + moduleConfig.has_telemetry = true; + moduleConfig.telemetry = c.payload_variant.telemetry; + break; + case ModuleConfig_canned_message_tag: + LOG_INFO("Setting module config: Canned Message\n"); + moduleConfig.has_canned_message = true; + moduleConfig.canned_message = c.payload_variant.canned_message; + break; + case ModuleConfig_audio_tag: + LOG_INFO("Setting module config: Audio\n"); + moduleConfig.has_audio = true; + moduleConfig.audio = c.payload_variant.audio; + break; + case ModuleConfig_remote_hardware_tag: + LOG_INFO("Setting module config: Remote Hardware\n"); + moduleConfig.has_remote_hardware = true; + moduleConfig.remote_hardware = c.payload_variant.remote_hardware; + break; } saveChanges(SEGMENT_MODULECONFIG); @@ -381,7 +380,8 @@ void AdminModule::handleGetConfig(const MeshPacket &req, const uint32_t configTy LOG_INFO("Getting config: Network\n"); res.get_config_response.which_payload_variant = Config_network_tag; res.get_config_response.payload_variant.network = config.network; - writeSecret(res.get_config_response.payload_variant.network.wifi_psk, sizeof(res.get_config_response.payload_variant.network.wifi_psk), config.network.wifi_psk); + writeSecret(res.get_config_response.payload_variant.network.wifi_psk, + sizeof(res.get_config_response.payload_variant.network.wifi_psk), config.network.wifi_psk); break; case AdminMessage_ConfigType_DISPLAY_CONFIG: LOG_INFO("Getting config: Display\n"); @@ -430,8 +430,7 @@ void AdminModule::handleGetModuleConfig(const MeshPacket &req, const uint32_t co case AdminMessage_ModuleConfigType_EXTNOTIF_CONFIG: LOG_INFO("Getting module config: External Notification\n"); res.get_module_config_response.which_payload_variant = ModuleConfig_external_notification_tag; - res.get_module_config_response.payload_variant.external_notification = - moduleConfig.external_notification; + res.get_module_config_response.payload_variant.external_notification = moduleConfig.external_notification; break; case AdminMessage_ModuleConfigType_STOREFORWARD_CONFIG: LOG_INFO("Getting module config: Store & Forward\n"); @@ -477,9 +476,10 @@ void AdminModule::handleGetModuleConfig(const MeshPacket &req, const uint32_t co } } -void AdminModule::handleGetDeviceMetadata(const MeshPacket &req) { +void AdminModule::handleGetDeviceMetadata(const MeshPacket &req) +{ AdminMessage r = AdminMessage_init_default; - + DeviceMetadata deviceMetadata; strncpy(deviceMetadata.firmware_version, myNodeInfo.firmware_version, 18); deviceMetadata.device_state_version = DEVICESTATE_CUR_VER; @@ -487,6 +487,8 @@ void AdminModule::handleGetDeviceMetadata(const MeshPacket &req) { deviceMetadata.hasBluetooth = HAS_BLUETOOTH; deviceMetadata.hasWifi = HAS_WIFI; deviceMetadata.hasEthernet = HAS_ETHERNET; + deviceMetadata.role = config.device.role; + deviceMetadata.position_flags = config.position.position_flags; r.get_device_metadata_response = deviceMetadata; r.which_payload_variant = AdminMessage_get_device_metadata_response_tag; @@ -504,14 +506,14 @@ void AdminModule::handleGetChannel(const MeshPacket &req, uint32_t channelIndex) } } -void AdminModule::reboot(int32_t seconds) +void AdminModule::reboot(int32_t seconds) { LOG_INFO("Rebooting in %d seconds\n", seconds); screen->startRebootScreen(); rebootAtMsec = (seconds < 0) ? 0 : (millis() + seconds * 1000); } -void AdminModule::saveChanges(int saveWhat, bool shouldReboot) +void AdminModule::saveChanges(int saveWhat, bool shouldReboot) { if (!hasOpenEditTransaction) { LOG_INFO("Saving changes to disk\n"); @@ -519,8 +521,7 @@ void AdminModule::saveChanges(int saveWhat, bool shouldReboot) } else { LOG_INFO("Delaying save of changes to disk until the open transaction is committed\n"); } - if (shouldReboot) - { + if (shouldReboot) { reboot(DEFAULT_REBOOT_SECONDS); } } From 6c41960919f057371567f334271efd4907b6b091 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 18 Jan 2023 15:55:58 -0600 Subject: [PATCH 18/20] Remove simulator for now --- .github/workflows/main_matrix.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 420ad0e35..8932cad45 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -116,10 +116,10 @@ jobs: run: platformio run -e native - name: Integration test run: | - .pio/build/native/program & - sleep 20 # 5 seconds was not enough - echo "Simulator started, launching python test..." - python3 -c 'from meshtastic.test import testSimulator; testSimulator()' + .pio/build/native/program + #& sleep 20 # 5 seconds was not enough + #echo "Simulator started, launching python test..." + #python3 -c 'from meshtastic.test import testSimulator; testSimulator()' - name: Build Native run: bin/build-native.sh From cd57df3f4fe30c40ff7844da7f2b46d02dd3493b Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 18 Jan 2023 16:18:01 -0600 Subject: [PATCH 19/20] Update main_matrix.yml --- .github/workflows/main_matrix.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 8932cad45..0a28ced37 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -112,11 +112,11 @@ jobs: uses: ./.github/actions/setup-base # We now run integration test before other build steps (to quickly see runtime failures) - - name: Build for native - run: platformio run -e native - - name: Integration test - run: | - .pio/build/native/program + #- name: Build for native + # run: platformio run -e native + #- name: Integration test + # run: | + #.pio/build/native/program #& sleep 20 # 5 seconds was not enough #echo "Simulator started, launching python test..." #python3 -c 'from meshtastic.test import testSimulator; testSimulator()' From 4cfedc4b57f3cfb79706dec61476bf6ff24f850a Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 18 Jan 2023 16:34:21 -0600 Subject: [PATCH 20/20] Kill it and grill it --- .github/workflows/main_matrix.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 0a28ced37..dbbd0e52e 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -115,11 +115,11 @@ jobs: #- name: Build for native # run: platformio run -e native #- name: Integration test - # run: | - #.pio/build/native/program - #& sleep 20 # 5 seconds was not enough - #echo "Simulator started, launching python test..." - #python3 -c 'from meshtastic.test import testSimulator; testSimulator()' + # run: | + #.pio/build/native/program + #& sleep 20 # 5 seconds was not enough + #echo "Simulator started, launching python test..." + #python3 -c 'from meshtastic.test import testSimulator; testSimulator()' - name: Build Native run: bin/build-native.sh