Skip to content

Commit 90c02f2

Browse files
Kimmo VaisanenHasnain Virk
authored andcommitted
Check correct return value
mib_get_request() returns lorawan_status_t value so comparing return value to boolean is incorrect.
1 parent 7224fba commit 90c02f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

features/lorawan/LoRaWANStack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ lorawan_status_t LoRaWANStack::set_channel_data_rate(uint8_t data_rate)
467467

468468
loramac_mib_req_confirm_t mib_params;
469469
mib_params.type = MIB_ADR;
470-
if (mib_get_request(&mib_params) == true) {
470+
if (mib_get_request(&mib_params) != LORAWAN_STATUS_OK) {
471471
tr_error("Cannot set data rate. Please turn off ADR first.");
472472
return LORAWAN_STATUS_PARAMETER_INVALID;
473473
}

0 commit comments

Comments
 (0)