leo hendrickson / Mbed OS example-Ethernet-mbed-Cloud-connect
Committer:
leothedragon
Date:
Tue May 04 08:55:12 2021 +0000
Revision:
0:8f0bb79ddd48
nmn

Who changed what in which revision?

UserRevisionLine numberNew contents of line
leothedragon 0:8f0bb79ddd48 1 /*
leothedragon 0:8f0bb79ddd48 2 * Copyright (c) 2015 ARM Limited. All rights reserved.
leothedragon 0:8f0bb79ddd48 3 * SPDX-License-Identifier: Apache-2.0
leothedragon 0:8f0bb79ddd48 4 * Licensed under the Apache License, Version 2.0 (the License); you may
leothedragon 0:8f0bb79ddd48 5 * not use this file except in compliance with the License.
leothedragon 0:8f0bb79ddd48 6 * You may obtain a copy of the License at
leothedragon 0:8f0bb79ddd48 7 *
leothedragon 0:8f0bb79ddd48 8 * http://www.apache.org/licenses/LICENSE-2.0
leothedragon 0:8f0bb79ddd48 9 *
leothedragon 0:8f0bb79ddd48 10 * Unless required by applicable law or agreed to in writing, software
leothedragon 0:8f0bb79ddd48 11 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
leothedragon 0:8f0bb79ddd48 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
leothedragon 0:8f0bb79ddd48 13 * See the License for the specific language governing permissions and
leothedragon 0:8f0bb79ddd48 14 * limitations under the License.
leothedragon 0:8f0bb79ddd48 15 */
leothedragon 0:8f0bb79ddd48 16 #include "mbed-client/m2mtimer.h"
leothedragon 0:8f0bb79ddd48 17 #include "mbed-client/m2mtimerobserver.h"
leothedragon 0:8f0bb79ddd48 18 #include "mbed-client-classic/m2mtimerpimpl.h"
leothedragon 0:8f0bb79ddd48 19
leothedragon 0:8f0bb79ddd48 20
leothedragon 0:8f0bb79ddd48 21 M2MTimer::M2MTimer(M2MTimerObserver& observer)
leothedragon 0:8f0bb79ddd48 22 : _observer(observer)
leothedragon 0:8f0bb79ddd48 23 {
leothedragon 0:8f0bb79ddd48 24 _private_impl = new M2MTimerPimpl(observer);
leothedragon 0:8f0bb79ddd48 25 }
leothedragon 0:8f0bb79ddd48 26
leothedragon 0:8f0bb79ddd48 27 M2MTimer::~M2MTimer()
leothedragon 0:8f0bb79ddd48 28 {
leothedragon 0:8f0bb79ddd48 29 delete _private_impl;
leothedragon 0:8f0bb79ddd48 30 //_private_impl = NULL;
leothedragon 0:8f0bb79ddd48 31 }
leothedragon 0:8f0bb79ddd48 32
leothedragon 0:8f0bb79ddd48 33 void M2MTimer::start_timer( uint64_t interval,
leothedragon 0:8f0bb79ddd48 34 M2MTimerObserver::Type type,
leothedragon 0:8f0bb79ddd48 35 bool single_shot)
leothedragon 0:8f0bb79ddd48 36 {
leothedragon 0:8f0bb79ddd48 37 _private_impl->start_timer(interval,
leothedragon 0:8f0bb79ddd48 38 type,
leothedragon 0:8f0bb79ddd48 39 single_shot);
leothedragon 0:8f0bb79ddd48 40 }
leothedragon 0:8f0bb79ddd48 41
leothedragon 0:8f0bb79ddd48 42 void M2MTimer::start_dtls_timer(uint64_t intermediate_interval, uint64_t total_interval, M2MTimerObserver::Type type){
leothedragon 0:8f0bb79ddd48 43 _private_impl->start_dtls_timer(intermediate_interval, total_interval, type);
leothedragon 0:8f0bb79ddd48 44 }
leothedragon 0:8f0bb79ddd48 45
leothedragon 0:8f0bb79ddd48 46 void M2MTimer::stop_timer()
leothedragon 0:8f0bb79ddd48 47 {
leothedragon 0:8f0bb79ddd48 48 _private_impl->stop_timer();
leothedragon 0:8f0bb79ddd48 49 }
leothedragon 0:8f0bb79ddd48 50
leothedragon 0:8f0bb79ddd48 51 bool M2MTimer::is_intermediate_interval_passed(){
leothedragon 0:8f0bb79ddd48 52 return _private_impl->is_intermediate_interval_passed();
leothedragon 0:8f0bb79ddd48 53 }
leothedragon 0:8f0bb79ddd48 54
leothedragon 0:8f0bb79ddd48 55 bool M2MTimer::is_total_interval_passed(){
leothedragon 0:8f0bb79ddd48 56 return _private_impl->is_total_interval_passed();
leothedragon 0:8f0bb79ddd48 57 }