Microsoft Azure IoTHub client libraries

Dependents:   sht15_remote_monitoring RobotArmDemo iothub_client_sample_amqp f767zi_mqtt ... more

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

Committer:
AzureIoTClient
Date:
Tue Sep 11 11:13:11 2018 -0700
Revision:
92:97148cf9aa2a
Parent:
91:bbf806070c5f
1.2.9

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AzureIoTClient 88:248736be106e 1 // Copyright (c) Microsoft. All rights reserved.
AzureIoTClient 88:248736be106e 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
AzureIoTClient 88:248736be106e 3
AzureIoTClient 88:248736be106e 4 /** @file iothub_client_core.h
AzureIoTClient 92:97148cf9aa2a 5 * @brief Extends the IoTHubClientCore_LL module with additional features.
AzureIoTClient 88:248736be106e 6 *
AzureIoTClient 92:97148cf9aa2a 7 * @details IoTHubClientCore is a module that extends the IoTHubClientCore_LL
AzureIoTClient 92:97148cf9aa2a 8 * module with 2 features:
AzureIoTClient 92:97148cf9aa2a 9 * - scheduling the work for the IoTHubCLient from a
AzureIoTClient 92:97148cf9aa2a 10 * thread, so that the user does not need to create their
AzureIoTClient 92:97148cf9aa2a 11 * own thread
AzureIoTClient 92:97148cf9aa2a 12 * - thread-safe APIs
AzureIoTClient 88:248736be106e 13 */
AzureIoTClient 88:248736be106e 14
AzureIoTClient 88:248736be106e 15 #ifndef IOTHUB_CLIENT_CORE_H
AzureIoTClient 88:248736be106e 16 #define IOTHUB_CLIENT_CORE_H
AzureIoTClient 88:248736be106e 17
AzureIoTClient 88:248736be106e 18 #include <stddef.h>
AzureIoTClient 88:248736be106e 19 #include <stdint.h>
AzureIoTClient 88:248736be106e 20 #include "azure_c_shared_utility/umock_c_prod.h"
AzureIoTClient 88:248736be106e 21
AzureIoTClient 88:248736be106e 22 #include "iothub_client_core_ll.h"
AzureIoTClient 88:248736be106e 23
AzureIoTClient 88:248736be106e 24 #ifndef IOTHUB_CLIENT_CORE_INSTANCE_TYPE
AzureIoTClient 88:248736be106e 25 typedef struct IOTHUB_CLIENT_CORE_INSTANCE_TAG* IOTHUB_CLIENT_CORE_HANDLE;
AzureIoTClient 88:248736be106e 26 #define IOTHUB_CLIENT_CORE_INSTANCE_TYPE
AzureIoTClient 88:248736be106e 27 #endif // IOTHUB_CLIENT_CORE_INSTANCE
AzureIoTClient 88:248736be106e 28
AzureIoTClient 88:248736be106e 29 #ifdef __cplusplus
AzureIoTClient 88:248736be106e 30 extern "C"
AzureIoTClient 88:248736be106e 31 {
AzureIoTClient 88:248736be106e 32 #endif
AzureIoTClient 88:248736be106e 33
AzureIoTClient 88:248736be106e 34 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_CORE_HANDLE, IoTHubClientCore_CreateFromConnectionString, const char*, connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol);
AzureIoTClient 88:248736be106e 35 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_CORE_HANDLE, IoTHubClientCore_Create, const IOTHUB_CLIENT_CONFIG*, config);
AzureIoTClient 88:248736be106e 36 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_CORE_HANDLE, IoTHubClientCore_CreateWithTransport, TRANSPORT_HANDLE, transportHandle, const IOTHUB_CLIENT_CONFIG*, config);
AzureIoTClient 88:248736be106e 37 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_CORE_HANDLE, IoTHubClientCore_CreateFromDeviceAuth, const char*, iothub_uri, const char*, device_id, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol);
AzureIoTClient 88:248736be106e 38 MOCKABLE_FUNCTION(, void, IoTHubClientCore_Destroy, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle);
AzureIoTClient 88:248736be106e 39 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_SendEventAsync, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, IOTHUB_MESSAGE_HANDLE, eventMessageHandle, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK, eventConfirmationCallback, void*, userContextCallback);
AzureIoTClient 88:248736be106e 40 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_GetSendStatus, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_STATUS*, iotHubClientStatus);
AzureIoTClient 88:248736be106e 41 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_SetMessageCallback, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC, messageCallback, void*, userContextCallback);
AzureIoTClient 88:248736be106e 42 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_SetConnectionStatusCallback, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_CONNECTION_STATUS_CALLBACK, connectionStatusCallback, void*, userContextCallback);
AzureIoTClient 88:248736be106e 43 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_SetRetryPolicy, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY, retryPolicy, size_t, retryTimeoutLimitInSeconds);
AzureIoTClient 88:248736be106e 44 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_GetRetryPolicy, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_RETRY_POLICY*, retryPolicy, size_t*, retryTimeoutLimitInSeconds);
AzureIoTClient 88:248736be106e 45 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_GetLastMessageReceiveTime, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, time_t*, lastMessageReceiveTime);
AzureIoTClient 88:248736be106e 46 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_SetOption, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, const char*, optionName, const void*, value);
AzureIoTClient 88:248736be106e 47 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_SetDeviceTwinCallback, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_TWIN_CALLBACK, deviceTwinCallback, void*, userContextCallback);
AzureIoTClient 88:248736be106e 48 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_SendReportedState, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, const unsigned char*, reportedState, size_t, size, IOTHUB_CLIENT_REPORTED_STATE_CALLBACK, reportedStateCallback, void*, userContextCallback);
AzureIoTClient 88:248736be106e 49 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_SetDeviceMethodCallback, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_DEVICE_METHOD_CALLBACK_ASYNC, deviceMethodCallback, void*, userContextCallback);
AzureIoTClient 88:248736be106e 50 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_SetDeviceMethodCallback_Ex, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, IOTHUB_CLIENT_INBOUND_DEVICE_METHOD_CALLBACK, inboundDeviceMethodCallback, void*, userContextCallback);
AzureIoTClient 88:248736be106e 51 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_DeviceMethodResponse, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, METHOD_HANDLE, methodId, const unsigned char*, response, size_t, response_size, int, statusCode);
AzureIoTClient 88:248736be106e 52
AzureIoTClient 88:248736be106e 53 #ifndef DONT_USE_UPLOADTOBLOB
AzureIoTClient 88:248736be106e 54 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_UploadToBlobAsync, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, const char*, destinationFileName, const unsigned char*, source, size_t, size, IOTHUB_CLIENT_FILE_UPLOAD_CALLBACK, iotHubClientFileUploadCallback, void*, context);
AzureIoTClient 88:248736be106e 55 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_UploadMultipleBlocksToBlobAsync, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, const char*, destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK, getDataCallback, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX, getDataCallbackEx, void*, context);
AzureIoTClient 88:248736be106e 56 #endif /* DONT_USE_UPLOADTOBLOB */
AzureIoTClient 88:248736be106e 57
AzureIoTClient 89:a2ed767a532e 58 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_SendEventToOutputAsync, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, IOTHUB_MESSAGE_HANDLE, eventMessageHandle, const char*, outputName, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK, eventConfirmationCallback, void*, userContextCallback);
AzureIoTClient 89:a2ed767a532e 59 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_SetInputMessageCallback, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, const char*, inputName, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC, eventHandlerCallback, void*, userContextCallback);
AzureIoTClient 89:a2ed767a532e 60
AzureIoTClient 89:a2ed767a532e 61 #ifdef USE_EDGE_MODULES
AzureIoTClient 89:a2ed767a532e 62 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_CORE_HANDLE, IoTHubClientCore_CreateFromEnvironment, IOTHUB_CLIENT_TRANSPORT_PROVIDER, protocol);
AzureIoTClient 92:97148cf9aa2a 63 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClientCore_GenericMethodInvoke, IOTHUB_CLIENT_CORE_HANDLE, iotHubClientHandle, const char*, deviceId, const char*, moduleId, const char*, methodName, const char*, methodPayload, unsigned int, timeout, IOTHUB_METHOD_INVOKE_CALLBACK, methodInvokeCallback, void*, context);
AzureIoTClient 91:bbf806070c5f 64 #endif /* USE_EDGE_MODULES */
AzureIoTClient 89:a2ed767a532e 65
AzureIoTClient 88:248736be106e 66 #ifdef __cplusplus
AzureIoTClient 88:248736be106e 67 }
AzureIoTClient 88:248736be106e 68 #endif
AzureIoTClient 88:248736be106e 69
AzureIoTClient 88:248736be106e 70 #endif /* IOTHUB_CLIENT_CORE_H */