fix error in downlink handling
This commit is contained in:
@ -156,15 +156,15 @@ void downLinkDataHandle(McpsIndication_t *mcpsIndication)
|
||||
for (uint8_t i = 0; i < NUM_OF_SENSORS; i++) {
|
||||
bool found = false;
|
||||
for (uint8_t j = 0; j < NUM_OF_SENSORS; j++) {
|
||||
if (sensors[i].addr == downlinkSensors[i].addr) {
|
||||
if (sensors[i].addr == downlinkSensors[j].addr) {
|
||||
found = true;
|
||||
sensors[i].index = downlinkSensors[i].index;
|
||||
memcpy(sensors[i].label, downlinkSensors[i].label, LABEL_LENGTH);
|
||||
sensors[i].index = downlinkSensors[j].index;
|
||||
memcpy(sensors[i].label, downlinkSensors[j].label, LABEL_LENGTH);
|
||||
sensors[i].label[LABEL_LENGTH] = 0;
|
||||
}
|
||||
}
|
||||
if (! found) {
|
||||
Serial.printf("Illegal label received for not existing %08x\n\r", downlinkSensors[i].addr);
|
||||
Serial.printf("Illegal label received for not existing %016llx\n\r", downlinkSensors[i].addr);
|
||||
errorCode |= ERR_ILLEGAL_DOWNLINK_MESSAGE_RECEIVED;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user