diff --git a/UNITTESTS/features/lorawan/loramac/Test_LoRaMac.cpp b/UNITTESTS/features/lorawan/loramac/Test_LoRaMac.cpp index 2abe1cb4e6..04f0c3b91d 100644 --- a/UNITTESTS/features/lorawan/loramac/Test_LoRaMac.cpp +++ b/UNITTESTS/features/lorawan/loramac/Test_LoRaMac.cpp @@ -77,6 +77,9 @@ TEST_F(Test_LoRaMac, initialize) conn.connection_u.otaa.nb_trials = 2; object->prepare_join(&conn, true); + channel_params_t params[] = {868300000, 0, { ((DR_5 << 4) | DR_0) }, 1}; + LoRaPHY_stub::channel_params_ptr = params; + LoRaWANTimer_stub::call_cb_immediately = true; EXPECT_TRUE(LORAWAN_STATUS_OK == object->initialize(NULL, my_cb)); } diff --git a/UNITTESTS/stubs/LoRaPHY_stub.cpp b/UNITTESTS/stubs/LoRaPHY_stub.cpp index 5c0f8f53ec..1cb6542042 100644 --- a/UNITTESTS/stubs/LoRaPHY_stub.cpp +++ b/UNITTESTS/stubs/LoRaPHY_stub.cpp @@ -416,4 +416,8 @@ uint8_t LoRaPHY::apply_DR_offset(int8_t dr, int8_t dr_offset) return LoRaPHY_stub::uint8_value; } +uint32_t LoRaPHY::get_rx_time_on_air(uint8_t modem, uint16_t pkt_len) +{ + return LoRaPHY_stub::uint32_value; +}