Skip to content

Commit c5e3703

Browse files
committed
Set NwkSKey after successfull sscanf
1 parent 093dadf commit c5e3703

File tree

1 file changed

+1
-2
lines changed
  • Projects/B-L072Z-LRWAN1/Applications/LoRa/AT_Slave/LoRaWAN/App/src

1 file changed

+1
-2
lines changed

Projects/B-L072Z-LRWAN1/Applications/LoRa/AT_Slave/LoRaWAN/App/src/at.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -456,13 +456,12 @@ ATEerror_t at_NwkSKey_set(const char *param)
456456
LoRaMacStatus_t status;
457457
uint8_t NwkSKey[16];
458458

459-
mib.Type = MIB_NWK_S_ENC_KEY;
460-
461459
if (sscanf_16_hhx(param, NwkSKey) != 16)
462460
{
463461
return AT_PARAM_ERROR;
464462
}
465463

464+
mib.Type = MIB_NWK_S_ENC_KEY;
466465
mib.Param.NwkSEncKey = NwkSKey;
467466
status = LoRaMacMibSetRequestConfirm(&mib);
468467
CHECK_STATUS(status);

0 commit comments

Comments
 (0)