This is a fork due to permission issues
Dependencies: mbed Socket lwip-eth lwip-sys lwip
Fork of 6_songs-from-the-cloud by
mbed-client/mbed-client-classic/source/m2mtimer.cpp@1:0ddbe2d3319c, 2016-05-19 (annotated)
- Committer:
- timbeight
- Date:
- Thu May 19 16:02:10 2016 +0000
- Revision:
- 1:0ddbe2d3319c
- Parent:
- 0:f7c60d3e7b8a
This is my first commit while in the class.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
maclobdell | 0:f7c60d3e7b8a | 1 | /* |
maclobdell | 0:f7c60d3e7b8a | 2 | * Copyright (c) 2015 ARM Limited. All rights reserved. |
maclobdell | 0:f7c60d3e7b8a | 3 | * SPDX-License-Identifier: Apache-2.0 |
maclobdell | 0:f7c60d3e7b8a | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
maclobdell | 0:f7c60d3e7b8a | 5 | * not use this file except in compliance with the License. |
maclobdell | 0:f7c60d3e7b8a | 6 | * You may obtain a copy of the License at |
maclobdell | 0:f7c60d3e7b8a | 7 | * |
maclobdell | 0:f7c60d3e7b8a | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
maclobdell | 0:f7c60d3e7b8a | 9 | * |
maclobdell | 0:f7c60d3e7b8a | 10 | * Unless required by applicable law or agreed to in writing, software |
maclobdell | 0:f7c60d3e7b8a | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
maclobdell | 0:f7c60d3e7b8a | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
maclobdell | 0:f7c60d3e7b8a | 13 | * See the License for the specific language governing permissions and |
maclobdell | 0:f7c60d3e7b8a | 14 | * limitations under the License. |
maclobdell | 0:f7c60d3e7b8a | 15 | */ |
maclobdell | 0:f7c60d3e7b8a | 16 | #include "mbed-client/m2mtimer.h" |
maclobdell | 0:f7c60d3e7b8a | 17 | #include "mbed-client/m2mtimerobserver.h" |
maclobdell | 0:f7c60d3e7b8a | 18 | #include "mbed-client-classic/m2mtimerpimpl.h" |
maclobdell | 0:f7c60d3e7b8a | 19 | |
maclobdell | 0:f7c60d3e7b8a | 20 | |
maclobdell | 0:f7c60d3e7b8a | 21 | M2MTimer::M2MTimer(M2MTimerObserver& observer) |
maclobdell | 0:f7c60d3e7b8a | 22 | : _observer(observer) |
maclobdell | 0:f7c60d3e7b8a | 23 | { |
maclobdell | 0:f7c60d3e7b8a | 24 | _private_impl = new M2MTimerPimpl(observer); |
maclobdell | 0:f7c60d3e7b8a | 25 | } |
maclobdell | 0:f7c60d3e7b8a | 26 | |
maclobdell | 0:f7c60d3e7b8a | 27 | M2MTimer::~M2MTimer() |
maclobdell | 0:f7c60d3e7b8a | 28 | { |
maclobdell | 0:f7c60d3e7b8a | 29 | delete _private_impl; |
maclobdell | 0:f7c60d3e7b8a | 30 | _private_impl = NULL; |
maclobdell | 0:f7c60d3e7b8a | 31 | } |
maclobdell | 0:f7c60d3e7b8a | 32 | |
maclobdell | 0:f7c60d3e7b8a | 33 | void M2MTimer::start_timer( uint64_t interval, |
maclobdell | 0:f7c60d3e7b8a | 34 | M2MTimerObserver::Type type, |
maclobdell | 0:f7c60d3e7b8a | 35 | bool single_shot) |
maclobdell | 0:f7c60d3e7b8a | 36 | { |
maclobdell | 0:f7c60d3e7b8a | 37 | _private_impl->start_timer(interval, |
maclobdell | 0:f7c60d3e7b8a | 38 | type, |
maclobdell | 0:f7c60d3e7b8a | 39 | single_shot); |
maclobdell | 0:f7c60d3e7b8a | 40 | } |
maclobdell | 0:f7c60d3e7b8a | 41 | |
maclobdell | 0:f7c60d3e7b8a | 42 | void M2MTimer::start_dtls_timer(uint64_t intermediate_interval, uint64_t total_interval, M2MTimerObserver::Type type){ |
maclobdell | 0:f7c60d3e7b8a | 43 | _private_impl->start_dtls_timer(intermediate_interval, total_interval, type); |
maclobdell | 0:f7c60d3e7b8a | 44 | } |
maclobdell | 0:f7c60d3e7b8a | 45 | |
maclobdell | 0:f7c60d3e7b8a | 46 | void M2MTimer::stop_timer() |
maclobdell | 0:f7c60d3e7b8a | 47 | { |
maclobdell | 0:f7c60d3e7b8a | 48 | _private_impl->stop_timer(); |
maclobdell | 0:f7c60d3e7b8a | 49 | } |
maclobdell | 0:f7c60d3e7b8a | 50 | |
maclobdell | 0:f7c60d3e7b8a | 51 | bool M2MTimer::is_intermediate_interval_passed(){ |
maclobdell | 0:f7c60d3e7b8a | 52 | return _private_impl->is_intermediate_interval_passed(); |
maclobdell | 0:f7c60d3e7b8a | 53 | } |
maclobdell | 0:f7c60d3e7b8a | 54 | |
maclobdell | 0:f7c60d3e7b8a | 55 | bool M2MTimer::is_total_interval_passed(){ |
maclobdell | 0:f7c60d3e7b8a | 56 | return _private_impl->is_total_interval_passed(); |
maclobdell | 0:f7c60d3e7b8a | 57 | } |