diff --git a/examples/companion_radio/DataStore.cpp b/examples/companion_radio/DataStore.cpp index fbf590d69..14961a8c5 100644 --- a/examples/companion_radio/DataStore.cpp +++ b/examples/companion_radio/DataStore.cpp @@ -269,7 +269,7 @@ bool DataStore::saveMainIdentity(const mesh::LocalIdentity &identity) { return identity_store.save("_main", identity); } -void DataStore::loadPrefs(NodePrefs& prefs, double& node_lat, double& node_lon) { +void DataStore::loadPrefs(CompanionNodePrefs& prefs, double& node_lat, double& node_lon) { if (_fs->exists("/new_prefs")) { loadPrefsInt("/new_prefs", prefs, node_lat, node_lon); // new filename } else if (_fs->exists("/node_prefs")) { @@ -280,7 +280,7 @@ void DataStore::loadPrefs(NodePrefs& prefs, double& node_lat, double& node_lon) } } -void DataStore::loadPrefsInt(const char *filename, NodePrefs& _prefs, double& node_lat, double& node_lon) { +void DataStore::loadPrefsInt(const char *filename, CompanionNodePrefs& _prefs, double& node_lat, double& node_lon) { File file = openRead(_fs, filename); if (file) { uint8_t pad[8]; @@ -328,7 +328,7 @@ void DataStore::loadPrefsInt(const char *filename, NodePrefs& _prefs, double& no } } -bool DataStore::savePrefs(const NodePrefs& _prefs, double node_lat, double node_lon) { +bool DataStore::savePrefs(const CompanionNodePrefs& _prefs, double node_lat, double node_lon) { #if defined(NRF52_PLATFORM) mesh::AtomicFileWriter file(_fs, "/new_prefs"); #else diff --git a/examples/companion_radio/DataStore.h b/examples/companion_radio/DataStore.h index 2e548d645..9bfec94cc 100644 --- a/examples/companion_radio/DataStore.h +++ b/examples/companion_radio/DataStore.h @@ -37,7 +37,7 @@ class DataStore { void resetContactPageState(); #endif - void loadPrefsInt(const char *filename, NodePrefs& prefs, double& node_lat, double& node_lon); + void loadPrefsInt(const char *filename, CompanionNodePrefs& prefs, double& node_lat, double& node_lon); #if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM) void checkAdvBlobFile(); #endif @@ -52,8 +52,8 @@ public: void disableSecondaryFS() { _fsExtra = nullptr; } bool loadMainIdentity(mesh::LocalIdentity &identity); bool saveMainIdentity(const mesh::LocalIdentity &identity); - void loadPrefs(NodePrefs& prefs, double& node_lat, double& node_lon); - bool savePrefs(const NodePrefs& prefs, double node_lat, double node_lon); + void loadPrefs(CompanionNodePrefs& prefs, double& node_lat, double& node_lon); + bool savePrefs(const CompanionNodePrefs& prefs, double node_lat, double node_lon); void loadContacts(DataStoreHost* host); bool saveContacts(DataStoreHost* host, bool (*filter)(const ContactInfo& c) = NULL); bool markContactDirty(const ContactInfo& contact); diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index f25a00711..60b8a0ec2 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -1768,7 +1768,7 @@ void MyMesh::serviceTempRadio() { const char *MyMesh::getNodeName() { return _prefs.node_name; } -NodePrefs *MyMesh::getNodePrefs() { +CompanionNodePrefs *MyMesh::getNodePrefs() { return &_prefs; } uint32_t MyMesh::getBLEPin() { diff --git a/examples/companion_radio/MyMesh.h b/examples/companion_radio/MyMesh.h index 45d7a9eed..31e667f49 100644 --- a/examples/companion_radio/MyMesh.h +++ b/examples/companion_radio/MyMesh.h @@ -116,7 +116,7 @@ public: void startInterface(BaseSerialInterface &serial); const char *getNodeName(); - NodePrefs *getNodePrefs(); + CompanionNodePrefs *getNodePrefs(); uint32_t getBLEPin(); #if defined(WITH_MQTT_BRIDGE) && defined(ESP32_PLATFORM) && defined(WIFI_SSID) @@ -324,7 +324,7 @@ private: void scheduleContactWriteAfterRelease(const ContactInfo& contact); DataStore* _store; - NodePrefs _prefs; + CompanionNodePrefs _prefs; #if defined(WITH_MQTT_BRIDGE) && defined(ESP32_PLATFORM) && defined(WIFI_SSID) MQTTPrefs _mqtt_prefs; MQTTBridge* _mqtt_bridge; diff --git a/examples/companion_radio/NodePrefs.h b/examples/companion_radio/NodePrefs.h index 214852dcd..ac0066b6b 100644 --- a/examples/companion_radio/NodePrefs.h +++ b/examples/companion_radio/NodePrefs.h @@ -8,7 +8,7 @@ #define ADVERT_LOC_NONE 0 #define ADVERT_LOC_SHARE 1 -struct NodePrefs { // persisted to file +struct CompanionNodePrefs { // persisted to file float airtime_factor; char node_name[32]; float freq; diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index aa7512fe8..b5bf84a67 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -110,7 +110,7 @@ class HomeScreen : public UIScreen { UITask* _task; mesh::RTCClock* _rtc; SensorManager* _sensors; - NodePrefs* _node_prefs; + CompanionNodePrefs* _node_prefs; uint8_t _page; bool _shutdown_init; AdvertPath recent[UI_RECENT_LIST_SIZE]; @@ -184,7 +184,7 @@ class HomeScreen : public UIScreen { } public: - HomeScreen(UITask* task, mesh::RTCClock* rtc, SensorManager* sensors, NodePrefs* node_prefs) + HomeScreen(UITask* task, mesh::RTCClock* rtc, SensorManager* sensors, CompanionNodePrefs* node_prefs) : _task(task), _rtc(rtc), _sensors(sensors), _node_prefs(node_prefs), _page(0), _shutdown_init(false), sensors_lpp(200) { } @@ -585,7 +585,7 @@ public: } }; -void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs) { +void UITask::begin(DisplayDriver* display, SensorManager* sensors, CompanionNodePrefs* node_prefs) { _display = display; _sensors = sensors; _auto_off = millis() + AUTO_OFF_MILLIS; diff --git a/examples/companion_radio/ui-new/UITask.h b/examples/companion_radio/ui-new/UITask.h index 517c9bcb4..fc517a88d 100644 --- a/examples/companion_radio/ui-new/UITask.h +++ b/examples/companion_radio/ui-new/UITask.h @@ -35,7 +35,7 @@ class UITask : public AbstractUITask { unsigned long _msg_preview_until; unsigned long _pairing_screen_until; bool _deferred_msg_preview; - NodePrefs* _node_prefs; + CompanionNodePrefs* _node_prefs; char _alert[80]; unsigned long _alert_expiry; int _msgcount; @@ -79,7 +79,7 @@ public: ui_started_at = 0; curr = NULL; } - void begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs); + void begin(DisplayDriver* display, SensorManager* sensors, CompanionNodePrefs* node_prefs); void gotoHomeScreen() { setCurrScreen(home); } void showAlert(const char* text, int duration_millis); diff --git a/examples/companion_radio/ui-orig/UITask.cpp b/examples/companion_radio/ui-orig/UITask.cpp index 9ed0ab729..86e67d1b8 100644 --- a/examples/companion_radio/ui-orig/UITask.cpp +++ b/examples/companion_radio/ui-orig/UITask.cpp @@ -43,7 +43,7 @@ static const uint8_t meshcore_logo [] PROGMEM = { 0xe3, 0xe3, 0x8f, 0xff, 0x1f, 0xfc, 0x3c, 0x0e, 0x1f, 0xf8, 0xff, 0xf8, 0x70, 0x3c, 0x7f, 0xf8, }; -void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs) { +void UITask::begin(DisplayDriver* display, SensorManager* sensors, CompanionNodePrefs* node_prefs) { _display = display; _sensors = sensors; _auto_off = millis() + AUTO_OFF_MILLIS; diff --git a/examples/companion_radio/ui-orig/UITask.h b/examples/companion_radio/ui-orig/UITask.h index db96df2a2..d99048fa5 100644 --- a/examples/companion_radio/ui-orig/UITask.h +++ b/examples/companion_radio/ui-orig/UITask.h @@ -28,7 +28,7 @@ class UITask : public AbstractUITask { DRV2605Vibration vibration; #endif unsigned long _next_refresh, _auto_off; - NodePrefs* _node_prefs; + CompanionNodePrefs* _node_prefs; char _version_info[32]; char _origin[62]; char _msg[80]; @@ -71,7 +71,7 @@ public: _pairing_screen_until = 0; ui_started_at = 0; } - void begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs); + void begin(DisplayDriver* display, SensorManager* sensors, CompanionNodePrefs* node_prefs); bool hasDisplay() const { return _display != NULL; } void clearMsgPreview(); diff --git a/examples/companion_radio/ui-tiny/UITask.cpp b/examples/companion_radio/ui-tiny/UITask.cpp index 8a23d8c2a..6207e0f05 100644 --- a/examples/companion_radio/ui-tiny/UITask.cpp +++ b/examples/companion_radio/ui-tiny/UITask.cpp @@ -110,7 +110,7 @@ class HomeScreen : public UIScreen { UITask* _task; mesh::RTCClock* _rtc; SensorManager* _sensors; - NodePrefs* _node_prefs; + CompanionNodePrefs* _node_prefs; uint8_t _page; bool _shutdown_init; AdvertPath recent[UI_RECENT_LIST_SIZE]; @@ -143,7 +143,7 @@ class HomeScreen : public UIScreen { } public: - HomeScreen(UITask* task, mesh::RTCClock* rtc, SensorManager* sensors, NodePrefs* node_prefs) + HomeScreen(UITask* task, mesh::RTCClock* rtc, SensorManager* sensors, CompanionNodePrefs* node_prefs) : _task(task), _rtc(rtc), _sensors(sensors), _node_prefs(node_prefs), _page(0), _shutdown_init(false), sensors_lpp(200) { } @@ -434,7 +434,7 @@ public: }; -void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs) { +void UITask::begin(DisplayDriver* display, SensorManager* sensors, CompanionNodePrefs* node_prefs) { _display = display; _sensors = sensors; _auto_off = millis() + AUTO_OFF_MILLIS; diff --git a/examples/companion_radio/ui-tiny/UITask.h b/examples/companion_radio/ui-tiny/UITask.h index 7b937d74a..aeb3a90e3 100644 --- a/examples/companion_radio/ui-tiny/UITask.h +++ b/examples/companion_radio/ui-tiny/UITask.h @@ -36,7 +36,7 @@ class UITask : public AbstractUITask { GenericVibration vibration; #endif unsigned long _next_refresh, _auto_off; - NodePrefs* _node_prefs; + CompanionNodePrefs* _node_prefs; char _alert[80]; unsigned long _alert_expiry; unsigned long _pairing_screen_until; @@ -82,7 +82,7 @@ public: ui_started_at = 0; curr = NULL; } - void begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* node_prefs); + void begin(DisplayDriver* display, SensorManager* sensors, CompanionNodePrefs* node_prefs); void gotoHomeScreen() { setCurrScreen(home); } void showAlert(const char* text, int duration_millis);