takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LoRaWANTimer_stub.cpp Source File

LoRaWANTimer_stub.cpp

00001 /*
00002  * Copyright (c) , Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #include "mbed_assert.h"
00019 #include "LoRaWANTimer.h"
00020 
00021 #include "LoRaWANTimer_stub.h"
00022 
00023 lorawan_time_t LoRaWANTimer_stub::time_value = 0;
00024 bool LoRaWANTimer_stub::call_cb_immediately = false;
00025 
00026 LoRaWANTimeHandler::LoRaWANTimeHandler()
00027     : _queue(NULL)
00028 {
00029 }
00030 
00031 LoRaWANTimeHandler::~LoRaWANTimeHandler()
00032 {
00033 }
00034 
00035 void LoRaWANTimeHandler::activate_timer_subsystem(events::EventQueue *queue)
00036 {
00037 }
00038 
00039 lorawan_time_t LoRaWANTimeHandler::get_current_time( void )
00040 {
00041     return LoRaWANTimer_stub::time_value;
00042 }
00043 
00044 lorawan_time_t LoRaWANTimeHandler::get_elapsed_time(lorawan_time_t saved_time)
00045 {
00046     return LoRaWANTimer_stub::time_value;
00047 }
00048 
00049 void LoRaWANTimeHandler::init(timer_event_t &obj, mbed::Callback<void()> callback)
00050 {
00051     if (callback && LoRaWANTimer_stub::call_cb_immediately) {
00052         callback();
00053     }
00054     obj.timer_id = 1;
00055 }
00056 
00057 void LoRaWANTimeHandler::start(timer_event_t &obj, const uint32_t timeout)
00058 {
00059 }
00060 
00061 void LoRaWANTimeHandler::stop(timer_event_t &obj)
00062 {
00063     obj.timer_id = 0;
00064 }