iothub_ll_telemetry_sample

Files at this revision

API Documentation at this revision

Comitter:
AzureIoTClient
Date:
Tue Mar 20 10:31:58 2018 -0700
Parent:
0:c979e2f5511a
Child:
2:2b31d7ad244c
Commit message:
1.2.1

Changed in this revision

iothub_ll_telemetry_sample.c Show annotated file Show diff for this revision Revisions of this file
--- a/iothub_ll_telemetry_sample.c	Thu Feb 15 13:22:49 2018 -0800
+++ b/iothub_ll_telemetry_sample.c	Tue Mar 20 10:31:58 2018 -0700
@@ -10,6 +10,10 @@
 #include "azure_c_shared_utility/platform.h"
 #include "azure_c_shared_utility/shared_util_options.h"
 
+// USE_MQTT, USE_AMQP, and/or USE_HTTP are set in .\CMakeLists.txt based/
+// on which protocols the IoT C SDK has been set to include during cmake
+// generation time.
+
 #ifdef USE_MQTT
     #include "iothubtransportmqtt.h"
     #ifdef USE_WEBSOCKETS
@@ -52,18 +56,18 @@
     size_t messages_sent = 0;
     const char* telemetry_msg = "test_message";
 
-    // Select the Protocol to use with the connection
+    // Select the Protocol to use with the connection.
+#ifdef USE_HTTP
+    protocol = HTTP_Protocol;
+#endif
 #ifdef USE_AMQP
     //protocol = AMQP_Protocol_over_WebSocketsTls;
     protocol = AMQP_Protocol;
 #endif
 #ifdef USE_MQTT
-    //protocol = MQTT_Protocol;
+    protocol = MQTT_Protocol;
     //protocol = MQTT_WebSocket_Protocol;
 #endif
-#ifdef USE_HTTP
-    //protocol = HTTP_Protocol;
-#endif
 
     IOTHUB_CLIENT_LL_HANDLE iothub_ll_handle;