Add sensor.h annotation

This commit is contained in:
Zhao_Jiasheng 2021-04-29 15:40:35 +08:00
parent c4280d9488
commit 613d6065ab
1 changed files with 10 additions and 9 deletions

View File

@ -50,7 +50,7 @@
#define SENSOR_ABILITY_VOICE ((uint32_t)(1 << SENSOR_QUANTITY_VOICE)) #define SENSOR_ABILITY_VOICE ((uint32_t)(1 << SENSOR_QUANTITY_VOICE))
struct SensorProductInfo { struct SensorProductInfo {
uint32_t ability; /* sensor ability */ uint32_t ability; /* Bitwise OR of sensor ability */
const char *vendor_name; const char *vendor_name;
const char *model_name; const char *model_name;
}; };
@ -66,16 +66,16 @@ struct SensorDone {
}; };
struct SensorDevice { struct SensorDevice {
char *name; char *name; /* Name of sensor */
struct SensorProductInfo *info; struct SensorProductInfo *info; /* Sensor model info */
struct SensorDone *done; struct SensorDone *done;
int fd; int fd; /* File descriptor */
int status; int status; /* Sensor work mode */
uint8 buffer[SENSOR_RECEIVE_BUFFSIZE]; uint8 buffer[SENSOR_RECEIVE_BUFFSIZE]; /* Buffer for read data */
int ref_cnt; int ref_cnt; /* Reference count */
DoubleLinklistType quant_list; DoubleLinklistType quant_list; /* Sensor quantity link */
struct SysDoubleLinklistNode link; struct SysDoubleLinklistNode link; /* Sensors link node */
}; };
enum SensorQuantityType { enum SensorQuantityType {
@ -86,6 +86,7 @@ enum SensorQuantityType {
SENSOR_QUANTITY_CO, SENSOR_QUANTITY_CO,
SENSOR_QUANTITY_PM, SENSOR_QUANTITY_PM,
SENSOR_QUANTITY_VOICE, SENSOR_QUANTITY_VOICE,
/* ...... */
SENSOR_QUANTITY_END, SENSOR_QUANTITY_END,
}; };