Use enums for hw_model per @sachaw idea.

This commit is contained in:
Kevin Hester
2021-03-14 10:37:32 +08:00
parent efebb8bb0b
commit 9a03536e3d
9 changed files with 54 additions and 24 deletions

View File

@@ -199,6 +199,7 @@ void NodeDB::init()
NodeInfo *info = getOrCreateNode(getNodeNum());
info->user = owner;
info->has_user = true;
info->hw_model = HW_VENDOR;
// removed from 1.2 (though we do use old values if found)
// We set these _after_ loading from disk - because they come from the build and are more trusted than
@@ -223,7 +224,10 @@ void NodeDB::init()
}
strncpy(myNodeInfo.firmware_version, optstr(APP_VERSION), sizeof(myNodeInfo.firmware_version));
strncpy(myNodeInfo.hw_model, HW_VENDOR, sizeof(myNodeInfo.hw_model));
// hw_model is no longer stored in myNodeInfo (as of 1.2.11) - we now store it as an enum in nodeinfo
myNodeInfo.hw_model[0] = '\0';
// strncpy(myNodeInfo.hw_model, HW_VENDOR, sizeof(myNodeInfo.hw_model));
resetRadioConfig(); // If bogus settings got saved, then fix them