Microsoft Azure IoTHub client AMQP transport

Dependents:   sht15_remote_monitoring RobotArmDemo iothub_client_sample_amqp iothub_client_sample_amqp ... more

This library implements the AMQP transport for Microsoft Azure IoTHub client. The code is replicated from https://github.com/Azure/azure-iot-sdks

Committer:
AzureIoTClient
Date:
Thu Oct 04 09:14:47 2018 -0700
Revision:
57:56ac1346c70d
Parent:
56:8704100b3b54
1.2.10

Who changed what in which revision?

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