Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface NTPClient iothub_amqp_transport iothub_client mbed-rtos mbed
Fork of iothub_client_sample_amqp by
agenttime.h
00001 // Copyright (c) Microsoft. All rights reserved. 00002 // Licensed under the MIT license. See LICENSE file in the project root for full license information. 00003 00004 /** @file agenttime.h 00005 * @brief Function prototypes for time related functions. 00006 * 00007 * @details These functions are implemented with C standard functions, 00008 * and therefore they are platform independent. But then a platform 00009 * can replace these functions with its own implementation as necessary. 00010 */ 00011 00012 #ifndef AGENTTIME_H 00013 #define AGENTTIME_H 00014 00015 #include <time.h> 00016 #include "azure_c_shared_utility/umock_c_prod.h" 00017 00018 #ifdef __cplusplus 00019 extern "C" 00020 { 00021 #endif 00022 00023 /** @brief Get current calendar time. 00024 * 00025 * @details This function provides the same functionality as the 00026 * standard C @c time() function. 00027 */ 00028 MOCKABLE_FUNCTION(, time_t, get_time, time_t*, currentTime); 00029 00030 /** @brief Get UTC in @c tm struct. 00031 * 00032 * @details This function provides the same functionality as the 00033 * standard C @c gmtime() function. 00034 */ 00035 MOCKABLE_FUNCTION(, struct tm*, get_gmtime, time_t*, currentTime); 00036 00037 /** @brief Get current time representation of the given calendar time. 00038 * 00039 * @details This function provides the same functionality as the 00040 * standard C @c mktime() function. 00041 */ 00042 MOCKABLE_FUNCTION(, time_t, get_mktime, struct tm*, cal_time); 00043 00044 /** @brief Gets a C-string representation of the given time. 00045 * 00046 * @details This function provides the same functionality as the 00047 * standard C @c ctime() function. 00048 */ 00049 MOCKABLE_FUNCTION(, char*, get_ctime, time_t*, timeToGet); 00050 00051 /** @brief Gets the difference in seconds between @c stopTime and 00052 * @c startTime. 00053 * 00054 * @details This function provides the same functionality as the 00055 * standard C @c difftime() function. 00056 */ 00057 MOCKABLE_FUNCTION(, double, get_difftime, time_t, stopTime, time_t, startTime); 00058 00059 #ifdef __cplusplus 00060 } 00061 #endif 00062 00063 #endif // AGENTTIME_H
Generated on Tue Jul 12 2022 12:43:15 by
