Browse Source

0.7.62

* fix communication to inverters #1198
pull/1219/head
lumapu 1 year ago
parent
commit
dae638f7c6
  1. 3
      src/CHANGES.md
  2. 2
      src/app.cpp
  3. 9
      src/app.h
  4. 2
      src/appInterface.h
  5. 2
      src/defines.h
  6. 2
      src/hm/hmRadio.h
  7. 14
      src/hm/radio.h
  8. 2
      src/hms/hmsRadio.h

3
src/CHANGES.md

@ -1,5 +1,8 @@
# Development Changes
## 0.7.62 - 2023-10-01
* fix communication to inverters #1198
## 0.7.61 - 2023-10-01
* merged `hmPayload` and `hmsPayload` into single class
* merged generic radio functions into new parent class `radio.h`

2
src/app.cpp

@ -394,9 +394,9 @@ void app::tickSend(void) {
if(mConfig->nrf.enabled) {
if(!mNrfRadio.isChipConnected()) {
DPRINTLN(DBG_WARN, F("NRF24 not connected!"));
return;
}
}
if (mIVCommunicationOn) {
if (!mNrfRadio.mBufCtrl.empty()) {
if (mConfig->serial.debug) {

9
src/app.h

@ -80,6 +80,7 @@ class app : public IApp, public ah::Scheduler {
#endif
}
}
#ifdef ESP32
void handleHmsIntr(void) {
mCmtRadio.handleIntr();
@ -125,14 +126,6 @@ class app : public IApp, public ah::Scheduler {
return mSaveReboot;
}
statistics_t *getNrfStatistics() {
return &mNrfStat;
}
statistics_t *getCmtStatistics() {
return &mCmtStat;
}
#if !defined(ETHERNET)
void scanAvailNetworks() {
mWifi.scanAvailNetworks();

2
src/appInterface.h

@ -32,8 +32,6 @@ class IApp {
virtual bool getShouldReboot() = 0;
virtual void setRebootFlag() = 0;
virtual const char *getVersion() = 0;
virtual statistics_t *getNrfStatistics() = 0;
virtual statistics_t *getCmtStatistics() = 0;
#if !defined(ETHERNET)
virtual void scanAvailNetworks() = 0;

2
src/defines.h

@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 7
#define VERSION_PATCH 61
#define VERSION_PATCH 62
//-------------------------------------
typedef struct {

2
src/hm/hmRadio.h

@ -232,7 +232,7 @@ class HmRadio : public Radio {
}
void sendPacket(Inverter<> *iv, uint8_t len, bool isRetransmit, bool appendCrc16=true) {
updateCrcs(len, appendCrc16);
updateCrcs(&len, appendCrc16);
// set TX and RX channels
mTxChIdx = (mTxChIdx + 1) % RF_CHANNELS;

14
src/hm/radio.h

@ -64,17 +64,17 @@ class Radio {
memset(&mTxBuf[10], 0x00, (MAX_RF_PAYLOAD_SIZE-10));
}
void updateCrcs(uint8_t len, bool appendCrc16=true) {
void updateCrcs(uint8_t *len, bool appendCrc16=true) {
// append crc's
if (appendCrc16 && (len > 10)) {
if (appendCrc16 && (*len > 10)) {
// crc control data
uint16_t crc = ah::crc16(&mTxBuf[10], len - 10);
mTxBuf[len++] = (crc >> 8) & 0xff;
mTxBuf[len++] = (crc ) & 0xff;
uint16_t crc = ah::crc16(&mTxBuf[10], *len - 10);
mTxBuf[(*len)++] = (crc >> 8) & 0xff;
mTxBuf[(*len)++] = (crc ) & 0xff;
}
// crc over all
mTxBuf[len] = ah::crc8(mTxBuf, len);
len++;
mTxBuf[*len] = ah::crc8(mTxBuf, *len);
(*len)++;
}
void generateDtuSn(void) {

2
src/hms/hmsRadio.h

@ -82,7 +82,7 @@ class CmtRadio : public Radio {
private:
void sendPacket(Inverter<> *iv, uint8_t len, bool isRetransmit, bool appendCrc16=true) {
updateCrcs(len, appendCrc16);
updateCrcs(&len, appendCrc16);
if(mSerialDebug) {
DPRINT(DBG_INFO, F("TX "));

Loading…
Cancel
Save