Fix Companion NodePrefs ODR conflict

This commit is contained in:
mikecarper committed 2026-08-12 15:42:50 -07:00
1 parent 7246e09708
commit 3cd9c84893
11 files changed
+23 -23

No files matched your search

+3 -3
View File
@@ -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
+3 -3
View File
@@ -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);
+1 -1
View File
@@ -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() {
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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;
+3 -3
View File
@@ -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;
+2 -2
View File
@@ -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);
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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();
+3 -3
View File
@@ -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;
+2 -2
View File
@@ -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);