[Companion] Horus support started

We only have the model name of the 1st model, but that's a good start ;)
This commit is contained in:
Bertrand Songis
2016-11-20 22:49:26 +01:00
parent d42fc6c471
commit ecb5416057
4 changed files with 17 additions and 8 deletions
@@ -200,9 +200,12 @@ bool OpenTxEepromInterface::loadModelVariant(unsigned int index, ModelData & mod
bool OpenTxEepromInterface::loadModelFromByteArray(ModelData & model, const QByteArray & data)
{
OpenTxModelData modelData(model, board, 218, 0);
modelData.Import(data);
modelData.Dump();
// TODO check the 8 first bytes (fourcc + version + 'M' + size)
QByteArray raw = data.right(data.size() - 8);
OpenTxModelData modelData(model, board, 218, 0); // TODO board and 218 should be the version taken from the header
modelData.Import(raw);
modelData.Dump(); // Dumps the structure so that it's easy to check with firmware datastructs.h
model.used = true;
return true;
}