STMicroelectronics / STMems_Android_Sensor_HAL_IIO

DISCONTINUED (October 2022): the maintenance for this repository has been discontinued. Please refer to https://github.com/STMicroelectronics/st-mems-android-linux-sensors-hal for the up-to-date HAL repository. This repository contains ST Android sensor Hardware Abstraction Layer (HAL) for MEMS Linux IIO drivers
Apache License 2.0
34 stars 21 forks source link

Temperature sensor should use temperature union element #8

Closed rob-mclean closed 11 months ago

rob-mclean commented 3 years ago

This may be overly picky, but...

In the file src/Temp.cpp, in the ProcessData method, the sensor_event should use the "temperature" union element to pass data into the pipe instead of the "relative_humidity" element.

Because the sensor_event member is a union, and because both the "temperature" and "relative_humidity" elements are of the same type in the union, I don't think this error affects the HAL performance. However, it is an obvious copy and change mistake that was missed when the class was coded. It may lead to confusion (as it did for me), or it may cause the HAL Temp class stop working correctly if AOSP changes the sensor_event_t structure so that those elements are no longer part of a union.

mariotesi commented 11 months ago

This project has been discontinued because of the Android Treble requirements which led to pass-through mode deprecation and new requirements for using HIDL / AIDL interfaces. As highlighted in the project repository entry page About the current Sensors HAL can be found in this repository st-mems-android-linux-sensors-hal.