Dependencies:   MMA7660 LM75B

Committer:
MACRUM
Date:
Sat Jun 30 01:40:30 2018 +0000
Revision:
0:119624335925
Initial commit

Who changed what in which revision?

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