Simulated product dispenser

Dependencies:   HTS221

Fork of mbed-cloud-workshop-connect-HTS221 by Jim Carver

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers m2mtimer.cpp Source File

m2mtimer.cpp

00001 /*
00002  * Copyright (c) 2015 ARM Limited. All rights reserved.
00003  * SPDX-License-Identifier: Apache-2.0
00004  * Licensed under the Apache License, Version 2.0 (the License); you may
00005  * not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
00012  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #include "mbed-client/m2mtimer.h"
00017 #include "mbed-client/m2mtimerobserver.h"
00018 #include "mbed-client-classic/m2mtimerpimpl.h"
00019 
00020 
00021 M2MTimer::M2MTimer(M2MTimerObserver& observer)
00022 : _observer(observer)
00023 {
00024     _private_impl = new M2MTimerPimpl(observer);
00025 }
00026 
00027 M2MTimer::~M2MTimer()
00028 {
00029     delete _private_impl;
00030     //_private_impl = NULL;
00031 }
00032 
00033 void M2MTimer::start_timer( uint64_t interval,
00034                             M2MTimerObserver::Type type,
00035                             bool single_shot)
00036 {
00037     _private_impl->start_timer(interval,
00038                                type,
00039                                single_shot);
00040 }
00041 
00042 void M2MTimer::start_dtls_timer(uint64_t intermediate_interval, uint64_t total_interval, M2MTimerObserver::Type type){
00043     _private_impl->start_dtls_timer(intermediate_interval, total_interval, type);
00044 }
00045 
00046 void M2MTimer::stop_timer()
00047 {
00048     _private_impl->stop_timer();
00049 }
00050 
00051 bool M2MTimer::is_intermediate_interval_passed(){
00052     return _private_impl->is_intermediate_interval_passed();
00053 }
00054 
00055 bool M2MTimer::is_total_interval_passed(){
00056     return _private_impl->is_total_interval_passed();
00057 }