Merge pull request #1 from rejoe2/MI-HW-detection

MI model detection
This commit is contained in:
rejoe2 2023-08-30 14:50:37 +02:00 committed by GitHub
commit abf084fa6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 81 additions and 15 deletions

View file

@ -210,8 +210,13 @@ class Inverter {
enqueCommand<InfoCommand>(InverterDevInform_Simple); // hardware version
enqueCommand<InfoCommand>(RealTimeRunData_Debug); // live data
} else if (ivGen == IV_MI){
if (getFwVersion() == 0)
enqueCommand<InfoCommand>(InverterDevInform_All); // firmware version; might not work, esp. for 1/2 ch hardware
if (getFwVersion() == 0) {
enqueCommand<InfoCommand>(InverterDevInform_All); // hard- and firmware version
} else {
record_t<> *rec = getRecordStruct(InverterDevInform_Simple);
if (getChannelFieldValue(CH0, FLD_PART_NUM, rec) == 0)
enqueCommand<InfoCommand>(InverterDevInform_All); // hard- and firmware version for missing HW part nr, delivered by frame 1
}
if (type == INV_TYPE_4CH) {
enqueCommand<InfoCommand>(0x36);
} else {
@ -334,6 +339,9 @@ class Inverter {
DPRINT(DBG_INFO, "alarm ID incremented to ");
DBGPRINTLN(String(alarmMesIndex));
enqueCommand<InfoCommand>(AlarmData);
// ivSendHighPrio(id);
// if(mHighPrioIv == NULL) // process the request immediately if possible
// mHighPrioIv = iv;
}
}
}