xiaoxiang781216 commented on code in PR #9916:
URL: https://github.com/apache/nuttx/pull/9916#discussion_r1277574607


##########
include/nuttx/sensors/sensor.h:
##########
@@ -595,6 +603,15 @@ struct sensor_cap           /* Type: Capacitance */
   int32_t rawdata[4];       /* in SI units pF */
 };
 
+struct sensor_gas           /* Type: Gas */
+{
+  uint64_t timestamp;       /* Units is microseconds */
+  float temperature;        /* Temperature in degrees Celsius */
+  float pressure;           /* Pressure in millibar or hPa */
+  float humidity;           /* Relative humidity in rH */

Review Comment:
   > Thank you for the clarification. I started to work on it and registered 
the sensors separately. However, i am not sure how to retrieve the data 
correctly, since every lowerhalf translates to a sensor_ file. It seems wrong 
to open all 3 or 4 files separately to get the data from each one. Is there a 
better way to do this?
   
   to handle multiple file handle, you need poll/select, or 
libuv(https://github.com/apache/nuttx-apps/tree/master/system/libuv).
   
   > I could not find any examples in nuttx-apps. Also, I have a calibration 
function that should be called only once through an ioctl, but the ioctl is 
bound to a file descriptor.
   
   it can be done through one of topics.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to