Hello all,
I’m writing a console application to retrieve the temperature and humidity values from HDC1010 sensor.
Code snippet:
PROPVARIANT var = {};
HRESULT hr = ppReport->GetSensorValue(SENSOR_DATA_TYPE_TEMPERATURE_CELSIUS, &var);
if (SUCCEEDED(hr))
{
float temp = var.fltVal;
std::cout << "Temperature in celsius: " << temp;
std::cout << “\n”;
}
PropVariantClear(&var);
hr = ppReport->GetSensorValue(SENSOR_DATA_TYPE_RELATIVE_HUMIDITY_PERCENT, &var);
if (SUCCEEDED(hr))
{
float humidity = var.fltVal;
std::cout << "Relative Humidity: " << humidity;
std::cout << “\n”;
}
PropVariantClear(&var);
Here, return value of hr is 0 on SUCCESS and -ve value on FAILURE. But I obtain 0x80070490 due to which GetSensorValue() fails.
While referring to below links, the error code 0x80070490 is not even listed:
- https://docs.microsoft.com/en-us/windows/win32/learnwin32/error-handling-in-com
- https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/705fb797-2175-4a90-b5a3-3918024b10b8
Can you please reach out to this?
Thanks,
Subashini.