fix payload of DevStatusAns mac-command
Lorawan specs say (e.g. 1.0.4 or 1.1), that the first byte is the battery-level and the second byte is the margin.
This commit is contained in:
parent
e121f963dc
commit
f2e1b547d5
1 changed files with 2 additions and 2 deletions
|
@ -2386,9 +2386,9 @@ bool LoRaWANNode::execMacCommand(LoRaWANMacCommand_t* cmd) {
|
|||
// set the uplink reply
|
||||
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("DevStatusReq");
|
||||
cmd->len = 2;
|
||||
cmd->payload[1] = this->battLevel;
|
||||
cmd->payload[0] = this->battLevel;
|
||||
int8_t snr = this->phyLayer->getSNR();
|
||||
cmd->payload[0] = snr & 0x3F;
|
||||
cmd->payload[1] = snr & 0x3F;
|
||||
|
||||
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("DevStatusAns: status = 0x%02x%02x", cmd->payload[0], cmd->payload[1]);
|
||||
return(true);
|
||||
|
|
Loading…
Add table
Reference in a new issue