Browse Source
Merge branch 'new_communication' into new_communication_mi
pull/1219/head^2
rejoe2
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
17 additions and
10 deletions
-
src/app.cpp
-
src/hm/Communication.h
-
src/hms/hmsRadio.h
|
|
@ -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(); |
|
|
|
} |
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
@ -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++) { |
|
|
|
|
|
@ -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(); |
|
|
|