mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-28 05:30:30 +00:00
Compare commits
18 Commits
v2.0.8.090
...
v2.0.9.6ea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ea0963f4b | ||
|
|
63cf01223c | ||
|
|
2505bdbc21 | ||
|
|
14be4ee9f0 | ||
|
|
d0243d2cd0 | ||
|
|
796e58161d | ||
|
|
e56f17c658 | ||
|
|
b808ffa9ab | ||
|
|
506bae4a8b | ||
|
|
f6ee6265e6 | ||
|
|
7539d92857 | ||
|
|
21fff392b4 | ||
|
|
580ec590fa | ||
|
|
5c9996dfa1 | ||
|
|
2f7c18303d | ||
|
|
b9df41c55f | ||
|
|
4801260440 | ||
|
|
606262e55d |
@@ -1,6 +1,8 @@
|
||||
; Common settings for rp2040 Processor based targets
|
||||
[rp2040_base]
|
||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#5ce1a228e7cae453f366deb8962252b9b7356bbc
|
||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#20c7dbfcfe6677c5305fa28ecf5e3870321cb157
|
||||
platform_packages =
|
||||
earlephilhower/toolchain-rp2040-earlephilhower@^5.100300.221223
|
||||
extends = arduino_base
|
||||
board_build.core = earlephilhower
|
||||
board_build.filesystem_size = 0.5m
|
||||
|
||||
47
boards/tlora-t3s3-v1.json
Normal file
47
boards/tlora-t3s3-v1.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"build": {
|
||||
"arduino": {
|
||||
"ldscript": "esp32s3_out.ld"
|
||||
},
|
||||
"core": "esp32",
|
||||
"extra_flags": [
|
||||
"-DLILYGO_T3S3_V1",
|
||||
"-DARDUINO_USB_CDC_ON_BOOT=1",
|
||||
"-DARDUINO_USB_MODE=0",
|
||||
"-DARDUINO_RUNNING_CORE=1",
|
||||
"-DARDUINO_EVENT_RUNNING_CORE=1"
|
||||
],
|
||||
"f_cpu": "240000000L",
|
||||
"f_flash": "80000000L",
|
||||
"flash_mode": "dio",
|
||||
"hwids": [
|
||||
[
|
||||
"0X303A",
|
||||
"0x1001"
|
||||
]
|
||||
],
|
||||
"mcu": "esp32s3",
|
||||
"variant": "tlora-t3s3-v1"
|
||||
},
|
||||
"connectivity": [
|
||||
"wifi"
|
||||
],
|
||||
"debug": {
|
||||
"openocd_target": "esp32s3.cfg"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"espidf"
|
||||
],
|
||||
"name": "LilyGo TLora-T3S3-V1",
|
||||
"upload": {
|
||||
"flash_size": "4MB",
|
||||
"maximum_ram_size": 327680,
|
||||
"maximum_size": 4194304,
|
||||
"wait_for_upload_port": true,
|
||||
"require_upload_port": true,
|
||||
"speed": 921600
|
||||
},
|
||||
"url": "http://www.lilygo.cn/",
|
||||
"vendor": "LilyGo"
|
||||
}
|
||||
@@ -10,7 +10,6 @@
|
||||
;default_envs = heltec-v2.0
|
||||
;default_envs = heltec-v2.1
|
||||
;default_envs = tlora-v1
|
||||
;default_envs = tlora-v1
|
||||
;default_envs = tlora_v1_3
|
||||
;default_envs = tlora-v2
|
||||
;default_envs = tlora-v2-1-1.6
|
||||
@@ -66,7 +65,8 @@ lib_deps =
|
||||
https://github.com/meshtastic/ArduinoThread.git#72921ac222eed6f526ba1682023cee290d9aa1b3
|
||||
nanopb/Nanopb@^0.4.6
|
||||
erriez/ErriezCRC32@^1.0.1
|
||||
jgromes/RadioLib@^5.5.0
|
||||
; jgromes/RadioLib@^5.5.1
|
||||
https://github.com/jgromes/RadioLib.git#395844922c5d88d5db0481a9c91479931172428d
|
||||
|
||||
; Used for the code analysis in PIO Home / Inspect
|
||||
check_tool = cppcheck
|
||||
@@ -82,6 +82,7 @@ framework = arduino
|
||||
lib_deps =
|
||||
${env.lib_deps}
|
||||
mprograms/QMC5883LCompass@^1.1.1
|
||||
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||
https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#52b5282639d08a8cbd4b748363089eed6102dc76
|
||||
|
||||
build_flags = ${env.build_flags} -Os -DRADIOLIB_SPI_PARANOID=0
|
||||
@@ -106,4 +107,5 @@ lib_deps =
|
||||
adafruit/Adafruit INA260 Library@^1.5.0
|
||||
adafruit/Adafruit INA219@^1.2.0
|
||||
adafruit/Adafruit SHTC3 Library@^1.0.0
|
||||
adafruit/Adafruit LPS2X@^2.0.4
|
||||
adafruit/Adafruit LPS2X@^2.0.4
|
||||
adafruit/Adafruit SHT31 Library@^2.2.0
|
||||
|
||||
Submodule protobufs updated: 0f2a3304ee...79e213fbcc
@@ -327,9 +327,7 @@ void PowerFSM_setup()
|
||||
powerFSM.add_timed_transition(&stateON, &stateDARK, getConfiguredOrDefaultMs(config.display.screen_on_secs, default_screen_on_secs), NULL, "Screen-on timeout");
|
||||
|
||||
#ifdef ARCH_ESP32
|
||||
// On most boards we use light-sleep to be our main state, but on NRF52 we just stay in DARK
|
||||
State *lowPowerState = &stateLS;
|
||||
|
||||
// We never enter light-sleep or NB states on NRF52 (because the CPU uses so little power normally)
|
||||
|
||||
// See: https://github.com/meshtastic/firmware/issues/1071
|
||||
|
||||
@@ -25,7 +25,7 @@ void consolePrintf(const char *format, ...)
|
||||
#endif
|
||||
}
|
||||
|
||||
SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port)
|
||||
SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port), concurrency::OSThread("SerialConsole")
|
||||
{
|
||||
assert(!console);
|
||||
console = this;
|
||||
@@ -46,6 +46,10 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port)
|
||||
emitRebooted();
|
||||
}
|
||||
|
||||
int32_t SerialConsole::runOnce()
|
||||
{
|
||||
return runOncePart();
|
||||
}
|
||||
|
||||
// For the serial port we can't really detect if any client is on the other side, so instead just look for recent messages
|
||||
bool SerialConsole::checkIsConnected()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Provides both debug printing and, if the client starts sending protobufs to us, switches to send/receive protobufs
|
||||
* (and starts dropping debug printing - FIXME, eventually those prints should be encapsulated in protobufs).
|
||||
*/
|
||||
class SerialConsole : public StreamAPI, public RedirectablePrint
|
||||
class SerialConsole : public StreamAPI, public RedirectablePrint, private concurrency::OSThread
|
||||
{
|
||||
public:
|
||||
SerialConsole();
|
||||
@@ -24,6 +24,8 @@ class SerialConsole : public StreamAPI, public RedirectablePrint
|
||||
return RedirectablePrint::write(c);
|
||||
}
|
||||
|
||||
virtual int32_t runOnce() override;
|
||||
|
||||
protected:
|
||||
|
||||
/// Check the current underlying physical link to see if the client is currently connected
|
||||
|
||||
@@ -114,6 +114,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define SHTC3_ADDR 0x70
|
||||
#define LPS22HB_ADDR 0x5C
|
||||
#define LPS22HB_ADDR_ALT 0x5D
|
||||
#define SHT31_ADDR 0x44
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Security
|
||||
|
||||
@@ -191,6 +191,10 @@ void scanI2Cdevice()
|
||||
nodeTelemetrySensorsMap[TelemetrySensorType_MCP9808] = addr;
|
||||
DEBUG_MSG("MCP9808 sensor found\n");
|
||||
}
|
||||
if (addr == SHT31_ADDR) {
|
||||
DEBUG_MSG("SHT31 sensor found\n");
|
||||
nodeTelemetrySensorsMap[TelemetrySensorType_SHT31] = addr;
|
||||
}
|
||||
if (addr == SHTC3_ADDR) {
|
||||
DEBUG_MSG("SHTC3 sensor found\n");
|
||||
nodeTelemetrySensorsMap[TelemetrySensorType_SHTC3] = addr;
|
||||
|
||||
@@ -35,7 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "mesh/Channels.h"
|
||||
#include "mesh/generated/deviceonly.pb.h"
|
||||
#include "modules/TextMessageModule.h"
|
||||
|
||||
#include "modules/ExternalNotificationModule.h"
|
||||
#include "sleep.h"
|
||||
#include "target_specific.h"
|
||||
#include "utils.h"
|
||||
@@ -1071,7 +1071,13 @@ int32_t Screen::runOnce()
|
||||
handleSetOn(false);
|
||||
break;
|
||||
case Cmd::ON_PRESS:
|
||||
handleOnPress();
|
||||
// If a nag notification is running, stop it
|
||||
if (externalNotificationModule->nagCycleCutoff != UINT32_MAX) {
|
||||
externalNotificationModule->stopNow();
|
||||
} else {
|
||||
// Don't advance the screen if we just wanted to switch off the nag notification
|
||||
handleOnPress();
|
||||
}
|
||||
break;
|
||||
case Cmd::START_BLUETOOTH_PIN_SCREEN:
|
||||
handleStartBluetoothPinScreen(cmd.bluetooth_pin);
|
||||
@@ -1400,7 +1406,7 @@ 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) {
|
||||
#if 0
|
||||
#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);
|
||||
|
||||
12
src/main.cpp
12
src/main.cpp
@@ -242,7 +242,6 @@ void setup()
|
||||
digitalWrite(PIN_3V3_EN, 1);
|
||||
#endif
|
||||
|
||||
|
||||
// Currently only the tbeam has a PMU
|
||||
// PMU initialization needs to be placed before scanI2Cdevice
|
||||
power = new Power();
|
||||
@@ -462,17 +461,6 @@ if((config.lora.region == Config_LoRaConfig_RegionCode_LORA_24) && (!rIf->wideLo
|
||||
}
|
||||
}
|
||||
|
||||
if((config.lora.region != Config_LoRaConfig_RegionCode_LORA_24) && (rIf->wideLora())){
|
||||
DEBUG_MSG("Warning: Radio chip only supports 2.4GHz LoRa. Adjusting Region.\n");
|
||||
config.lora.region = Config_LoRaConfig_RegionCode_LORA_24;
|
||||
nodeDB.saveToDisk(SEGMENT_CONFIG);
|
||||
if(!rIf->reconfigure()) {
|
||||
DEBUG_MSG("Reconfigure failed, rebooting\n");
|
||||
screen->startRebootScreen();
|
||||
rebootAtMsec = millis() + 5000;
|
||||
}
|
||||
}
|
||||
|
||||
#if HAS_WIFI || HAS_ETHERNET
|
||||
mqttInit();
|
||||
#endif
|
||||
|
||||
@@ -17,7 +17,7 @@ ErrorCode FloodingRouter::send(MeshPacket *p)
|
||||
return Router::send(p);
|
||||
}
|
||||
|
||||
bool FloodingRouter::shouldFilterReceived(MeshPacket *p)
|
||||
bool FloodingRouter::shouldFilterReceived(const MeshPacket *p)
|
||||
{
|
||||
if (wasSeenRecently(p)) { // Note: this will also add a recent packet record
|
||||
printPacket("Ignoring incoming msg, because we've already seen it", p);
|
||||
@@ -34,7 +34,8 @@ void FloodingRouter::sniffReceived(const MeshPacket *p, const Routing *c)
|
||||
// do not flood direct message that is ACKed
|
||||
DEBUG_MSG("Receiving an ACK not for me, but don't need to rebroadcast this direct message anymore.\n");
|
||||
Router::cancelSending(p->to, p->decoded.request_id); // cancel rebroadcast for this DM
|
||||
} else if ((p->to != getNodeNum()) && (p->hop_limit > 0) && (getFrom(p) != getNodeNum())) {
|
||||
}
|
||||
if ((p->to != getNodeNum()) && (p->hop_limit > 0) && (getFrom(p) != getNodeNum())) {
|
||||
if (p->id != 0) {
|
||||
if (config.device.role != Config_DeviceConfig_Role_CLIENT_MUTE) {
|
||||
MeshPacket *tosend = packetPool.allocCopy(*p); // keep a copy because we will be sending it
|
||||
|
||||
@@ -51,7 +51,7 @@ class FloodingRouter : public Router, protected PacketHistory
|
||||
* Called immedately on receiption, before any further processing.
|
||||
* @return true to abandon the packet
|
||||
*/
|
||||
virtual bool shouldFilterReceived(MeshPacket *p) override;
|
||||
virtual bool shouldFilterReceived(const MeshPacket *p) override;
|
||||
|
||||
/**
|
||||
* Look for broadcasts we need to rebroadcast
|
||||
|
||||
@@ -44,11 +44,11 @@ MeshPacket *MeshModule::allocAckNak(Routing_Error err, NodeNum to, PacketId idFr
|
||||
// auto p = allocDataProtobuf(c);
|
||||
MeshPacket *p = router->allocForSending();
|
||||
p->decoded.portnum = PortNum_ROUTING_APP;
|
||||
p->decoded.payload.size = pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), Routing_fields, &c);
|
||||
p->decoded.payload.size = pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &Routing_msg, &c);
|
||||
|
||||
p->priority = MeshPacket_Priority_ACK;
|
||||
|
||||
p->hop_limit = 0; // Assume just immediate neighbors for now
|
||||
p->hop_limit = config.lora.hop_limit; // Flood ACK back to original sender
|
||||
p->to = to;
|
||||
p->decoded.request_id = idFrom;
|
||||
p->channel = chIndex;
|
||||
|
||||
@@ -401,7 +401,7 @@ bool loadProto(const char *filename, size_t protoSize, size_t objSize, const pb_
|
||||
void NodeDB::loadFromDisk()
|
||||
{
|
||||
// static DeviceState scratch; We no longer read into a tempbuf because this structure is 15KB of valuable RAM
|
||||
if (!loadProto(prefFileName, DeviceState_size, sizeof(devicestate), DeviceState_fields, &devicestate)) {
|
||||
if (!loadProto(prefFileName, DeviceState_size, sizeof(DeviceState), &DeviceState_msg, &devicestate)) {
|
||||
installDefaultDeviceState(); // Our in RAM copy might now be corrupt
|
||||
} else {
|
||||
if (devicestate.version < DEVICESTATE_MIN_VER) {
|
||||
@@ -412,7 +412,7 @@ void NodeDB::loadFromDisk()
|
||||
}
|
||||
}
|
||||
|
||||
if (!loadProto(configFileName, LocalConfig_size, sizeof(LocalConfig), LocalConfig_fields, &config)) {
|
||||
if (!loadProto(configFileName, LocalConfig_size, sizeof(LocalConfig), &LocalConfig_msg, &config)) {
|
||||
installDefaultConfig(); // Our in RAM copy might now be corrupt
|
||||
} else {
|
||||
if (config.version < DEVICESTATE_MIN_VER) {
|
||||
@@ -423,7 +423,7 @@ void NodeDB::loadFromDisk()
|
||||
}
|
||||
}
|
||||
|
||||
if (!loadProto(moduleConfigFileName, LocalModuleConfig_size, sizeof(LocalModuleConfig), LocalModuleConfig_fields, &moduleConfig)) {
|
||||
if (!loadProto(moduleConfigFileName, LocalModuleConfig_size, sizeof(LocalModuleConfig), &LocalModuleConfig_msg, &moduleConfig)) {
|
||||
installDefaultModuleConfig(); // Our in RAM copy might now be corrupt
|
||||
} else {
|
||||
if (moduleConfig.version < DEVICESTATE_MIN_VER) {
|
||||
@@ -434,7 +434,7 @@ void NodeDB::loadFromDisk()
|
||||
}
|
||||
}
|
||||
|
||||
if (!loadProto(channelFileName, ChannelFile_size, sizeof(ChannelFile), ChannelFile_fields, &channelFile)) {
|
||||
if (!loadProto(channelFileName, ChannelFile_size, sizeof(ChannelFile), &ChannelFile_msg, &channelFile)) {
|
||||
installDefaultChannels(); // Our in RAM copy might now be corrupt
|
||||
} else {
|
||||
if (channelFile.version < DEVICESTATE_MIN_VER) {
|
||||
@@ -445,12 +445,12 @@ void NodeDB::loadFromDisk()
|
||||
}
|
||||
}
|
||||
|
||||
if (loadProto(oemConfigFile, OEMStore_size, sizeof(OEMStore), OEMStore_fields, &oemStore))
|
||||
if (loadProto(oemConfigFile, OEMStore_size, sizeof(OEMStore), &OEMStore_msg, &oemStore))
|
||||
DEBUG_MSG("Loaded OEMStore\n");
|
||||
}
|
||||
|
||||
/** Save a protobuf from a file, return true for success */
|
||||
bool saveProto(const char *filename, size_t protoSize, size_t objSize, const pb_msgdesc_t *fields, const void *dest_struct)
|
||||
bool saveProto(const char *filename, size_t protoSize, const pb_msgdesc_t *fields, const void *dest_struct)
|
||||
{
|
||||
bool okay = false;
|
||||
#ifdef FSCom
|
||||
@@ -498,7 +498,7 @@ void NodeDB::saveChannelsToDisk()
|
||||
#ifdef FSCom
|
||||
FSCom.mkdir("/prefs");
|
||||
#endif
|
||||
saveProto(channelFileName, ChannelFile_size, sizeof(channelFile), ChannelFile_fields, &channelFile);
|
||||
saveProto(channelFileName, ChannelFile_size, &ChannelFile_msg, &channelFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ void NodeDB::saveDeviceStateToDisk()
|
||||
#ifdef FSCom
|
||||
FSCom.mkdir("/prefs");
|
||||
#endif
|
||||
saveProto(prefFileName, DeviceState_size, sizeof(devicestate), DeviceState_fields, &devicestate);
|
||||
saveProto(prefFileName, DeviceState_size, &DeviceState_msg, &devicestate);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ void NodeDB::saveToDisk(int saveWhat)
|
||||
config.has_power = true;
|
||||
config.has_network = true;
|
||||
config.has_bluetooth = true;
|
||||
saveProto(configFileName, LocalConfig_size, sizeof(config), LocalConfig_fields, &config);
|
||||
saveProto(configFileName, LocalConfig_size, &LocalConfig_msg, &config);
|
||||
}
|
||||
|
||||
if (saveWhat & SEGMENT_MODULECONFIG) {
|
||||
@@ -541,7 +541,7 @@ void NodeDB::saveToDisk(int saveWhat)
|
||||
moduleConfig.has_serial = true;
|
||||
moduleConfig.has_store_forward = true;
|
||||
moduleConfig.has_telemetry = true;
|
||||
saveProto(moduleConfigFileName, LocalModuleConfig_size, sizeof(moduleConfig), LocalModuleConfig_fields, &moduleConfig);
|
||||
saveProto(moduleConfigFileName, LocalModuleConfig_size, &LocalModuleConfig_msg, &moduleConfig);
|
||||
}
|
||||
|
||||
if (saveWhat & SEGMENT_CHANNELS) {
|
||||
|
||||
@@ -77,7 +77,7 @@ bool PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength)
|
||||
// return (lastContactMsec != 0) &&
|
||||
|
||||
memset(&toRadioScratch, 0, sizeof(toRadioScratch));
|
||||
if (pb_decode_from_bytes(buf, bufLength, ToRadio_fields, &toRadioScratch)) {
|
||||
if (pb_decode_from_bytes(buf, bufLength, &ToRadio_msg, &toRadioScratch)) {
|
||||
switch (toRadioScratch.which_payload_variant) {
|
||||
case ToRadio_packet_tag:
|
||||
return handleToRadioPacket(toRadioScratch.packet);
|
||||
@@ -291,7 +291,7 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
|
||||
// Do we have a message from the mesh?
|
||||
if (fromRadioScratch.which_payload_variant != 0) {
|
||||
// Encapsulate as a FromRadio packet
|
||||
size_t numbytes = pb_encode_to_bytes(buf, FromRadio_size, FromRadio_fields, &fromRadioScratch);
|
||||
size_t numbytes = pb_encode_to_bytes(buf, FromRadio_size, &FromRadio_msg, &fromRadioScratch);
|
||||
|
||||
DEBUG_MSG("encoding toPhone packet to phone variant=%d, %d bytes\n", fromRadioScratch.which_payload_variant, numbytes);
|
||||
return numbytes;
|
||||
|
||||
@@ -175,7 +175,7 @@ uint32_t RadioInterface::getRetransmissionMsec(const MeshPacket *p)
|
||||
{
|
||||
assert(slotTimeMsec); // Better be non zero
|
||||
static uint8_t bytes[MAX_RHPACKETLEN];
|
||||
size_t numbytes = pb_encode_to_bytes(bytes, sizeof(bytes), Data_fields, &p->decoded);
|
||||
size_t numbytes = pb_encode_to_bytes(bytes, sizeof(bytes), &Data_msg, &p->decoded);
|
||||
uint32_t packetAirtime = getPacketTime(numbytes + sizeof(PacketHeader));
|
||||
// Make sure enough time has elapsed for this packet to be sent and an ACK is received.
|
||||
// DEBUG_MSG("Waiting for flooding message with airtime %d and slotTime is %d\n", packetAirtime, slotTimeMsec);
|
||||
|
||||
@@ -66,10 +66,5 @@ class RadioLibRF95: public SX1278 {
|
||||
// since default current limit for SX126x/127x in updated RadioLib is 60mA
|
||||
// use the previous value
|
||||
float currentLimit = 100;
|
||||
|
||||
#ifndef RADIOLIB_GODMODE
|
||||
private:
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ ErrorCode ReliableRouter::send(MeshPacket *p)
|
||||
return FloodingRouter::send(p);
|
||||
}
|
||||
|
||||
bool ReliableRouter::shouldFilterReceived(MeshPacket *p)
|
||||
bool ReliableRouter::shouldFilterReceived(const MeshPacket *p)
|
||||
{
|
||||
// Note: do not use getFrom() here, because we want to ignore messages sent from phone
|
||||
if (p->from == getNodeNum()) {
|
||||
@@ -37,9 +37,8 @@ bool ReliableRouter::shouldFilterReceived(MeshPacket *p)
|
||||
// If this is the first time we saw this, cancel any retransmissions we have queued up and generate an internal ack for
|
||||
// the original sending process.
|
||||
|
||||
// FIXME - we might want to turn off this "optimization", it does save lots of airtime but it assumes that once we've
|
||||
// heard one one adjacent node hear our packet that a) probably other adjacent nodes heard it and b) we can trust those
|
||||
// nodes to reach our destination. Both of which might be incorrect.
|
||||
// This "optimization", does save lots of airtime. For DMs, you also get a real ACK back
|
||||
// from the intended recipient.
|
||||
auto key = GlobalPacketId(getFrom(p), p->id);
|
||||
auto old = findPendingPacket(key);
|
||||
if (old) {
|
||||
@@ -54,16 +53,11 @@ bool ReliableRouter::shouldFilterReceived(MeshPacket *p)
|
||||
}
|
||||
}
|
||||
|
||||
/* send acks for repeated packets that want acks and are destined for us
|
||||
* this way if an ACK is dropped and a packet is resent we'll ACK the resent packet
|
||||
* make sure wasSeenRecently _doesn't_ update
|
||||
* finding the channel requires decoding the packet. */
|
||||
if (p->want_ack && (p->to == getNodeNum()) && wasSeenRecently(p, false) && !MeshModule::currentReply) {
|
||||
if (perhapsDecode(p)) {
|
||||
sendAckNak(Routing_Error_NONE, getFrom(p), p->id, p->channel);
|
||||
DEBUG_MSG("acking a repeated want_ack packet\n");
|
||||
}
|
||||
} else if (wasSeenRecently(p, false) && p->hop_limit == HOP_RELIABLE && !MeshModule::currentReply && p->to != nodeDB.getNodeNum()) {
|
||||
/* Resend implicit ACKs for repeated packets (assuming the original packet was sent with HOP_RELIABLE)
|
||||
* this way if an implicit ACK is dropped and a packet is resent we'll rebroadcast again.
|
||||
* Resending real ACKs is omitted, as you might receive a packet multiple times due to flooding and
|
||||
* flooding this ACK back to the original sender already adds redundancy. */
|
||||
if (wasSeenRecently(p, false) && p->hop_limit == HOP_RELIABLE && !MeshModule::currentReply && p->to != nodeDB.getNodeNum()) {
|
||||
// retransmission on broadcast has hop_limit still equal to HOP_RELIABLE
|
||||
DEBUG_MSG("Resending implicit ack for a repeated floodmsg\n");
|
||||
MeshPacket *tosend = packetPool.allocCopy(*p);
|
||||
|
||||
@@ -96,7 +96,7 @@ class ReliableRouter : public FloodingRouter
|
||||
/**
|
||||
* We hook this method so we can see packets before FloodingRouter says they should be discarded
|
||||
*/
|
||||
virtual bool shouldFilterReceived(MeshPacket *p) override;
|
||||
virtual bool shouldFilterReceived(const MeshPacket *p) override;
|
||||
|
||||
/**
|
||||
* Add p to the list of packets to retransmit occasionally. We will free it once we stop retransmitting.
|
||||
|
||||
@@ -306,7 +306,7 @@ bool perhapsDecode(MeshPacket *p)
|
||||
|
||||
// Take those raw bytes and convert them back into a well structured protobuf we can understand
|
||||
memset(&p->decoded, 0, sizeof(p->decoded));
|
||||
if (!pb_decode_from_bytes(bytes, rawSize, Data_fields, &p->decoded)) {
|
||||
if (!pb_decode_from_bytes(bytes, rawSize, &Data_msg, &p->decoded)) {
|
||||
DEBUG_MSG("Invalid protobufs in received mesh packet (bad psk?)!\n");
|
||||
} else if (p->decoded.portnum == PortNum_UNKNOWN_APP) {
|
||||
DEBUG_MSG("Invalid portnum (bad psk?)!\n");
|
||||
@@ -360,7 +360,7 @@ Routing_Error perhapsEncode(MeshPacket *p)
|
||||
if (p->which_payload_variant == MeshPacket_decoded_tag) {
|
||||
static uint8_t bytes[MAX_RHPACKETLEN]; // we have to use a scratch buffer because a union
|
||||
|
||||
size_t numbytes = pb_encode_to_bytes(bytes, sizeof(bytes), Data_fields, &p->decoded);
|
||||
size_t numbytes = pb_encode_to_bytes(bytes, sizeof(bytes), &Data_msg, &p->decoded);
|
||||
|
||||
// Only allow encryption on the text message app.
|
||||
// TODO: Allow modules to opt into compression.
|
||||
|
||||
@@ -90,7 +90,7 @@ class Router : protected concurrency::OSThread
|
||||
* Called immedately on receiption, before any further processing.
|
||||
* @return true to abandon the packet
|
||||
*/
|
||||
virtual bool shouldFilterReceived(MeshPacket *p) { return false; }
|
||||
virtual bool shouldFilterReceived(const MeshPacket *p) { return false; }
|
||||
|
||||
/**
|
||||
* Every (non duplicate) packet this node receives will be passed through this method. This allows subclasses to
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "configuration.h"
|
||||
#include "SX128xInterface.h"
|
||||
#include "mesh/NodeDB.h"
|
||||
#include "error.h"
|
||||
|
||||
// Particular boards might define a different max power based on what their hardware can do
|
||||
@@ -50,6 +51,20 @@ bool SX128xInterface<T>::init()
|
||||
// \todo Display actual typename of the adapter, not just `SX128x`
|
||||
DEBUG_MSG("SX128x init result %d\n", res);
|
||||
|
||||
if((config.lora.region != Config_LoRaConfig_RegionCode_LORA_24) && (res == RADIOLIB_ERR_INVALID_FREQUENCY)) {
|
||||
DEBUG_MSG("Warning: Radio chip only supports 2.4GHz LoRa. Adjusting Region and rebooting.\n");
|
||||
config.lora.region = Config_LoRaConfig_RegionCode_LORA_24;
|
||||
nodeDB.saveToDisk(SEGMENT_CONFIG);
|
||||
delay(2000);
|
||||
#if defined(ARCH_ESP32)
|
||||
ESP.restart();
|
||||
#elif defined(ARCH_NRF52)
|
||||
NVIC_SystemReset();
|
||||
#else
|
||||
DEBUG_MSG("FIXME implement reboot for this platform. Skipping for now.\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
DEBUG_MSG("Frequency set to %f\n", getFreq());
|
||||
DEBUG_MSG("Bandwidth set to %f\n", bw);
|
||||
DEBUG_MSG("Power output set to %d\n", power);
|
||||
@@ -223,13 +238,9 @@ bool SX128xInterface<T>::isChannelActive()
|
||||
template<typename T>
|
||||
bool SX128xInterface<T>::isActivelyReceiving()
|
||||
{
|
||||
#ifdef RADIOLIB_GODMODE
|
||||
uint16_t irq = lora.getIrqStatus();
|
||||
bool hasPreamble = (irq & RADIOLIB_SX128X_IRQ_HEADER_VALID);
|
||||
return hasPreamble;
|
||||
#else
|
||||
return isChannelActive();
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
||||
@@ -27,9 +27,7 @@ class SX128xInterface : public RadioLibInterface
|
||||
/// Prepare hardware for sleep. Call this _only_ for deep sleep, not needed for light sleep.
|
||||
virtual bool sleep() override;
|
||||
|
||||
#ifdef RADIOLIB_GODMODE
|
||||
bool isIRQPending() override { return lora.getIrqStatus() != 0; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define START2 0xc3
|
||||
#define HEADER_LEN 4
|
||||
|
||||
int32_t StreamAPI::runOnce()
|
||||
int32_t StreamAPI::runOncePart()
|
||||
{
|
||||
auto result = readStream();
|
||||
writeStream();
|
||||
@@ -115,7 +115,7 @@ void StreamAPI::emitRebooted()
|
||||
fromRadioScratch.rebooted = true;
|
||||
|
||||
// DEBUG_MSG("Emitting reboot packet for serial shell\n");
|
||||
emitTxBuffer(pb_encode_to_bytes(txBuf + HEADER_LEN, FromRadio_size, FromRadio_fields, &fromRadioScratch));
|
||||
emitTxBuffer(pb_encode_to_bytes(txBuf + HEADER_LEN, FromRadio_size, &FromRadio_msg, &fromRadioScratch));
|
||||
}
|
||||
|
||||
/// Hookable to find out when connection changes
|
||||
|
||||
@@ -28,7 +28,7 @@ valid utf8 encoding. This makes it a bit easier to start a device outputting reg
|
||||
after it has received a valid packet from the PC, turn off unencoded debug printing and switch to this packet encoding.
|
||||
|
||||
*/
|
||||
class StreamAPI : public PhoneAPI, protected concurrency::OSThread
|
||||
class StreamAPI : public PhoneAPI
|
||||
{
|
||||
/**
|
||||
* The stream we read/write from
|
||||
@@ -42,13 +42,13 @@ class StreamAPI : public PhoneAPI, protected concurrency::OSThread
|
||||
uint32_t lastRxMsec = 0;
|
||||
|
||||
public:
|
||||
StreamAPI(Stream *_stream) : concurrency::OSThread("StreamAPI"), stream(_stream) {}
|
||||
StreamAPI(Stream *_stream) : stream(_stream) {}
|
||||
|
||||
/**
|
||||
* Currently we require frequent invocation from loop() to check for arrived serial packets and to send new packets to the
|
||||
* phone.
|
||||
*/
|
||||
virtual int32_t runOnce() override;
|
||||
virtual int32_t runOncePart();
|
||||
|
||||
private:
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,7 @@ void initApiServer(int port)
|
||||
}
|
||||
}
|
||||
|
||||
ethServerAPI::ethServerAPI(EthernetClient &_client) : StreamAPI(&client), client(_client)
|
||||
ethServerAPI::ethServerAPI(EthernetClient &_client) : StreamAPI(&client), concurrency::OSThread("ethServerAPI"), client(_client)
|
||||
{
|
||||
DEBUG_MSG("Incoming ethernet connection\n");
|
||||
}
|
||||
@@ -42,7 +42,7 @@ bool ethServerAPI::checkIsConnected()
|
||||
int32_t ethServerAPI::runOnce()
|
||||
{
|
||||
if (client.connected()) {
|
||||
return StreamAPI::runOnce();
|
||||
return StreamAPI::runOncePart();
|
||||
} else {
|
||||
DEBUG_MSG("Client dropped connection, suspending API service\n");
|
||||
enabled = false; // we no longer need to run
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Provides both debug printing and, if the client starts sending protobufs to us, switches to send/receive protobufs
|
||||
* (and starts dropping debug printing - FIXME, eventually those prints should be encapsulated in protobufs).
|
||||
*/
|
||||
class ethServerAPI : public StreamAPI
|
||||
class ethServerAPI : public StreamAPI, private concurrency::OSThread
|
||||
{
|
||||
private:
|
||||
EthernetClient client;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "admin.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_ADMIN_PB_H_INCLUDED
|
||||
#define PB_ADMIN_PB_H_INCLUDED
|
||||
@@ -15,32 +15,49 @@
|
||||
#endif
|
||||
|
||||
/* Enum definitions */
|
||||
typedef enum _AdminMessage_ConfigType {
|
||||
AdminMessage_ConfigType_DEVICE_CONFIG = 0,
|
||||
AdminMessage_ConfigType_POSITION_CONFIG = 1,
|
||||
AdminMessage_ConfigType_POWER_CONFIG = 2,
|
||||
AdminMessage_ConfigType_NETWORK_CONFIG = 3,
|
||||
AdminMessage_ConfigType_DISPLAY_CONFIG = 4,
|
||||
AdminMessage_ConfigType_LORA_CONFIG = 5,
|
||||
AdminMessage_ConfigType_BLUETOOTH_CONFIG = 6
|
||||
/* 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;
|
||||
|
||||
typedef enum _AdminMessage_ModuleConfigType {
|
||||
AdminMessage_ModuleConfigType_MQTT_CONFIG = 0,
|
||||
AdminMessage_ModuleConfigType_SERIAL_CONFIG = 1,
|
||||
AdminMessage_ModuleConfigType_EXTNOTIF_CONFIG = 2,
|
||||
AdminMessage_ModuleConfigType_STOREFORWARD_CONFIG = 3,
|
||||
AdminMessage_ModuleConfigType_RANGETEST_CONFIG = 4,
|
||||
AdminMessage_ModuleConfigType_TELEMETRY_CONFIG = 5,
|
||||
AdminMessage_ModuleConfigType_CANNEDMSG_CONFIG = 6,
|
||||
AdminMessage_ModuleConfigType_AUDIO_CONFIG = 7
|
||||
/* 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
|
||||
} 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 {
|
||||
typedef struct _AdminMessage {
|
||||
pb_size_t which_payload_variant;
|
||||
union {
|
||||
/* Send the specified channel in the response to this message
|
||||
@@ -112,6 +129,10 @@ typedef struct _AdminMessage {
|
||||
} 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
|
||||
@@ -121,10 +142,9 @@ typedef struct _AdminMessage {
|
||||
#define _AdminMessage_ModuleConfigType_MAX AdminMessage_ModuleConfigType_AUDIO_CONFIG
|
||||
#define _AdminMessage_ModuleConfigType_ARRAYSIZE ((AdminMessage_ModuleConfigType)(AdminMessage_ModuleConfigType_AUDIO_CONFIG+1))
|
||||
|
||||
#define AdminMessage_payload_variant_get_config_request_ENUMTYPE AdminMessage_ConfigType
|
||||
#define AdminMessage_payload_variant_get_module_config_request_ENUMTYPE AdminMessage_ModuleConfigType
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define AdminMessage_init_default {0, {0}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "apponly.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_APPONLY_PB_H_INCLUDED
|
||||
#define PB_APPONLY_PB_H_INCLUDED
|
||||
@@ -17,7 +17,7 @@
|
||||
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 {
|
||||
typedef struct _ChannelSet {
|
||||
/* Channel list with settings */
|
||||
pb_size_t settings_count;
|
||||
ChannelSettings settings[8];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "cannedmessages.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_CANNEDMESSAGES_PB_H_INCLUDED
|
||||
#define PB_CANNEDMESSAGES_PB_H_INCLUDED
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
/* Struct definitions */
|
||||
/* Canned message module configuration. */
|
||||
typedef struct _CannedMessageModuleConfig {
|
||||
typedef struct _CannedMessageModuleConfig {
|
||||
/* Predefined messages for canned message module separated by '|' characters. */
|
||||
char messages[201];
|
||||
} CannedMessageModuleConfig;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "channel.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_CHANNEL_PB_H_INCLUDED
|
||||
#define PB_CHANNEL_PB_H_INCLUDED
|
||||
@@ -10,10 +10,23 @@
|
||||
#endif
|
||||
|
||||
/* Enum definitions */
|
||||
typedef enum _Channel_Role {
|
||||
Channel_Role_DISABLED = 0,
|
||||
Channel_Role_PRIMARY = 1,
|
||||
Channel_Role_SECONDARY = 2
|
||||
/* 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 */
|
||||
@@ -37,7 +50,7 @@ typedef PB_BYTES_ARRAY_T(32) 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 _ChannelSettings {
|
||||
typedef struct _ChannelSettings {
|
||||
/* Deprecated in favor of LoraConfig.channel_num */
|
||||
uint32_t channel_num;
|
||||
/* A simple pre-shared key for now for crypto.
|
||||
@@ -79,7 +92,7 @@ typedef struct _ChannelSettings {
|
||||
} ChannelSettings;
|
||||
|
||||
/* A pair of a channel number, mode and the (sharable) settings for that channel */
|
||||
typedef struct _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. */
|
||||
@@ -92,15 +105,18 @@ typedef struct _Channel {
|
||||
} 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))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#define Channel_role_ENUMTYPE Channel_Role
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define ChannelSettings_init_default {0, {0, {0}}, "", 0, 0, 0}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "config.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_CONFIG_PB_H_INCLUDED
|
||||
#define PB_CONFIG_PB_H_INCLUDED
|
||||
@@ -10,169 +10,371 @@
|
||||
#endif
|
||||
|
||||
/* Enum definitions */
|
||||
typedef enum _Config_DeviceConfig_Role {
|
||||
Config_DeviceConfig_Role_CLIENT = 0,
|
||||
Config_DeviceConfig_Role_CLIENT_MUTE = 1,
|
||||
Config_DeviceConfig_Role_ROUTER = 2,
|
||||
Config_DeviceConfig_Role_ROUTER_CLIENT = 3
|
||||
/* 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;
|
||||
|
||||
typedef enum _Config_PositionConfig_PositionFlags {
|
||||
Config_PositionConfig_PositionFlags_UNSET = 0,
|
||||
Config_PositionConfig_PositionFlags_ALTITUDE = 1,
|
||||
Config_PositionConfig_PositionFlags_ALTITUDE_MSL = 2,
|
||||
Config_PositionConfig_PositionFlags_GEOIDAL_SEPARATION = 4,
|
||||
Config_PositionConfig_PositionFlags_DOP = 8,
|
||||
Config_PositionConfig_PositionFlags_HVDOP = 16,
|
||||
Config_PositionConfig_PositionFlags_SATINVIEW = 32,
|
||||
Config_PositionConfig_PositionFlags_SEQ_NO = 64,
|
||||
Config_PositionConfig_PositionFlags_TIMESTAMP = 128,
|
||||
Config_PositionConfig_PositionFlags_HEADING = 256,
|
||||
Config_PositionConfig_PositionFlags_SPEED = 512
|
||||
/* 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_EthMode {
|
||||
Config_NetworkConfig_EthMode_DHCP = 0,
|
||||
Config_NetworkConfig_EthMode_STATIC = 1
|
||||
typedef enum _Config_NetworkConfig_EthMode {
|
||||
/* obtain ip address via DHCP */
|
||||
Config_NetworkConfig_EthMode_DHCP = 0,
|
||||
/* use static ip address */
|
||||
Config_NetworkConfig_EthMode_STATIC = 1
|
||||
} Config_NetworkConfig_EthMode;
|
||||
|
||||
typedef enum _Config_DisplayConfig_GpsCoordinateFormat {
|
||||
Config_DisplayConfig_GpsCoordinateFormat_DEC = 0,
|
||||
Config_DisplayConfig_GpsCoordinateFormat_DMS = 1,
|
||||
Config_DisplayConfig_GpsCoordinateFormat_UTM = 2,
|
||||
Config_DisplayConfig_GpsCoordinateFormat_MGRS = 3,
|
||||
Config_DisplayConfig_GpsCoordinateFormat_OLC = 4,
|
||||
Config_DisplayConfig_GpsCoordinateFormat_OSGR = 5
|
||||
/* 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;
|
||||
|
||||
typedef enum _Config_DisplayConfig_DisplayUnits {
|
||||
Config_DisplayConfig_DisplayUnits_METRIC = 0,
|
||||
Config_DisplayConfig_DisplayUnits_IMPERIAL = 1
|
||||
/* Unit display preference */
|
||||
typedef enum _Config_DisplayConfig_DisplayUnits {
|
||||
/* Metric (Default) */
|
||||
Config_DisplayConfig_DisplayUnits_METRIC = 0,
|
||||
/* Imperial */
|
||||
Config_DisplayConfig_DisplayUnits_IMPERIAL = 1
|
||||
} Config_DisplayConfig_DisplayUnits;
|
||||
|
||||
typedef enum _Config_DisplayConfig_OledType {
|
||||
Config_DisplayConfig_OledType_OLED_AUTO = 0,
|
||||
Config_DisplayConfig_OledType_OLED_SSD1306 = 1,
|
||||
Config_DisplayConfig_OledType_OLED_SH1106 = 2
|
||||
/* 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_LoRaConfig_RegionCode {
|
||||
Config_LoRaConfig_RegionCode_UNSET = 0,
|
||||
Config_LoRaConfig_RegionCode_US = 1,
|
||||
Config_LoRaConfig_RegionCode_EU_433 = 2,
|
||||
Config_LoRaConfig_RegionCode_EU_868 = 3,
|
||||
Config_LoRaConfig_RegionCode_CN = 4,
|
||||
Config_LoRaConfig_RegionCode_JP = 5,
|
||||
Config_LoRaConfig_RegionCode_ANZ = 6,
|
||||
Config_LoRaConfig_RegionCode_KR = 7,
|
||||
Config_LoRaConfig_RegionCode_TW = 8,
|
||||
Config_LoRaConfig_RegionCode_RU = 9,
|
||||
Config_LoRaConfig_RegionCode_IN = 10,
|
||||
Config_LoRaConfig_RegionCode_NZ_865 = 11,
|
||||
Config_LoRaConfig_RegionCode_TH = 12,
|
||||
Config_LoRaConfig_RegionCode_LORA_24 = 13
|
||||
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
|
||||
} Config_LoRaConfig_RegionCode;
|
||||
|
||||
typedef enum _Config_LoRaConfig_ModemPreset {
|
||||
Config_LoRaConfig_ModemPreset_LONG_FAST = 0,
|
||||
Config_LoRaConfig_ModemPreset_LONG_SLOW = 1,
|
||||
Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW = 2,
|
||||
Config_LoRaConfig_ModemPreset_MEDIUM_SLOW = 3,
|
||||
Config_LoRaConfig_ModemPreset_MEDIUM_FAST = 4,
|
||||
Config_LoRaConfig_ModemPreset_SHORT_SLOW = 5,
|
||||
Config_LoRaConfig_ModemPreset_SHORT_FAST = 6
|
||||
/* 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 {
|
||||
Config_BluetoothConfig_PairingMode_RANDOM_PIN = 0,
|
||||
Config_BluetoothConfig_PairingMode_FIXED_PIN = 1,
|
||||
Config_BluetoothConfig_PairingMode_NO_PIN = 2
|
||||
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 */
|
||||
typedef struct _Config_BluetoothConfig {
|
||||
bool enabled;
|
||||
Config_BluetoothConfig_PairingMode mode;
|
||||
uint32_t fixed_pin;
|
||||
} Config_BluetoothConfig;
|
||||
|
||||
typedef struct _Config_DeviceConfig {
|
||||
/* 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;
|
||||
|
||||
typedef struct _Config_DisplayConfig {
|
||||
uint32_t screen_on_secs;
|
||||
Config_DisplayConfig_GpsCoordinateFormat gps_format;
|
||||
uint32_t auto_screen_carousel_secs;
|
||||
bool compass_north_top;
|
||||
bool flip_screen;
|
||||
Config_DisplayConfig_DisplayUnits units;
|
||||
Config_DisplayConfig_OledType oled;
|
||||
} Config_DisplayConfig;
|
||||
|
||||
typedef struct _Config_LoRaConfig {
|
||||
bool use_preset;
|
||||
Config_LoRaConfig_ModemPreset modem_preset;
|
||||
uint16_t bandwidth;
|
||||
uint32_t spread_factor;
|
||||
uint8_t coding_rate;
|
||||
float frequency_offset;
|
||||
Config_LoRaConfig_RegionCode region;
|
||||
uint32_t hop_limit;
|
||||
bool tx_enabled;
|
||||
int8_t tx_power;
|
||||
uint16_t channel_num;
|
||||
bool override_duty_cycle;
|
||||
pb_size_t ignore_incoming_count;
|
||||
uint32_t ignore_incoming[3];
|
||||
} Config_LoRaConfig;
|
||||
|
||||
typedef struct _Config_NetworkConfig_IpV4Config {
|
||||
uint32_t ip;
|
||||
uint32_t gateway;
|
||||
uint32_t subnet;
|
||||
uint32_t dns;
|
||||
} Config_NetworkConfig_IpV4Config;
|
||||
|
||||
typedef struct _Config_PositionConfig {
|
||||
/* 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;
|
||||
|
||||
typedef struct _Config_PowerConfig {
|
||||
/* 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 {
|
||||
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_EthMode eth_mode;
|
||||
/* struct to keep static address */
|
||||
bool has_ipv4_config;
|
||||
Config_NetworkConfig_IpV4Config ipv4_config;
|
||||
} Config_NetworkConfig;
|
||||
|
||||
typedef struct _Config {
|
||||
/* 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;
|
||||
} 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<<spread_factor. */
|
||||
uint32_t spread_factor;
|
||||
/* The denominator of the coding rate.
|
||||
ie for 4/5, the value is 5. 4/8 the value is 8. */
|
||||
uint8_t coding_rate;
|
||||
/* This parameter is for advanced users with advanced test equipment, we do not recommend most users use it.
|
||||
A frequency offset that is added to to the calculated band center frequency.
|
||||
Used to correct for crystal calibration errors. */
|
||||
float frequency_offset;
|
||||
/* The region code for the radio (US, CN, EU433, etc...) */
|
||||
Config_LoRaConfig_RegionCode region;
|
||||
/* Maximum number of hops. This can't be greater than 7.
|
||||
Default of 3 */
|
||||
uint32_t hop_limit;
|
||||
/* Disable TX from the LoRa radio. Useful for hot-swapping antennas and other tests.
|
||||
Defaults to false */
|
||||
bool tx_enabled;
|
||||
/* If zero then, use default max legal continuous power (ie. something that won't
|
||||
burn out the radio hardware)
|
||||
In most cases you should use zero here.
|
||||
Units are in dBm. */
|
||||
int8_t tx_power;
|
||||
/* This is controlling the actual hardware frequency the radio is transmitting on.
|
||||
Most users should never need to be exposed to this field/concept.
|
||||
A channel number between 1 and NUM_CHANNELS (whatever the max is in the current region).
|
||||
If ZERO then the rule is "use the old channel name hash based
|
||||
algorithm to derive the channel number")
|
||||
If using the hash algorithm the channel number will be: hash(channel_name) %
|
||||
NUM_CHANNELS (Where num channels depends on the regulatory region). */
|
||||
uint16_t channel_num;
|
||||
/* If true, duty cycle limits will be exceeded and thus you're possibly not following
|
||||
the local regulations if you're not a HAM.
|
||||
Has no effect if the duty cycle of the used region is 100%. */
|
||||
bool override_duty_cycle;
|
||||
/* For testing it is useful sometimes to force a node to never listen to
|
||||
particular other nodes (simulating radio out of range). All nodenums listed
|
||||
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];
|
||||
} Config_LoRaConfig;
|
||||
|
||||
typedef struct _Config_BluetoothConfig {
|
||||
/* Enable Bluetooth on the device */
|
||||
bool enabled;
|
||||
/* Determines the pairing strategy for the device */
|
||||
Config_BluetoothConfig_PairingMode mode;
|
||||
/* Specified pin for PairingMode.FixedPin */
|
||||
uint32_t fixed_pin;
|
||||
} Config_BluetoothConfig;
|
||||
|
||||
typedef struct _Config {
|
||||
pb_size_t which_payload_variant;
|
||||
union {
|
||||
Config_DeviceConfig device;
|
||||
@@ -186,6 +388,10 @@ typedef struct _Config {
|
||||
} Config;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _Config_DeviceConfig_Role_MIN Config_DeviceConfig_Role_CLIENT
|
||||
#define _Config_DeviceConfig_Role_MAX Config_DeviceConfig_Role_ROUTER_CLIENT
|
||||
@@ -224,9 +430,22 @@ typedef struct _Config {
|
||||
#define _Config_BluetoothConfig_PairingMode_ARRAYSIZE ((Config_BluetoothConfig_PairingMode)(Config_BluetoothConfig_PairingMode_NO_PIN+1))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#define Config_DeviceConfig_role_ENUMTYPE Config_DeviceConfig_Role
|
||||
|
||||
|
||||
|
||||
#define Config_NetworkConfig_eth_mode_ENUMTYPE Config_NetworkConfig_EthMode
|
||||
|
||||
|
||||
#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_LoRaConfig_modem_preset_ENUMTYPE Config_LoRaConfig_ModemPreset
|
||||
#define Config_LoRaConfig_region_ENUMTYPE Config_LoRaConfig_RegionCode
|
||||
|
||||
#define Config_BluetoothConfig_mode_ENUMTYPE Config_BluetoothConfig_PairingMode
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define Config_init_default {0, {Config_DeviceConfig_init_default}}
|
||||
@@ -249,14 +468,39 @@ extern "C" {
|
||||
#define Config_BluetoothConfig_init_zero {0, _Config_BluetoothConfig_PairingMode_MIN, 0}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define Config_BluetoothConfig_enabled_tag 1
|
||||
#define Config_BluetoothConfig_mode_tag 2
|
||||
#define Config_BluetoothConfig_fixed_pin_tag 3
|
||||
#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_eth_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
|
||||
@@ -277,34 +521,9 @@ extern "C" {
|
||||
#define Config_LoRaConfig_channel_num_tag 11
|
||||
#define Config_LoRaConfig_override_duty_cycle_tag 12
|
||||
#define Config_LoRaConfig_ignore_incoming_tag 103
|
||||
#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_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_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_eth_mode_tag 7
|
||||
#define Config_NetworkConfig_ipv4_config_tag 8
|
||||
#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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "device_metadata.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_DEVICE_METADATA_PB_H_INCLUDED
|
||||
#define PB_DEVICE_METADATA_PB_H_INCLUDED
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
/* Struct definitions */
|
||||
/* Device metadata response */
|
||||
typedef struct _DeviceMetadata {
|
||||
typedef struct _DeviceMetadata {
|
||||
/* Device firmware version string */
|
||||
char firmware_version[18];
|
||||
/* Device state version */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "deviceonly.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_DEVICEONLY_PB_H_INCLUDED
|
||||
#define PB_DEVICEONLY_PB_H_INCLUDED
|
||||
@@ -13,33 +13,22 @@
|
||||
|
||||
/* Enum definitions */
|
||||
/* TODO: REPLACE */
|
||||
typedef enum _ScreenFonts {
|
||||
typedef enum _ScreenFonts {
|
||||
/* TODO: REPLACE */
|
||||
ScreenFonts_FONT_SMALL = 0,
|
||||
ScreenFonts_FONT_SMALL = 0,
|
||||
/* TODO: REPLACE */
|
||||
ScreenFonts_FONT_MEDIUM = 1,
|
||||
ScreenFonts_FONT_MEDIUM = 1,
|
||||
/* TODO: REPLACE */
|
||||
ScreenFonts_FONT_LARGE = 2
|
||||
ScreenFonts_FONT_LARGE = 2
|
||||
} ScreenFonts;
|
||||
|
||||
/* Struct definitions */
|
||||
/* 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;
|
||||
|
||||
/* 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 {
|
||||
typedef struct _DeviceState {
|
||||
/* Read only settings/info about this node */
|
||||
bool has_my_node;
|
||||
MyNodeInfo my_node;
|
||||
@@ -68,11 +57,22 @@ typedef struct _DeviceState {
|
||||
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 {
|
||||
typedef struct _OEMStore {
|
||||
/* The Logo width in Px */
|
||||
uint32_t oem_icon_width;
|
||||
/* The Logo height in Px */
|
||||
@@ -88,15 +88,19 @@ typedef struct _OEMStore {
|
||||
} 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))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#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}
|
||||
@@ -107,8 +111,6 @@ extern "C" {
|
||||
#define OEMStore_init_zero {0, 0, {0, {0}}, _ScreenFonts_MIN, "", {0, {0}}}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define ChannelFile_channels_tag 1
|
||||
#define ChannelFile_version_tag 2
|
||||
#define DeviceState_my_node_tag 2
|
||||
#define DeviceState_owner_tag 3
|
||||
#define DeviceState_node_db_tag 4
|
||||
@@ -117,6 +119,8 @@ extern "C" {
|
||||
#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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "localonly.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_LOCALONLY_PB_H_INCLUDED
|
||||
#define PB_LOCALONLY_PB_H_INCLUDED
|
||||
@@ -12,7 +12,7 @@
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _LocalConfig {
|
||||
typedef struct _LocalConfig {
|
||||
/* The part of the config that is specific to the Device */
|
||||
bool has_device;
|
||||
Config_DeviceConfig device;
|
||||
@@ -40,7 +40,7 @@ typedef struct _LocalConfig {
|
||||
uint32_t version;
|
||||
} LocalConfig;
|
||||
|
||||
typedef struct _LocalModuleConfig {
|
||||
typedef struct _LocalModuleConfig {
|
||||
/* The part of the config that is specific to the MQTT module */
|
||||
bool has_mqtt;
|
||||
ModuleConfig_MQTTConfig mqtt;
|
||||
@@ -151,7 +151,7 @@ extern const pb_msgdesc_t LocalModuleConfig_msg;
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
#define LocalConfig_size 387
|
||||
#define LocalModuleConfig_size 358
|
||||
#define LocalModuleConfig_size 376
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "mesh.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_MESH_PB_H_INCLUDED
|
||||
#define PB_MESH_PB_H_INCLUDED
|
||||
@@ -19,350 +19,247 @@
|
||||
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 {
|
||||
typedef enum _HardwareModel {
|
||||
/* TODO: REPLACE */
|
||||
HardwareModel_UNSET = 0,
|
||||
HardwareModel_UNSET = 0,
|
||||
/* TODO: REPLACE */
|
||||
HardwareModel_TLORA_V2 = 1,
|
||||
HardwareModel_TLORA_V2 = 1,
|
||||
/* TODO: REPLACE */
|
||||
HardwareModel_TLORA_V1 = 2,
|
||||
HardwareModel_TLORA_V1 = 2,
|
||||
/* TODO: REPLACE */
|
||||
HardwareModel_TLORA_V2_1_1P6 = 3,
|
||||
HardwareModel_TLORA_V2_1_1P6 = 3,
|
||||
/* TODO: REPLACE */
|
||||
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). */
|
||||
HardwareModel_HELTEC_V2_0 = 5,
|
||||
HardwareModel_HELTEC_V2_0 = 5,
|
||||
/* TODO: REPLACE */
|
||||
HardwareModel_TBEAM_V0P7 = 6,
|
||||
HardwareModel_TBEAM_V0P7 = 6,
|
||||
/* TODO: REPLACE */
|
||||
HardwareModel_T_ECHO = 7,
|
||||
HardwareModel_T_ECHO = 7,
|
||||
/* TODO: REPLACE */
|
||||
HardwareModel_TLORA_V1_1P3 = 8,
|
||||
HardwareModel_TLORA_V1_1P3 = 8,
|
||||
/* TODO: REPLACE */
|
||||
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 */
|
||||
HardwareModel_HELTEC_V2_1 = 10,
|
||||
HardwareModel_HELTEC_V2_1 = 10,
|
||||
/* Ancient heltec WiFi_Lora_32 board */
|
||||
HardwareModel_HELTEC_V1 = 11,
|
||||
HardwareModel_HELTEC_V1 = 11,
|
||||
/* New T-BEAM with ESP32-S3 CPU */
|
||||
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/ */
|
||||
HardwareModel_RAK11200 = 13,
|
||||
HardwareModel_RAK11200 = 13,
|
||||
/* B&Q Consulting Nano Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:nano */
|
||||
HardwareModel_NANO_G1 = 14,
|
||||
HardwareModel_NANO_G1 = 14,
|
||||
/* TODO: REPLACE */
|
||||
HardwareModel_TLORA_V2_1_1P8 = 15,
|
||||
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,
|
||||
HardwareModel_STATION_G1 = 25,
|
||||
/* Less common/prototype boards listed here (needs one more byte over the air) */
|
||||
HardwareModel_LORA_RELAY_V1 = 32,
|
||||
HardwareModel_LORA_RELAY_V1 = 32,
|
||||
/* TODO: REPLACE */
|
||||
HardwareModel_NRF52840DK = 33,
|
||||
HardwareModel_NRF52840DK = 33,
|
||||
/* TODO: REPLACE */
|
||||
HardwareModel_PPR = 34,
|
||||
HardwareModel_PPR = 34,
|
||||
/* TODO: REPLACE */
|
||||
HardwareModel_GENIEBLOCKS = 35,
|
||||
HardwareModel_GENIEBLOCKS = 35,
|
||||
/* TODO: REPLACE */
|
||||
HardwareModel_NRF52_UNKNOWN = 36,
|
||||
HardwareModel_NRF52_UNKNOWN = 36,
|
||||
/* TODO: REPLACE */
|
||||
HardwareModel_PORTDUINO = 37,
|
||||
HardwareModel_PORTDUINO = 37,
|
||||
/* The simulator built into the android app */
|
||||
HardwareModel_ANDROID_SIM = 38,
|
||||
HardwareModel_ANDROID_SIM = 38,
|
||||
/* Custom DIY device based on @NanoVHF schematics: https://github.com/NanoVHF/Meshtastic-DIY/tree/main/Schematics */
|
||||
HardwareModel_DIY_V1 = 39,
|
||||
HardwareModel_DIY_V1 = 39,
|
||||
/* nRF52840 Dongle : https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle/ */
|
||||
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 */
|
||||
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/ */
|
||||
HardwareModel_M5STACK = 42,
|
||||
HardwareModel_M5STACK = 42,
|
||||
/* New Heltec LoRA32 with ESP32-S3 CPU */
|
||||
HardwareModel_HELTEC_V3 = 43,
|
||||
HardwareModel_HELTEC_V3 = 43,
|
||||
/* New Heltec Wireless Stick Lite with ESP32-S3 CPU */
|
||||
HardwareModel_HELTEC_WSL_V3 = 44,
|
||||
HardwareModel_HELTEC_WSL_V3 = 44,
|
||||
/* 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_PRIVATE_HW = 255
|
||||
} HardwareModel;
|
||||
|
||||
/* Shared constants between device and phone */
|
||||
typedef enum _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 */
|
||||
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 */
|
||||
Constants_DATA_PAYLOAD_LEN = 237
|
||||
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 {
|
||||
typedef enum _CriticalErrorCode {
|
||||
/* TODO: REPLACE */
|
||||
CriticalErrorCode_NONE = 0,
|
||||
CriticalErrorCode_NONE = 0,
|
||||
/* A software bug was detected while trying to send lora */
|
||||
CriticalErrorCode_TX_WATCHDOG = 1,
|
||||
CriticalErrorCode_TX_WATCHDOG = 1,
|
||||
/* A software bug was detected on entry to sleep */
|
||||
CriticalErrorCode_SLEEP_ENTER_WAIT = 2,
|
||||
CriticalErrorCode_SLEEP_ENTER_WAIT = 2,
|
||||
/* No Lora radio hardware could be found */
|
||||
CriticalErrorCode_NO_RADIO = 3,
|
||||
CriticalErrorCode_NO_RADIO = 3,
|
||||
/* Not normally used */
|
||||
CriticalErrorCode_UNSPECIFIED = 4,
|
||||
CriticalErrorCode_UNSPECIFIED = 4,
|
||||
/* We failed while configuring a UBlox GPS */
|
||||
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 */
|
||||
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. */
|
||||
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. */
|
||||
CriticalErrorCode_TRANSMIT_FAILED = 8,
|
||||
CriticalErrorCode_TRANSMIT_FAILED = 8,
|
||||
/* We detected that the main CPU voltage dropped below the minumum acceptable value */
|
||||
CriticalErrorCode_BROWNOUT = 9,
|
||||
CriticalErrorCode_BROWNOUT = 9,
|
||||
/* Selftest of SX1262 radio chip failed */
|
||||
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 */
|
||||
CriticalErrorCode_RADIO_SPI_BUG = 11
|
||||
CriticalErrorCode_RADIO_SPI_BUG = 11
|
||||
} CriticalErrorCode;
|
||||
|
||||
/* 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 _Position_LocSource {
|
||||
/* How the location was acquired: manual, onboard GPS, external (EUD) GPS */
|
||||
typedef enum _Position_LocSource {
|
||||
/* TODO: REPLACE */
|
||||
Position_LocSource_LOC_UNSET = 0,
|
||||
Position_LocSource_LOC_UNSET = 0,
|
||||
/* TODO: REPLACE */
|
||||
Position_LocSource_LOC_MANUAL = 1,
|
||||
Position_LocSource_LOC_MANUAL = 1,
|
||||
/* TODO: REPLACE */
|
||||
Position_LocSource_LOC_INTERNAL = 2,
|
||||
Position_LocSource_LOC_INTERNAL = 2,
|
||||
/* TODO: REPLACE */
|
||||
Position_LocSource_LOC_EXTERNAL = 3
|
||||
Position_LocSource_LOC_EXTERNAL = 3
|
||||
} Position_LocSource;
|
||||
|
||||
/* Shared constants between device and phone */
|
||||
typedef enum _Position_AltSource {
|
||||
/* First enum must be zero, and we are just using this enum to
|
||||
pass int constants between two very different environments */
|
||||
Position_AltSource_ALT_UNSET = 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 */
|
||||
Position_AltSource_ALT_MANUAL = 1,
|
||||
Position_AltSource_ALT_INTERNAL = 2,
|
||||
Position_AltSource_ALT_EXTERNAL = 3,
|
||||
Position_AltSource_ALT_BAROMETRIC = 4
|
||||
/* 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;
|
||||
|
||||
/* 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 _Routing_Error {
|
||||
/* 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_NONE = 0,
|
||||
/* TODO: REPLACE */
|
||||
Routing_Error_NO_ROUTE = 1,
|
||||
/* TODO: REPLACE */
|
||||
Routing_Error_GOT_NAK = 2,
|
||||
/* TODO: REPLACE */
|
||||
Routing_Error_TIMEOUT = 3,
|
||||
/* TODO: REPLACE */
|
||||
Routing_Error_NO_INTERFACE = 4,
|
||||
/* The original heltec WiFi_Lora_32_V2, which had battery voltage sensing hooked to GPIO 13
|
||||
(see HELTEC_V2 for the new version). */
|
||||
Routing_Error_MAX_RETRANSMIT = 5,
|
||||
/* TODO: REPLACE */
|
||||
Routing_Error_NO_CHANNEL = 6,
|
||||
/* TODO: REPLACE */
|
||||
Routing_Error_TOO_LARGE = 7,
|
||||
/* TODO: REPLACE */
|
||||
Routing_Error_NO_RESPONSE = 8,
|
||||
/* TODO: REPLACE */
|
||||
Routing_Error_DUTY_CYCLE_LIMIT = 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 */
|
||||
Routing_Error_BAD_REQUEST = 32,
|
||||
/* Ancient heltec WiFi_Lora_32 board */
|
||||
Routing_Error_NOT_AUTHORIZED = 33
|
||||
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;
|
||||
|
||||
/* 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 _MeshPacket_Priority {
|
||||
/* 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_UNSET = 0,
|
||||
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_MIN = 1,
|
||||
/* TODO: REPLACE */
|
||||
MeshPacket_Priority_BACKGROUND = 10,
|
||||
/* TODO: REPLACE */
|
||||
MeshPacket_Priority_DEFAULT = 64,
|
||||
/* TODO: REPLACE */
|
||||
MeshPacket_Priority_RELIABLE = 70,
|
||||
/* The original heltec WiFi_Lora_32_V2, which had battery voltage sensing hooked to GPIO 13
|
||||
(see HELTEC_V2 for the new version). */
|
||||
MeshPacket_Priority_ACK = 120,
|
||||
/* TODO: REPLACE */
|
||||
MeshPacket_Priority_MAX = 127
|
||||
MeshPacket_Priority_MAX = 127
|
||||
} MeshPacket_Priority;
|
||||
|
||||
/* Shared constants between device and phone */
|
||||
typedef enum _MeshPacket_Delayed {
|
||||
/* First enum must be zero, and we are just using this enum to
|
||||
pass int constants between two very different environments */
|
||||
MeshPacket_Delayed_NO_DELAY = 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 */
|
||||
MeshPacket_Delayed_DELAYED_BROADCAST = 1,
|
||||
MeshPacket_Delayed_DELAYED_DIRECT = 2
|
||||
/* 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;
|
||||
|
||||
/* 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 _LogRecord_Level {
|
||||
/* TODO: REPLACE */
|
||||
LogRecord_Level_UNSET = 0,
|
||||
/* TODO: REPLACE */
|
||||
LogRecord_Level_CRITICAL = 50,
|
||||
/* TODO: REPLACE */
|
||||
LogRecord_Level_ERROR = 40,
|
||||
/* TODO: REPLACE */
|
||||
LogRecord_Level_WARNING = 30,
|
||||
/* TODO: REPLACE */
|
||||
LogRecord_Level_INFO = 20,
|
||||
/* The original heltec WiFi_Lora_32_V2, which had battery voltage sensing hooked to GPIO 13
|
||||
(see HELTEC_V2 for the new version). */
|
||||
LogRecord_Level_DEBUG = 10,
|
||||
/* TODO: REPLACE */
|
||||
LogRecord_Level_TRACE = 5
|
||||
/* 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 */
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* a gps position */
|
||||
typedef struct _Position {
|
||||
typedef struct _Position {
|
||||
/* The new preferred location encoding, multiply by 1e-7 to get degrees
|
||||
in floating point */
|
||||
int32_t latitude_i;
|
||||
@@ -429,13 +326,6 @@ typedef struct _Position {
|
||||
uint32_t seq_number;
|
||||
} Position;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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)
|
||||
@@ -456,7 +346,7 @@ typedef struct _RouteDiscovery {
|
||||
A few nodenums are reserved and will never be requested:
|
||||
0xff - broadcast
|
||||
0 through 3 - for future use */
|
||||
typedef struct _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
|
||||
@@ -481,8 +371,62 @@ typedef struct _User {
|
||||
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 {
|
||||
typedef struct _Waypoint {
|
||||
/* Id of the waypoint */
|
||||
uint32_t id;
|
||||
/* latitude_i */
|
||||
@@ -504,7 +448,7 @@ 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 {
|
||||
typedef struct _MeshPacket {
|
||||
/* The sending node number.
|
||||
Note: Our crypto implementation uses this field as well.
|
||||
See [crypto](/docs/overview/encryption) for details.
|
||||
@@ -588,7 +532,7 @@ typedef struct _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 _NodeInfo {
|
||||
typedef struct _NodeInfo {
|
||||
/* The node number */
|
||||
uint32_t num;
|
||||
/* The user info for this node */
|
||||
@@ -608,25 +552,80 @@ typedef struct _NodeInfo {
|
||||
DeviceMetrics device_metrics;
|
||||
} NodeInfo;
|
||||
|
||||
/* 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;
|
||||
/* 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;
|
||||
|
||||
/* 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 {
|
||||
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;
|
||||
@@ -663,7 +662,7 @@ typedef struct _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 {
|
||||
typedef struct _ToRadio {
|
||||
pb_size_t which_payload_variant;
|
||||
union {
|
||||
/* Send this packet on the mesh */
|
||||
@@ -684,6 +683,19 @@ typedef struct _ToRadio {
|
||||
};
|
||||
} 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
|
||||
@@ -722,10 +734,29 @@ typedef struct _ToRadio {
|
||||
#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
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* 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}
|
||||
@@ -756,36 +787,6 @@ extern "C" {
|
||||
#define Compressed_init_zero {_PortNum_MIN, {0, {0}}}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define Compressed_portnum_tag 1
|
||||
#define Compressed_data_tag 2
|
||||
#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 LogRecord_message_tag 1
|
||||
#define LogRecord_time_tag 2
|
||||
#define LogRecord_source_tag 3
|
||||
#define LogRecord_level_tag 4
|
||||
#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 Position_latitude_i_tag 1
|
||||
#define Position_longitude_i_tag 2
|
||||
#define Position_altitude_tag 3
|
||||
@@ -808,13 +809,24 @@ extern "C" {
|
||||
#define Position_sensor_id_tag 20
|
||||
#define Position_next_update_tag 21
|
||||
#define Position_seq_number_tag 22
|
||||
#define RouteDiscovery_route_tag 1
|
||||
#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
|
||||
@@ -841,9 +853,26 @@ extern "C" {
|
||||
#define NodeInfo_snr_tag 4
|
||||
#define NodeInfo_last_heard_tag 5
|
||||
#define NodeInfo_device_metrics_tag 6
|
||||
#define Routing_route_request_tag 1
|
||||
#define Routing_route_reply_tag 2
|
||||
#define Routing_error_reason_tag 3
|
||||
#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 FromRadio_id_tag 1
|
||||
#define FromRadio_packet_tag 2
|
||||
#define FromRadio_my_info_tag 3
|
||||
@@ -857,6 +886,8 @@ extern "C" {
|
||||
#define ToRadio_packet_tag 1
|
||||
#define ToRadio_want_config_id_tag 3
|
||||
#define ToRadio_disconnect_tag 4
|
||||
#define Compressed_portnum_tag 1
|
||||
#define Compressed_data_tag 2
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define Position_FIELDLIST(X, a) \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "module_config.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_MODULE_CONFIG_PB_H_INCLUDED
|
||||
#define PB_MODULE_CONFIG_PB_H_INCLUDED
|
||||
@@ -10,134 +10,244 @@
|
||||
#endif
|
||||
|
||||
/* Enum definitions */
|
||||
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
|
||||
/* 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;
|
||||
|
||||
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
|
||||
/* 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;
|
||||
|
||||
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
|
||||
/* 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;
|
||||
|
||||
typedef enum _ModuleConfig_CannedMessageConfig_InputEventChar {
|
||||
ModuleConfig_CannedMessageConfig_InputEventChar_NONE = 0,
|
||||
ModuleConfig_CannedMessageConfig_InputEventChar_UP = 17,
|
||||
ModuleConfig_CannedMessageConfig_InputEventChar_DOWN = 18,
|
||||
ModuleConfig_CannedMessageConfig_InputEventChar_LEFT = 19,
|
||||
ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT = 20,
|
||||
ModuleConfig_CannedMessageConfig_InputEventChar_SELECT = 10,
|
||||
ModuleConfig_CannedMessageConfig_InputEventChar_BACK = 27,
|
||||
ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL = 24
|
||||
/* 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 */
|
||||
typedef struct _ModuleConfig_AudioConfig {
|
||||
bool codec2_enabled;
|
||||
uint8_t ptt_pin;
|
||||
ModuleConfig_AudioConfig_Audio_Baud bitrate;
|
||||
uint8_t i2s_ws;
|
||||
uint8_t i2s_sd;
|
||||
uint8_t i2s_din;
|
||||
uint8_t i2s_sck;
|
||||
} ModuleConfig_AudioConfig;
|
||||
|
||||
typedef struct _ModuleConfig_CannedMessageConfig {
|
||||
bool rotary1_enabled;
|
||||
uint32_t inputbroker_pin_a;
|
||||
uint32_t inputbroker_pin_b;
|
||||
uint32_t inputbroker_pin_press;
|
||||
ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_cw;
|
||||
ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_ccw;
|
||||
ModuleConfig_CannedMessageConfig_InputEventChar inputbroker_event_press;
|
||||
bool updown1_enabled;
|
||||
bool enabled;
|
||||
char allow_input_source[16];
|
||||
bool send_bell;
|
||||
} ModuleConfig_CannedMessageConfig;
|
||||
|
||||
typedef struct _ModuleConfig_ExternalNotificationConfig {
|
||||
bool enabled;
|
||||
uint32_t output_ms;
|
||||
uint32_t output;
|
||||
bool active;
|
||||
bool alert_message;
|
||||
bool alert_bell;
|
||||
bool use_pwm;
|
||||
} ModuleConfig_ExternalNotificationConfig;
|
||||
|
||||
typedef struct _ModuleConfig_MQTTConfig {
|
||||
/* 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[32];
|
||||
/* 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;
|
||||
|
||||
typedef struct _ModuleConfig_RangeTestConfig {
|
||||
bool enabled;
|
||||
uint32_t sender;
|
||||
bool save;
|
||||
} ModuleConfig_RangeTestConfig;
|
||||
/* 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;
|
||||
|
||||
typedef struct _ModuleConfig_SerialConfig {
|
||||
/* 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;
|
||||
|
||||
typedef struct _ModuleConfig_StoreForwardConfig {
|
||||
/* 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;
|
||||
|
||||
typedef struct _ModuleConfig_TelemetryConfig {
|
||||
/* 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 {
|
||||
typedef struct _ModuleConfig {
|
||||
pb_size_t which_payload_variant;
|
||||
union {
|
||||
/* TODO: REPLACE */
|
||||
@@ -160,6 +270,10 @@ typedef struct _ModuleConfig {
|
||||
} 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
|
||||
@@ -178,16 +292,27 @@ typedef struct _ModuleConfig {
|
||||
#define _ModuleConfig_CannedMessageConfig_InputEventChar_ARRAYSIZE ((ModuleConfig_CannedMessageConfig_InputEventChar)(ModuleConfig_CannedMessageConfig_InputEventChar_BACK+1))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#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_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}
|
||||
#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}
|
||||
@@ -196,13 +321,19 @@ extern "C" {
|
||||
#define ModuleConfig_MQTTConfig_init_zero {0, "", "", "", 0, 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}
|
||||
#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_AudioConfig_codec2_enabled_tag 1
|
||||
#define ModuleConfig_AudioConfig_ptt_pin_tag 2
|
||||
#define ModuleConfig_AudioConfig_bitrate_tag 3
|
||||
@@ -210,6 +341,40 @@ extern "C" {
|
||||
#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
|
||||
@@ -221,39 +386,6 @@ extern "C" {
|
||||
#define ModuleConfig_CannedMessageConfig_enabled_tag 9
|
||||
#define ModuleConfig_CannedMessageConfig_allow_input_source_tag 10
|
||||
#define ModuleConfig_CannedMessageConfig_send_bell_tag 11
|
||||
#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_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_RangeTestConfig_enabled_tag 1
|
||||
#define ModuleConfig_RangeTestConfig_sender_tag 2
|
||||
#define ModuleConfig_RangeTestConfig_save_tag 3
|
||||
#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_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_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_mqtt_tag 1
|
||||
#define ModuleConfig_serial_tag 2
|
||||
#define ModuleConfig_external_notification_tag 3
|
||||
@@ -323,7 +455,14 @@ 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, 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
|
||||
|
||||
@@ -391,7 +530,7 @@ extern const pb_msgdesc_t ModuleConfig_CannedMessageConfig_msg;
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
#define ModuleConfig_AudioConfig_size 19
|
||||
#define ModuleConfig_CannedMessageConfig_size 49
|
||||
#define ModuleConfig_ExternalNotificationConfig_size 22
|
||||
#define ModuleConfig_ExternalNotificationConfig_size 40
|
||||
#define ModuleConfig_MQTTConfig_size 169
|
||||
#define ModuleConfig_RangeTestConfig_size 10
|
||||
#define ModuleConfig_SerialConfig_size 26
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "mqtt.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_MQTT_PB_H_INCLUDED
|
||||
#define PB_MQTT_PB_H_INCLUDED
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
/* Struct definitions */
|
||||
/* This message wraps a MeshPacket with extra metadata about the sender and how it arrived. */
|
||||
typedef struct _ServiceEnvelope {
|
||||
typedef struct _ServiceEnvelope {
|
||||
/* The (probably encrypted) packet */
|
||||
struct _MeshPacket *packet;
|
||||
/* The global channel ID it was sent on */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "portnums.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_PORTNUMS_PB_H_INCLUDED
|
||||
#define PB_PORTNUMS_PB_H_INCLUDED
|
||||
@@ -22,89 +22,89 @@
|
||||
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 {
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
PortNum_POSITION_APP = 3,
|
||||
/* The built-in user info app.
|
||||
Payload is a [User](/docs/developers/protobufs/api#user) message */
|
||||
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 */
|
||||
PortNum_ROUTING_APP = 5,
|
||||
PortNum_ROUTING_APP = 5,
|
||||
/* Admin control packets.
|
||||
Payload is a [AdminMessage](/docs/developers/protobufs/api#adminmessage) message */
|
||||
PortNum_ADMIN_APP = 6,
|
||||
PortNum_ADMIN_APP = 6,
|
||||
/* Compressed TEXT_MESSAGE payloads. */
|
||||
PortNum_TEXT_MESSAGE_COMPRESSED_APP = 7,
|
||||
PortNum_TEXT_MESSAGE_COMPRESSED_APP = 7,
|
||||
/* Waypoint payloads.
|
||||
Payload is a [Waypoint](/docs/developers/protobufs/api#waypoint) message */
|
||||
PortNum_WAYPOINT_APP = 8,
|
||||
PortNum_WAYPOINT_APP = 8,
|
||||
/* Audio Payloads.
|
||||
Encapsulated codec2 packets. On 2.4 GHZ Bandwidths only for now */
|
||||
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. */
|
||||
PortNum_REPLY_APP = 32,
|
||||
PortNum_REPLY_APP = 32,
|
||||
/* Used for the python IP tunnel feature */
|
||||
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. */
|
||||
PortNum_SERIAL_APP = 64,
|
||||
PortNum_SERIAL_APP = 64,
|
||||
/* STORE_FORWARD_APP (Work in Progress)
|
||||
Maintained by Jm Casler (MC Hamster) : jm@casler.org */
|
||||
PortNum_STORE_FORWARD_APP = 65,
|
||||
PortNum_STORE_FORWARD_APP = 65,
|
||||
/* Optional port for messages for the range test module. */
|
||||
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 */
|
||||
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 */
|
||||
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 */
|
||||
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. */
|
||||
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)) */
|
||||
PortNum_PRIVATE_APP = 256,
|
||||
PortNum_PRIVATE_APP = 256,
|
||||
/* ATAK Forwarder Module https://github.com/paulmandal/atak-forwarder */
|
||||
PortNum_ATAK_FORWARDER = 257,
|
||||
PortNum_ATAK_FORWARDER = 257,
|
||||
/* Currently we limit port nums to no higher than this value */
|
||||
PortNum_MAX = 511
|
||||
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
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "remote_hardware.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_REMOTE_HARDWARE_PB_H_INCLUDED
|
||||
#define PB_REMOTE_HARDWARE_PB_H_INCLUDED
|
||||
@@ -10,13 +10,22 @@
|
||||
#endif
|
||||
|
||||
/* Enum definitions */
|
||||
typedef enum _HardwareMessage_Type {
|
||||
HardwareMessage_Type_UNSET = 0,
|
||||
HardwareMessage_Type_WRITE_GPIOS = 1,
|
||||
HardwareMessage_Type_WATCH_GPIOS = 2,
|
||||
HardwareMessage_Type_GPIOS_CHANGED = 3,
|
||||
HardwareMessage_Type_READ_GPIOS = 4,
|
||||
HardwareMessage_Type_READ_GPIOS_REPLY = 5
|
||||
/* 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 */
|
||||
@@ -29,7 +38,7 @@ typedef enum _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 _HardwareMessage {
|
||||
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 */
|
||||
@@ -40,15 +49,17 @@ typedef struct _HardwareMessage {
|
||||
} 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
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define HardwareMessage_init_default {_HardwareMessage_Type_MIN, 0, 0}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "storeforward.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_STOREFORWARD_PB_H_INCLUDED
|
||||
#define PB_STOREFORWARD_PB_H_INCLUDED
|
||||
@@ -10,88 +10,126 @@
|
||||
#endif
|
||||
|
||||
/* Enum definitions */
|
||||
typedef enum _StoreAndForward_RequestResponse {
|
||||
StoreAndForward_RequestResponse_UNSET = 0,
|
||||
StoreAndForward_RequestResponse_ROUTER_ERROR = 1,
|
||||
StoreAndForward_RequestResponse_ROUTER_HEARTBEAT = 2,
|
||||
StoreAndForward_RequestResponse_ROUTER_PING = 3,
|
||||
StoreAndForward_RequestResponse_ROUTER_PONG = 4,
|
||||
StoreAndForward_RequestResponse_ROUTER_BUSY = 5,
|
||||
StoreAndForward_RequestResponse_ROUTER_HISTORY = 6,
|
||||
StoreAndForward_RequestResponse_CLIENT_ERROR = 101,
|
||||
StoreAndForward_RequestResponse_CLIENT_HISTORY = 102,
|
||||
StoreAndForward_RequestResponse_CLIENT_STATS = 103,
|
||||
StoreAndForward_RequestResponse_CLIENT_PING = 104,
|
||||
StoreAndForward_RequestResponse_CLIENT_PONG = 105,
|
||||
StoreAndForward_RequestResponse_CLIENT_ABORT = 106
|
||||
/* 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 */
|
||||
typedef struct _StoreAndForward_Heartbeat {
|
||||
uint32_t period;
|
||||
uint32_t secondary;
|
||||
} StoreAndForward_Heartbeat;
|
||||
|
||||
typedef struct _StoreAndForward_History {
|
||||
uint32_t history_messages;
|
||||
uint32_t window;
|
||||
uint32_t last_request;
|
||||
} StoreAndForward_History;
|
||||
|
||||
typedef struct _StoreAndForward_Statistics {
|
||||
/* 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 {
|
||||
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;
|
||||
/* TODO: REPLACE */
|
||||
bool has_stats;
|
||||
StoreAndForward_Statistics stats;
|
||||
/* TODO: REPLACE */
|
||||
bool has_history;
|
||||
StoreAndForward_History history;
|
||||
/* TODO: REPLACE */
|
||||
bool has_heartbeat;
|
||||
StoreAndForward_Heartbeat heartbeat;
|
||||
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;
|
||||
|
||||
|
||||
/* 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))
|
||||
|
||||
|
||||
#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, false, StoreAndForward_Statistics_init_default, false, StoreAndForward_History_init_default, false, StoreAndForward_Heartbeat_init_default}
|
||||
#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, false, StoreAndForward_Statistics_init_zero, false, StoreAndForward_History_init_zero, false, StoreAndForward_Heartbeat_init_zero}
|
||||
#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_Heartbeat_period_tag 1
|
||||
#define StoreAndForward_Heartbeat_secondary_tag 2
|
||||
#define StoreAndForward_History_history_messages_tag 1
|
||||
#define StoreAndForward_History_window_tag 2
|
||||
#define StoreAndForward_History_last_request_tag 3
|
||||
#define StoreAndForward_Statistics_messages_total_tag 1
|
||||
#define StoreAndForward_Statistics_messages_saved_tag 2
|
||||
#define StoreAndForward_Statistics_messages_max_tag 3
|
||||
@@ -101,22 +139,29 @@ extern "C" {
|
||||
#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, OPTIONAL, MESSAGE, stats, 2) \
|
||||
X(a, STATIC, OPTIONAL, MESSAGE, history, 3) \
|
||||
X(a, STATIC, OPTIONAL, MESSAGE, heartbeat, 4)
|
||||
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_stats_MSGTYPE StoreAndForward_Statistics
|
||||
#define StoreAndForward_history_MSGTYPE StoreAndForward_History
|
||||
#define StoreAndForward_heartbeat_MSGTYPE StoreAndForward_Heartbeat
|
||||
#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) \
|
||||
@@ -159,7 +204,7 @@ extern const pb_msgdesc_t StoreAndForward_Heartbeat_msg;
|
||||
#define StoreAndForward_Heartbeat_size 12
|
||||
#define StoreAndForward_History_size 18
|
||||
#define StoreAndForward_Statistics_size 50
|
||||
#define StoreAndForward_size 88
|
||||
#define StoreAndForward_size 54
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#include "telemetry.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_TELEMETRY_PB_H_INCLUDED
|
||||
#define PB_TELEMETRY_PB_H_INCLUDED
|
||||
@@ -11,36 +11,38 @@
|
||||
|
||||
/* Enum definitions */
|
||||
/* TODO: REPLACE */
|
||||
typedef enum _TelemetrySensorType {
|
||||
typedef enum _TelemetrySensorType {
|
||||
/* No external telemetry sensor explicitly set */
|
||||
TelemetrySensorType_SENSOR_UNSET = 0,
|
||||
TelemetrySensorType_SENSOR_UNSET = 0,
|
||||
/* High accuracy temperature, pressure, humidity */
|
||||
TelemetrySensorType_BME280 = 1,
|
||||
TelemetrySensorType_BME280 = 1,
|
||||
/* High accuracy temperature, pressure, humidity, and air resistance */
|
||||
TelemetrySensorType_BME680 = 2,
|
||||
TelemetrySensorType_BME680 = 2,
|
||||
/* Very high accuracy temperature */
|
||||
TelemetrySensorType_MCP9808 = 3,
|
||||
TelemetrySensorType_MCP9808 = 3,
|
||||
/* Moderate accuracy current and voltage */
|
||||
TelemetrySensorType_INA260 = 4,
|
||||
TelemetrySensorType_INA260 = 4,
|
||||
/* Moderate accuracy current and voltage */
|
||||
TelemetrySensorType_INA219 = 5,
|
||||
TelemetrySensorType_INA219 = 5,
|
||||
/* High accuracy temperature and pressure */
|
||||
TelemetrySensorType_BMP280 = 6,
|
||||
TelemetrySensorType_BMP280 = 6,
|
||||
/* High accuracy temperature and humidity */
|
||||
TelemetrySensorType_SHTC3 = 7,
|
||||
TelemetrySensorType_SHTC3 = 7,
|
||||
/* High accuracy pressure */
|
||||
TelemetrySensorType_LPS22 = 8,
|
||||
TelemetrySensorType_LPS22 = 8,
|
||||
/* 3-Axis magnetic sensor */
|
||||
TelemetrySensorType_QMC6310 = 9,
|
||||
TelemetrySensorType_QMC6310 = 9,
|
||||
/* 6-Axis inertial measurement sensor */
|
||||
TelemetrySensorType_QMI8658 = 10,
|
||||
TelemetrySensorType_QMI8658 = 10,
|
||||
/* 3-Axis magnetic sensor */
|
||||
TelemetrySensorType_QMC5883L = 11
|
||||
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 {
|
||||
typedef struct _DeviceMetrics {
|
||||
/* 1-100 (0 means powered) */
|
||||
uint32_t battery_level;
|
||||
/* Voltage measured */
|
||||
@@ -52,7 +54,7 @@ typedef struct _DeviceMetrics {
|
||||
} DeviceMetrics;
|
||||
|
||||
/* Weather station or other environmental metrics */
|
||||
typedef struct _EnvironmentMetrics {
|
||||
typedef struct _EnvironmentMetrics {
|
||||
/* Temperature measured */
|
||||
float temperature;
|
||||
/* Relative humidity percent measured */
|
||||
@@ -68,7 +70,7 @@ typedef struct _EnvironmentMetrics {
|
||||
} EnvironmentMetrics;
|
||||
|
||||
/* Types of Measurements the telemetry module is equipped to handle */
|
||||
typedef struct _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
|
||||
@@ -85,16 +87,19 @@ typedef struct _Telemetry {
|
||||
} Telemetry;
|
||||
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _TelemetrySensorType_MIN TelemetrySensorType_SENSOR_UNSET
|
||||
#define _TelemetrySensorType_MAX TelemetrySensorType_QMC5883L
|
||||
#define _TelemetrySensorType_ARRAYSIZE ((TelemetrySensorType)(TelemetrySensorType_QMC5883L+1))
|
||||
|
||||
|
||||
#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}
|
||||
|
||||
@@ -14,7 +14,7 @@ void initApiServer(int port)
|
||||
}
|
||||
}
|
||||
|
||||
WiFiServerAPI::WiFiServerAPI(WiFiClient &_client) : StreamAPI(&client), client(_client)
|
||||
WiFiServerAPI::WiFiServerAPI(WiFiClient &_client) : StreamAPI(&client), concurrency::OSThread("WiFiServerAPI"), client(_client)
|
||||
{
|
||||
DEBUG_MSG("Incoming wifi connection\n");
|
||||
}
|
||||
@@ -42,7 +42,7 @@ bool WiFiServerAPI::checkIsConnected()
|
||||
int32_t WiFiServerAPI::runOnce()
|
||||
{
|
||||
if (client.connected()) {
|
||||
return StreamAPI::runOnce();
|
||||
return StreamAPI::runOncePart();
|
||||
} else {
|
||||
DEBUG_MSG("Client dropped connection, suspending API service\n");
|
||||
enabled = false; // we no longer need to run
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Provides both debug printing and, if the client starts sending protobufs to us, switches to send/receive protobufs
|
||||
* (and starts dropping debug printing - FIXME, eventually those prints should be encapsulated in protobufs).
|
||||
*/
|
||||
class WiFiServerAPI : public StreamAPI
|
||||
class WiFiServerAPI : public StreamAPI, private concurrency::OSThread
|
||||
{
|
||||
private:
|
||||
WiFiClient client;
|
||||
|
||||
@@ -515,7 +515,7 @@ void AdminModule::saveChanges(int saveWhat, bool shouldReboot)
|
||||
}
|
||||
}
|
||||
|
||||
AdminModule::AdminModule() : ProtobufModule("Admin", PortNum_ADMIN_APP, AdminMessage_fields)
|
||||
AdminModule::AdminModule() : ProtobufModule("Admin", PortNum_ADMIN_APP, &AdminMessage_msg)
|
||||
{
|
||||
// restrict to the admin channel for rx
|
||||
boundChannel = Channels::adminChannel;
|
||||
|
||||
@@ -45,8 +45,7 @@ CannedMessageModule *cannedMessageModule;
|
||||
|
||||
// TODO: move it into NodeDB.h!
|
||||
extern bool loadProto(const char *filename, size_t protoSize, size_t objSize, const pb_msgdesc_t *fields, void *dest_struct);
|
||||
extern bool saveProto(const char *filename, size_t protoSize, size_t objSize, const pb_msgdesc_t *fields,
|
||||
const void *dest_struct);
|
||||
extern bool saveProto(const char *filename, size_t protoSize, const pb_msgdesc_t *fields, const void *dest_struct);
|
||||
|
||||
CannedMessageModule::CannedMessageModule()
|
||||
: SinglePortModule("canned", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread("CannedMessageModule")
|
||||
@@ -480,7 +479,7 @@ void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *st
|
||||
void CannedMessageModule::loadProtoForModule()
|
||||
{
|
||||
if (!loadProto(cannedMessagesConfigFile, CannedMessageModuleConfig_size, sizeof(cannedMessagesConfigFile),
|
||||
CannedMessageModuleConfig_fields, &cannedMessageModuleConfig)) {
|
||||
&CannedMessageModuleConfig_msg, &cannedMessageModuleConfig)) {
|
||||
installDefaultCannedMessageModuleConfig();
|
||||
}
|
||||
}
|
||||
@@ -499,8 +498,8 @@ bool CannedMessageModule::saveProtoForModule()
|
||||
FS.mkdir("/prefs");
|
||||
#endif
|
||||
|
||||
okay &= saveProto(cannedMessagesConfigFile, CannedMessageModuleConfig_size, sizeof(cannedMessageModuleConfig),
|
||||
CannedMessageModuleConfig_fields, &cannedMessageModuleConfig);
|
||||
okay &= saveProto(cannedMessagesConfigFile, CannedMessageModuleConfig_size,
|
||||
&CannedMessageModuleConfig_msg, &cannedMessageModuleConfig);
|
||||
|
||||
return okay;
|
||||
}
|
||||
|
||||
@@ -11,41 +11,9 @@
|
||||
#define PIN_BUZZER false
|
||||
#endif
|
||||
|
||||
//#include <assert.h>
|
||||
|
||||
/*
|
||||
|
||||
Documentation:
|
||||
https://github.com/meshtastic/firmware/blob/master/docs/software/modules/ExternalNotificationModule.md
|
||||
|
||||
This module supports:
|
||||
https://github.com/meshtastic/firmware/issues/654
|
||||
|
||||
|
||||
Quick reference:
|
||||
|
||||
moduleConfig.external_notification.enabled
|
||||
0 = Disabled (Default)
|
||||
1 = Enabled
|
||||
|
||||
moduleConfig.external_notification.active
|
||||
0 = Active Low (Default)
|
||||
1 = Active High
|
||||
|
||||
moduleConfig.external_notification.alert_message
|
||||
0 = Disabled (Default)
|
||||
1 = Alert when a text message comes
|
||||
|
||||
moduleConfig.external_notification.alert_bell
|
||||
0 = Disabled (Default)
|
||||
1 = Alert when the bell character is received
|
||||
|
||||
moduleConfig.external_notification.output
|
||||
GPIO of the output. (Default = 13)
|
||||
|
||||
moduleConfig.external_notification.output_ms
|
||||
Amount of time in ms for the alert. Default is 1000.
|
||||
|
||||
https://meshtastic.org/docs/settings/moduleconfig/external-notification
|
||||
*/
|
||||
|
||||
// Default configurations
|
||||
@@ -58,59 +26,121 @@
|
||||
|
||||
#define ASCII_BELL 0x07
|
||||
|
||||
bool externalCurrentState = 0;
|
||||
uint32_t externalTurnedOn = 0;
|
||||
ExternalNotificationModule *externalNotificationModule;
|
||||
|
||||
bool externalCurrentState[3] = {};
|
||||
|
||||
uint32_t externalTurnedOn[3] = {};
|
||||
|
||||
int32_t ExternalNotificationModule::runOnce()
|
||||
{
|
||||
/*
|
||||
Uncomment the preferences below if you want to use the module
|
||||
without having to configure it from the PythonAPI or WebUI.
|
||||
*/
|
||||
|
||||
// moduleConfig.external_notification.enabled = 1;
|
||||
// moduleConfig.external_notification.alert_message = 1;
|
||||
|
||||
// moduleConfig.external_notification.active = 1;
|
||||
// moduleConfig.external_notification.alert_bell = 1;
|
||||
// moduleConfig.external_notification.output_ms = 1000;
|
||||
// moduleConfig.external_notification.output = 13;
|
||||
|
||||
if (externalCurrentState && !moduleConfig.external_notification.use_pwm) {
|
||||
if (!moduleConfig.external_notification.enabled) {
|
||||
return INT32_MAX; // we don't need this thread here...
|
||||
} else {
|
||||
#ifndef ARCH_PORTDUINO
|
||||
if ((nagCycleCutoff < millis()) && !rtttl::isPlaying()) {
|
||||
#else
|
||||
if (nagCycleCutoff < millis()) {
|
||||
#endif
|
||||
nagCycleCutoff = UINT32_MAX;
|
||||
DEBUG_MSG("Turning off external notification: ");
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (getExternal(i)) {
|
||||
setExternalOff(i);
|
||||
externalTurnedOn[i] = 0;
|
||||
DEBUG_MSG("%d ", i);
|
||||
}
|
||||
}
|
||||
DEBUG_MSG("\n");
|
||||
return INT32_MAX; // save cycles till we're needed again
|
||||
}
|
||||
|
||||
// If the output is turned on, turn it back off after the given period of time.
|
||||
if (externalTurnedOn + (moduleConfig.external_notification.output_ms
|
||||
if (nagCycleCutoff != UINT32_MAX) {
|
||||
if (externalTurnedOn[0] + (moduleConfig.external_notification.output_ms
|
||||
? moduleConfig.external_notification.output_ms
|
||||
: EXT_NOTIFICATION_MODULE_OUTPUT_MS) <
|
||||
millis()) {
|
||||
DEBUG_MSG("Turning off external notification\n");
|
||||
setExternalOff();
|
||||
: 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()) {
|
||||
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()) {
|
||||
getExternal(2) ? setExternalOff(2) : setExternalOn(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (moduleConfig.external_notification.use_pwm)
|
||||
return INT32_MAX; // we don't need this thread here...
|
||||
else
|
||||
|
||||
// now let the PWM buzzer play
|
||||
#ifndef ARCH_PORTDUINO
|
||||
if (moduleConfig.external_notification.use_pwm) {
|
||||
if (rtttl::isPlaying()) {
|
||||
rtttl::play();
|
||||
} else if (nagCycleCutoff >= millis()) {
|
||||
// start the song again if we have time left
|
||||
rtttl::begin(config.device.buzzer_gpio, pwmRingtone);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 25;
|
||||
}
|
||||
}
|
||||
|
||||
void ExternalNotificationModule::setExternalOn()
|
||||
void ExternalNotificationModule::setExternalOn(uint8_t index)
|
||||
{
|
||||
externalCurrentState = 1;
|
||||
externalTurnedOn = millis();
|
||||
externalCurrentState[index] = 1;
|
||||
externalTurnedOn[index] = millis();
|
||||
|
||||
digitalWrite(output,
|
||||
(moduleConfig.external_notification.active ? true : false));
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
void ExternalNotificationModule::setExternalOff()
|
||||
void ExternalNotificationModule::setExternalOff(uint8_t index)
|
||||
{
|
||||
externalCurrentState = 0;
|
||||
externalCurrentState[index] = 0;
|
||||
externalTurnedOn[index] = millis();
|
||||
|
||||
digitalWrite(output,
|
||||
(moduleConfig.external_notification.active ? false : true));
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// --------
|
||||
bool ExternalNotificationModule::getExternal(uint8_t index)
|
||||
{
|
||||
return externalCurrentState[index];
|
||||
}
|
||||
|
||||
void ExternalNotificationModule::stopNow() {
|
||||
#ifndef ARCH_PORTDUINO
|
||||
rtttl::stop();
|
||||
#endif
|
||||
nagCycleCutoff = 1; // small value
|
||||
setIntervalFromNow(0);
|
||||
}
|
||||
|
||||
ExternalNotificationModule::ExternalNotificationModule()
|
||||
: SinglePortModule("ExternalNotificationModule", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread(
|
||||
@@ -121,13 +151,18 @@ ExternalNotificationModule::ExternalNotificationModule()
|
||||
without having to configure it from the PythonAPI or WebUI.
|
||||
*/
|
||||
|
||||
// moduleConfig.external_notification.enabled = 1;
|
||||
// moduleConfig.external_notification.alert_message = 1;
|
||||
// moduleConfig.external_notification.enabled = true;
|
||||
// moduleConfig.external_notification.alert_message = true;
|
||||
// moduleConfig.external_notification.alert_message_buzzer = true;
|
||||
// moduleConfig.external_notification.alert_message_vibra = true;
|
||||
|
||||
// moduleConfig.external_notification.active = 1;
|
||||
// moduleConfig.external_notification.active = true;
|
||||
// moduleConfig.external_notification.alert_bell = 1;
|
||||
// moduleConfig.external_notification.output_ms = 1000;
|
||||
// moduleConfig.external_notification.output = 13;
|
||||
// moduleConfig.external_notification.output = 4; // RAK4631 IO4
|
||||
// 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) {
|
||||
|
||||
@@ -137,19 +172,30 @@ ExternalNotificationModule::ExternalNotificationModule()
|
||||
? moduleConfig.external_notification.output
|
||||
: EXT_NOTIFICATION_MODULE_OUTPUT;
|
||||
|
||||
if (!moduleConfig.external_notification.use_pwm) {
|
||||
// Set the direction of a pin
|
||||
DEBUG_MSG("Using Pin %i in digital mode\n", output);
|
||||
pinMode(output, OUTPUT);
|
||||
// Turn off the pin
|
||||
setExternalOff();
|
||||
} else {
|
||||
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
|
||||
DEBUG_MSG("Using Pin %i in PWM mode\n", config.device.buzzer_gpio);
|
||||
// Set the direction of a pin
|
||||
DEBUG_MSG("Using Pin %i in digital mode\n", output);
|
||||
pinMode(output, OUTPUT);
|
||||
setExternalOff(0);
|
||||
externalTurnedOn[0] = 0;
|
||||
if(moduleConfig.external_notification.output_vibra) {
|
||||
DEBUG_MSG("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.use_pwm) {
|
||||
DEBUG_MSG("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;
|
||||
// in PWM Mode we force the buzzer pin if it is set
|
||||
DEBUG_MSG("Using Pin %i in PWM mode\n", config.device.buzzer_gpio);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
DEBUG_MSG("External Notification Module Disabled\n");
|
||||
@@ -163,30 +209,95 @@ ProcessMessage ExternalNotificationModule::handleReceived(const MeshPacket &mp)
|
||||
|
||||
if (getFrom(&mp) != nodeDB.getNodeNum()) {
|
||||
|
||||
// TODO: This may be a problem if messages are sent in unicide, but I'm not sure if it will.
|
||||
// Need to know if and how this could be a problem.
|
||||
// Check if the message contains a bell character. Don't do this loop for every pin, just once.
|
||||
auto &p = mp.decoded;
|
||||
bool containsBell = false;
|
||||
for (int i = 0; i < p.payload.size; i++) {
|
||||
if (p.payload.bytes[i] == ASCII_BELL) {
|
||||
containsBell = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (moduleConfig.external_notification.alert_bell) {
|
||||
auto &p = mp.decoded;
|
||||
DEBUG_MSG("externalNotificationModule - Notification Bell\n");
|
||||
for (int i = 0; i < p.payload.size; i++) {
|
||||
if (p.payload.bytes[i] == ASCII_BELL) {
|
||||
if (!moduleConfig.external_notification.use_pwm) {
|
||||
setExternalOn();
|
||||
} else {
|
||||
playBeep();
|
||||
}
|
||||
if (containsBell) {
|
||||
DEBUG_MSG("externalNotificationModule - Notification Bell\n");
|
||||
setExternalOn(0);
|
||||
if (moduleConfig.external_notification.nag_timeout) {
|
||||
nagCycleCutoff = millis() + moduleConfig.external_notification.nag_timeout * 1000;
|
||||
} else {
|
||||
nagCycleCutoff = millis() + moduleConfig.external_notification.output_ms;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (moduleConfig.external_notification.alert_bell_vibra) {
|
||||
if (containsBell) {
|
||||
DEBUG_MSG("externalNotificationModule - Notification Bell (Vibra)\n");
|
||||
setExternalOn(1);
|
||||
if (moduleConfig.external_notification.nag_timeout) {
|
||||
nagCycleCutoff = millis() + moduleConfig.external_notification.nag_timeout * 1000;
|
||||
} else {
|
||||
nagCycleCutoff = millis() + moduleConfig.external_notification.output_ms;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (moduleConfig.external_notification.alert_bell_buzzer) {
|
||||
if (containsBell) {
|
||||
DEBUG_MSG("externalNotificationModule - Notification Bell (Buzzer)\n");
|
||||
if (!moduleConfig.external_notification.use_pwm) {
|
||||
setExternalOn(2);
|
||||
} else {
|
||||
#ifndef ARCH_PORTDUINO
|
||||
rtttl::begin(config.device.buzzer_gpio, pwmRingtone);
|
||||
#endif
|
||||
}
|
||||
if (moduleConfig.external_notification.nag_timeout) {
|
||||
nagCycleCutoff = millis() + moduleConfig.external_notification.nag_timeout * 1000;
|
||||
} else {
|
||||
nagCycleCutoff = millis() + moduleConfig.external_notification.output_ms;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (moduleConfig.external_notification.alert_message) {
|
||||
DEBUG_MSG("externalNotificationModule - Notification Module\n");
|
||||
if (!moduleConfig.external_notification.use_pwm) {
|
||||
setExternalOn();
|
||||
setExternalOn(0);
|
||||
if (moduleConfig.external_notification.nag_timeout) {
|
||||
nagCycleCutoff = millis() + moduleConfig.external_notification.nag_timeout * 1000;
|
||||
} else {
|
||||
playBeep();
|
||||
nagCycleCutoff = millis() + moduleConfig.external_notification.output_ms;
|
||||
}
|
||||
}
|
||||
|
||||
if (!moduleConfig.external_notification.use_pwm) {
|
||||
if (moduleConfig.external_notification.alert_message_vibra) {
|
||||
DEBUG_MSG("externalNotificationModule - Notification Module (Vibra)\n");
|
||||
setExternalOn(1);
|
||||
if (moduleConfig.external_notification.nag_timeout) {
|
||||
nagCycleCutoff = millis() + moduleConfig.external_notification.nag_timeout * 1000;
|
||||
} else {
|
||||
nagCycleCutoff = millis() + moduleConfig.external_notification.output_ms;
|
||||
}
|
||||
}
|
||||
|
||||
if (moduleConfig.external_notification.alert_message_buzzer) {
|
||||
DEBUG_MSG("externalNotificationModule - Notification Module (Buzzer)\n");
|
||||
if (!moduleConfig.external_notification.use_pwm) {
|
||||
setExternalOn(2);
|
||||
} else {
|
||||
#ifndef ARCH_PORTDUINO
|
||||
rtttl::begin(config.device.buzzer_gpio, pwmRingtone);
|
||||
#endif
|
||||
}
|
||||
if (moduleConfig.external_notification.nag_timeout) {
|
||||
nagCycleCutoff = millis() + moduleConfig.external_notification.nag_timeout * 1000;
|
||||
} else {
|
||||
nagCycleCutoff = millis() + moduleConfig.external_notification.output_ms;
|
||||
}
|
||||
}
|
||||
}
|
||||
setIntervalFromNow(0); // run once so we know if we should do something
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
#include "SinglePortModule.h"
|
||||
#include "concurrency/OSThread.h"
|
||||
#include "configuration.h"
|
||||
#ifndef ARCH_PORTDUINO
|
||||
#include <NonBlockingRtttl.h>
|
||||
#endif
|
||||
#include <Arduino.h>
|
||||
#include <functional>
|
||||
|
||||
@@ -17,18 +20,23 @@ class ExternalNotificationModule : public SinglePortModule, private concurrency:
|
||||
public:
|
||||
ExternalNotificationModule();
|
||||
|
||||
void setExternalOn();
|
||||
void setExternalOff();
|
||||
void getExternal();
|
||||
uint32_t nagCycleCutoff = UINT32_MAX;
|
||||
|
||||
void setExternalOn(uint8_t index = 0);
|
||||
void setExternalOff(uint8_t index = 0);
|
||||
bool getExternal(uint8_t index = 0);
|
||||
|
||||
void stopNow();
|
||||
|
||||
char pwmRingtone[Constants_DATA_PAYLOAD_LEN] = "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#";
|
||||
|
||||
protected:
|
||||
// virtual MeshPacket *allocReply();
|
||||
|
||||
/** Called to handle a particular incoming message
|
||||
|
||||
@return ProcessMessage::STOP if you've guaranteed you've handled this message and no other handlers should be considered for it
|
||||
*/
|
||||
virtual ProcessMessage handleReceived(const MeshPacket &mp) override;
|
||||
|
||||
virtual int32_t runOnce() override;
|
||||
};
|
||||
|
||||
extern ExternalNotificationModule *externalNotificationModule;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#endif
|
||||
#if defined(ARCH_ESP32) || defined(ARCH_NRF52)
|
||||
#include "modules/ExternalNotificationModule.h"
|
||||
#if !defined(TTGO_T_ECHO)
|
||||
#if (defined(ARCH_ESP32) || defined(ARCH_NRF52)) && !defined(TTGO_T_ECHO) && !defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||
#include "modules/SerialModule.h"
|
||||
#endif
|
||||
#endif
|
||||
@@ -63,13 +63,13 @@ void setupModules()
|
||||
new DeviceTelemetryModule();
|
||||
new EnvironmentTelemetryModule();
|
||||
#endif
|
||||
#if (defined(ARCH_ESP32) || defined(ARCH_NRF52)) && !defined(TTGO_T_ECHO)
|
||||
#if (defined(ARCH_ESP32) || defined(ARCH_NRF52)) && !defined(TTGO_T_ECHO) && !defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||
new SerialModule();
|
||||
#endif
|
||||
#ifdef ARCH_ESP32
|
||||
// Only run on an esp32 based device.
|
||||
audioModule = new AudioModule();
|
||||
new ExternalNotificationModule();
|
||||
externalNotificationModule = new ExternalNotificationModule();
|
||||
|
||||
storeForwardModule = new StoreForwardModule();
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ MeshPacket *NodeInfoModule::allocReply()
|
||||
}
|
||||
|
||||
NodeInfoModule::NodeInfoModule()
|
||||
: ProtobufModule("nodeinfo", PortNum_NODEINFO_APP, User_fields), concurrency::OSThread("NodeInfoModule")
|
||||
: ProtobufModule("nodeinfo", PortNum_NODEINFO_APP, &User_msg), concurrency::OSThread("NodeInfoModule")
|
||||
{
|
||||
isPromiscuous = true; // We always want to update our nodedb, even if we are sniffing on others
|
||||
setIntervalFromNow(30 * 1000); // Send our initial owner announcement 30 seconds after we start (to give network time to setup)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
PositionModule *positionModule;
|
||||
|
||||
PositionModule::PositionModule()
|
||||
: ProtobufModule("position", PortNum_POSITION_APP, Position_fields), concurrency::OSThread("PositionModule")
|
||||
: ProtobufModule("position", PortNum_POSITION_APP, &Position_msg), concurrency::OSThread("PositionModule")
|
||||
{
|
||||
isPromiscuous = true; // We always want to update our nodedb, even if we are sniffing on others
|
||||
setIntervalFromNow(60 * 1000); // Send our initial position 60 seconds after we start (to give GPS time to setup)
|
||||
|
||||
@@ -47,7 +47,7 @@ static uint64_t digitalReads(uint64_t mask)
|
||||
}
|
||||
|
||||
RemoteHardwareModule::RemoteHardwareModule()
|
||||
: ProtobufModule("remotehardware", PortNum_REMOTE_HARDWARE_APP, HardwareMessage_fields), concurrency::OSThread(
|
||||
: ProtobufModule("remotehardware", PortNum_REMOTE_HARDWARE_APP, &HardwareMessage_msg), concurrency::OSThread(
|
||||
"remotehardware")
|
||||
{
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ void RoutingModule::sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom, C
|
||||
router->sendLocal(p); // we sometimes send directly to the local node
|
||||
}
|
||||
|
||||
RoutingModule::RoutingModule() : ProtobufModule("routing", PortNum_ROUTING_APP, Routing_fields)
|
||||
RoutingModule::RoutingModule() : ProtobufModule("routing", PortNum_ROUTING_APP, &Routing_msg)
|
||||
{
|
||||
isPromiscuous = true;
|
||||
encryptedOk = true;
|
||||
|
||||
@@ -46,18 +46,22 @@
|
||||
|
||||
*/
|
||||
|
||||
#if (defined(ARCH_ESP32) || defined(ARCH_NRF52)) && !defined(TTGO_T_ECHO) && !defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||
|
||||
#define RXD2 16
|
||||
#define TXD2 17
|
||||
#define RX_BUFFER 128
|
||||
#define STRING_MAX Constants_DATA_PAYLOAD_LEN
|
||||
#define TIMEOUT 250
|
||||
#define BAUD 38400
|
||||
#define ACK 1
|
||||
|
||||
// API: Defaulting to the formerly removed phone_timeout_secs value of 15 minutes
|
||||
#define SERIAL_CONNECTION_TIMEOUT (15 * 60) * 1000UL
|
||||
|
||||
SerialModule *serialModule;
|
||||
SerialModuleRadio *serialModuleRadio;
|
||||
|
||||
SerialModule::SerialModule() : concurrency::OSThread("SerialModule") {}
|
||||
SerialModule::SerialModule() : StreamAPI(&Serial2), concurrency::OSThread("SerialModule") {}
|
||||
|
||||
char serialStringChar[Constants_DATA_PAYLOAD_LEN];
|
||||
|
||||
@@ -80,9 +84,15 @@ SerialModuleRadio::SerialModuleRadio() : MeshModule("SerialModuleRadio")
|
||||
}
|
||||
}
|
||||
|
||||
// For the serial2 port we can't really detect if any client is on the other side, so instead just look for recent messages
|
||||
bool SerialModule::checkIsConnected()
|
||||
{
|
||||
uint32_t now = millis();
|
||||
return (now - lastContactMsec) < SERIAL_CONNECTION_TIMEOUT;
|
||||
}
|
||||
|
||||
int32_t SerialModule::runOnce()
|
||||
{
|
||||
#if (defined(ARCH_ESP32) || defined(ARCH_NRF52)) && !defined(TTGO_T_ECHO) && !defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||
/*
|
||||
Uncomment the preferences below if you want to use the module
|
||||
without having to configure it from the PythonAPI or WebUI.
|
||||
@@ -178,10 +188,17 @@ int32_t SerialModule::runOnce()
|
||||
|
||||
firstTime = 0;
|
||||
|
||||
// in API mode send rebooted sequence
|
||||
if (moduleConfig.serial.mode == ModuleConfig_SerialConfig_Serial_Mode_PROTO) {
|
||||
emitRebooted();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// in NMEA mode send out GGA every 2 seconds, Don't read from Port
|
||||
if (moduleConfig.serial.mode == ModuleConfig_SerialConfig_Serial_Mode_NMEA) {
|
||||
if (moduleConfig.serial.mode == ModuleConfig_SerialConfig_Serial_Mode_PROTO) {
|
||||
return runOncePart();
|
||||
} else if (moduleConfig.serial.mode == ModuleConfig_SerialConfig_Serial_Mode_NMEA) {
|
||||
// in NMEA mode send out GGA every 2 seconds, Don't read from Port
|
||||
if (millis() - lastNmeaTime > 2000) {
|
||||
lastNmeaTime = millis();
|
||||
printGGA(outbuf, nodeDB.getNode(myNodeInfo.my_node_num)->position);
|
||||
@@ -207,9 +224,6 @@ int32_t SerialModule::runOnce()
|
||||
|
||||
return INT32_MAX;
|
||||
}
|
||||
#else
|
||||
return INT32_MAX;
|
||||
#endif
|
||||
}
|
||||
|
||||
MeshPacket *SerialModuleRadio::allocReply()
|
||||
@@ -221,12 +235,8 @@ MeshPacket *SerialModuleRadio::allocReply()
|
||||
|
||||
void SerialModuleRadio::sendPayload(NodeNum dest, bool wantReplies)
|
||||
{
|
||||
Channel *ch = (boundChannel != NULL) ? &channels.getByName(boundChannel) : NULL;
|
||||
MeshPacket *p = allocReply();
|
||||
p->to = dest;
|
||||
if (ch != NULL) {
|
||||
p->channel = ch->index;
|
||||
}
|
||||
p->decoded.want_response = wantReplies;
|
||||
|
||||
p->want_ack = ACK;
|
||||
@@ -239,8 +249,11 @@ void SerialModuleRadio::sendPayload(NodeNum dest, bool wantReplies)
|
||||
|
||||
ProcessMessage SerialModuleRadio::handleReceived(const MeshPacket &mp)
|
||||
{
|
||||
#if (defined(ARCH_ESP32) || defined(ARCH_NRF52)) && !defined(TTGO_T_ECHO) && !defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||
if (moduleConfig.serial.enabled) {
|
||||
if (moduleConfig.serial.mode == ModuleConfig_SerialConfig_Serial_Mode_PROTO) {
|
||||
// in API mode we don't care about stuff from radio.
|
||||
return ProcessMessage::CONTINUE;
|
||||
}
|
||||
|
||||
auto &p = mp.decoded;
|
||||
// DEBUG_MSG("Received text msg self=0x%0x, from=0x%0x, to=0x%0x, id=%d, msg=%.*s\n",
|
||||
@@ -275,15 +288,13 @@ ProcessMessage SerialModuleRadio::handleReceived(const MeshPacket &mp)
|
||||
Serial2.println();
|
||||
Serial2.printf("%s: %s", sender, p.payload.bytes);
|
||||
Serial2.println();
|
||||
} else if (moduleConfig.serial.mode == ModuleConfig_SerialConfig_Serial_Mode_PROTO) {
|
||||
// TODO this needs to be implemented
|
||||
} else if (moduleConfig.serial.mode == ModuleConfig_SerialConfig_Serial_Mode_NMEA) {
|
||||
// Decode the Payload some more
|
||||
Position scratch;
|
||||
Position *decoded = NULL;
|
||||
if (mp.which_payload_variant == MeshPacket_decoded_tag && mp.decoded.portnum == ourPortNum) {
|
||||
memset(&scratch, 0, sizeof(scratch));
|
||||
if (pb_decode_from_bytes(p.payload.bytes, p.payload.size, Position_fields, &scratch)) {
|
||||
if (pb_decode_from_bytes(p.payload.bytes, p.payload.size, &Position_msg, &scratch)) {
|
||||
decoded = &scratch;
|
||||
}
|
||||
// send position packet as WPL to the serial port
|
||||
@@ -296,8 +307,6 @@ ProcessMessage SerialModuleRadio::handleReceived(const MeshPacket &mp)
|
||||
} else {
|
||||
DEBUG_MSG("Serial Module Disabled\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return ProcessMessage::CONTINUE; // Let others look at this message also if they want
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
#include "Router.h"
|
||||
#include <functional>
|
||||
|
||||
class SerialModule : private concurrency::OSThread
|
||||
#if (defined(ARCH_ESP32) || defined(ARCH_NRF52)) && !defined(TTGO_T_ECHO) && !defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||
|
||||
class SerialModule : public StreamAPI, private concurrency::OSThread
|
||||
{
|
||||
bool firstTime = 1;
|
||||
unsigned long lastNmeaTime = millis();
|
||||
@@ -19,6 +21,9 @@ class SerialModule : private concurrency::OSThread
|
||||
|
||||
protected:
|
||||
virtual int32_t runOnce() override;
|
||||
|
||||
/// Check the current underlying physical link to see if the client is currently connected
|
||||
virtual bool checkIsConnected() override;
|
||||
};
|
||||
|
||||
extern SerialModule *serialModule;
|
||||
@@ -65,3 +70,5 @@ class SerialModuleRadio : public MeshModule
|
||||
};
|
||||
|
||||
extern SerialModuleRadio *serialModuleRadio;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "Sensor/INA219Sensor.h"
|
||||
#include "Sensor/SHTC3Sensor.h"
|
||||
#include "Sensor/LPS22HBSensor.h"
|
||||
#include "Sensor/SHT31Sensor.h"
|
||||
|
||||
BMP280Sensor bmp280Sensor;
|
||||
BME280Sensor bme280Sensor;
|
||||
@@ -29,6 +30,7 @@ INA260Sensor ina260Sensor;
|
||||
INA219Sensor ina219Sensor;
|
||||
SHTC3Sensor shtc3Sensor;
|
||||
LPS22HBSensor lps22hbSensor;
|
||||
SHT31Sensor sht31Sensor;
|
||||
|
||||
#define FAILED_STATE_SENSOR_READ_MULTIPLIER 10
|
||||
#define DISPLAY_RECEIVEID_MEASUREMENTS_ON_SCREEN true
|
||||
@@ -93,6 +95,8 @@ int32_t EnvironmentTelemetryModule::runOnce()
|
||||
if (lps22hbSensor.hasSensor()) {
|
||||
result = lps22hbSensor.runOnce();
|
||||
}
|
||||
if (sht31Sensor.hasSensor())
|
||||
result = sht31Sensor.runOnce();
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
@@ -155,7 +159,7 @@ void EnvironmentTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiSt
|
||||
const char *lastSender = getSenderShortName(*lastMeasurementPacket);
|
||||
|
||||
auto &p = lastMeasurementPacket->decoded;
|
||||
if (!pb_decode_from_bytes(p.payload.bytes, p.payload.size, Telemetry_fields, &lastMeasurement)) {
|
||||
if (!pb_decode_from_bytes(p.payload.bytes, p.payload.size, &Telemetry_msg, &lastMeasurement)) {
|
||||
display->setFont(FONT_SMALL);
|
||||
display->drawString(x, y += fontHeight(FONT_MEDIUM), "Measurement Error");
|
||||
DEBUG_MSG("Unable to decode last packet");
|
||||
@@ -211,6 +215,8 @@ bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
||||
m.variant.environment_metrics.temperature = 0;
|
||||
m.variant.environment_metrics.voltage = 0;
|
||||
|
||||
if (sht31Sensor.hasSensor())
|
||||
sht31Sensor.getMetrics(&m);
|
||||
if (lps22hbSensor.hasSensor())
|
||||
lps22hbSensor.getMetrics(&m);
|
||||
if (shtc3Sensor.hasSensor())
|
||||
|
||||
31
src/modules/Telemetry/Sensor/SHT31Sensor.cpp
Normal file
31
src/modules/Telemetry/Sensor/SHT31Sensor.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "../mesh/generated/telemetry.pb.h"
|
||||
#include "configuration.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include "SHT31Sensor.h"
|
||||
#include <Adafruit_SHT31.h>
|
||||
|
||||
SHT31Sensor::SHT31Sensor() :
|
||||
TelemetrySensor(TelemetrySensorType_SHT31, "SHT31")
|
||||
{
|
||||
}
|
||||
|
||||
int32_t SHT31Sensor::runOnce() {
|
||||
DEBUG_MSG("Init sensor: %s\n", sensorName);
|
||||
if (!hasSensor()) {
|
||||
return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS;
|
||||
}
|
||||
status = sht31.begin();
|
||||
return initI2CSensor();
|
||||
}
|
||||
|
||||
void SHT31Sensor::setup()
|
||||
{
|
||||
// Set up oversampling and filter initialization
|
||||
}
|
||||
|
||||
bool SHT31Sensor::getMetrics(Telemetry *measurement) {
|
||||
measurement->variant.environment_metrics.temperature = sht31.readTemperature();
|
||||
measurement->variant.environment_metrics.relative_humidity = sht31.readHumidity();
|
||||
|
||||
return true;
|
||||
}
|
||||
16
src/modules/Telemetry/Sensor/SHT31Sensor.h
Normal file
16
src/modules/Telemetry/Sensor/SHT31Sensor.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "../mesh/generated/telemetry.pb.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include <Adafruit_SHT31.h>
|
||||
|
||||
class SHT31Sensor : virtual public TelemetrySensor {
|
||||
private:
|
||||
Adafruit_SHT31 sht31 = Adafruit_SHT31();
|
||||
|
||||
protected:
|
||||
virtual void setup() override;
|
||||
|
||||
public:
|
||||
SHT31Sensor();
|
||||
virtual int32_t runOnce() override;
|
||||
virtual bool getMetrics(Telemetry *measurement) override;
|
||||
};
|
||||
@@ -24,14 +24,14 @@ void TraceRouteModule::updateRoute(MeshPacket* p)
|
||||
RouteDiscovery scratch;
|
||||
RouteDiscovery *updated = NULL;
|
||||
memset(&scratch, 0, sizeof(scratch));
|
||||
pb_decode_from_bytes(incoming.payload.bytes, incoming.payload.size, RouteDiscovery_fields, &scratch);
|
||||
pb_decode_from_bytes(incoming.payload.bytes, incoming.payload.size, &RouteDiscovery_msg, &scratch);
|
||||
updated = &scratch;
|
||||
|
||||
appendMyID(updated);
|
||||
printRoute(updated, p->from, NODENUM_BROADCAST);
|
||||
|
||||
// Set updated route to the payload of the to be flooded packet
|
||||
p->decoded.payload.size = pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), RouteDiscovery_fields, updated);
|
||||
p->decoded.payload.size = pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &RouteDiscovery_msg, updated);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ MeshPacket* TraceRouteModule::allocReply()
|
||||
RouteDiscovery scratch;
|
||||
RouteDiscovery *updated = NULL;
|
||||
memset(&scratch, 0, sizeof(scratch));
|
||||
pb_decode_from_bytes(p.payload.bytes, p.payload.size, RouteDiscovery_fields, &scratch);
|
||||
pb_decode_from_bytes(p.payload.bytes, p.payload.size, &RouteDiscovery_msg, &scratch);
|
||||
updated = &scratch;
|
||||
|
||||
printRoute(updated, req.from, req.to);
|
||||
@@ -81,6 +81,6 @@ MeshPacket* TraceRouteModule::allocReply()
|
||||
}
|
||||
|
||||
|
||||
TraceRouteModule::TraceRouteModule() : ProtobufModule("traceroute", PortNum_TRACEROUTE_APP, RouteDiscovery_fields) {
|
||||
TraceRouteModule::TraceRouteModule() : ProtobufModule("traceroute", PortNum_TRACEROUTE_APP, &RouteDiscovery_msg) {
|
||||
ourPortNum = PortNum_TRACEROUTE_APP;
|
||||
}
|
||||
|
||||
@@ -22,41 +22,32 @@ int32_t StoreForwardModule::runOnce()
|
||||
if (this->busy) {
|
||||
// Only send packets if the channel is less than 25% utilized.
|
||||
if (airTime->channelUtilizationPercent() < polite_channel_util_percent) {
|
||||
|
||||
// DEBUG_MSG("--- --- --- In busy loop 1 %d\n", this->packetHistoryTXQueue_index);
|
||||
storeForwardModule->sendPayload(this->busyTo, this->packetHistoryTXQueue_index);
|
||||
|
||||
if (this->packetHistoryTXQueue_index == packetHistoryTXQueue_size) {
|
||||
strcpy(this->routerMessage, "** S&F - Done");
|
||||
storeForwardModule->sendMessage(this->busyTo, this->routerMessage);
|
||||
|
||||
// DEBUG_MSG("--- --- --- In busy loop - Done \n");
|
||||
// Tell the client we're done sending
|
||||
StoreAndForward sf = StoreAndForward_init_zero;
|
||||
sf.rr = StoreAndForward_RequestResponse_ROUTER_PING;
|
||||
storeForwardModule->sendMessage(this->busyTo, sf);
|
||||
DEBUG_MSG("*** S&F - Done. (ROUTER_PING)\n");
|
||||
this->packetHistoryTXQueue_index = 0;
|
||||
this->busy = false;
|
||||
} else {
|
||||
this->packetHistoryTXQueue_index++;
|
||||
}
|
||||
|
||||
} else {
|
||||
DEBUG_MSG("Channel utilization is too high. Retrying later.\n");
|
||||
DEBUG_MSG("*** Channel utilization is too high. Retrying later.\n");
|
||||
}
|
||||
DEBUG_MSG("SF bitrate = %f bytes / sec\n", myNodeInfo.bitrate);
|
||||
DEBUG_MSG("*** SF bitrate = %f bytes / sec\n", myNodeInfo.bitrate);
|
||||
|
||||
} else if (millis() - lastHeartbeat > 300000) {
|
||||
} else if ((millis() - lastHeartbeat > (heartbeatInterval * 1000)) && (airTime->channelUtilizationPercent() < polite_channel_util_percent)) {
|
||||
lastHeartbeat = millis();
|
||||
DEBUG_MSG("Sending heartbeat\n");
|
||||
|
||||
StoreAndForward sf;
|
||||
DEBUG_MSG("*** Sending heartbeat\n");
|
||||
StoreAndForward sf = StoreAndForward_init_zero;
|
||||
sf.rr = StoreAndForward_RequestResponse_ROUTER_HEARTBEAT;
|
||||
sf.has_heartbeat = true;
|
||||
sf.heartbeat.period = 300;
|
||||
sf.heartbeat.secondary = 0; // TODO we always have one primary router for now
|
||||
|
||||
MeshPacket *p = allocDataProtobuf(sf);
|
||||
p->to = NODENUM_BROADCAST;
|
||||
p->decoded.want_response = false;
|
||||
p->priority = MeshPacket_Priority_MIN;
|
||||
service.sendToMesh(p);
|
||||
sf.which_variant = StoreAndForward_heartbeat_tag;
|
||||
sf.variant.heartbeat.period = 300;
|
||||
sf.variant.heartbeat.secondary = 0; // TODO we always have one primary router for now
|
||||
storeForwardModule->sendMessage(NODENUM_BROADCAST, sf);
|
||||
}
|
||||
return (this->packetTimeMax);
|
||||
}
|
||||
@@ -74,7 +65,7 @@ void StoreForwardModule::populatePSRAM()
|
||||
https://learn.upesy.com/en/programmation/psram.html#psram-tab
|
||||
*/
|
||||
|
||||
DEBUG_MSG("Before PSRAM initilization: heap %d/%d PSRAM %d/%d\n", ESP.getFreeHeap(), ESP.getHeapSize(), ESP.getFreePsram(), ESP.getPsramSize());
|
||||
DEBUG_MSG("*** Before PSRAM initilization: heap %d/%d PSRAM %d/%d\n", ESP.getFreeHeap(), ESP.getHeapSize(), ESP.getFreePsram(), ESP.getPsramSize());
|
||||
|
||||
this->packetHistoryTXQueue =
|
||||
static_cast<PacketHistoryStruct *>(ps_calloc(this->historyReturnMax, sizeof(PacketHistoryStruct)));
|
||||
@@ -83,46 +74,36 @@ void StoreForwardModule::populatePSRAM()
|
||||
Note: This needs to be done after every thing that would use PSRAM
|
||||
*/
|
||||
uint32_t numberOfPackets = (this->records ? this->records : (((ESP.getFreePsram() / 3) * 2) / sizeof(PacketHistoryStruct)));
|
||||
this->records = numberOfPackets;
|
||||
|
||||
this->packetHistory = static_cast<PacketHistoryStruct *>(ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct)));
|
||||
|
||||
DEBUG_MSG("After PSRAM initilization: heap %d/%d PSRAM %d/%d\n", ESP.getFreeHeap(), ESP.getHeapSize(), ESP.getFreePsram(), ESP.getPsramSize());
|
||||
DEBUG_MSG("numberOfPackets for packetHistory - %u\n", numberOfPackets);
|
||||
DEBUG_MSG("*** After PSRAM initilization: heap %d/%d PSRAM %d/%d\n", ESP.getFreeHeap(), ESP.getHeapSize(), ESP.getFreePsram(), ESP.getPsramSize());
|
||||
DEBUG_MSG("*** numberOfPackets for packetHistory - %u\n", numberOfPackets);
|
||||
}
|
||||
|
||||
void StoreForwardModule::historyReport()
|
||||
{
|
||||
DEBUG_MSG("Message history contains %u records\n", this->packetHistoryCurrent);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
void StoreForwardModule::historySend(uint32_t msAgo, uint32_t to)
|
||||
{
|
||||
|
||||
// uint32_t packetsSent = 0;
|
||||
|
||||
uint32_t queueSize = storeForwardModule->historyQueueCreate(msAgo, to);
|
||||
|
||||
if (queueSize) {
|
||||
snprintf(this->routerMessage, 80, "** S&F - Sending %u message(s)", queueSize);
|
||||
storeForwardModule->sendMessage(to, this->routerMessage);
|
||||
|
||||
DEBUG_MSG ("*** S&F - Sending %u message(s)\n", queueSize);
|
||||
this->busy = true; // runOnce() will pickup the next steps once busy = true.
|
||||
this->busyTo = to;
|
||||
|
||||
} else {
|
||||
strcpy(this->routerMessage, "** S&F - No history to send");
|
||||
storeForwardModule->sendMessage(to, this->routerMessage);
|
||||
DEBUG_MSG ("*** S&F - No history to send\n");
|
||||
}
|
||||
StoreAndForward sf = StoreAndForward_init_zero;
|
||||
sf.rr = StoreAndForward_RequestResponse_ROUTER_HISTORY;
|
||||
sf.which_variant = StoreAndForward_history_tag;
|
||||
sf.variant.history.history_messages = queueSize;
|
||||
sf.variant.history.window = msAgo;
|
||||
storeForwardModule->sendMessage(to, sf);
|
||||
}
|
||||
|
||||
uint32_t StoreForwardModule::historyQueueCreate(uint32_t msAgo, uint32_t to)
|
||||
{
|
||||
|
||||
// uint32_t packetHistoryTXQueueIndex = 0;
|
||||
|
||||
this->packetHistoryTXQueue_size = 0;
|
||||
|
||||
for (int i = 0; i < this->packetHistoryCurrent; i++) {
|
||||
@@ -133,7 +114,7 @@ uint32_t StoreForwardModule::historyQueueCreate(uint32_t msAgo, uint32_t to)
|
||||
DEBUG_MSG("SF historyQueueCreate - math %d\n", (millis() - msAgo));
|
||||
*/
|
||||
if (this->packetHistory[i].time && (this->packetHistory[i].time < (millis() - msAgo))) {
|
||||
DEBUG_MSG("SF historyQueueCreate - Time matches - ok\n");
|
||||
DEBUG_MSG("*** SF historyQueueCreate - Time matches - ok\n");
|
||||
/*
|
||||
Copy the messages that were received by the router in the last msAgo
|
||||
to the packetHistoryTXQueue structure.
|
||||
@@ -144,7 +125,6 @@ uint32_t StoreForwardModule::historyQueueCreate(uint32_t msAgo, uint32_t to)
|
||||
if ((this->packetHistory[i].to & NODENUM_BROADCAST) == NODENUM_BROADCAST ||
|
||||
((this->packetHistory[i].to & NODENUM_BROADCAST) == to)) {
|
||||
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].time = this->packetHistory[i].time;
|
||||
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].time = this->packetHistory[i].time;
|
||||
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].to = this->packetHistory[i].to;
|
||||
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].from = this->packetHistory[i].from;
|
||||
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].channel = this->packetHistory[i].channel;
|
||||
@@ -153,9 +133,8 @@ uint32_t StoreForwardModule::historyQueueCreate(uint32_t msAgo, uint32_t to)
|
||||
Constants_DATA_PAYLOAD_LEN);
|
||||
this->packetHistoryTXQueue_size++;
|
||||
|
||||
DEBUG_MSG("PacketHistoryStruct time=%d\n", this->packetHistory[i].time);
|
||||
DEBUG_MSG("PacketHistoryStruct msg=%.*s\n", this->packetHistory[i].payload);
|
||||
// DEBUG_MSG("PacketHistoryStruct msg=%.*s\n", this->packetHistoryTXQueue[packetHistoryTXQueueIndex].payload);
|
||||
DEBUG_MSG("*** PacketHistoryStruct time=%d\n", this->packetHistory[i].time);
|
||||
DEBUG_MSG("*** PacketHistoryStruct msg=%s\n", this->packetHistory[i].payload);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,6 +153,7 @@ void StoreForwardModule::historyAdd(const MeshPacket &mp)
|
||||
memcpy(this->packetHistory[this->packetHistoryCurrent].payload, p.payload.bytes, Constants_DATA_PAYLOAD_LEN);
|
||||
|
||||
this->packetHistoryCurrent++;
|
||||
this->packetHistoryMax++;
|
||||
}
|
||||
|
||||
MeshPacket *StoreForwardModule::allocReply()
|
||||
@@ -184,7 +164,7 @@ MeshPacket *StoreForwardModule::allocReply()
|
||||
|
||||
void StoreForwardModule::sendPayload(NodeNum dest, uint32_t packetHistory_index)
|
||||
{
|
||||
DEBUG_MSG("Sending S&F Payload\n");
|
||||
DEBUG_MSG("*** Sending S&F Payload\n");
|
||||
MeshPacket *p = allocReply();
|
||||
|
||||
p->to = dest;
|
||||
@@ -203,12 +183,14 @@ void StoreForwardModule::sendPayload(NodeNum dest, uint32_t packetHistory_index)
|
||||
service.sendToMesh(p);
|
||||
}
|
||||
|
||||
void StoreForwardModule::sendMessage(NodeNum dest, char *str)
|
||||
void StoreForwardModule::sendMessage(NodeNum dest, StoreAndForward &payload)
|
||||
{
|
||||
MeshPacket *p = allocReply();
|
||||
MeshPacket *p = allocDataProtobuf(payload);
|
||||
|
||||
p->to = dest;
|
||||
|
||||
p->priority = MeshPacket_Priority_MIN;
|
||||
|
||||
// FIXME - Determine if the delayed packet is broadcast or delayed. For now, assume
|
||||
// everything is broadcast.
|
||||
p->delayed = MeshPacket_Delayed_DELAYED_BROADCAST;
|
||||
@@ -216,13 +198,37 @@ void StoreForwardModule::sendMessage(NodeNum dest, char *str)
|
||||
// Let's assume that if the router received the S&F request that the client is in range.
|
||||
// TODO: Make this configurable.
|
||||
p->want_ack = false;
|
||||
|
||||
p->decoded.payload.size = strlen(str); // You must specify how many bytes are in the reply
|
||||
memcpy(p->decoded.payload.bytes, str, strlen(str));
|
||||
p->decoded.want_response = false;
|
||||
|
||||
service.sendToMesh(p);
|
||||
}
|
||||
|
||||
// HardwareMessage_init_default
|
||||
void StoreForwardModule::sendMessage(NodeNum dest, StoreAndForward_RequestResponse rr)
|
||||
{
|
||||
// Craft an empty response, save some bytes in flash
|
||||
StoreAndForward sf = StoreAndForward_init_zero;
|
||||
sf.rr = rr;
|
||||
storeForwardModule->sendMessage(dest, sf);
|
||||
}
|
||||
|
||||
void StoreForwardModule::statsSend(uint32_t to)
|
||||
{
|
||||
StoreAndForward sf = StoreAndForward_init_zero;
|
||||
|
||||
sf.rr = StoreAndForward_RequestResponse_ROUTER_STATS;
|
||||
sf.which_variant = StoreAndForward_stats_tag;
|
||||
sf.variant.stats.messages_total = this->packetHistoryMax;
|
||||
sf.variant.stats.messages_saved = this->packetHistoryCurrent;
|
||||
sf.variant.stats.messages_max = this->records;
|
||||
sf.variant.stats.up_time = millis() / 1000;
|
||||
sf.variant.stats.requests = this->requests;
|
||||
sf.variant.stats.requests_history = this->requests_history;
|
||||
sf.variant.stats.heartbeat = this->heartbeat;
|
||||
sf.variant.stats.return_max = this->historyReturnMax;
|
||||
sf.variant.stats.return_window = this->historyReturnWindow;
|
||||
|
||||
DEBUG_MSG("*** Sending S&F Stats\n");
|
||||
storeForwardModule->sendMessage(to, sf);
|
||||
}
|
||||
|
||||
ProcessMessage StoreForwardModule::handleReceived(const MeshPacket &mp)
|
||||
@@ -230,46 +236,28 @@ ProcessMessage StoreForwardModule::handleReceived(const MeshPacket &mp)
|
||||
#ifdef ARCH_ESP32
|
||||
if (moduleConfig.store_forward.enabled) {
|
||||
|
||||
DEBUG_MSG("--- S&F Received something\n");
|
||||
|
||||
// The router node should not be sending messages as a client. Unless he is a ROUTER_CLIENT
|
||||
if ((getFrom(&mp) != nodeDB.getNodeNum()) || (config.device.role == Config_DeviceConfig_Role_ROUTER_CLIENT)) {
|
||||
|
||||
if (mp.decoded.portnum == PortNum_TEXT_MESSAGE_APP) {
|
||||
DEBUG_MSG("Packet came from - PortNum_TEXT_MESSAGE_APP\n");
|
||||
|
||||
auto &p = mp.decoded;
|
||||
|
||||
if ((p.payload.bytes[0] == 'S') && (p.payload.bytes[1] == 'F') && (p.payload.bytes[2] == 0x00)) {
|
||||
DEBUG_MSG("--- --- --- Request to send\n");
|
||||
|
||||
// Send the last 60 minutes of messages.
|
||||
if (this->busy) {
|
||||
strcpy(this->routerMessage, "** S&F - Busy. Try again shortly.");
|
||||
storeForwardModule->sendMessage(getFrom(&mp), this->routerMessage);
|
||||
} else {
|
||||
storeForwardModule->historySend(1000 * 60, getFrom(&mp));
|
||||
}
|
||||
|
||||
} else if ((p.payload.bytes[0] == 'S') && (p.payload.bytes[1] == 'F') && (p.payload.bytes[2] == 'm') &&
|
||||
(p.payload.bytes[3] == 0x00)) {
|
||||
strlcpy(this->routerMessage,
|
||||
"01234567890123456789012345678901234567890123456789012345678901234567890123456789"
|
||||
"01234567890123456789012345678901234567890123456789012345678901234567890123456789"
|
||||
"01234567890123456789012345678901234567890123456789012345678901234567890123456",
|
||||
sizeof(this->routerMessage));
|
||||
storeForwardModule->sendMessage(getFrom(&mp), this->routerMessage);
|
||||
|
||||
} else {
|
||||
storeForwardModule->historyAdd(mp);
|
||||
}
|
||||
storeForwardModule->historyAdd(mp);
|
||||
DEBUG_MSG("*** S&F stored. Message history contains %u records now.\n", this->packetHistoryCurrent);
|
||||
|
||||
} else if (mp.decoded.portnum == PortNum_STORE_FORWARD_APP) {
|
||||
DEBUG_MSG("Packet came from an PortNum_STORE_FORWARD_APP port %u\n", mp.decoded.portnum);
|
||||
|
||||
} else {
|
||||
DEBUG_MSG("Packet came from an unknown port %u\n", mp.decoded.portnum);
|
||||
}
|
||||
auto &p = mp.decoded;
|
||||
StoreAndForward scratch;
|
||||
StoreAndForward *decoded = NULL;
|
||||
if (mp.which_payload_variant == MeshPacket_decoded_tag) {
|
||||
if (pb_decode_from_bytes(p.payload.bytes, p.payload.size, &StoreAndForward_msg, &scratch)) {
|
||||
decoded = &scratch;
|
||||
} else {
|
||||
DEBUG_MSG("Error decoding protobuf module!\n");
|
||||
// if we can't decode it, nobody can process it!
|
||||
return ProcessMessage::STOP;
|
||||
}
|
||||
return handleReceivedProtobuf(mp, decoded) ? ProcessMessage::STOP : ProcessMessage::CONTINUE;
|
||||
}
|
||||
} // all others are irrelevant
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,95 +273,127 @@ bool StoreForwardModule::handleReceivedProtobuf(const MeshPacket &mp, StoreAndFo
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mp.decoded.portnum != PortNum_STORE_FORWARD_APP) {
|
||||
DEBUG_MSG("Packet came from port %u\n", mp.decoded.portnum);
|
||||
return false;
|
||||
} else {
|
||||
DEBUG_MSG("Packet came from PortNum_STORE_FORWARD_APP port %u\n", mp.decoded.portnum);
|
||||
|
||||
requests++;
|
||||
|
||||
switch (p->rr) {
|
||||
case StoreAndForward_RequestResponse_CLIENT_ERROR:
|
||||
case StoreAndForward_RequestResponse_CLIENT_ABORT:
|
||||
if(is_server) {
|
||||
// Do nothing
|
||||
DEBUG_MSG("StoreAndForward_RequestResponse_CLIENT_ERROR\n");
|
||||
// stop sending stuff, the client wants to abort or has another error
|
||||
if ((this->busy) && (this->busyTo == getFrom(&mp))) {
|
||||
DEBUG_MSG("*** Client in ERROR or ABORT requested\n");
|
||||
this->packetHistoryTXQueue_index = 0;
|
||||
this->busy = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case StoreAndForward_RequestResponse_CLIENT_HISTORY:
|
||||
if(is_server) {
|
||||
DEBUG_MSG("StoreAndForward_RequestResponse_CLIENT_HISTORY\n");
|
||||
requests_history++;
|
||||
DEBUG_MSG("*** Client Request to send HISTORY\n");
|
||||
// Send the last 60 minutes of messages.
|
||||
if (this->busy) {
|
||||
strcpy(this->routerMessage, "** S&F - Busy. Try again shortly.");
|
||||
storeForwardModule->sendMessage(getFrom(&mp), this->routerMessage);
|
||||
storeForwardModule->sendMessage(getFrom(&mp), StoreAndForward_RequestResponse_ROUTER_BUSY);
|
||||
DEBUG_MSG("*** S&F - Busy. Try again shortly.\n");
|
||||
} else {
|
||||
storeForwardModule->historySend(1000 * 60, getFrom(&mp));
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case StoreAndForward_RequestResponse_CLIENT_PING:
|
||||
if(is_server) {
|
||||
// Do nothing
|
||||
DEBUG_MSG("StoreAndForward_RequestResponse_CLIENT_PING\n");
|
||||
DEBUG_MSG("*** 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) {
|
||||
// Do nothing
|
||||
DEBUG_MSG("StoreAndForward_RequestResponse_CLIENT_PONG\n");
|
||||
DEBUG_MSG("*** StoreAndForward_RequestResponse_CLIENT_PONG\n");
|
||||
// The Client is alive, update NodeDB
|
||||
nodeDB.updateFrom(mp);
|
||||
}
|
||||
break;
|
||||
|
||||
case StoreAndForward_RequestResponse_CLIENT_STATS:
|
||||
if(is_server) {
|
||||
// Do nothing
|
||||
DEBUG_MSG("StoreAndForward_RequestResponse_CLIENT_STATS\n");
|
||||
}
|
||||
break;
|
||||
|
||||
case StoreAndForward_RequestResponse_ROUTER_BUSY:
|
||||
if(is_client) {
|
||||
// Do nothing
|
||||
DEBUG_MSG("StoreAndForward_RequestResponse_ROUTER_BUSY\n");
|
||||
DEBUG_MSG("*** Client Request to send STATS\n");
|
||||
if (this->busy) {
|
||||
storeForwardModule->sendMessage(getFrom(&mp), StoreAndForward_RequestResponse_ROUTER_BUSY);
|
||||
DEBUG_MSG("*** S&F - Busy. Try again shortly.\n");
|
||||
} else {
|
||||
storeForwardModule->statsSend(getFrom(&mp));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case StoreAndForward_RequestResponse_ROUTER_ERROR:
|
||||
case StoreAndForward_RequestResponse_ROUTER_BUSY:
|
||||
if(is_client) {
|
||||
// Do nothing
|
||||
DEBUG_MSG("StoreAndForward_RequestResponse_ROUTER_ERROR\n");
|
||||
DEBUG_MSG("*** 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) {
|
||||
// Do nothing
|
||||
DEBUG_MSG("StoreAndForward_RequestResponse_ROUTER_HEARTBEAT\n");
|
||||
// register heartbeat and interval
|
||||
if (p->which_variant == StoreAndForward_heartbeat_tag) {
|
||||
heartbeatInterval = p->variant.heartbeat.period;
|
||||
}
|
||||
lastHeartbeat = millis();
|
||||
DEBUG_MSG("*** StoreAndForward Heartbeat received\n");
|
||||
}
|
||||
break;
|
||||
|
||||
case StoreAndForward_RequestResponse_ROUTER_PING:
|
||||
if(is_client) {
|
||||
// Do nothing
|
||||
DEBUG_MSG("StoreAndForward_RequestResponse_ROUTER_PING\n");
|
||||
DEBUG_MSG("*** StoreAndForward_RequestResponse_ROUTER_PING\n");
|
||||
// respond with a CLIENT PONG
|
||||
storeForwardModule->sendMessage(getFrom(&mp), StoreAndForward_RequestResponse_CLIENT_PONG);
|
||||
}
|
||||
break;
|
||||
|
||||
case StoreAndForward_RequestResponse_ROUTER_PONG:
|
||||
case StoreAndForward_RequestResponse_ROUTER_STATS:
|
||||
if(is_client) {
|
||||
// Do nothing
|
||||
DEBUG_MSG("StoreAndForward_RequestResponse_ROUTER_PONG\n");
|
||||
DEBUG_MSG("*** 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;
|
||||
DEBUG_MSG("*** Router Response HISTORY - Sending %d messages from last %d minutes\n", p->variant.history.history_messages, this->historyReturnWindow);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0); // unexpected state - FIXME, make an error code and reboot
|
||||
}
|
||||
}
|
||||
|
||||
return true; // There's no need for others to look at this message.
|
||||
}
|
||||
|
||||
@@ -398,7 +418,7 @@ StoreForwardModule::StoreForwardModule()
|
||||
|
||||
// Router
|
||||
if ((config.device.role == Config_DeviceConfig_Role_ROUTER) || (config.device.role == Config_DeviceConfig_Role_ROUTER_CLIENT)) {
|
||||
DEBUG_MSG("Initializing Store & Forward Module in Router mode\n");
|
||||
DEBUG_MSG("*** Initializing Store & Forward Module in Router mode\n");
|
||||
if (ESP.getPsramSize() > 0) {
|
||||
if (ESP.getFreePsram() >= 1024 * 1024) {
|
||||
|
||||
@@ -424,19 +444,19 @@ StoreForwardModule::StoreForwardModule()
|
||||
this->populatePSRAM();
|
||||
is_server = true;
|
||||
} else {
|
||||
DEBUG_MSG("Device has less than 1M of PSRAM free.\n");
|
||||
DEBUG_MSG("Store & Forward Module - disabling server.\n");
|
||||
DEBUG_MSG("*** Device has less than 1M of PSRAM free.\n");
|
||||
DEBUG_MSG("*** Store & Forward Module - disabling server.\n");
|
||||
}
|
||||
} else {
|
||||
DEBUG_MSG("Device doesn't have PSRAM.\n");
|
||||
DEBUG_MSG("Store & Forward Module - disabling server.\n");
|
||||
DEBUG_MSG("*** Device doesn't have PSRAM.\n");
|
||||
DEBUG_MSG("*** Store & Forward Module - disabling server.\n");
|
||||
}
|
||||
|
||||
// Client
|
||||
}
|
||||
if ((config.device.role == Config_DeviceConfig_Role_CLIENT) || (config.device.role == Config_DeviceConfig_Role_ROUTER_CLIENT)) {
|
||||
is_client = true;
|
||||
DEBUG_MSG("Initializing Store & Forward Module in Client mode\n");
|
||||
DEBUG_MSG("*** Initializing Store & Forward Module in Client mode\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -24,10 +24,9 @@ class StoreForwardModule : private concurrency::OSThread, public ProtobufModule<
|
||||
uint32_t busyTo = 0;
|
||||
char routerMessage[Constants_DATA_PAYLOAD_LEN] = {0};
|
||||
|
||||
uint32_t receivedRecord[50][2] = {{0}};
|
||||
|
||||
PacketHistoryStruct *packetHistory = 0;
|
||||
uint32_t packetHistoryCurrent = 0;
|
||||
uint32_t packetHistoryMax = 0;
|
||||
|
||||
PacketHistoryStruct *packetHistoryTXQueue = 0;
|
||||
uint32_t packetHistoryTXQueue_size = 0;
|
||||
@@ -35,20 +34,21 @@ class StoreForwardModule : private concurrency::OSThread, public ProtobufModule<
|
||||
|
||||
uint32_t packetTimeMax = 5000;
|
||||
|
||||
unsigned long lastHeartbeat = 0;
|
||||
|
||||
bool is_client = false;
|
||||
bool is_server = false;
|
||||
|
||||
public:
|
||||
StoreForwardModule();
|
||||
|
||||
unsigned long lastHeartbeat = 0;
|
||||
uint32_t heartbeatInterval = 300;
|
||||
|
||||
/**
|
||||
Update our local reference of when we last saw that node.
|
||||
@return 0 if we have never seen that node before otherwise return the last time we saw the node.
|
||||
*/
|
||||
void historyAdd(const MeshPacket &mp);
|
||||
void historyReport();
|
||||
void statsSend(uint32_t to);
|
||||
void historySend(uint32_t msAgo, uint32_t to);
|
||||
|
||||
uint32_t historyQueueCreate(uint32_t msAgo, uint32_t to);
|
||||
@@ -57,12 +57,23 @@ class StoreForwardModule : private concurrency::OSThread, public ProtobufModule<
|
||||
* Send our payload into the mesh
|
||||
*/
|
||||
void sendPayload(NodeNum dest = NODENUM_BROADCAST, uint32_t packetHistory_index = 0);
|
||||
void sendMessage(NodeNum dest, char *str);
|
||||
void sendMessage(NodeNum dest, StoreAndForward &payload);
|
||||
void sendMessage(NodeNum dest, StoreAndForward_RequestResponse rr);
|
||||
|
||||
virtual MeshPacket *allocReply() override;
|
||||
/*
|
||||
Override the wantPortnum method.
|
||||
*/
|
||||
virtual bool wantPortnum(PortNum p) { return true; };
|
||||
-Override the wantPacket method.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
void populatePSRAM();
|
||||
@@ -73,6 +84,12 @@ class StoreForwardModule : private concurrency::OSThread, public ProtobufModule<
|
||||
uint32_t records = 0; // Calculated
|
||||
bool heartbeat = false; // No heartbeat.
|
||||
|
||||
// stats
|
||||
uint32_t requests = 0;
|
||||
uint32_t requests_history = 0;
|
||||
|
||||
uint32_t retry_delay = 0;
|
||||
|
||||
protected:
|
||||
virtual int32_t runOnce() override;
|
||||
|
||||
|
||||
@@ -88,6 +88,8 @@
|
||||
#define HW_VENDOR HardwareModel_HELTEC_V3
|
||||
#elif defined(HELTEC_WSL_V3)
|
||||
#define HW_VENDOR HardwareModel_HELTEC_WSL_V3
|
||||
#elif defined(TLORA_T3S3_V1)
|
||||
#define HW_VENDOR HardwareModel_TLORA_T3_S3
|
||||
#endif
|
||||
|
||||
//
|
||||
|
||||
@@ -201,7 +201,7 @@ void SimRadio::startSend(MeshPacket * txp)
|
||||
} else {
|
||||
DEBUG_MSG("Payload size is larger than compressed message allows! Sending empty payload.\n");
|
||||
}
|
||||
p->decoded.payload.size = pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), Compressed_fields, &c);
|
||||
p->decoded.payload.size = pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &Compressed_msg, &c);
|
||||
p->decoded.portnum = PortNum_SIMULATOR_APP;
|
||||
service.sendToPhone(p); // Sending back to simulator
|
||||
}
|
||||
|
||||
@@ -66,3 +66,4 @@
|
||||
//has 32768 Hz crystal
|
||||
#define HAS_32768HZ
|
||||
|
||||
#define USE_SH1106
|
||||
34
variants/tlora_t3s3_v1/pins_arduino.h
Normal file
34
variants/tlora_t3s3_v1/pins_arduino.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
#define EXTERNAL_NUM_INTERRUPTS 46
|
||||
#define NUM_DIGITAL_PINS 48
|
||||
#define NUM_ANALOG_INPUTS 20
|
||||
|
||||
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
|
||||
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
|
||||
#define digitalPinHasPWM(p) (p < 46)
|
||||
|
||||
// The default Wire will be mapped to PMU and RTC
|
||||
static const uint8_t SDA = 18;
|
||||
static const uint8_t SCL = 17;
|
||||
|
||||
// Default SPI will be mapped to Radio
|
||||
static const uint8_t SS = 7;
|
||||
static const uint8_t MOSI = 6;
|
||||
static const uint8_t MISO = 3;
|
||||
static const uint8_t SCK = 5;
|
||||
|
||||
#define SPI_MOSI (11)
|
||||
#define SPI_SCK (14)
|
||||
#define SPI_MISO (2)
|
||||
#define SPI_CS (13)
|
||||
|
||||
#define SDCARD_CS SPI_CS
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
9
variants/tlora_t3s3_v1/platformio.ini
Normal file
9
variants/tlora_t3s3_v1/platformio.ini
Normal file
@@ -0,0 +1,9 @@
|
||||
[env:tlora-t3s3-v1]
|
||||
extends = esp32s3_base
|
||||
board = tlora-t3s3-v1
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
caveman99/ESP32 Codec2@^1.0.1
|
||||
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D TLORA_T3S3_V1 -I variants/tlora_t3s3_v1
|
||||
54
variants/tlora_t3s3_v1/variant.h
Normal file
54
variants/tlora_t3s3_v1/variant.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#undef GPS_RX_PIN
|
||||
#undef GPS_TX_PIN
|
||||
|
||||
#define HAS_SDCARD
|
||||
#define SDCARD_USE_SPI1
|
||||
|
||||
#define USE_SSD1306
|
||||
|
||||
#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||
// ratio of voltage divider = 2.0 (R42=100k, R43=100k)
|
||||
#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage.
|
||||
|
||||
#define I2C_SDA 18 // I2C pins for this board
|
||||
#define I2C_SCL 17
|
||||
|
||||
#define LED_PIN 37 // If defined we will blink this LED
|
||||
#define BUTTON_PIN 0 // If defined, this will be used for user button presses,
|
||||
|
||||
#define BUTTON_NEED_PULLUP
|
||||
|
||||
// TTGO uses a common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if
|
||||
// not found then probe for SX1262
|
||||
#define USE_RF95 // RFM95/SX127x
|
||||
#define USE_SX1262
|
||||
#define USE_SX1280
|
||||
|
||||
#define RF95_SCK 5
|
||||
#define RF95_MISO 3
|
||||
#define RF95_MOSI 6
|
||||
#define RF95_NSS 7
|
||||
|
||||
#define LORA_RESET 8
|
||||
#define LORA_DIO0 9
|
||||
#define LORA_DIO1 9
|
||||
#define LORA_DIO2 33 // SX1262 BUSY
|
||||
#define LORA_DIO3 34 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
|
||||
|
||||
#ifdef USE_SX1262
|
||||
#define SX126X_CS RF95_NSS // FIXME - we really should define LORA_CS instead
|
||||
#define SX126X_DIO1 LORA_DIO1
|
||||
#define SX126X_BUSY 36
|
||||
#define SX126X_RESET LORA_RESET
|
||||
#define SX126X_RXEN 21
|
||||
#define SX126X_TXEN 10
|
||||
#endif
|
||||
|
||||
#ifdef USE_SX1280
|
||||
#define SX128X_CS RF95_NSS
|
||||
#define SX128X_DIO1 LORA_DIO1
|
||||
#define SX128X_BUSY 36
|
||||
#define SX128X_RESET LORA_RESET
|
||||
#define SX128X_RXEN 21
|
||||
#define SX128X_TXEN 10
|
||||
#endif
|
||||
@@ -5,7 +5,5 @@ lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
caveman99/ESP32 Codec2@^1.0.1
|
||||
|
||||
; the RADIOLIB_GODMODE flag can be removed once the next version of RadioLib is released. (>5.5.0)
|
||||
|
||||
build_flags =
|
||||
${esp32_base.build_flags} -D TLORA_V2_1_18 -I variants/tlora_v2_1_18 -D RADIOLIB_GODMODE
|
||||
${esp32_base.build_flags} -D TLORA_V2_1_18 -I variants/tlora_v2_1_18
|
||||
@@ -1,4 +1,4 @@
|
||||
[VERSION]
|
||||
major = 2
|
||||
minor = 0
|
||||
build = 8
|
||||
build = 9
|
||||
|
||||
Reference in New Issue
Block a user