未验证 提交 d74fe1a5 编写于 作者: O openharmony_ci 提交者: Gitee

!7213 docs:modify sensor inaccurate description of some sentences

Merge pull request !7213 from sunxuejiao/master
# Sensor
## 概述
......@@ -8,7 +8,7 @@
Sensor驱动模型屏蔽硬件器件差异,为上层Sensor服务系统提供稳定的Sensor基础能力接口,包括Sensor列表查询、Sensor启停、Sensor订阅及取消订阅,Sensor参数配置等功能。Sensor设备驱动的开发是基于HDF驱动框架基础上,结合操作系统适配层(OSAL)和平台驱动接口(比如I2C/SPI/UART总线等平台资源)能力,屏蔽不同操作系统和平台总线资源差异,实现Sensor驱动“一次开发,多系统部署”的目标。Sensor驱动模型如图1所示。
**图 1** Sensor驱动模型图
![Sensor驱动模型图](figures/Sensor驱动模型图.png)
### 基本概念
......@@ -64,16 +64,16 @@ Sensor驱动模型对外开放的API接口能力的具体实现请参考:
**表 1** Sensor驱动模型对外API接口功能介绍
| 接口名 | 功能描述 |
| 接口名 | 功能描述 |
| ----- | -------- |
| int32_t GetAllSensors(struct SensorInformation **sensorInfo, int32_t *count) | 获取系统中注册的所有传感器信息,一组完整传感器信息包括传感器名字、设备厂商、固件版本号、硬件版本号、传感器类型编号、传感器标识、最大量程、精度、功耗。 |
| int32_t Enable(int32_t sensorId) | 使能指定传感器设备,只有数据订阅者使能传感器后,才能获取订阅的传感器数据。 |
| int32_t Disable(int32_t sensorId) | 去使能指定传感器设备。 |
| int32_t SetBatch(int32_t sensorId, int64_t samplingInterval, int64_t reportInterval) | 设置指定传感器的数据采样间隔和数据上报间隔。 |
| int32_t SetMode(int32_t sensorId, int32_t mode) | 设置指定传感器的工作模式,不同的工作模式,上报数据方式不同。 |
| int32_t SetOption(int32_t sensorId, uint32_t option) | 设置指定传感器量程,精度等可选配置。 |
| int32_t Register(int32_t groupId, RecordDataCallback cb) | 订阅者根据不同groupId注册传感器数据回调函数,系统会将获取到的传感器数据上报给订阅者。 |
| int32_t Unregister(int32_t groupId, RecordDataCallback cb) | 订阅者根据groupId和回调函数注销对应订阅者的传感器数据回调函数。 |
| int32_t Enable(int32_t sensorId) | 使能指定传感器设备,只有数据订阅者使能传感器后,才能获取订阅的传感器数据。 |
| int32_t Disable(int32_t sensorId) | 去使能指定传感器设备。 |
| int32_t SetBatch(int32_t sensorId, int64_t samplingInterval, int64_t reportInterval) | 设置指定传感器的数据采样间隔和数据上报间隔。 |
| int32_t SetMode(int32_t sensorId, int32_t mode) | 设置指定传感器的工作模式,不同的工作模式,上报数据方式不同。 |
| int32_t SetOption(int32_t sensorId, uint32_t option) | 设置指定传感器量程,精度等可选配置。 |
| int32_t Register(int32_t groupId, RecordDataCallback cb) | 订阅者根据不同groupId注册传感器数据回调函数,系统会将获取到的传感器数据上报给订阅者。 |
| int32_t Unregister(int32_t groupId, RecordDataCallback cb) | 订阅者根据groupId和回调函数注销对应订阅者的传感器数据回调函数。 |
......@@ -81,7 +81,7 @@ Sensor驱动模型对驱动开发者开放的功能接口,驱动开发者无
**表2** Sensor驱动模型对驱动开发者开放的功能接口列表
| 接口名 | 功能描述 |
| 接口名 | 功能描述 |
| ----- | -------- |
| int32_t AddSensorDevice(const struct SensorDeviceInfo *deviceInfo) | 添加当前类型的传感器设备到传感器设备管理。 |
| int32_t DeleteSensorDevice(const struct SensorBasicInfo *sensorBaseInfo) | 删除传感器设备管理里指定的传感器设备。 |
......@@ -101,7 +101,7 @@ Sensor驱动模型要求驱动开发者实现的接口功能,请参考:
**表 3** Sensor驱动模型要求驱动开发者实现的接口列表
| 接口名 | 功能描述 |
| 接口名 | 功能描述 |
| ----- | -------- |
| int32_t init(void) | 传感器设备探测成功后,需要对传感器设备初始化配置。 |
| int32_t Enable(void) | 根据当前传感器设备的HCS配置,下发传感器设备使能操作组的寄存器配置。 |
......@@ -545,7 +545,7 @@ void HdfSensorTest::SetUpTestCase()
{
g_sensorDev = NewSensorInterfaceInstance();
if (g_sensorDev == nullptr) {
printf("test sensorHdi get Module instance failed\n\r");
printf("test sensor get module instance failed\n\r");
}
}
/* 用例资源释放 */
......
......@@ -13,10 +13,10 @@
### Public 属性
| Public 属性 | 描述 |
| Public 属性 | 描述 |
| -------- | -------- |
| [lightBrightness](#lightbrightness) | 亮度值。 |
| [flashEffect](#flasheffect) | 闪烁模式。 |
| [lightBrightness](#lightbrightness) | 亮度值。 |
| [flashEffect](#flasheffect) | 闪烁模式。 |
## **详细描述**
......@@ -35,7 +35,7 @@
### flashEffect
```
struct LightFlashEffect LightEffect::flashEffect
```
......@@ -47,11 +47,11 @@ struct LightFlashEffect LightEffect::flashEffect
### lightBrightness
```
int32_t LightEffect::lightBrightness
```
**描述:**
亮度值:Bits 24–31为扩展位,Bits 16–23为红色,bits 8–15为绿色,bits 0–7为蓝色。 如果字节段不等于0,指示打开相应颜色的灯。
亮度值:Bits 24–31为扩展位,Bits 16–23为红色,Bits 8–15为绿色,Bits 0–7为蓝色。 如果相对应的字节段不等于0,表示打开相应颜色的灯。
......@@ -13,18 +13,18 @@
### Public 属性
| Public 属性 | 描述 |
| Public 属性 | 描述 |
| -------- | -------- |
| ( [GetLightInfo](#getlightinfo) )([out] struct [LightInfo](_light_info.md) \*\*lightInfo, [out] uint32_t \*count) | 获取当前系统中所有类型的灯信息。 [更多...](#getlightinfo) |
| ( [TurnOnLight](#turnonlight) )([in] uint32_t lightId, [in] struct [LightEffect](_light_effect.md) \*effect) | 根据指定的灯ID打开列表中的可用灯。 [更多...](#turnonlight) |
| ( [TurnOffLight](#turnofflight) )([in] uint32_t lightId) | 根据指定的灯ID关闭列表中的可用灯。 [更多...](#turnofflight) |
| ( [GetLightInfo](#getlightinfo) )([out] struct [LightInfo](_light_info.md) \*\*lightInfo, [out] uint32_t \*count) | 获取当前系统中所有类型的灯信息。 [更多...](#getlightinfo) |
| ( [TurnOnLight](#turnonlight) )([in] uint32_t lightId, [in] struct [LightEffect](_light_effect.md) \*effect) | 根据指定的灯ID打开列表中的可用灯。 [更多...](#turnonlight) |
| ( [TurnOffLight](#turnofflight) )([in] uint32_t lightId) | 根据指定的灯ID关闭列表中的可用灯。 [更多...](#turnofflight) |
## **详细描述**
定义可以在灯上执行的基本操作。
操作包括获取灯的信息、打开或关闭灯、设置灯的亮度闪烁模式。
操作包括获取灯的信息、打开或关闭灯、设置灯的亮度闪烁模式。
## **类成员变量说明**
......@@ -32,7 +32,7 @@
### GetLightInfo
```
int32_t(* LightInterface::GetLightInfo) ([out] struct LightInfo **lightInfo,[out] uint32_t *count)
```
......@@ -43,10 +43,10 @@ int32_t(* LightInterface::GetLightInfo) ([out] struct LightInfo **lightInfo,[out
**参数:**
| 名称 | 描述 |
| 名称 | 描述 |
| -------- | -------- |
| lightInfo | 表示指向灯信息的二级指针,详见[LightInfo](_light_info.md)。 |
| count | 表示指向灯数量的指针。 |
| lightInfo | 表示指向灯信息的二级指针,详见[LightInfo](_light_info.md)。 |
| count | 表示指向灯数量的指针。 |
**返回:**
......@@ -57,7 +57,7 @@ int32_t(* LightInterface::GetLightInfo) ([out] struct LightInfo **lightInfo,[out
### TurnOffLight
```
int32_t(* LightInterface::TurnOffLight) ([in] uint32_t lightId)
```
......@@ -68,9 +68,9 @@ int32_t(* LightInterface::TurnOffLight) ([in] uint32_t lightId)
**参数:**
| 名称 | 描述 |
| 名称 | 描述 |
| -------- | -------- |
| lightId | 表示灯ID,详见[LightId](_light.md#lightid)。 |
| lightId | 表示灯ID,详见[LightId](_light.md#lightid)。 |
**返回:**
......@@ -81,7 +81,7 @@ int32_t(* LightInterface::TurnOffLight) ([in] uint32_t lightId)
### TurnOnLight
```
int32_t(* LightInterface::TurnOnLight) ([in] uint32_t lightId,[in] struct LightEffect *effect)
```
......@@ -92,10 +92,10 @@ int32_t(* LightInterface::TurnOnLight) ([in] uint32_t lightId,[in] struct LightE
**参数:**
| 名称 | 描述 |
| 名称 | 描述 |
| -------- | -------- |
| lightId | 表示灯ID,详见[LightId](_light.md#lightid)。 |
| effect | 表示指向灯效果的指针,如果lightbrightness字段为0时, 灯的亮度根据HCS配置的默认亮度进行设置,详见[LightEffect](_light_effect.md)。 |
| lightId | 表示灯ID,详见[LightId](_light.md#lightid)。 |
| effect | 表示指向灯效果的指针,如果lightbrightness字段为0时, 灯的亮度根据HCS配置的默认亮度进行设置,详见[LightEffect](_light_effect.md)。 |
**返回:**
......@@ -105,4 +105,5 @@ int32_t(* LightInterface::TurnOnLight) ([in] uint32_t lightId,[in] struct LightE
如果不支持闪烁设置,则返回-2。
如果不支持亮度设置,则返回3。
如果不支持亮度设置,则返回-3。
......@@ -13,17 +13,17 @@
### Public 属性
| Public 属性 | 描述 |
| Public 属性 | 描述 |
| -------- | -------- |
| [sensorName](#sensorname) [[SENSOR_NAME_MAX_LEN](_sensor.md#sensornamemaxlen)] | 传感器名称。 |
| [vendorName](#vendorname) [[SENSOR_NAME_MAX_LEN](_sensor.md#sensornamemaxlen)] | 传感器设备厂商。 |
| [firmwareVersion](#firmwareversion) [[SENSOR_VERSION_MAX_LEN](_sensor.md#sensorversionmaxlen)] | 传感器固件版本号。 |
| [hardwareVersion](#hardwareversion)<br/>[[SENSOR_VERSION_MAX_LEN](_sensor.md#sensorversionmaxlen)] | 传感器硬件版本号。 |
| [sensorTypeId](#sensortypeid) | 传感器类型编号, |
| [sensorId](#sensorid) | 传感器的标识号,有传感器驱动开发者定义。 |
| [maxRange](#maxrange) | 传感器的最大量程。 |
| [accuracy](#accuracy) | 传感器的精度。 |
| [power](#power) | 传感器的功耗。 |
| [sensorName](#sensorname)&nbsp;[[SENSOR_NAME_MAX_LEN](_sensor.md#sensornamemaxlen)] | 传感器名称。 |
| [vendorName](#vendorname)&nbsp;[[SENSOR_NAME_MAX_LEN](_sensor.md#sensornamemaxlen)] | 传感器设备厂商。 |
| [firmwareVersion](#firmwareversion)&nbsp;[[SENSOR_VERSION_MAX_LEN](_sensor.md#sensorversionmaxlen)] | 传感器固件版本号。 |
| [hardwareVersion](#hardwareversion)<br/>[[SENSOR_VERSION_MAX_LEN](_sensor.md#sensorversionmaxlen)] | 传感器硬件版本号。 |
| [sensorTypeId](#sensortypeid) | 传感器类型编号。 |
| [sensorId](#sensorid) | 传感器的标识号,由传感器驱动开发者定义。 |
| [maxRange](#maxrange) | 传感器的最大量程。 |
| [accuracy](#accuracy) | 传感器的精度。 |
| [power](#power) | 传感器的功耗。 |
## **详细描述**
......@@ -42,7 +42,7 @@
### accuracy
```
float SensorInformation::accuracy
```
......@@ -54,7 +54,7 @@ float SensorInformation::accuracy
### firmwareVersion
```
char SensorInformation::firmwareVersion[SENSOR_VERSION_MAX_LEN]
```
......@@ -66,7 +66,7 @@ char SensorInformation::firmwareVersion[SENSOR_VERSION_MAX_LEN]
### hardwareVersion
```
char SensorInformation::hardwareVersion[SENSOR_VERSION_MAX_LEN]
```
......@@ -78,7 +78,7 @@ char SensorInformation::hardwareVersion[SENSOR_VERSION_MAX_LEN]
### maxRange
```
float SensorInformation::maxRange
```
......@@ -90,19 +90,19 @@ float SensorInformation::maxRange
### sensorId
```
int32_t SensorInformation::sensorId
```
**描述:**
传感器的标识号,传感器驱动开发者定义。
传感器的标识号,传感器驱动开发者定义。
### sensorName
```
char SensorInformation::sensorName[SENSOR_NAME_MAX_LEN]
```
......@@ -114,7 +114,7 @@ char SensorInformation::sensorName[SENSOR_NAME_MAX_LEN]
### sensorTypeId
```
int32_t SensorInformation::sensorTypeId
```
......@@ -126,7 +126,7 @@ int32_t SensorInformation::sensorTypeId
### vendorName
```
char SensorInformation::vendorName[SENSOR_NAME_MAX_LEN]
```
......@@ -138,7 +138,7 @@ char SensorInformation::vendorName[SENSOR_NAME_MAX_LEN]
### power
```
char SensorInformation::power
```
......
......@@ -13,23 +13,23 @@
### Public 属性
| Public&nbsp;属性 | 描述 |
| Public&nbsp;属性 | 描述 |
| -------- | -------- |
| (&nbsp;[GetAllSensors](#getallsensors)&nbsp;)([out]&nbsp;struct&nbsp;[SensorInformation](_sensor_information.md)&nbsp;\*\*sensorInfo,&nbsp;[out]&nbsp;int32_t&nbsp;\*count) | 获取当前系统中所有类型的传感器信息。&nbsp;[更多...](#getallsensors) |
| (&nbsp;[Enable](#enable)&nbsp;)([in]&nbsp;int32_t&nbsp;sensorId) | 根据传感器设备类型标识使能传感器信息列表里存在的设备,只有数据订阅者使能传感器后,才能获取订阅的传感器数据。&nbsp;[更多...](#enable) |
| (&nbsp;[Disable](#disable)&nbsp;)([in]&nbsp;int32_t&nbsp;sensorId) | 根据传感器设备类型标识去使能传感器信息列表里存在的设备。&nbsp;[更多...](#disable) |
| (&nbsp;[SetBatch](#setbatch)&nbsp;)([in]&nbsp;int32_t&nbsp;sensorId,&nbsp;[in]&nbsp;int64_t&nbsp;samplingInterval,&nbsp;[in]&nbsp;int64_t&nbsp;reportInterval) | 设置指定传感器的数据采样间隔和数据上报间隔。&nbsp;[更多...](#setbatch) |
| (&nbsp;[SetMode](#setmode)&nbsp;)([in]&nbsp;int32_t&nbsp;sensorId,&nbsp;[in]&nbsp;int32_t&nbsp;mode) | 设置指定传感器的数据上报模式,不同的工作模式,上报数据的方式不同。&nbsp;[更多...](#setmode) |
| (&nbsp;[SetOption](#setoption)&nbsp;)([in]&nbsp;int32_t&nbsp;sensorId,&nbsp;[in]&nbsp;uint32_t&nbsp;option) | 设置指定传感器量程、精度等可选配置。&nbsp;[更多...](#setoption) |
| (&nbsp;[Register](#register)&nbsp;)([in]&nbsp;int32_t&nbsp;groupId,&nbsp;[in]&nbsp;[RecordDataCallback](_sensor.md#recorddatacallback)&nbsp;cb) | 订阅者注册传感器数据回调函数,系统会将获取到的传感器数据上报给订阅者。&nbsp;[更多...](#register) |
| (&nbsp;[Unregister](#unregister)&nbsp;)([in]&nbsp;int32_t&nbsp;groupId,&nbsp;[in]&nbsp;[RecordDataCallback](_sensor.md#recorddatacallback)&nbsp;cb) | 订阅者去注册传感器数据回调函数。&nbsp;[更多...](#unregister) |
| (&nbsp;[GetAllSensors](#getallsensors)&nbsp;)([out]&nbsp;struct&nbsp;[SensorInformation](_sensor_information.md)&nbsp;\*\*sensorInfo,&nbsp;[out]&nbsp;int32_t&nbsp;\*count) | 获取当前系统中所有类型的传感器信息。&nbsp;[更多...](#getallsensors) |
| (&nbsp;[Enable](#enable)&nbsp;)([in]&nbsp;int32_t&nbsp;sensorId) | 根据传感器设备类型标识使能传感器信息列表里存在的设备,只有数据订阅者使能传感器后,才能获取订阅的传感器数据。&nbsp;[更多...](#enable) |
| (&nbsp;[Disable](#disable)&nbsp;)([in]&nbsp;int32_t&nbsp;sensorId) | 根据传感器设备类型标识去使能传感器信息列表里存在的设备。&nbsp;[更多...](#disable) |
| (&nbsp;[SetBatch](#setbatch)&nbsp;)([in]&nbsp;int32_t&nbsp;sensorId,&nbsp;[in]&nbsp;int64_t&nbsp;samplingInterval,&nbsp;[in]&nbsp;int64_t&nbsp;reportInterval) | 设置指定传感器的数据采样间隔和数据上报间隔。&nbsp;[更多...](#setbatch) |
| (&nbsp;[SetMode](#setmode)&nbsp;)([in]&nbsp;int32_t&nbsp;sensorId,&nbsp;[in]&nbsp;int32_t&nbsp;mode) | 设置指定传感器的数据上报模式,不同的工作模式,上报数据的方式不同。&nbsp;[更多...](#setmode) |
| (&nbsp;[SetOption](#setoption)&nbsp;)([in]&nbsp;int32_t&nbsp;sensorId,&nbsp;[in]&nbsp;uint32_t&nbsp;option) | 设置指定传感器量程、精度等可选配置。&nbsp;[更多...](#setoption) |
| (&nbsp;[Register](#register)&nbsp;)([in]&nbsp;int32_t&nbsp;groupId,&nbsp;[in]&nbsp;[RecordDataCallback](_sensor.md#recorddatacallback)&nbsp;cb) | 订阅者注册传感器数据回调函数,系统会将获取到的传感器数据上报给订阅者。&nbsp;[更多...](#register) |
| (&nbsp;[Unregister](#unregister)&nbsp;)([in]&nbsp;int32_t&nbsp;groupId,&nbsp;[in]&nbsp;[RecordDataCallback](_sensor.md#recorddatacallback)&nbsp;cb) | 订阅者取消注册传感器数据回调函数。&nbsp;[更多...](#unregister) |
## **详细描述**
提供sensor设备基本控制操作接口。
结构体提供获取传感器设备信息、订阅/订阅传感器数据、使能/去使能传感器、设置传感器模式、设置传感器精度、量程等可选配置接口定义。
结构体提供获取传感器设备信息、订阅/取消订阅传感器数据、使能/去使能传感器、设置传感器模式、设置传感器精度、量程等可选配置接口定义。
## **类成员变量说明**
......@@ -37,7 +37,7 @@
### Disable
```
int32_t(* SensorInterface::Disable) ([in] int32_t sensorId)
```
......@@ -48,9 +48,9 @@ int32_t(* SensorInterface::Disable) ([in] int32_t sensorId)
**参数:**
| 名称 | 描述 |
| 名称 | 描述 |
| -------- | -------- |
| sensorId | 唯一标识一个传感器设备类型,详见[SensorTypeTag](_sensor.md#sensortypetag)。 |
| sensorId | 唯一标识一个传感器设备类型,详见[SensorTypeTag](_sensor.md#sensortypetag)。 |
**返回:**
......@@ -61,7 +61,7 @@ int32_t(* SensorInterface::Disable) ([in] int32_t sensorId)
### Enable
```
int32_t(* SensorInterface::Enable) ([in] int32_t sensorId)
```
......@@ -72,9 +72,9 @@ int32_t(* SensorInterface::Enable) ([in] int32_t sensorId)
**参数:**
| 名称 | 描述 |
| 名称 | 描述 |
| -------- | -------- |
| sensorId | 唯一标识一个传感器设备类型,详见[SensorTypeTag](_sensor.md#sensortypetag)。 |
| sensorId | 唯一标识一个传感器设备类型,详见[SensorTypeTag](_sensor.md#sensortypetag)。 |
**返回:**
......@@ -85,7 +85,7 @@ int32_t(* SensorInterface::Enable) ([in] int32_t sensorId)
### GetAllSensors
```
int32_t(* SensorInterface::GetAllSensors) ([out] struct SensorInformation **sensorInfo,[out] int32_t *count)
```
......@@ -96,10 +96,10 @@ int32_t(* SensorInterface::GetAllSensors) ([out] struct SensorInformation **sens
**参数:**
| 名称 | 描述 |
| 名称 | 描述 |
| -------- | -------- |
| sensorInfo | 输出系统中注册的所有传感器信息,一种类型传感器信息包括传感器名字、设备厂商、&nbsp;固件版本号、硬件版本号、传感器类型编号、传感器标识、最大量程、精度、功耗,详见[SensorInformation](_sensor_information.md)。 |
| count | 输出系统中注册的传感器数量。 |
| sensorInfo | 输出系统中注册的所有传感器信息,一种类型传感器信息包括传感器名字、设备厂商、&nbsp;固件版本号、硬件版本号、传感器类型编号、传感器标识、最大量程、精度、功耗,详见[SensorInformation](_sensor_information.md)。 |
| count | 输出系统中注册的传感器数量。 |
**返回:**
......@@ -110,7 +110,7 @@ int32_t(* SensorInterface::GetAllSensors) ([out] struct SensorInformation **sens
### Register
```
int32_t(* SensorInterface::Register) ([in] int32_t groupId,[in] RecordDataCallback cb)
```
......@@ -121,10 +121,10 @@ int32_t(* SensorInterface::Register) ([in] int32_t groupId,[in] RecordDataCallba
**参数:**
| 名称 | 描述 |
| 名称 | 描述 |
| -------- | -------- |
| groupId | 传感器组ID。&nbsp;sensorId枚举值范围为128-160,表示已订阅医疗传感器服务,只需成功订阅一次,无需重复订阅。&nbsp;sensorId枚举值范围不在128-160之间,这意味着传统传感器已订阅,只需成功订阅一次,无需重复订阅。 |
| cb | 要注册的回调函数,详见[RecordDataCallback](_sensor.md#recorddatacallback)。 |
| groupId | 传感器组ID。&nbsp;sensorId枚举值范围为128-160,表示已订阅医疗传感器服务,只需成功订阅一次,无需重复订阅。&nbsp;sensorId枚举值范围不在128-160之间,这意味着传统传感器已订阅,只需成功订阅一次,无需重复订阅。 |
| cb | 要注册的回调函数,详见[RecordDataCallback](_sensor.md#recorddatacallback)。 |
**返回:**
......@@ -135,7 +135,7 @@ int32_t(* SensorInterface::Register) ([in] int32_t groupId,[in] RecordDataCallba
### SetBatch
```
int32_t(* SensorInterface::SetBatch) ([in] int32_t sensorId,[in] int64_t samplingInterval,[in] int64_t reportInterval)
```
......@@ -146,11 +146,11 @@ int32_t(* SensorInterface::SetBatch) ([in] int32_t sensorId,[in] int64_t samplin
**参数:**
| 名称 | 描述 |
| 名称 | 描述 |
| -------- | -------- |
| sensorId | 唯一标识一个传感器设备类型,详见[SensorTypeTag](_sensor.md#sensortypetag)。 |
| samplingInterval | 设置指定传感器的数据采样间隔,单位纳秒。 |
| reportInterval | 表示传感器数据上报间隔,单位纳秒。 |
| sensorId | 唯一标识一个传感器设备类型,详见[SensorTypeTag](_sensor.md#sensortypetag)。 |
| samplingInterval | 设置指定传感器的数据采样间隔,单位纳秒。 |
| reportInterval | 表示传感器数据上报间隔,单位纳秒。 |
**返回:**
......@@ -161,7 +161,7 @@ int32_t(* SensorInterface::SetBatch) ([in] int32_t sensorId,[in] int64_t samplin
### SetMode
```
int32_t(* SensorInterface::SetMode) ([in] int32_t sensorId,[in] int32_t mode)
```
......@@ -172,10 +172,10 @@ int32_t(* SensorInterface::SetMode) ([in] int32_t sensorId,[in] int32_t mode)
**参数:**
| 名称 | 描述 |
| 名称 | 描述 |
| -------- | -------- |
| sensorId | 唯一标识一个传感器设备类型,详见[SensorTypeTag](_sensor.md#sensortypetag)。 |
| mode | 传感器的数据上报模式,详见[SensorModeType](_sensor.md#sensormodetype)。 |
| sensorId | 唯一标识一个传感器设备类型,详见[SensorTypeTag](_sensor.md#sensortypetag)。 |
| mode | 传感器的数据上报模式,详见[SensorModeType](_sensor.md#sensormodetype)。 |
**返回:**
......@@ -186,7 +186,7 @@ int32_t(* SensorInterface::SetMode) ([in] int32_t sensorId,[in] int32_t mode)
### SetOption
```
int32_t(* SensorInterface::SetOption) ([in] int32_t sensorId,[in] uint32_t option)
```
......@@ -197,10 +197,10 @@ int32_t(* SensorInterface::SetOption) ([in] int32_t sensorId,[in] uint32_t optio
**参数:**
| 名称 | 描述 |
| 名称 | 描述 |
| -------- | -------- |
| sensorId | 唯一标识一个传感器设备类型,详见[SensorTypeTag](_sensor.md#sensortypetag)。 |
| option | 传感器的量程、精度等配置。 |
| sensorId | 唯一标识一个传感器设备类型,详见[SensorTypeTag](_sensor.md#sensortypetag)。 |
| option | 传感器的量程、精度等配置。 |
**返回:**
......@@ -211,21 +211,21 @@ int32_t(* SensorInterface::SetOption) ([in] int32_t sensorId,[in] uint32_t optio
### Unregister
```
int32_t(* SensorInterface::Unregister) ([in] int32_t groupId,[in] RecordDataCallback cb)
```
**描述:**
订阅者注册传感器数据回调函数。
订阅者取消注册传感器数据回调函数。
**参数:**
| 名称 | 描述 |
| 名称 | 描述 |
| -------- | -------- |
| groupId | 传感器组ID。&nbsp;sensorId枚举值范围为128-160,表示已订阅医疗传感器服务。只需成功取消订阅一次,无需重复取消订阅。&nbsp;sensorId枚举值范围不在128-160之间,这意味着传统传感器已订阅。并且成功取消订阅。 |
| cb | 要注册的回调函数,详见[RecordDataCallback](_sensor.md#recorddatacallback)。 |
| groupId | 传感器组ID。&nbsp;sensorId枚举值范围为128-160,表示已订阅医疗传感器服务。只需成功取消订阅一次,无需重复取消订阅。&nbsp;sensorId枚举值范围不在128-160之间,这意味着传统传感器已订阅。并且成功取消订阅。 |
| cb | 要取消注册的回调函数,详见[RecordDataCallback](_sensor.md#recorddatacallback)。 |
**返回:**
......
......@@ -13,11 +13,11 @@
### 类
| 类 | 描述 |
| 类 | 描述 |
| -------- | -------- |
| LightFlashEffect | 定义闪烁参数。&nbsp;[更多...](_light_flash_effect.md) |
| LightEffect | 定义灯的效果参数。&nbsp;[更多...](_light_effect.md) |
| LightInfo | 定义灯的基本信息。&nbsp;[更多...](_light_info.md) |
| LightFlashEffect | 定义闪烁参数。&nbsp;[更多...](_light_flash_effect.md) |
| LightEffect | 定义灯的效果参数。&nbsp;[更多...](_light_effect.md) |
| LightInfo | 定义灯的基本信息。&nbsp;[更多...](_light_info.md) |
## **详细描述**
......@@ -27,3 +27,7 @@
**Since:**
3.1
**Version:**
1.0
\ No newline at end of file
......@@ -13,23 +13,28 @@
### 类
| 类 | 描述 |
| 类 | 描述 |
| -------- | -------- |
| [LightInterface](_light_interface.md) | 定义可以在灯上执行的基本操作。&nbsp;[更多...](_light_interface.md) |
| [LightInterface](_light_interface.md) | 定义可以在灯上执行的基本操作。&nbsp;[更多...](_light_interface.md) |
### 函数
| 函数 | 描述 |
| 函数 | 描述 |
| -------- | -------- |
| [NewLightInterfaceInstance](_light.md#newlightinterfaceinstance)&nbsp;(void) | 创建LightInterface实例。&nbsp;[更多...](_light.md#newlightinterfaceinstance) |
| [FreeLightInterfaceInstance](_light.md#freelightinterfaceinstance)&nbsp;(void) | 释放LightInterface实例和相关资源。&nbsp;[更多...](_light.md#freelightinterfaceinstance) |
| [NewLightInterfaceInstance](_light.md#newlightinterfaceinstance)&nbsp;(void) | 创建LightInterface实例。&nbsp;[更多...](_light.md#newlightinterfaceinstance) |
| [FreeLightInterfaceInstance](_light.md#freelightinterfaceinstance)&nbsp;(void) | 释放LightInterface实例和相关资源。&nbsp;[更多...](_light.md#freelightinterfaceinstance) |
## **详细描述**
声明light模块的通用API,可用于获取灯ID、打开或关闭灯、并设置灯光亮度和闪烁模式。
**Sinc[更多...](_light_flash_effect.md)e更多...[更多...](_light_info.md):**
**Since:**
3.1
**Version:**
1.0
......@@ -13,22 +13,22 @@
### 类
| 类 | 描述 |
| 类 | 描述 |
| -------- | -------- |
| [SensorInterface](_sensor_interface.md) | 提供sensor设备基本控制操作接口。&nbsp;[更多...](_sensor_interface.md) |
| [SensorInterface](_sensor_interface.md) | 提供sensor设备基本控制操作接口。&nbsp;[更多...](_sensor_interface.md) |
### 函数
| 函数 | 描述 |
| 函数 | 描述 |
| -------- | -------- |
| [NewSensorInterfaceInstance](_sensor.md#newsensorinterfaceinstance)&nbsp;(void) | 创建传感器接口实例。&nbsp;[更多...](_sensor.md#newsensorinterfaceinstance) |
| [FreeSensorInterfaceInstance](_sensor.md#freesensorinterfaceinstance)&nbsp;(void) | 释放传感器接口实例。&nbsp;[更多...](_sensor.md#freesensorinterfaceinstance) |
| [NewSensorInterfaceInstance](_sensor.md#newsensorinterfaceinstance)&nbsp;(void) | 创建传感器接口实例。&nbsp;[更多...](_sensor.md#newsensorinterfaceinstance) |
| [FreeSensorInterfaceInstance](_sensor.md#freesensorinterfaceinstance)&nbsp;(void) | 释放传感器接口实例。&nbsp;[更多...](_sensor.md#freesensorinterfaceinstance) |
## **详细描述**
Sensor模块对外通用的接口声明文件,提供获取传感器设备信息、订阅/订阅传感器数据、 使能/去使能传感器、设置传感器模式、设置传感器精度,量程等可选配置接口定义。
Sensor模块对外通用的接口声明文件,提供获取传感器设备信息、订阅/取消订阅传感器数据、 使能/去使能传感器、设置传感器模式、设置传感器精度,量程等可选配置接口定义。
**Since:**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册