Ignore:
Timestamp:
Jun 5, 2019, 2:23:55 PM (5 years ago)
Author:
coas-nagasima
Message:

更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • azure_iot_hub/trunk/app_iothub_client/src/client.c

    r396 r399  
    218218                                printf("failure to set option \"MinimumPollingTime\"\r\n");
    219219                        }
     220
     221                        bool traceOn = 1;
     222                        if (IoTHubClient_LL_SetOption(iotHubClientHandle, OPTION_LOG_TRACE, &traceOn) != IOTHUB_CLIENT_OK)
     223                        {
     224                                printf("failure to set option \"log trace on\"\r\n");
     225                        }
    220226#endif
    221227#ifdef SET_TRUSTED_CERT_IN_SAMPLES
     
    241247                                do
    242248                                {
    243                                         //(void)printf("iterator: [%d], callbackCounter: [%d]. \r\n", iterator, callbackCounter);
    244 
    245                                         if (iterator < MESSAGE_COUNT && (iterator <= callbackCounter))
     249                                        if ((iterator < MESSAGE_COUNT) && (iterator <= callbackCounter))
    246250                                        {
    247251                                                temperature = minTemperature + (rand() % 10);
     
    265269                                                        }
    266270
    267                                                         (void)IoTHubMessage_SetContentTypeSystemProperty(messages[iterator].messageHandle, "application/json");
    268                                                         (void)IoTHubMessage_SetContentEncodingSystemProperty(messages[iterator].messageHandle, "utf-8");
     271                                                        if (proto == 0) {
     272                                                                (void)IoTHubMessage_SetContentTypeSystemProperty(messages[iterator].messageHandle, "application/json");
     273                                                                (void)IoTHubMessage_SetContentEncodingSystemProperty(messages[iterator].messageHandle, "utf-8");
     274                                                        }
    269275
    270276                                                        if (IoTHubClient_LL_SendEventAsync(iotHubClientHandle, messages[iterator].messageHandle, SendConfirmationCallback, &messages[iterator]) != IOTHUB_CLIENT_OK)
     
    277283                                                        }
    278284                                                }
     285                                                iterator++;
    279286                                        }
    280287
    281288                                        IoTHubClient_LL_DoWork(iotHubClientHandle);
    282289                                        ThreadAPI_Sleep(1);
    283 
    284                                         iterator++;
    285290
    286291                                        if (callbackCounter >= MESSAGE_COUNT)
Note: See TracChangeset for help on using the changeset viewer.