MI - request missing parts

seems to basically work
This commit is contained in:
rejoe2 2023-03-05 10:50:19 +01:00 committed by GitHub
parent a5fb9cce17
commit 7add54bf2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 209 additions and 133 deletions

View file

@ -90,6 +90,13 @@ class InfoCommand : public CommandAbstract {
}
};
class MiInfoCommand : public CommandAbstract {
public:
MiInfoCommand(uint8_t cmd){
_TxType = cmd;
_Cmd = cmd;
}
};
// list of all available functions, mapped in hmDefines.h
template<class T=float>
const calcFunc_t<T> calcFunctions[] = {
@ -163,9 +170,26 @@ class Inverter {
uint8_t getQueuedCmd() {
if (_commandQueue.empty()) {
if (getFwVersion() == 0)
enqueCommand<InfoCommand>(InverterDevInform_All); // firmware version
enqueCommand<InfoCommand>(RealTimeRunData_Debug); // live data
if (ivGen != IV_MI) {
if (getFwVersion() == 0)
enqueCommand<InfoCommand>(InverterDevInform_All); // firmware version
enqueCommand<InfoCommand>(RealTimeRunData_Debug); // live data
} else if (ivGen == IV_MI){
if (type == INV_TYPE_4CH) {
enqueCommand<MiInfoCommand>(0x36);
/*for(uint8_t i = 0x36; i <= 0x39; i++) {
enqueCommand<MiInfoCommand>(i); // live data
}*/
} else if (type == INV_TYPE_2CH) {
enqueCommand<InfoCommand>(0x09);
//enqueCommand<MiInfoCommand>(0x11);
} else if (type == INV_TYPE_1CH) {
enqueCommand<MiInfoCommand>(0x09);
}
//if (getFwVersion() == 0)
// enqueCommand<MiInfoCommand>(InverterDevInform_All); // firmware version, might not work, esp. for 1/2 ch hardware
}
if ((actPowerLimit == 0xffff) && isConnected)
enqueCommand<InfoCommand>(SystemConfigPara); // power limit info
}