Browse Source

Merge branch 'new_communication' into new_communication_mi

pull/1219/head^2
rejoe2 12 months ago
committed by GitHub
parent
commit
c8a5de2151
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      src/app.cpp
  2. 1
      src/hm/Communication.h
  3. 6
      src/hms/hmsRadio.h

20
src/app.cpp

@ -413,13 +413,15 @@ void app::tickSend(void) {
for (uint8_t i = 0; i < MAX_NUM_INVERTERS; i++) {
Inverter<> *iv = mSys.getInverterByPos(i);
if(NULL != iv) {
iv->tickSend([this, iv](uint8_t cmd, bool isDevControl) {
if(isDevControl)
mCommunication.addImportant(iv, cmd);
else
mCommunication.add(iv, cmd);
});
};
if(iv->config->enabled) {
iv->tickSend([this, iv](uint8_t cmd, bool isDevControl) {
if(isDevControl)
mCommunication.addImportant(iv, cmd);
else
mCommunication.add(iv, cmd);
});
}
}
}
/*if(mConfig->nrf.enabled) {
@ -468,9 +470,9 @@ void app::tickSend(void) {
if (mConfig->serial.debug)
DPRINTLN(DBG_WARN, F("Time not set or it is night time, therefore no communication to the inverter!"));
}
yield();
yield();*/
updateLed();*/
updateLed();
}
//-----------------------------------------------------------------------------

1
src/hm/Communication.h

@ -416,6 +416,7 @@ class Communication : public CommQueue<> {
{ FLD_BOOTLOADER_VER, UNIT_NONE, CH0, 8, 2, 1 }
};
*/
if ( p->packet[9] == 0x00 ) {//first frame
//FLD_FW_VERSION
for (uint8_t i = 0; i < 5; i++) {

6
src/hms/hmsRadio.h

@ -44,7 +44,7 @@ class CmtRadio : public Radio {
return mCmtAvail;
}
void sendControlPacket(Inverter<> *iv, uint8_t cmd, uint16_t *data, bool isRetransmit, bool isNoMI = true, uint16_t powerMax = 0) {
void sendControlPacket(Inverter<> *iv, uint8_t cmd, uint16_t *data, bool isRetransmit) {
DPRINT(DBG_INFO, F("sendControlPacket cmd: 0x"));
DBGHEXLN(cmd);
initPacket(iv->radioId.u64, TX_REQ_DEVCONTROL, SINGLE_FRAME);
@ -101,6 +101,10 @@ class CmtRadio : public Radio {
return iv->radioId.u64;
}
uint8_t getIvGen(Inverter<> *iv) {
return iv->ivGen;
}
inline void reset(bool genDtuSn) {
if(genDtuSn)
generateDtuSn();

Loading…
Cancel
Save