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

Revision:
43:038d8511e817
Parent:
42:448eecc3676e
Child:
44:33dd78697616
--- a/iothub_client_ll.h	Tue Jun 07 10:49:08 2016 -0700
+++ b/iothub_client_ll.h	Fri Jun 17 17:02:44 2016 -0700
@@ -23,16 +23,7 @@
 #ifndef IOTHUB_CLIENT_LL_H
 #define IOTHUB_CLIENT_LL_H
 
-#include "azure_c_shared_utility/agenttime.h"
 #include "azure_c_shared_utility/macro_utils.h"
-#include "azure_c_shared_utility/xio.h"
-#include "azure_c_shared_utility/doublylinkedlist.h"
-#include "iothub_message.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
 
 #define IOTHUB_CLIENT_RESULT_VALUES       \
     IOTHUB_CLIENT_OK,                     \
@@ -41,9 +32,34 @@
     IOTHUB_CLIENT_INVALID_SIZE,           \
     IOTHUB_CLIENT_INDEFINITE_TIME         \
 
-	/** @brief Enumeration specifying the status of calls to various APIs in this module.
-	*/
-	DEFINE_ENUM(IOTHUB_CLIENT_RESULT, IOTHUB_CLIENT_RESULT_VALUES);
+/** @brief Enumeration specifying the status of calls to various APIs in this module.
+*/
+
+DEFINE_ENUM(IOTHUB_CLIENT_RESULT, IOTHUB_CLIENT_RESULT_VALUES);
+
+typedef struct IOTHUBTRANSPORT_CONFIG_TAG IOTHUBTRANSPORT_CONFIG;
+
+typedef struct IOTHUB_CLIENT_LL_HANDLE_DATA_TAG* IOTHUB_CLIENT_LL_HANDLE;
+
+#define IOTHUB_CLIENT_STATUS_VALUES       \
+    IOTHUB_CLIENT_SEND_STATUS_IDLE,       \
+    IOTHUB_CLIENT_SEND_STATUS_BUSY        \
+
+/** @brief Enumeration returned by the ::IoTHubClient_LL_GetSendStatus
+*		   API to indicate the current sending status of the IoT Hub client.
+*/
+DEFINE_ENUM(IOTHUB_CLIENT_STATUS, IOTHUB_CLIENT_STATUS_VALUES);
+
+#include "azure_c_shared_utility/agenttime.h"
+#include "azure_c_shared_utility/xio.h"
+#include "azure_c_shared_utility/doublylinkedlist.h"
+#include "iothub_message.h"
+#include "iothub_transport_ll.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
 
 #define IOTHUB_CLIENT_CONFIRMATION_RESULT_VALUES     \
     IOTHUB_CLIENT_CONFIRMATION_OK,                   \
@@ -57,15 +73,6 @@
 	*/
 	DEFINE_ENUM(IOTHUB_CLIENT_CONFIRMATION_RESULT, IOTHUB_CLIENT_CONFIRMATION_RESULT_VALUES);
 
-#define IOTHUB_CLIENT_STATUS_VALUES       \
-    IOTHUB_CLIENT_SEND_STATUS_IDLE,       \
-    IOTHUB_CLIENT_SEND_STATUS_BUSY        \
-
-	/** @brief Enumeration returned by the ::IoTHubClient_LL_GetSendStatus
-	*		   API to indicate the current sending status of the IoT Hub client.
-	*/
-	DEFINE_ENUM(IOTHUB_CLIENT_STATUS, IOTHUB_CLIENT_STATUS_VALUES);
-
 #define TRANSPORT_TYPE_VALUES \
     TRANSPORT_LL, /*LL comes from "LowLevel" */ \
     TRANSPORT_THREADED
@@ -82,10 +89,10 @@
 	*/
 	DEFINE_ENUM(IOTHUBMESSAGE_DISPOSITION_RESULT, IOTHUBMESSAGE_DISPOSITION_RESULT_VALUES);
 
-	typedef struct IOTHUB_CLIENT_LL_HANDLE_DATA_TAG* IOTHUB_CLIENT_LL_HANDLE;
+	
 	typedef void(*IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK)(IOTHUB_CLIENT_CONFIRMATION_RESULT result, void* userContextCallback);
 	typedef IOTHUBMESSAGE_DISPOSITION_RESULT (*IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC)(IOTHUB_MESSAGE_HANDLE message, void* userContextCallback);
-	typedef const void*(*IOTHUB_CLIENT_TRANSPORT_PROVIDER)(void);
+	typedef const TRANSPORT_PROVIDER*(*IOTHUB_CLIENT_TRANSPORT_PROVIDER)(void);
 
 	/** @brief	This struct captures IoTHub client configuration. */
 	typedef struct IOTHUB_CLIENT_CONFIG_TAG
@@ -318,8 +325,22 @@
 	*/
 	extern IOTHUB_CLIENT_RESULT IoTHubClient_LL_SetOption(IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle, const char* optionName, const void* value);
 
+#ifdef USE_UPLOADTOBLOB
+    /**
+    * @brief	This API uploads to Azure Storage the content pointed to by @p source having the size @p size
+    *           under the blob name devicename/@pdestinationFileName
+    *
+    * @param	iotHubClientHandle	    The handle created by a call to the create function.
+    * @param	destinationFileName     name of the file.
+    * @param	source                  pointer to the source for file content (can be NULL)
+    * @param    size                    the size of the source in memory (if @p source is NULL then size needs to be 0).
+    *
+    * @return	IOTHUB_CLIENT_OK upon success or an error code upon failure.
+    */
     extern IOTHUB_CLIENT_RESULT IoTHubClient_LL_UploadToBlob(IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle, const char* destinationFileName, const unsigned char* source, size_t size);
 
+#endif /*USE_UPLOADTOBLOB*/
+
 #ifdef __cplusplus
 }
 #endif