mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-19 17:22:59 +00:00
drop oem.proto support in favor of userprefs
This commit is contained in:
@@ -55,8 +55,6 @@ meshtastic_MyNodeInfo &myNodeInfo = devicestate.my_node;
|
||||
meshtastic_LocalConfig config;
|
||||
meshtastic_LocalModuleConfig moduleConfig;
|
||||
meshtastic_ChannelFile channelFile;
|
||||
meshtastic_OEMStore oemStore;
|
||||
static bool hasOemStore = false;
|
||||
|
||||
bool meshtastic_DeviceState_callback(pb_istream_t *istream, pb_ostream_t *ostream, const pb_field_iter_t *field)
|
||||
{
|
||||
@@ -684,7 +682,6 @@ static const char *prefFileName = "/prefs/db.proto";
|
||||
static const char *configFileName = "/prefs/config.proto";
|
||||
static const char *moduleConfigFileName = "/prefs/module.proto";
|
||||
static const char *channelFileName = "/prefs/channels.proto";
|
||||
static const char *oemConfigFile = "/oem/oem.proto";
|
||||
|
||||
/** Load a protobuf from a file, return LoadFileResult */
|
||||
LoadFileResult NodeDB::loadProto(const char *filename, size_t protoSize, size_t objSize, const pb_msgdesc_t *fields,
|
||||
@@ -785,12 +782,6 @@ void NodeDB::loadFromDisk()
|
||||
}
|
||||
}
|
||||
|
||||
state = loadProto(oemConfigFile, meshtastic_OEMStore_size, sizeof(meshtastic_OEMStore), &meshtastic_OEMStore_msg, &oemStore);
|
||||
if (state == LoadFileResult::LOAD_SUCCESS) {
|
||||
LOG_INFO("Loaded OEMStore");
|
||||
hasOemStore = true;
|
||||
}
|
||||
|
||||
// 2.4.X - configuration migration to update new default intervals
|
||||
if (moduleConfig.version < 23) {
|
||||
LOG_DEBUG("ModuleConfig version %d is stale, upgrading to new default intervals", moduleConfig.version);
|
||||
@@ -897,11 +888,6 @@ bool NodeDB::saveToDiskNoRetry(int saveWhat)
|
||||
saveProto(moduleConfigFileName, meshtastic_LocalModuleConfig_size, &meshtastic_LocalModuleConfig_msg, &moduleConfig);
|
||||
}
|
||||
|
||||
// We might need to rewrite the OEM data if we are reformatting the FS
|
||||
if ((saveWhat & SEGMENT_OEM) && hasOemStore) {
|
||||
success &= saveProto(oemConfigFile, meshtastic_OEMStore_size, &meshtastic_OEMStore_msg, &oemStore);
|
||||
}
|
||||
|
||||
if (saveWhat & SEGMENT_CHANNELS) {
|
||||
success &= saveChannelsToDisk();
|
||||
}
|
||||
@@ -922,8 +908,6 @@ bool NodeDB::saveToDisk(int saveWhat)
|
||||
#ifdef ARCH_NRF52 // @geeksville is not ready yet to say we should do this on other platforms. See bug #4184 discussion
|
||||
FSCom.format();
|
||||
|
||||
// We need to rewrite the OEM data if we are reformatting the FS
|
||||
saveWhat |= SEGMENT_OEM;
|
||||
#endif
|
||||
success = saveToDiskNoRetry(saveWhat);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user