Changeset 396 for azure_iot_hub
- Timestamp:
- May 28, 2019, 3:22:09 PM (4 years ago)
- Location:
- azure_iot_hub/trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
azure_iot_hub/trunk/app_iothub_client/src/client.c
r393 r396 17 17 #include "iothub_message.h" 18 18 #include "iothubtransporthttp.h" 19 #include "iothubtransportmqtt.h" 19 20 #include "iothubtransportmqtt_websockets.h" 20 21 … … 131 132 EVENT_INSTANCE* eventInstance = (EVENT_INSTANCE*)userContextCallback; 132 133 133 (void)printf("Confirmation[%d] received for message tracking id = % zu with result = %s\r\n", callbackCounter, eventInstance->messageTrackingId, MU_ENUM_TO_STRING(IOTHUB_CLIENT_CONFIRMATION_RESULT, result));134 (void)printf("Confirmation[%d] received for message tracking id = %u with result = %s\r\n", callbackCounter, eventInstance->messageTrackingId, MU_ENUM_TO_STRING(IOTHUB_CLIENT_CONFIRMATION_RESULT, result)); 134 135 135 136 /* Some device specific action code goes here... */ … … 138 139 } 139 140 140 void iothub_client_run( void)141 void iothub_client_run(int proto) 141 142 { 142 143 IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle; … … 160 161 else 161 162 { 162 #if 1 163 (void)printf("Starting the IoTHub client sample HTTP...\r\n"); 164 IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol = HTTP_Protocol; 165 #else 166 (void)printf("Starting the IoTHub client sample MQTT...\r\n"); 167 IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol = MQTT_WebSocket_Protocol; 168 #endif 163 IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol; 164 switch (proto) { 165 case 0: 166 (void)printf("Starting the IoTHub client sample HTTP...\r\n"); 167 protocol = HTTP_Protocol; 168 break; 169 case 1: 170 (void)printf("Starting the IoTHub client sample MQTT...\r\n"); 171 protocol = MQTT_Protocol; 172 break; 173 case 2: 174 (void)printf("Starting the IoTHub client sample MQTT over WebSocket...\r\n"); 175 protocol = MQTT_WebSocket_Protocol; 176 break; 177 default: 178 platform_deinit(); 179 return; 180 } 169 181 170 182 if ((iotHubClientHandle = IoTHubClient_LL_CreateFromConnectionString(connectionString, protocol)) == NULL) … … 294 306 int iothub_client_main(int argc, char **argv) 295 307 { 296 iothub_client_run( );308 iothub_client_run(0); 297 309 return 0; 298 310 } -
azure_iot_hub/trunk/app_iothub_client/src/main.c
r392 r396 171 171 static void main_initialize() 172 172 { 173 FILINFO fno;174 #if FF_USE_LFN175 char lfn[FF_MAX_LFN + 1];176 fno.lfname = lfn;177 fno.lfsize = FF_MAX_LFN + 1;178 #endif179 173 ER ret; 180 174 -
azure_iot_hub/trunk/azure_iothub/iothub_client/src/iothub_client_ll_uploadtoblob.c
r389 r396 832 832 { 833 833 req_string = STRING_construct_sprintf("{\"isSuccess\":%s, \"statusCode\":%d, \"statusDescription\":""}", ((httpResponse < 300) ? "true" : "false"), httpResponse); 834 834 } 835 835 else 836 836 {
Note:
See TracChangeset
for help on using the changeset viewer.