WIP. send a large constant string twice a second, in order to test out the transport with something indicative of our required load.
Dependencies: FXOS8700CQ NTPClient azure_umqtt_c iothub_mqtt_transport mbed-rtos mbed wolfSSL Socket lwip-eth lwip-sys lwip
Fork of FXOS8700CQ_To_Azure_IoT by
azure_c_shared_utility/agenttime_mbed.c@7:0d1a0fe537dc, 2017-01-05 (annotated)
- Committer:
- julianhigginson
- Date:
- Thu Jan 05 23:40:24 2017 +0000
- Revision:
- 7:0d1a0fe537dc
- Parent:
- 3:c0556ff7b8e3
modified dummy message for minimal data transport
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
markrad | 3:c0556ff7b8e3 | 1 | // Copyright (c) Microsoft. All rights reserved. |
markrad | 3:c0556ff7b8e3 | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
markrad | 3:c0556ff7b8e3 | 3 | |
markrad | 3:c0556ff7b8e3 | 4 | #include "azure_c_shared_utility/agenttime.h" |
markrad | 3:c0556ff7b8e3 | 5 | |
markrad | 3:c0556ff7b8e3 | 6 | // mbed version of gmtime() returns NULL. |
markrad | 3:c0556ff7b8e3 | 7 | // system RTC should be set to UTC as its localtime |
markrad | 3:c0556ff7b8e3 | 8 | |
markrad | 3:c0556ff7b8e3 | 9 | time_t get_time(time_t* currentTime) |
markrad | 3:c0556ff7b8e3 | 10 | { |
markrad | 3:c0556ff7b8e3 | 11 | return time(currentTime); |
markrad | 3:c0556ff7b8e3 | 12 | } |
markrad | 3:c0556ff7b8e3 | 13 | |
markrad | 3:c0556ff7b8e3 | 14 | double get_difftime(time_t stopTime, time_t startTime) |
markrad | 3:c0556ff7b8e3 | 15 | { |
markrad | 3:c0556ff7b8e3 | 16 | return difftime(stopTime, startTime); |
markrad | 3:c0556ff7b8e3 | 17 | } |
markrad | 3:c0556ff7b8e3 | 18 | |
markrad | 3:c0556ff7b8e3 | 19 | |
markrad | 3:c0556ff7b8e3 | 20 | struct tm* get_gmtime(time_t* currentTime) |
markrad | 3:c0556ff7b8e3 | 21 | { |
markrad | 3:c0556ff7b8e3 | 22 | return localtime(currentTime); |
markrad | 3:c0556ff7b8e3 | 23 | } |
markrad | 3:c0556ff7b8e3 | 24 | |
markrad | 3:c0556ff7b8e3 | 25 | char* get_ctime(time_t* timeToGet) |
markrad | 3:c0556ff7b8e3 | 26 | { |
markrad | 3:c0556ff7b8e3 | 27 | return ctime(timeToGet); |
markrad | 3:c0556ff7b8e3 | 28 | } |