Read model names into models list while converting

This commit is contained in:
Raphael Coeffic
2021-11-22 13:23:28 +01:00
committed by Raphael Coeffic
parent 934f4dadb9
commit 7cccb0e76e
2 changed files with 11 additions and 0 deletions
@@ -118,6 +118,16 @@ void convertBinRadioData(const char * path, int version)
error = convertBinModelData(filename, model_version);
++model_it;
if (error) {
TRACE("ERROR converting '%s': %s", filename, error);
category_ptr->removeModel(model_ptr);
} else {
PartialModel partial;
memclear(&partial, sizeof(PartialModel));
readModelYaml(filename, reinterpret_cast<uint8_t*>(&partial), sizeof(partial));
model_ptr->setModelName(partial.header.name);
}
} else {
TRACE("ERROR reading '%s': %s", filename, error);
+1
View File
@@ -23,3 +23,4 @@
const char * loadRadioSettingsYaml();
const char * writeModelYaml(const char* filename);
const char * readModelYaml(const char * filename, uint8_t * buffer, uint32_t size);