espressif / esp-azure

SDK to connect ESP8266 and ESP32 to Microsoft Azure IoT services
176 stars 92 forks source link

esp32 azure reported properties updates (CA-100) #105

Open ajithcsSA opened 3 years ago

ajithcsSA commented 3 years ago

Hi I am using iothub_client_device_twin_and_methods_sample for updating the reported state. if (reportedProperties != NULL) { (void)IoTHubDeviceClient_LL_SendReportedState(iotHubClientHandle, (const unsigned char *)reportedProperties, strlen(reportedProperties), reportedStateCallback, NULL); (void)IoTHubDeviceClient_LL_SetDeviceMethodCallback(iotHubClientHandle, deviceMethodCallback, NULL); (void)IoTHubDeviceClient_LL_SetDeviceTwinCallback(iotHubClientHandle, deviceTwinCallback, &huilanpro);

            while (1)
            {
                IoTHubDeviceClient_LL_DoWork(iotHubClientHandle);
                ThreadAPI_Sleep(10);
            }
            free(reportedProperties);
        }

this is the code snippet where i can i update my reported properties.But through this i can only update once. If i have a change in my reported properties during my program flow. How can i update my reportedproperties again?

ajithcsSA commented 3 years ago

any ideas?