Preliminary main mbed library for nexpaq development

Committer:
nexpaq
Date:
Fri Nov 04 20:54:50 2016 +0000
Revision:
1:d96dbedaebdb
Parent:
0:6c56fb4bc5f0
Removed extra directories for other platforms

Who changed what in which revision?

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