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:
Thu Oct 04 09:15:49 2018 -0700
Revision:
93:7c0bbb86b167
Parent:
92:97148cf9aa2a
1.2.10

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_ll.h
AzureIoTClient 92:97148cf9aa2a 5 * @brief APIs that allow a user (usually a device) to communicate
AzureIoTClient 92:97148cf9aa2a 6 * with an Azure IoTHub.
AzureIoTClient 88:248736be106e 7 *
AzureIoTClient 92:97148cf9aa2a 8 * @details IoTHubClient_LL is a module that allows a user (usually a
AzureIoTClient 92:97148cf9aa2a 9 * device) to communicate with an Azure IoTHub. It can send events
AzureIoTClient 92:97148cf9aa2a 10 * and receive messages. At any given moment in time there can only
AzureIoTClient 92:97148cf9aa2a 11 * be at most 1 message callback function.
AzureIoTClient 88:248736be106e 12 *
AzureIoTClient 92:97148cf9aa2a 13 * This API surface contains a set of APIs that allows the user to
AzureIoTClient 92:97148cf9aa2a 14 * interact with the lower layer portion of the IoTHubClient. These APIs
AzureIoTClient 92:97148cf9aa2a 15 * contain @c _LL_ in their name, but retain the same functionality like the
AzureIoTClient 92:97148cf9aa2a 16 * @c IoTHubClient_... APIs, with one difference. If the @c _LL_ APIs are
AzureIoTClient 92:97148cf9aa2a 17 * used then the user is responsible for scheduling when the actual work done
AzureIoTClient 92:97148cf9aa2a 18 * by the IoTHubClient happens (when the data is sent/received on/from the wire).
AzureIoTClient 92:97148cf9aa2a 19 * This is useful for constrained devices where spinning a separate thread is
AzureIoTClient 92:97148cf9aa2a 20 * often not desired.
AzureIoTClient 88:248736be106e 21 */
AzureIoTClient 88:248736be106e 22
AzureIoTClient 88:248736be106e 23 #ifndef DONT_USE_UPLOADTOBLOB
AzureIoTClient 88:248736be106e 24
AzureIoTClient 88:248736be106e 25 #ifndef IOTHUB_CLIENT_LL_UPLOADTOBLOB_H
AzureIoTClient 88:248736be106e 26 #define IOTHUB_CLIENT_LL_UPLOADTOBLOB_H
AzureIoTClient 88:248736be106e 27
AzureIoTClient 88:248736be106e 28 #include "iothub_client_core_ll.h"
AzureIoTClient 88:248736be106e 29
AzureIoTClient 88:248736be106e 30 #include "azure_c_shared_utility/umock_c_prod.h"
AzureIoTClient 88:248736be106e 31 #ifdef __cplusplus
AzureIoTClient 88:248736be106e 32 #include <cstddef>
AzureIoTClient 88:248736be106e 33 extern "C"
AzureIoTClient 88:248736be106e 34 {
AzureIoTClient 88:248736be106e 35 #else
AzureIoTClient 88:248736be106e 36 #include <stddef.h>
AzureIoTClient 88:248736be106e 37 #endif
AzureIoTClient 88:248736be106e 38
AzureIoTClient 88:248736be106e 39 #define BLOCK_SIZE (4*1024*1024)
AzureIoTClient 88:248736be106e 40
AzureIoTClient 88:248736be106e 41 typedef struct IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE_DATA* IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE;
AzureIoTClient 88:248736be106e 42
AzureIoTClient 88:248736be106e 43 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE, IoTHubClient_LL_UploadToBlob_Create, const IOTHUB_CLIENT_CONFIG*, config);
AzureIoTClient 88:248736be106e 44 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_UploadToBlob_Impl, IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE, handle, const char*, destinationFileName, const unsigned char*, source, size_t, size);
AzureIoTClient 88:248736be106e 45 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_UploadMultipleBlocksToBlob_Impl, IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE, handle, const char*, destinationFileName, IOTHUB_CLIENT_FILE_UPLOAD_GET_DATA_CALLBACK_EX, getDataCallbackEx, void*, context);
AzureIoTClient 88:248736be106e 46 MOCKABLE_FUNCTION(, IOTHUB_CLIENT_RESULT, IoTHubClient_LL_UploadToBlob_SetOption, IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE, handle, const char*, optionName, const void*, value);
AzureIoTClient 88:248736be106e 47 MOCKABLE_FUNCTION(, void, IoTHubClient_LL_UploadToBlob_Destroy, IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE, handle);
AzureIoTClient 88:248736be106e 48
AzureIoTClient 88:248736be106e 49 #ifdef __cplusplus
AzureIoTClient 88:248736be106e 50 }
AzureIoTClient 88:248736be106e 51 #endif
AzureIoTClient 88:248736be106e 52
AzureIoTClient 88:248736be106e 53 #endif /* IOTHUB_CLIENT_LL_UPLOADTOBLOB_H */
AzureIoTClient 88:248736be106e 54
AzureIoTClient 88:248736be106e 55 #else
AzureIoTClient 88:248736be106e 56 #error "trying to #include iothub_client_ll_uploadtoblob.h in the presence of #define DONT_USE_UPLOADTOBLOB"
AzureIoTClient 88:248736be106e 57 #endif /*DONT_USE_UPLOADTOBLOB*/