mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-22 21:36:11 +02:00
HW info triggers next request
immediate request prod. data if HW info was received
This commit is contained in:
parent
f9857b52ab
commit
3105cd4380
3 changed files with 11 additions and 2 deletions
|
@ -339,6 +339,9 @@ class Inverter {
|
||||||
DPRINT(DBG_INFO, "alarm ID incremented to ");
|
DPRINT(DBG_INFO, "alarm ID incremented to ");
|
||||||
DBGPRINTLN(String(alarmMesIndex));
|
DBGPRINTLN(String(alarmMesIndex));
|
||||||
enqueCommand<InfoCommand>(AlarmData);
|
enqueCommand<InfoCommand>(AlarmData);
|
||||||
|
// ivSendHighPrio(id);
|
||||||
|
// if(mHighPrioIv == NULL) // process the request immediately if possible
|
||||||
|
// mHighPrioIv = iv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -338,6 +338,9 @@ class HmPayload {
|
||||||
yield();
|
yield();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if( (InverterDevInform_All == mPayload[iv->id].txCmd) && (mHighPrioIv == NULL) ) // process next request immediately if possible
|
||||||
|
mHighPrioIv = iv;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
DPRINT(DBG_ERROR, F("plausibility check failed, expected "));
|
DPRINT(DBG_ERROR, F("plausibility check failed, expected "));
|
||||||
DBGPRINT(String(rec->pyldLen));
|
DBGPRINT(String(rec->pyldLen));
|
||||||
|
|
|
@ -193,6 +193,8 @@ class MiPayload {
|
||||||
record_t<> *rec = iv->getRecordStruct(InverterDevInform_All); // choose the record structure
|
record_t<> *rec = iv->getRecordStruct(InverterDevInform_All); // choose the record structure
|
||||||
rec->ts = mPayload[iv->id].ts;
|
rec->ts = mPayload[iv->id].ts;
|
||||||
mPayload[iv->id].gotFragment = true;
|
mPayload[iv->id].gotFragment = true;
|
||||||
|
if(mHighPrioIv == NULL) // process next request immediately if possible
|
||||||
|
mHighPrioIv = iv;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Polling the device software and hardware version number command
|
Polling the device software and hardware version number command
|
||||||
|
@ -244,7 +246,7 @@ const byteAssign_t InfoAssignment[] = {
|
||||||
record_t<> *rec = iv->getRecordStruct(InverterDevInform_Simple); // choose the record structure
|
record_t<> *rec = iv->getRecordStruct(InverterDevInform_Simple); // choose the record structure
|
||||||
rec->ts = mPayload[iv->id].ts;
|
rec->ts = mPayload[iv->id].ts;
|
||||||
iv->setValue(1, rec, (uint32_t) ((p->packet[24] << 8) + p->packet[25])/1);
|
iv->setValue(1, rec, (uint32_t) ((p->packet[24] << 8) + p->packet[25])/1);
|
||||||
notify(InverterDevInform_All, iv);
|
//notify(InverterDevInform_All, iv);
|
||||||
//28737
|
//28737
|
||||||
} else if ( p->packet[9] == 0x01 || p->packet[9] == 0x10 ) {//second frame for MI, 3rd gen. answers in 0x10
|
} else if ( p->packet[9] == 0x01 || p->packet[9] == 0x10 ) {//second frame for MI, 3rd gen. answers in 0x10
|
||||||
DPRINT_IVID(DBG_INFO, iv->id);
|
DPRINT_IVID(DBG_INFO, iv->id);
|
||||||
|
@ -278,7 +280,8 @@ const byteAssign_t InfoAssignment[] = {
|
||||||
DPRINT(DBG_INFO,F("Matching_APPFW_PN "));
|
DPRINT(DBG_INFO,F("Matching_APPFW_PN "));
|
||||||
DBGPRINTLN(String((uint32_t) (((p->packet[22] << 8) | p->packet[23]) << 8 | p->packet[24]) << 8 | p->packet[25]));
|
DBGPRINTLN(String((uint32_t) (((p->packet[22] << 8) | p->packet[23]) << 8 | p->packet[24]) << 8 | p->packet[25]));
|
||||||
}
|
}
|
||||||
notify(InverterDevInform_Simple, iv);
|
//notify(InverterDevInform_Simple, iv);
|
||||||
|
notify(InverterDevInform_All, iv);
|
||||||
} else {
|
} else {
|
||||||
DBGPRINTLN(F("3rd gen. inverter!")); // see table in OpenDTU code, DevInfoParser.cpp devInfo[]
|
DBGPRINTLN(F("3rd gen. inverter!")); // see table in OpenDTU code, DevInfoParser.cpp devInfo[]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue