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:
91:bbf806070c5f
Parent:
89:a2ed767a532e
Child:
92:97148cf9aa2a
--- a/iothub_client_core.c	Thu Jun 28 10:07:22 2018 -0700
+++ b/iothub_client_core.c	Thu Jul 12 18:09:13 2018 -0700
@@ -20,10 +20,6 @@
 #include "azure_c_shared_utility/singlylinkedlist.h"
 #include "azure_c_shared_utility/vector.h"
 
-#ifdef USE_EDGE_MODULES
-#include "iothub_client_ll_edge.h"
-#endif
-
 struct IOTHUB_QUEUE_CONTEXT_TAG;
 
 typedef struct IOTHUB_CLIENT_CORE_INSTANCE_TAG
@@ -893,7 +889,7 @@
                     }
                     else
                     {
-                        result->IoTHubClientLLHandle = IoTHubModuleClient_LL_CreateFromEnvironment(protocol);
+                        result->IoTHubClientLLHandle = IoTHubClientCore_LL_CreateFromEnvironment(protocol);
                     }
                 }
 #endif
@@ -2327,4 +2323,27 @@
     return result;
 }
 
+/* Temporary function until replacement during iothub_client refactor*/
+#ifdef USE_EDGE_MODULES
+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, int* responseStatus, unsigned char** responsePayload, size_t* responsePayloadSize)
+{
+    IOTHUB_CLIENT_RESULT result;
+    if (iotHubClientHandle == NULL)
+    {
+        LogError("Argument cannot be NULL");
+        result = IOTHUB_CLIENT_INVALID_ARG;
+    }
+    else if (Lock(iotHubClientHandle->LockHandle) != LOCK_OK)
+    {
+        LogError("failed locking for dispatch_user_callbacks");
+        result = IOTHUB_CLIENT_ERROR;
+    }
+    else
+    {
+        result = IoTHubClientCore_LL_GenericMethodInvoke(iotHubClientHandle->IoTHubClientLLHandle, deviceId, moduleId, methodName, methodPayload, timeout, responseStatus, responsePayload, responsePayloadSize);
+        (void)Unlock(iotHubClientHandle->LockHandle);
+    }
 
+    return result;
+}
+#endif /* USE_EDGE_MODULES */