Microsoft Azure IoTHub client MQTT transport

Dependents:   STM32F746_iothub_client_sample_mqtt FXOS8700CQ_To_Azure_IoT f767zi_mqtt FXOS8700CQ_To_Azure_IoT ... more

Committer:
AzureIoTClient
Date:
Tue Sep 11 11:12:42 2018 -0700
Revision:
41:410450f16a9f
Parent:
39:6231984e0179
1.2.9

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AzureIoTClient 39:6231984e0179 1 // Copyright (c) Microsoft. All rights reserved.
AzureIoTClient 39:6231984e0179 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
AzureIoTClient 39:6231984e0179 3
AzureIoTClient 39:6231984e0179 4 #ifndef IOTHUB_CLIENT_RETRY_CONTROL
AzureIoTClient 39:6231984e0179 5 #define IOTHUB_CLIENT_RETRY_CONTROL
AzureIoTClient 39:6231984e0179 6
AzureIoTClient 39:6231984e0179 7 #include <stdlib.h>
AzureIoTClient 39:6231984e0179 8 #include <stdbool.h>
AzureIoTClient 39:6231984e0179 9 #include "azure_c_shared_utility/optionhandler.h"
AzureIoTClient 39:6231984e0179 10 #include "azure_c_shared_utility/umock_c_prod.h"
AzureIoTClient 39:6231984e0179 11 #include "iothub_client_core_ll.h"
AzureIoTClient 39:6231984e0179 12 #include "internal/iothubtransport.h"
AzureIoTClient 39:6231984e0179 13 #include "azure_c_shared_utility/const_defines.h"
AzureIoTClient 39:6231984e0179 14
AzureIoTClient 39:6231984e0179 15 #ifdef __cplusplus
AzureIoTClient 39:6231984e0179 16 extern "C"
AzureIoTClient 39:6231984e0179 17 {
AzureIoTClient 39:6231984e0179 18 #endif
AzureIoTClient 39:6231984e0179 19
AzureIoTClient 39:6231984e0179 20 static STATIC_VAR_UNUSED const char* RETRY_CONTROL_OPTION_INITIAL_WAIT_TIME_IN_SECS = "initial_wait_time_in_secs";
AzureIoTClient 39:6231984e0179 21 static STATIC_VAR_UNUSED const char* RETRY_CONTROL_OPTION_MAX_JITTER_PERCENT = "max_jitter_percent";
AzureIoTClient 39:6231984e0179 22 static STATIC_VAR_UNUSED const char* RETRY_CONTROL_OPTION_SAVED_OPTIONS = "retry_control_saved_options";
AzureIoTClient 39:6231984e0179 23
AzureIoTClient 39:6231984e0179 24 typedef enum RETRY_ACTION_TAG
AzureIoTClient 39:6231984e0179 25 {
AzureIoTClient 41:410450f16a9f 26 RETRY_ACTION_RETRY_NOW,
AzureIoTClient 41:410450f16a9f 27 RETRY_ACTION_RETRY_LATER,
AzureIoTClient 41:410450f16a9f 28 RETRY_ACTION_STOP_RETRYING
AzureIoTClient 39:6231984e0179 29 } RETRY_ACTION;
AzureIoTClient 39:6231984e0179 30
AzureIoTClient 39:6231984e0179 31 struct RETRY_CONTROL_INSTANCE_TAG;
AzureIoTClient 39:6231984e0179 32 typedef struct RETRY_CONTROL_INSTANCE_TAG* RETRY_CONTROL_HANDLE;
AzureIoTClient 39:6231984e0179 33
AzureIoTClient 39:6231984e0179 34 MOCKABLE_FUNCTION(, RETRY_CONTROL_HANDLE, retry_control_create, IOTHUB_CLIENT_RETRY_POLICY, policy, unsigned int, max_retry_time_in_secs);
AzureIoTClient 39:6231984e0179 35 MOCKABLE_FUNCTION(, int, retry_control_should_retry, RETRY_CONTROL_HANDLE, retry_control_handle, RETRY_ACTION*, retry_action);
AzureIoTClient 39:6231984e0179 36 MOCKABLE_FUNCTION(, void, retry_control_reset, RETRY_CONTROL_HANDLE, retry_control_handle);
AzureIoTClient 39:6231984e0179 37 MOCKABLE_FUNCTION(, int, retry_control_set_option, RETRY_CONTROL_HANDLE, retry_control_handle, const char*, name, const void*, value);
AzureIoTClient 39:6231984e0179 38 MOCKABLE_FUNCTION(, OPTIONHANDLER_HANDLE, retry_control_retrieve_options, RETRY_CONTROL_HANDLE, retry_control_handle);
AzureIoTClient 39:6231984e0179 39 MOCKABLE_FUNCTION(, void, retry_control_destroy, RETRY_CONTROL_HANDLE, retry_control_handle);
AzureIoTClient 39:6231984e0179 40
AzureIoTClient 39:6231984e0179 41 MOCKABLE_FUNCTION(, int, is_timeout_reached, time_t, start_time, unsigned int, timeout_in_secs, bool*, is_timed_out);
AzureIoTClient 39:6231984e0179 42
AzureIoTClient 39:6231984e0179 43 #ifdef __cplusplus
AzureIoTClient 39:6231984e0179 44 }
AzureIoTClient 39:6231984e0179 45 #endif
AzureIoTClient 39:6231984e0179 46
AzureIoTClient 41:410450f16a9f 47 #endif // IOTHUB_CLIENT_RETRY_CONTROL