diff --git a/UNITTESTS/stubs/LoRaMac_stub.cpp b/UNITTESTS/stubs/LoRaMac_stub.cpp index 9bc4578f53..33c7881c9f 100644 --- a/UNITTESTS/stubs/LoRaMac_stub.cpp +++ b/UNITTESTS/stubs/LoRaMac_stub.cpp @@ -37,6 +37,7 @@ loramac_mlme_indication_t *LoRaMac_stub::mlme_ind_ptr = NULL; device_class_t LoRaMac_stub::dev_class_value = CLASS_A; mbed::Callback LoRaMac_stub::_scheduling_failure_handler = NULL; LoRaWANTimeHandler *LoRaMac_stub::time_handler_ptr = NULL; +lorawan_gps_time_t LoRaMac_stub::gps_time_value = 0; LoRaMac::LoRaMac() : _lora_time(), @@ -510,12 +511,11 @@ lorawan_status_t LoRaMac::rejoin(join_req_type_t rejoin_type, bool is_forced, ui lorawan_gps_time_t LoRaMac::get_gps_time(void) { - return _lora_time.get_gps_time(); + return LoRaMac_stub::gps_time_value; } void LoRaMac::set_gps_time(lorawan_gps_time_t gps_time) { - _lora_time.set_gps_time(gps_time); } lorawan_status_t LoRaMac::add_ping_slot_info_req() diff --git a/UNITTESTS/stubs/LoRaMac_stub.h b/UNITTESTS/stubs/LoRaMac_stub.h index 3785718e24..f645882eed 100644 --- a/UNITTESTS/stubs/LoRaMac_stub.h +++ b/UNITTESTS/stubs/LoRaMac_stub.h @@ -38,4 +38,5 @@ extern loramac_mlme_indication_t *mlme_ind_ptr; extern device_class_t dev_class_value; extern mbed::Callback _scheduling_failure_handler; extern LoRaWANTimeHandler *time_handler_ptr; +extern lorawan_gps_time_t gps_time_value; } diff --git a/UNITTESTS/stubs/LoRaWANStack_stub.cpp b/UNITTESTS/stubs/LoRaWANStack_stub.cpp index 8815baaf14..f626a70f28 100644 --- a/UNITTESTS/stubs/LoRaWANStack_stub.cpp +++ b/UNITTESTS/stubs/LoRaWANStack_stub.cpp @@ -19,10 +19,13 @@ #include #include "LoRaWANStack.h" +#include "LoRaWANStack_stub.h" using namespace mbed; using namespace events; +lorawan_gps_time_t LoRaWANStack_stub::gps_time_value = 0; + /***************************************************************************** * Constructor * ****************************************************************************/ @@ -312,12 +315,11 @@ void LoRaWANStack::remove_device_time_request(void) lorawan_gps_time_t LoRaWANStack::get_current_gps_time() { - return _loramac.get_gps_time(); + return LoRaWANStack_stub::gps_time_value; } void LoRaWANStack::set_current_gps_time(lorawan_gps_time_t gps_time) { - _loramac.set_gps_time(gps_time); } lorawan_status_t LoRaWANStack::add_ping_slot_info_request(uint8_t periodicity) diff --git a/UNITTESTS/stubs/LoRaWANStack_stub.h b/UNITTESTS/stubs/LoRaWANStack_stub.h new file mode 100644 index 0000000000..3815d790f9 --- /dev/null +++ b/UNITTESTS/stubs/LoRaWANStack_stub.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) , Arm Limited and affiliates. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +namespace LoRaWANStack_stub { +extern lorawan_gps_time_t gps_time_value; +} \ No newline at end of file