From 05d237ee8400076c966121d5b5fca314deaf780b Mon Sep 17 00:00:00 2001 From: Charles Crossan Date: Mon, 15 Feb 2021 21:01:18 -0500 Subject: [PATCH 1/2] add handleSetChannel --- src/mesh/PhoneAPI.cpp | 15 +++++++++++++++ src/mesh/PhoneAPI.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index fa10e20f..f9c9b617 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -87,6 +87,10 @@ void PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength) handleSetRadio(toRadioScratch.set_radio); break; + case ToRadio_set_channel_tag: + DEBUG_MSG("Client is setting channel\n"); + handleSetChannel(toRadioScratch.set_channel); + break; default: DEBUG_MSG("Error: unexpected ToRadio variant\n"); break; @@ -275,6 +279,17 @@ void PhoneAPI::handleSetOwner(const User &o) service.reloadOwner(); } +void PhoneAPI::handleSetChannel(const ChannelSettings &cc) +{ + radioConfig.channel_settings = cc; + + bool didReset = service.reloadConfig(); + if (didReset) { + state = STATE_SEND_MY_INFO; // Squirt a completely new set of configs to the client + } + +} + void PhoneAPI::handleSetRadio(const RadioConfig &r) { radioConfig = r; diff --git a/src/mesh/PhoneAPI.h b/src/mesh/PhoneAPI.h index 3cfd9744..663d6824 100644 --- a/src/mesh/PhoneAPI.h +++ b/src/mesh/PhoneAPI.h @@ -88,6 +88,7 @@ class PhoneAPI // void handleSetOwner(const User &o); + void handleSetChannel(const ChannelSettings &cc); void handleSetRadio(const RadioConfig &r); protected: From c8584d576aca41b5f92695b1600841fcb3e63a18 Mon Sep 17 00:00:00 2001 From: geoffreyheller Date: Mon, 15 Feb 2021 19:33:35 -0800 Subject: [PATCH 2/2] Fix for non-working tx pin --- src/configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configuration.h b/src/configuration.h index 26742087..4fd395fd 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -343,7 +343,7 @@ along with this program. If not, see . #undef GPS_RX_PIN #undef GPS_TX_PIN #define GPS_RX_PIN 36 -#define GPS_TX_PIN 39 +#define GPS_TX_PIN 13 #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage