Demo using MBED TLS

Dependencies:   EthernetInterface NTPClient iothub_amqp_transport iothub_client mbed-rtos mbed

Fork of iothub_client_sample_amqp by Azure IoT

Committer:
markrad
Date:
Thu Jan 05 00:20:03 2017 +0000
Revision:
58:f50b97b08851
Sample using MBED TLS

Who changed what in which revision?

UserRevisionLine numberNew contents of line
markrad 58:f50b97b08851 1 // Copyright (c) Microsoft. All rights reserved.
markrad 58:f50b97b08851 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
markrad 58:f50b97b08851 3
markrad 58:f50b97b08851 4 #include "azure_c_shared_utility/agenttime.h"
markrad 58:f50b97b08851 5
markrad 58:f50b97b08851 6 // mbed version of gmtime() returns NULL.
markrad 58:f50b97b08851 7 // system RTC should be set to UTC as its localtime
markrad 58:f50b97b08851 8
markrad 58:f50b97b08851 9 time_t get_time(time_t* currentTime)
markrad 58:f50b97b08851 10 {
markrad 58:f50b97b08851 11 return time(currentTime);
markrad 58:f50b97b08851 12 }
markrad 58:f50b97b08851 13
markrad 58:f50b97b08851 14 double get_difftime(time_t stopTime, time_t startTime)
markrad 58:f50b97b08851 15 {
markrad 58:f50b97b08851 16 return difftime(stopTime, startTime);
markrad 58:f50b97b08851 17 }
markrad 58:f50b97b08851 18
markrad 58:f50b97b08851 19
markrad 58:f50b97b08851 20 struct tm* get_gmtime(time_t* currentTime)
markrad 58:f50b97b08851 21 {
markrad 58:f50b97b08851 22 return localtime(currentTime);
markrad 58:f50b97b08851 23 }
markrad 58:f50b97b08851 24
markrad 58:f50b97b08851 25 char* get_ctime(time_t* timeToGet)
markrad 58:f50b97b08851 26 {
markrad 58:f50b97b08851 27 return ctime(timeToGet);
markrad 58:f50b97b08851 28 }