Fix: Filter incoming packages from CMT module for the right destination address
The CMT module receives every package on it's target frequency. Compared to the NRF module to filtering takes place. Therefor it's required to check if the package destination id is really the id of our dtu
This commit is contained in:
parent
e7198073af
commit
8f2a2b40b1
@ -121,6 +121,13 @@ void HoymilesRadio_CMT::loop()
|
|||||||
if (!_rxBuffer.empty()) {
|
if (!_rxBuffer.empty()) {
|
||||||
fragment_t f = _rxBuffer.back();
|
fragment_t f = _rxBuffer.back();
|
||||||
if (checkFragmentCrc(&f)) {
|
if (checkFragmentCrc(&f)) {
|
||||||
|
|
||||||
|
serial_u dtuId = convertSerialToRadioId(_dtuSerial);
|
||||||
|
|
||||||
|
// The CMT RF module does not filter foreign packages by itself.
|
||||||
|
// Has to be done manually here.
|
||||||
|
if (memcmp(&f.fragment[5], &dtuId.b[1], 4) == 0) {
|
||||||
|
|
||||||
std::shared_ptr<InverterAbstract> inv = Hoymiles.getInverterByFragment(&f);
|
std::shared_ptr<InverterAbstract> inv = Hoymiles.getInverterByFragment(&f);
|
||||||
|
|
||||||
if (nullptr != inv) {
|
if (nullptr != inv) {
|
||||||
@ -133,6 +140,7 @@ void HoymilesRadio_CMT::loop()
|
|||||||
} else {
|
} else {
|
||||||
Hoymiles.getMessageOutput()->println("Inverter Not found!");
|
Hoymiles.getMessageOutput()->println("Inverter Not found!");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Hoymiles.getMessageOutput()->println("Frame kaputt"); // ;-)
|
Hoymiles.getMessageOutput()->println("Frame kaputt"); // ;-)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user