Skip to content

Commit 1130cf1

Browse files
author
Scott Powell
committed
Merge branch 'dev'
2 parents 4413e5b + 637891b commit 1130cf1

File tree

20 files changed

+134
-30
lines changed

20 files changed

+134
-30
lines changed

examples/companion_radio/MyMesh.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
#define FIRMWARE_VER_CODE 7
99

1010
#ifndef FIRMWARE_BUILD_DATE
11-
#define FIRMWARE_BUILD_DATE "31 Aug 2025"
11+
#define FIRMWARE_BUILD_DATE "1 Sep 2025"
1212
#endif
1313

1414
#ifndef FIRMWARE_VERSION
15-
#define FIRMWARE_VERSION "v1.8.0"
15+
#define FIRMWARE_VERSION "v1.8.1"
1616
#endif
1717

1818
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)

examples/companion_radio/ui-new/UITask.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* no
354354
#if defined(PIN_USER_BTN)
355355
user_btn.begin();
356356
#endif
357+
#if defined(PIN_USER_BTN_ANA)
358+
analog_btn.begin();
359+
#endif
357360

358361
_node_prefs = node_prefs;
359362
if (_display != NULL) {
@@ -508,6 +511,14 @@ void UITask::loop() {
508511
c = handleLongPress(KEY_RIGHT);
509512
}
510513
#endif
514+
#if defined(PIN_USER_BTN_ANA)
515+
ev = analog_btn.check();
516+
if (ev == BUTTON_EVENT_CLICK) {
517+
c = checkDisplayOn(KEY_SELECT);
518+
} else if (ev == BUTTON_EVENT_LONG_PRESS) {
519+
c = handleLongPress(KEY_ENTER);
520+
}
521+
#endif
511522

512523
if (c != 0 && curr) {
513524
curr->handleInput(c);

examples/simple_repeater/main.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
/* ------------------------------ Config -------------------------------- */
2323

2424
#ifndef FIRMWARE_BUILD_DATE
25-
#define FIRMWARE_BUILD_DATE "31 Aug 2025"
25+
#define FIRMWARE_BUILD_DATE "1 Sep 2025"
2626
#endif
2727

2828
#ifndef FIRMWARE_VERSION
29-
#define FIRMWARE_VERSION "v1.8.0"
29+
#define FIRMWARE_VERSION "v1.8.1"
3030
#endif
3131

3232
#ifndef LORA_FREQ
@@ -732,6 +732,20 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks {
732732

733733
mesh::LocalIdentity& getSelfId() override { return self_id; }
734734

735+
void saveIdentity(const mesh::LocalIdentity& new_id) override {
736+
self_id = new_id;
737+
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
738+
IdentityStore store(*_fs, "");
739+
#elif defined(ESP32)
740+
IdentityStore store(*_fs, "/identity");
741+
#elif defined(RP2040_PLATFORM)
742+
IdentityStore store(*_fs, "/identity");
743+
#else
744+
#error "need to define saveIdentity()"
745+
#endif
746+
store.save("_main", self_id);
747+
}
748+
735749
void clearStats() override {
736750
radio_driver.resetStats();
737751
resetStats();

examples/simple_room_server/main.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
/* ------------------------------ Config -------------------------------- */
2323

2424
#ifndef FIRMWARE_BUILD_DATE
25-
#define FIRMWARE_BUILD_DATE "31 Aug 2025"
25+
#define FIRMWARE_BUILD_DATE "1 Sep 2025"
2626
#endif
2727

2828
#ifndef FIRMWARE_VERSION
29-
#define FIRMWARE_VERSION "v1.8.0"
29+
#define FIRMWARE_VERSION "v1.8.1"
3030
#endif
3131

3232
#ifndef LORA_FREQ
@@ -865,6 +865,20 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks {
865865

866866
mesh::LocalIdentity& getSelfId() override { return self_id; }
867867

868+
void saveIdentity(const mesh::LocalIdentity& new_id) override {
869+
self_id = new_id;
870+
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
871+
IdentityStore store(*_fs, "");
872+
#elif defined(ESP32)
873+
IdentityStore store(*_fs, "/identity");
874+
#elif defined(RP2040_PLATFORM)
875+
IdentityStore store(*_fs, "/identity");
876+
#else
877+
#error "need to define saveIdentity()"
878+
#endif
879+
store.save("_main", self_id);
880+
}
881+
868882
void clearStats() override {
869883
radio_driver.resetStats();
870884
resetStats();

examples/simple_sensor/SensorMesh.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,20 @@ bool SensorMesh::formatFileSystem() {
837837
#endif
838838
}
839839

840+
void SensorMesh::saveIdentity(const mesh::LocalIdentity& new_id) {
841+
self_id = new_id;
842+
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
843+
IdentityStore store(*_fs, "");
844+
#elif defined(ESP32)
845+
IdentityStore store(*_fs, "/identity");
846+
#elif defined(RP2040_PLATFORM)
847+
IdentityStore store(*_fs, "/identity");
848+
#else
849+
#error "need to define saveIdentity()"
850+
#endif
851+
store.save("_main", self_id);
852+
}
853+
840854
void SensorMesh::applyTempRadioParams(float freq, float bw, uint8_t sf, uint8_t cr, int timeout_mins) {
841855
set_radio_at = futureMillis(2000); // give CLI reply some time to be sent back, before applying temp radio params
842856
pending_freq = freq;

examples/simple_sensor/SensorMesh.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ struct ContactInfo {
4949
};
5050

5151
#ifndef FIRMWARE_BUILD_DATE
52-
#define FIRMWARE_BUILD_DATE "31 Aug 2025"
52+
#define FIRMWARE_BUILD_DATE "1 Sep 2025"
5353
#endif
5454

5555
#ifndef FIRMWARE_VERSION
56-
#define FIRMWARE_VERSION "v1.8.0"
56+
#define FIRMWARE_VERSION "v1.8.1"
5757
#endif
5858

5959
#define FIRMWARE_ROLE "sensor"
@@ -89,6 +89,7 @@ class SensorMesh : public mesh::Mesh, public CommonCLICallbacks {
8989
strcpy(reply, "not supported");
9090
}
9191
mesh::LocalIdentity& getSelfId() override { return self_id; }
92+
void saveIdentity(const mesh::LocalIdentity& new_id) override;
9293
void clearStats() override { }
9394
void applyTempRadioParams(float freq, float bw, uint8_t sf, uint8_t cr, int timeout_mins) override;
9495

library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "MeshCore",
3-
"version" : "1.7.4",
3+
"version" : "1.8.0",
44
"dependencies": {
55
"SPI": "*",
66
"Wire": "*",
@@ -13,4 +13,4 @@
1313
"build": {
1414
"extraScript": "build_as_lib.py"
1515
}
16-
}
16+
}

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ build_src_filter =
5353

5454
[esp32_base]
5555
extends = arduino_base
56-
platform = platformio/espressif32@^6.11.0
56+
platform = platformio/[email protected]
5757
monitor_filters = esp32_exception_decoder
5858
extra_scripts = merge-bin.py
5959
build_flags = ${arduino_base.build_flags}

src/helpers/CommonCLI.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
305305
uint8_t prv_key[PRV_KEY_SIZE];
306306
bool success = mesh::Utils::fromHex(prv_key, PRV_KEY_SIZE, &config[8]);
307307
if (success) {
308-
_callbacks->getSelfId().readFrom(prv_key, PRV_KEY_SIZE);
308+
mesh::LocalIdentity new_id;
309+
new_id.readFrom(prv_key, PRV_KEY_SIZE);
310+
_callbacks->saveIdentity(new_id);
309311
strcpy(reply, "OK");
310312
} else {
311313
strcpy(reply, "Error, invalid key");

src/helpers/CommonCLI.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class CommonCLICallbacks {
4747
// no op by default
4848
};
4949
virtual mesh::LocalIdentity& getSelfId() = 0;
50+
virtual void saveIdentity(const mesh::LocalIdentity& new_id) = 0;
5051
virtual void clearStats() = 0;
5152
virtual void applyTempRadioParams(float freq, float bw, uint8_t sf, uint8_t cr, int timeout_mins) = 0;
5253
};

0 commit comments

Comments
 (0)