Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
49cd920a
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
49cd920a
编写于
3月 12, 2022
作者:
C
cff-gite
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改sensor的on、once、off用例
Signed-off-by:
N
cff-gite
<
chenfeifei8@huawei.com
>
上级
b7d8bbdb
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
685 addition
and
298 deletion
+685
-298
zh-cn/application-dev/reference/apis/js-apis-sensor.md
zh-cn/application-dev/reference/apis/js-apis-sensor.md
+685
-298
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-sensor.md
浏览文件 @
49cd920a
...
@@ -13,7 +13,7 @@ import sensor from '@ohos.sensor';
...
@@ -13,7 +13,7 @@ import sensor from '@ohos.sensor';
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER)
on(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback:
Async
Callback
<
AccelerometerResponse
>
,options?: Options): void
on(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback
<
AccelerometerResponse
>
,options?: Options): void
监听加速度传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听加速度传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -26,16 +26,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallbac
...
@@ -26,16 +26,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallbac
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的加速度传感器类型为SENSOR_TYPE_ID_ACCELEROMETER。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的加速度传感器类型为SENSOR_TYPE_ID_ACCELEROMETER。 |
| callback |
Async
Callback
<
[AccelerometerResponse](#accelerometerresponse)
>
| 是 | 注册加速度传感器的回调函数,上报的数据类型为AccelerometerResponse。 |
| callback | Callback
<
[AccelerometerResponse](#accelerometerresponse)
>
| 是 | 注册加速度传感器的回调函数,上报的数据类型为AccelerometerResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -47,7 +43,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallbac
...
@@ -47,7 +43,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallbac
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION)
on(type:sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:
Async
Callback
<
LinearAccelerometerResponse
>
, options?: Options): void
on(type:sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback
<
LinearAccelerometerResponse
>
, options?: Options): void
监听线性加速度传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听线性加速度传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -59,16 +55,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:AsyncCallb
...
@@ -59,16 +55,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:AsyncCallb
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的线性加速度传感器类型为SENSOR_TYPE_ID_LINEAR_ACCELERATION。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的线性加速度传感器类型为SENSOR_TYPE_ID_LINEAR_ACCELERATION。 |
| callback |
Async
Callback
<
[LinearAccelerometerResponse](#linearaccelerometerresponse)
>
| 是 | 注册线性加速度传感器的回调函数,上报的数据类型为LinearAccelerometerResponse。 |
| callback | Callback
<
[LinearAccelerometerResponse](#linearaccelerometerresponse)
>
| 是 | 注册线性加速度传感器的回调函数,上报的数据类型为LinearAccelerometerResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -80,7 +72,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:AsyncCallb
...
@@ -80,7 +72,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:AsyncCallb
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED)
on(type:sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:
Async
Callback
<
AccelerometerUncalibratedResponse
>
, options?: Options): void
on(type:sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:
Callback
<
AccelerometerUncalibratedResponse
>
, options?: Options): void
监听未校准加速度计传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听未校准加速度计传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -92,16 +84,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:Asy
...
@@ -92,16 +84,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:Asy
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的未校准加速度计传感器类型为SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的未校准加速度计传感器类型为SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED。 |
| callback |
Async
Callback
<
[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)
>
| 是 | 注册未校准加速度计传感器的回调函数,上报的数据类型为AccelerometerUncalibratedResponse。 |
| callback | Callback
<
[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)
>
| 是 | 注册未校准加速度计传感器的回调函数,上报的数据类型为AccelerometerUncalibratedResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -116,7 +104,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:Asy
...
@@ -116,7 +104,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:Asy
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY)
on(type: sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback:
Async
Callback
<
GravityResponse
>
,options?: Options): void
on(type: sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback
<
GravityResponse
>
,options?: Options): void
监听重力传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听重力传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -126,16 +114,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback<Gr
...
@@ -126,16 +114,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback<Gr
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的重力传感器类型为SENSOR_TYPE_ID_GRAVITY。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的重力传感器类型为SENSOR_TYPE_ID_GRAVITY。 |
| callback |
Async
Callback
<
[GravityResponse](#gravityresponse)
>
| 是 | 注册重力传感器的回调函数,上报的数据类型为GravityResponse。 |
| callback | Callback
<
[GravityResponse](#gravityresponse)
>
| 是 | 注册重力传感器的回调函数,上报的数据类型为GravityResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -147,7 +131,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback<Gr
...
@@ -147,7 +131,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback<Gr
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE)
on(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback:
Async
Callback
<
GyroscopeResponse
>
, options?: Options): void
on(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback
<
GyroscopeResponse
>
, options?: Options): void
监听陀螺仪传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听陀螺仪传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -159,16 +143,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback<
...
@@ -159,16 +143,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback<
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的陀螺仪传感器类型为SENSOR_TYPE_ID_GYROSCOPE。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的陀螺仪传感器类型为SENSOR_TYPE_ID_GYROSCOPE。 |
| callback |
Async
Callback
<
[GyroscopeResponse](#gyroscoperesponse)
>
| 是 | 注册陀螺仪传感器的回调函数,上报的数据类型为GyroscopeResponse。 |
| callback | Callback
<
[GyroscopeResponse](#gyroscoperesponse)
>
| 是 | 注册陀螺仪传感器的回调函数,上报的数据类型为GyroscopeResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -180,7 +160,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback<
...
@@ -180,7 +160,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback<
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED)
on(type:sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:
Async
Callback
<
GyroscopeUncalibratedResponse
>
, options?: Options): void
on(type:sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:Callback
<
GyroscopeUncalibratedResponse
>
, options?: Options): void
监听未校准陀螺仪传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听未校准陀螺仪传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -192,16 +172,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:AsyncCa
...
@@ -192,16 +172,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:AsyncCa
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的未校准陀螺仪传感器类型为SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的未校准陀螺仪传感器类型为SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED。 |
| callback |
Async
Callback
<
[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)
>
| 是 | 注册未校准陀螺仪传感器的回调函数,上报的数据类型为GyroscopeUncalibratedResponse。 |
| callback | Callback
<
[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)
>
| 是 | 注册未校准陀螺仪传感器的回调函数,上报的数据类型为GyroscopeUncalibratedResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -216,7 +192,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:AsyncCa
...
@@ -216,7 +192,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:AsyncCa
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION)
on(type: sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback:
Async
Callback
<
SignificantMotionResponse
>
, options?: Options): void
on(type: sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: Callback
<
SignificantMotionResponse
>
, options?: Options): void
监听大幅动作传感器数据变化。如果多次调用该接口,仅最后一次调用生效。
监听大幅动作传感器数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -226,16 +202,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: AsyncCal
...
@@ -226,16 +202,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: AsyncCal
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的大幅动作传感器类型为SENSOR_TYPE_ID_SIGNIFICANT_MOTION。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的大幅动作传感器类型为SENSOR_TYPE_ID_SIGNIFICANT_MOTION。 |
| callback |
Async
Callback
<
[SignificantMotionResponse](#significantmotionresponse)
>
| 是 | 注册有效运动传感器的回调函数,上报的数据类型为SignificantMotionResponse。 |
| callback | Callback
<
[SignificantMotionResponse](#significantmotionresponse)
>
| 是 | 注册有效运动传感器的回调函数,上报的数据类型为SignificantMotionResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Scalar data: ' + data.scalar);
console.info('Scalar data: ' + data.scalar);
},
},
{interval: 10000000}
{interval: 10000000}
...
@@ -245,7 +217,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: AsyncCal
...
@@ -245,7 +217,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: AsyncCal
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION)
on(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback:
Async
Callback
<
PedometerDetectionResponse
>
, options?: Options): void
on(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: Callback
<
PedometerDetectionResponse
>
, options?: Options): void
监听计步检测传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听计步检测传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -257,16 +229,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: AsyncCa
...
@@ -257,16 +229,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: AsyncCa
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的计步检测传感器类型为SENSOR_TYPE_ID_PEDOMETER_DETECTION。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的计步检测传感器类型为SENSOR_TYPE_ID_PEDOMETER_DETECTION。 |
| callback |
Async
Callback
<
[PedometerDetectionResponse](#pedometerdetectionresponse)
>
| 是 | 注册计步检测传感器的回调函数,上报的数据类型为PedometerDetectionResponse。 |
| callback | Callback
<
[PedometerDetectionResponse](#pedometerdetectionresponse)
>
| 是 | 注册计步检测传感器的回调函数,上报的数据类型为PedometerDetectionResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Scalar data: ' + data.scalar);
console.info('Scalar data: ' + data.scalar);
},
},
{interval: 10000000}
{interval: 10000000}
...
@@ -276,7 +244,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: AsyncCa
...
@@ -276,7 +244,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: AsyncCa
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER)
on(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback:
Async
Callback
<
PedometerResponse
>
, options?: Options): void
on(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback
<
PedometerResponse
>
, options?: Options): void
监听计步传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听计步传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -288,16 +256,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback<
...
@@ -288,16 +256,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback<
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的计步传感器类型为SENSOR_TYPE_ID_PEDOMETER。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的计步传感器类型为SENSOR_TYPE_ID_PEDOMETER。 |
| callback |
Async
Callback
<
[PedometerResponse](#pedometerresponse)
>
| 是 | 注册计步传感器的回调函数,上报的数据类型为PedometerResponse。 |
| callback | Callback
<
[PedometerResponse](#pedometerresponse)
>
| 是 | 注册计步传感器的回调函数,上报的数据类型为PedometerResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Steps: ' + data.steps);
console.info('Steps: ' + data.steps);
},
},
{interval: 10000000}
{interval: 10000000}
...
@@ -307,7 +271,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback<
...
@@ -307,7 +271,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback<
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE)
on(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:
Async
Callback
<
AmbientTemperatureResponse
>
, options?: Options): void
on(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:Callback
<
AmbientTemperatureResponse
>
, options?: Options): void
监听环境温度传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听环境温度传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -317,16 +281,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:AsyncCallb
...
@@ -317,16 +281,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:AsyncCallb
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的环境温度传感器类型为SENSOR_TYPE_ID_AMBIENT_TEMPERATURE。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的环境温度传感器类型为SENSOR_TYPE_ID_AMBIENT_TEMPERATURE。 |
| callback |
Async
Callback
<
[AmbientTemperatureResponse](#ambienttemperatureresponse)
>
| 是 | 注册环境温度传感器的回调函数,上报的数据类型为AmbientTemperatureResponse。 |
| callback | Callback
<
[AmbientTemperatureResponse](#ambienttemperatureresponse)
>
| 是 | 注册环境温度传感器的回调函数,上报的数据类型为AmbientTemperatureResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Temperature: ' + data.temperature);
console.info('Temperature: ' + data.temperature);
},
},
{interval: 10000000}
{interval: 10000000}
...
@@ -336,7 +296,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:AsyncCallb
...
@@ -336,7 +296,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:AsyncCallb
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD)
on(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback:
Async
Callback
<
MagneticFieldResponse
>
,options?: Options): void
on(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback
<
MagneticFieldResponse
>
,options?: Options): void
监听磁场传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听磁场传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -346,16 +306,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallbac
...
@@ -346,16 +306,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallbac
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的磁场传感器类型为SENSOR_TYPE_ID_MAGNETIC_FIELD。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的磁场传感器类型为SENSOR_TYPE_ID_MAGNETIC_FIELD。 |
| callback |
Async
Callback
<
[MagneticFieldResponse](#magneticfieldresponse)
>
| 是 | 注册磁场传感器的回调函数,上报的数据类型为MagneticFieldResponse。 |
| callback | Callback
<
[MagneticFieldResponse](#magneticfieldresponse)
>
| 是 | 注册磁场传感器的回调函数,上报的数据类型为MagneticFieldResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -367,7 +323,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallbac
...
@@ -367,7 +323,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallbac
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED)
on(type:sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:
Async
Callback
<
MagneticFieldUncalibratedResponse
>
, options: Options): void
on(type:sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:
Callback
<
MagneticFieldUncalibratedResponse
>
, options: Options): void
监听未校准磁场传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听未校准磁场传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -377,16 +333,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:As
...
@@ -377,16 +333,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:As
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的未校准磁场传感器类型为SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的未校准磁场传感器类型为SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED。 |
| callback |
Async
Callback
<
[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)
>
| 是 | 注册未校准磁场传感器的回调函数,上报的数据类型为MagneticFieldUncalibratedResponse。 |
| callback | Callback
<
[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)
>
| 是 | 注册未校准磁场传感器的回调函数,上报的数据类型为MagneticFieldUncalibratedResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -401,7 +353,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:As
...
@@ -401,7 +353,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:As
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY)
on(type:sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback:
Async
Callback
<
ProximityResponse
>
,options?: Options): void
on(type:sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback
<
ProximityResponse
>
,options?: Options): void
监听接近光传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听接近光传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -411,16 +363,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback<P
...
@@ -411,16 +363,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback<P
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的接近光传感器类型为SENSOR_TYPE_ID_PROXIMITY。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的接近光传感器类型为SENSOR_TYPE_ID_PROXIMITY。 |
| callback |
Async
Callback
<
[ProximityResponse](#proximityresponse)
>
| 是 | 注册接近光传感器的回调函数,上报的数据类型为ProximityResponse。 |
| callback | Callback
<
[ProximityResponse](#proximityresponse)
>
| 是 | 注册接近光传感器的回调函数,上报的数据类型为ProximityResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Distance: ' + data.distance);
console.info('Distance: ' + data.distance);
},
},
{interval: 10000000}
{interval: 10000000}
...
@@ -430,7 +378,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback<P
...
@@ -430,7 +378,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback<P
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY)
on(type: sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback:
Async
Callback
<
HumidityResponse
>
,options?: Options): void
on(type: sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback
<
HumidityResponse
>
,options?: Options): void
监听湿度传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听湿度传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -440,16 +388,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback<H
...
@@ -440,16 +388,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback<H
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的湿度传感器类型为SENSOR_TYPE_ID_HUMIDITY。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的湿度传感器类型为SENSOR_TYPE_ID_HUMIDITY。 |
| callback |
Async
Callback
<
[HumidityResponse](#humidityresponse)
>
| 是 | 注册湿度传感器的回调函数,上报的数据类型为HumidityResponse。 |
| callback | Callback
<
[HumidityResponse](#humidityresponse)
>
| 是 | 注册湿度传感器的回调函数,上报的数据类型为HumidityResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Humidity: ' + data.humidity);
console.info('Humidity: ' + data.humidity);
},
},
{interval: 10000000}
{interval: 10000000}
...
@@ -459,7 +403,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback<H
...
@@ -459,7 +403,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback<H
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER)
on(type:sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback:
Async
Callback
<
BarometerResponse
>
,options?: Options): void
on(type:sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback
<
BarometerResponse
>
,options?: Options): void
监听气压计传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听气压计传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -469,16 +413,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback<B
...
@@ -469,16 +413,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback<B
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的气压计传感器类型为SENSOR_TYPE_ID_BAROMETER。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的气压计传感器类型为SENSOR_TYPE_ID_BAROMETER。 |
| callback |
Async
Callback
<
[BarometerResponse](#barometerresponse)
>
| 是 | 注册气压计传感器的回调函数,上报的数据类型为BarometerResponse。 |
| callback | Callback
<
[BarometerResponse](#barometerresponse)
>
| 是 | 注册气压计传感器的回调函数,上报的数据类型为BarometerResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Atmospheric pressure: ' + data.pressure);
console.info('Atmospheric pressure: ' + data.pressure);
},
},
{interval: 10000000}
{interval: 10000000}
...
@@ -488,7 +428,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback<B
...
@@ -488,7 +428,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback<B
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HALL)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HALL)
on(type: sensor.SensorType.SENSOR_TYPE_ID_HALL, callback:
Async
Callback
<
HallResponse
>
, options?: Options): void
on(type: sensor.SensorType.SENSOR_TYPE_ID_HALL, callback: Callback
<
HallResponse
>
, options?: Options): void
监听霍尔传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听霍尔传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -498,16 +438,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback<HallR
...
@@ -498,16 +438,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback<HallR
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的霍尔传感器类型为SENSOR_TYPE_ID_HALL。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的霍尔传感器类型为SENSOR_TYPE_ID_HALL。 |
| callback |
Async
Callback
<
[HallResponse](#hallresponse)
>
| 是 | 注册霍尔传感器的回调函数,上报的数据类型为
HallResponse。 |
| callback | Callback
<
[HallResponse](#hallresponse)
>
| 是 | 注册霍尔传感器的回调函数,上报的数据类型为
HallResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HALL,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HALL,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Status: ' + data.status);
console.info('Status: ' + data.status);
},
},
{interval: 10000000}
{interval: 10000000}
...
@@ -517,7 +453,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback<HallR
...
@@ -517,7 +453,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback<HallR
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT)
on(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback:
Async
Callback
<
LightResponse
>
, options?: Options): void
on(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback
<
LightResponse
>
, options?: Options): void
监听环境光传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听环境光传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -527,16 +463,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallback&
...
@@ -527,16 +463,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallback&
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的环境光传感器类型为SENSOR_TYPE_ID_AMBIENT_LIGHT。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的环境光传感器类型为SENSOR_TYPE_ID_AMBIENT_LIGHT。 |
| callback |
Async
Callback
<
[LightResponse](#lightresponse)
>
| 是 | 注册环境光传感器的回调函数,上报的数据类型为LightResponse。 |
| callback | Callback
<
[LightResponse](#lightresponse)
>
| 是 | 注册环境光传感器的回调函数,上报的数据类型为LightResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info(' Illumination: ' + data.intensity);
console.info(' Illumination: ' + data.intensity);
},
},
{interval: 10000000}
{interval: 10000000}
...
@@ -546,7 +478,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallback&
...
@@ -546,7 +478,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallback&
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION)
on(type: sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback:
Async
Callback
<
OrientationResponse
>
, options?: Options): void
on(type: sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback
<
OrientationResponse
>
, options?: Options): void
监听方向传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听方向传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -556,16 +488,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback&l
...
@@ -556,16 +488,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback&l
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的方向传感器类型为SENSOR_TYPE_ID_ORIENTATION |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的方向传感器类型为SENSOR_TYPE_ID_ORIENTATION |
| callback |
Async
Callback
<
[OrientationResponse](#orientationresponse)
>
| 是 | 注册方向传感器的回调函数,上报的数据类型为OrientationResponse。 |
| callback | Callback
<
[OrientationResponse](#orientationresponse)
>
| 是 | 注册方向传感器的回调函数,上报的数据类型为OrientationResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -574,10 +502,36 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback&l
...
@@ -574,10 +502,36 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback&l
);
);
```
```
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE)
on(type: sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback
<
HeartRateResponse
>
, options?: Options): void
监听心率传感器数据变化一次。
**需要权限**
:ohos.permission.READ_HEALTH_DATA
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的心率传感器类型为SENSOR_TYPE_ID_HEART_RATE。 |
| callback | Callback
<
[HeartRateResponse](#heartrateresponse)
>
| 是 | 注册一次心率传感器的回调函数,上报的数据类型为HeartRateResponse。 |
-
示例:
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE,function(data){
console.info("Heart rate: " + data.heartRate);
},
{interval: 10000000}
);
```
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR)
on(type:sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,callback:
Async
Callback
<
RotationVectorResponse
>
,options?: Options): void
on(type:sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,callback:
Callback
<
RotationVectorResponse
>
,options?: Options): void
监听旋转矢量传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听旋转矢量传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -587,16 +541,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,callback:AsyncCallback&
...
@@ -587,16 +541,12 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,callback:AsyncCallback&
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的旋转矢量传感器类型为SENSOR_TYPE_ID_ROTATION_VECTOR。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的旋转矢量传感器类型为SENSOR_TYPE_ID_ROTATION_VECTOR。 |
| callback |
Async
Callback
<
[RotationVectorResponse](#rotationvectorresponse)
>
| 是 | 注册旋转矢量传感器的回调函数,上报的数据类型为RotationVectorResponse。 |
| callback | Callback
<
[RotationVectorResponse](#rotationvectorresponse)
>
| 是 | 注册旋转矢量传感器的回调函数,上报的数据类型为RotationVectorResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -608,7 +558,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,callback:AsyncCallback&
...
@@ -608,7 +558,7 @@ on(type:sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,callback:AsyncCallback&
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION)
## sensor.on(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION)
on(type: sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback:
Async
Callback
<
WearDetectionResponse
>
,options?: Options): void
on(type: sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback
<
WearDetectionResponse
>
,options?: Options): void
监听佩戴检测传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
监听佩戴检测传感器的数据变化。如果多次调用该接口,仅最后一次调用生效。
...
@@ -618,16 +568,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: AsyncCallbac
...
@@ -618,16 +568,12 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: AsyncCallbac
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的佩戴检测传感器类型为SENSOR_TYPE_ID_WEAR_DETECTION。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要订阅的佩戴检测传感器类型为SENSOR_TYPE_ID_WEAR_DETECTION。 |
| callback |
Async
Callback
<
[WearDetectionResponse](#weardetectionresponse)
>
| 是 | 注册佩戴检测传感器的回调函数,上报的数据类型为WearDetectionResponse。 |
| callback | Callback
<
[WearDetectionResponse](#weardetectionresponse)
>
| 是 | 注册佩戴检测传感器的回调函数,上报的数据类型为WearDetectionResponse。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
| options |
[
Options
](
#options
)
| 否 | 可选参数列表,设置上报频率,默认值为200000000ns。 |
-
示例:
-
示例:
```
```
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION,function(error,data){
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Wear status: ' + data.value);
console.info('Wear status: ' + data.value);
},
},
{interval: 10000000}
{interval: 10000000}
...
@@ -637,7 +583,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: AsyncCallbac
...
@@ -637,7 +583,7 @@ on(type: sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: AsyncCallbac
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER)
once(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback:
Async
Callback
<
AccelerometerResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback
<
AccelerometerResponse
>
): void
监听加速度传感器的数据变化一次。
监听加速度传感器的数据变化一次。
...
@@ -649,15 +595,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallba
...
@@ -649,15 +595,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallba
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 加速度传感器类型为SENSOR_TYPE_ID_ACCELEROMETER。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 加速度传感器类型为SENSOR_TYPE_ID_ACCELEROMETER。 |
| callback |
Async
Callback
<
[AccelerometerResponse](#accelerometerresponse)
>
| 是 | 注册一次加速度传感器的回调函数,上报的数据类型为AccelerometerResponse。 |
| callback | Callback
<
[AccelerometerResponse](#accelerometerresponse)
>
| 是 | 注册一次加速度传感器的回调函数,上报的数据类型为AccelerometerResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER,function(error,data){
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER,function(data){
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -668,7 +610,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallba
...
@@ -668,7 +610,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallba
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION)
once(type:sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:
Async
Callback
<
LinearAccelerometerResponse
>
): void
once(type:sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback
<
LinearAccelerometerResponse
>
): void
监听线性加速度传感器数据变化一次。
监听线性加速度传感器数据变化一次。
...
@@ -680,15 +622,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:AsyncCal
...
@@ -680,15 +622,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:AsyncCal
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 线性加速度传感器类型为SENSOR_TYPE_ID_LINEAR_ACCELERATION。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 线性加速度传感器类型为SENSOR_TYPE_ID_LINEAR_ACCELERATION。 |
| callback |
Async
Callback
<
[LinearAccelerometerResponse](#linearaccelerometerresponse)
>
| 是 | 注册一次线性加速度传感器的回调函数,上报的数据类型为LinearAccelerometerResponse。 |
| callback | Callback
<
[LinearAccelerometerResponse](#linearaccelerometerresponse)
>
| 是 | 注册一次线性加速度传感器的回调函数,上报的数据类型为LinearAccelerometerResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -699,7 +637,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:AsyncCal
...
@@ -699,7 +637,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:AsyncCal
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED)
once(type:sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:
Async
Callback
<
AccelerometerUncalibratedResponse
>
): void
once(type:sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:
Callback
<
AccelerometerUncalibratedResponse
>
): void
监听未校准加速度传感器的数据变化一次。
监听未校准加速度传感器的数据变化一次。
...
@@ -711,15 +649,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:A
...
@@ -711,15 +649,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:A
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 未校准加速度传感器类型为SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 未校准加速度传感器类型为SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED。 |
| callback |
Async
Callback
<
[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)
>
| 是 | 注册一次未校准加速度传感器的回调函数,上报的数据类型为AccelerometerUncalibratedResponse。 |
| callback | Callback
<
[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)
>
| 是 | 注册一次未校准加速度传感器的回调函数,上报的数据类型为AccelerometerUncalibratedResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -733,7 +667,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:A
...
@@ -733,7 +667,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:A
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY)
once(type:sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback:
Async
Callback
<
GravityResponse
>
): void
once(type:sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback
<
GravityResponse
>
): void
监听重力传感器的数据变化一次。
监听重力传感器的数据变化一次。
...
@@ -743,15 +677,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback<G
...
@@ -743,15 +677,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback<G
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 重力传感器类型为SENSOR_TYPE_ID_GRAVITY。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 重力传感器类型为SENSOR_TYPE_ID_GRAVITY。 |
| callback |
Async
Callback
<
[GravityResponse](#gravityresponse)
>
| 是 | 注册一次重力传感器的回调函数,上报的数据类型为GravityResponse。 |
| callback | Callback
<
[GravityResponse](#gravityresponse)
>
| 是 | 注册一次重力传感器的回调函数,上报的数据类型为GravityResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -762,7 +692,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback<G
...
@@ -762,7 +692,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback<G
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE)
once(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback:
Async
Callback
<
GyroscopeResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback
<
GyroscopeResponse
>
): void
监听陀螺仪传感器的数据变化一次。
监听陀螺仪传感器的数据变化一次。
...
@@ -774,15 +704,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback&l
...
@@ -774,15 +704,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback&l
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 陀螺仪传感器类型为SENSOR_TYPE_ID_GYROSCOPE。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 陀螺仪传感器类型为SENSOR_TYPE_ID_GYROSCOPE。 |
| callback |
Async
Callback
<
[GyroscopeResponse](#gyroscoperesponse)
>
| 是 | 注册一次陀螺仪传感器的回调函数,上报的数据类型为GyroscopeResponse。 |
| callback | Callback
<
[GyroscopeResponse](#gyroscoperesponse)
>
| 是 | 注册一次陀螺仪传感器的回调函数,上报的数据类型为GyroscopeResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -793,7 +719,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback&l
...
@@ -793,7 +719,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback&l
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED)
once(type:sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:
Async
Callback
<
GyroscopeUncalibratedResponse
>
): void
once(type:sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:
Callback
<
GyroscopeUncalibratedResponse
>
): void
监听未校准陀螺仪传感器的数据变化一次。
监听未校准陀螺仪传感器的数据变化一次。
...
@@ -805,15 +731,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:Async
...
@@ -805,15 +731,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:Async
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 未校准陀螺仪传感器类型为SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 未校准陀螺仪传感器类型为SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED。 |
| callback |
Async
Callback
<
[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)
>
| 是 | 注册一次未校准陀螺仪传感器的回调函数,上报的数据类型为GyroscopeUncalibratedResponse。 |
| callback | Callback
<
[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)
>
| 是 | 注册一次未校准陀螺仪传感器的回调函数,上报的数据类型为GyroscopeUncalibratedResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -827,7 +749,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:Async
...
@@ -827,7 +749,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:Async
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION)
once(type: sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION,callback:
Async
Callback
<
SignificantMotionResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION,callback:
Callback
<
SignificantMotionResponse
>
): void
监听有效运动传感器的数据变化一次。
监听有效运动传感器的数据变化一次。
...
@@ -837,15 +759,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION,callback:AsyncCal
...
@@ -837,15 +759,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION,callback:AsyncCal
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 有效运动传感器类型为SENSOR_TYPE_ID_SIGNIFICANT_MOTION。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 有效运动传感器类型为SENSOR_TYPE_ID_SIGNIFICANT_MOTION。 |
| callback |
Async
Callback
<
[SignificantMotionResponse](#significantmotionresponse)
>
| 是 | 注册一次有效运动传感器的回调函数,上报的数据类型为SignificantMotionResponse。 |
| callback | Callback
<
[SignificantMotionResponse](#significantmotionresponse)
>
| 是 | 注册一次有效运动传感器的回调函数,上报的数据类型为SignificantMotionResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Scalar data: ' + data.scalar);
console.info('Scalar data: ' + data.scalar);
}
}
);
);
...
@@ -854,7 +772,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION,callback:AsyncCal
...
@@ -854,7 +772,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION,callback:AsyncCal
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION)
once(type:sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,callback:
Async
Callback
<
PedometerDetectionResponse
>
): void
once(type:sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,callback:
Callback
<
PedometerDetectionResponse
>
): void
监听计步检测传感器数据变化一次。
监听计步检测传感器数据变化一次。
...
@@ -866,15 +784,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,callback:AsyncCal
...
@@ -866,15 +784,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,callback:AsyncCal
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 计步检测传感器类型为SENSOR_TYPE_ID_PEDOMETER_DETECTION。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 计步检测传感器类型为SENSOR_TYPE_ID_PEDOMETER_DETECTION。 |
| callback |
Async
Callback
<
[PedometerDetectionResponse](#pedometerdetectionresponse)
>
| 是 | 注册一次计步检测传感器的回调函数,上报的数据类型为PedometerDetectionResponse。 |
| callback | Callback
<
[PedometerDetectionResponse](#pedometerdetectionresponse)
>
| 是 | 注册一次计步检测传感器的回调函数,上报的数据类型为PedometerDetectionResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Scalar data: ' + data.scalar);
console.info('Scalar data: ' + data.scalar);
}
}
);
);
...
@@ -883,7 +797,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,callback:AsyncCal
...
@@ -883,7 +797,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,callback:AsyncCal
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER)
once(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback:
Async
Callback
<
PedometerResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback
<
PedometerResponse
>
): void
监听计步器传感器数据变化一次。
监听计步器传感器数据变化一次。
...
@@ -895,15 +809,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback&l
...
@@ -895,15 +809,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback&l
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 计步传感器类型为SENSOR_TYPE_ID_PEDOMETER。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 计步传感器类型为SENSOR_TYPE_ID_PEDOMETER。 |
| callback |
Async
Callback
<
[PedometerResponse](#pedometerresponse)
>
| 是 | 注册一次计步传感器的回调函数,上报的数据类型为PedometerResponse。 |
| callback | Callback
<
[PedometerResponse](#pedometerresponse)
>
| 是 | 注册一次计步传感器的回调函数,上报的数据类型为PedometerResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Steps: ' + data.steps);
console.info('Steps: ' + data.steps);
}
}
);
);
...
@@ -912,7 +822,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback&l
...
@@ -912,7 +822,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback&l
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE)
once(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:
Async
Callback
<
AmbientTemperatureResponse
>
): void
once(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:
Callback
<
AmbientTemperatureResponse
>
): void
监听环境温度传感器数据变化一次。
监听环境温度传感器数据变化一次。
...
@@ -922,15 +832,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:AsyncCal
...
@@ -922,15 +832,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:AsyncCal
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 环境温度传感器类型为SENSOR_TYPE_ID_AMBIENT_TEMPERATURE。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 环境温度传感器类型为SENSOR_TYPE_ID_AMBIENT_TEMPERATURE。 |
| callback |
Async
Callback
<
[AmbientTemperatureResponse](#ambienttemperatureresponse)
>
| 是 | 注册一次环境温度传感器的回调函数,上报的数据类型为AmbientTemperatureResponse。 |
| callback | Callback
<
[AmbientTemperatureResponse](#ambienttemperatureresponse)
>
| 是 | 注册一次环境温度传感器的回调函数,上报的数据类型为AmbientTemperatureResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Temperature: ' + data.temperature);
console.info('Temperature: ' + data.temperature);
}
}
);
);
...
@@ -939,7 +845,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:AsyncCal
...
@@ -939,7 +845,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:AsyncCal
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD)
once(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback:
Async
Callback
<
MagneticFieldResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback
<
MagneticFieldResponse
>
): void
监听磁场传感器数据变化一次。
监听磁场传感器数据变化一次。
...
@@ -949,15 +855,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallb
...
@@ -949,15 +855,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallb
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 磁场传感器类型为SENSOR_TYPE_ID_MAGNETIC_FIELD。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 磁场传感器类型为SENSOR_TYPE_ID_MAGNETIC_FIELD。 |
| callback |
Async
Callback
<
[MagneticFieldResponse](#magneticfieldresponse)
>
| 是 | 注册一次磁场传感器的回调函数,上报的数据类型为MagneticFieldResponse。 |
| callback | Callback
<
[MagneticFieldResponse](#magneticfieldresponse)
>
| 是 | 注册一次磁场传感器的回调函数,上报的数据类型为MagneticFieldResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -968,7 +870,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallb
...
@@ -968,7 +870,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallb
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED)
once(type:sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:
Async
Callback
<
MagneticFieldUncalibratedResponse
>
): void
once(type:sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:
Callback
<
MagneticFieldUncalibratedResponse
>
): void
监听未校准磁场传感器数据变化一次。
监听未校准磁场传感器数据变化一次。
...
@@ -978,15 +880,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:
...
@@ -978,15 +880,11 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 未校准磁场传感器类型为SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 未校准磁场传感器类型为SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED。 |
| callback |
Async
Callback
<
[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)
>
| 是 | 注册一次未校准磁场传感器的回调函数,上报的数据类型为MagneticFieldUncalibratedResponse。 |
| callback | Callback
<
[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)
>
| 是 | 注册一次未校准磁场传感器的回调函数,上报的数据类型为MagneticFieldUncalibratedResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -1000,7 +898,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:
...
@@ -1000,7 +898,7 @@ once(type:sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY)
once(type: sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback:
Async
Callback
<
ProximityResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback
<
ProximityResponse
>
): void
监听接近光传感器数据变化一次。
监听接近光传感器数据变化一次。
...
@@ -1010,7 +908,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback&l
...
@@ -1010,7 +908,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback&l
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 接近光传感器类型为SENSOR_TYPE_ID_PROXIMITY。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 接近光传感器类型为SENSOR_TYPE_ID_PROXIMITY。 |
| callback |
Async
Callback
<
[ProximityResponse](#proximityresponse)
>
| 是 | 注册一次接近光传感器的回调函数,上报的数据类型为ProximityResponse。 |
| callback | Callback
<
[ProximityResponse](#proximityresponse)
>
| 是 | 注册一次接近光传感器的回调函数,上报的数据类型为ProximityResponse。 |
-
示例:
-
示例:
```
```
...
@@ -1027,7 +925,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback&l
...
@@ -1027,7 +925,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback&l
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY)
once(type: sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback:
Async
Callback
<
HumidityResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback
<
HumidityResponse
>
): void
监听湿度传感器数据变化一次。
监听湿度传感器数据变化一次。
...
@@ -1037,15 +935,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback<
...
@@ -1037,15 +935,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback<
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 湿度传感器类型为SENSOR_TYPE_ID_HUMIDITY。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 湿度传感器类型为SENSOR_TYPE_ID_HUMIDITY。 |
| callback |
Async
Callback
<
[HumidityResponse](#humidityresponse)
>
| 是 | 注册一次湿度传感器的回调函数,上报的数据类型为HumidityResponse。 |
| callback | Callback
<
[HumidityResponse](#humidityresponse)
>
| 是 | 注册一次湿度传感器的回调函数,上报的数据类型为HumidityResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Humidity: ' + data.humidity);
console.info('Humidity: ' + data.humidity);
}
}
);
);
...
@@ -1054,7 +948,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback<
...
@@ -1054,7 +948,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback<
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER)
once(type: sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback:
Async
Callback
<
BarometerResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback
<
BarometerResponse
>
): void
监听气压计传感器数据变化一次。
监听气压计传感器数据变化一次。
...
@@ -1064,15 +958,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback&l
...
@@ -1064,15 +958,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback&l
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 气压计传感器类型为SENSOR_TYPE_ID_BAROMETER。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 气压计传感器类型为SENSOR_TYPE_ID_BAROMETER。 |
| callback |
Async
Callback
<
[BarometerResponse](#barometerresponse)
>
| 是 | 注册一次气压计传感器的回调函数,上报的数据类型为BarometerResponse。 |
| callback | Callback
<
[BarometerResponse](#barometerresponse)
>
| 是 | 注册一次气压计传感器的回调函数,上报的数据类型为BarometerResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Atmospheric pressure: ' + data.pressure);
console.info('Atmospheric pressure: ' + data.pressure);
}
}
);
);
...
@@ -1081,7 +971,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback&l
...
@@ -1081,7 +971,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback&l
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HALL)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HALL)
once(type: sensor.SensorType.SENSOR_TYPE_ID_HALL, callback:
Async
Callback
<
HallResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_HALL, callback: Callback
<
HallResponse
>
): void
监听霍尔传感器数据变化一次。
监听霍尔传感器数据变化一次。
...
@@ -1091,15 +981,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback<H
...
@@ -1091,15 +981,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback<H
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 霍尔传感器类型为SENSOR_TYPE_ID_HALL。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 霍尔传感器类型为SENSOR_TYPE_ID_HALL。 |
| callback |
Async
Callback
<
[HallResponse](#hallresponse)
>
| 是 | 注册一次霍尔传感器的回调函数,上报的数据类型为HallResponse。 |
| callback | Callback
<
[HallResponse](#hallresponse)
>
| 是 | 注册一次霍尔传感器的回调函数,上报的数据类型为HallResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HALL, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HALL, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('Status: ' + data.status);
console.info('Status: ' + data.status);
}
}
);
);
...
@@ -1108,7 +994,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback<H
...
@@ -1108,7 +994,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback<H
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT)
once(type: sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback:
Async
Callback
<
LightResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback
<
LightResponse
>
): void
监听环境光传感器数据变化一次。
监听环境光传感器数据变化一次。
...
@@ -1118,15 +1004,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallba
...
@@ -1118,15 +1004,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallba
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 环境光传感器类型为SENSOR_TYPE_ID_AMBIENT_LIGHT。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 环境光传感器类型为SENSOR_TYPE_ID_AMBIENT_LIGHT。 |
| callback |
Async
Callback
<
[LightResponse](#lightresponse)
>
| 是 | 注册一次环境光传感器的回调函数,上报的数据类型为LightResponse。 |
| callback | Callback
<
[LightResponse](#lightresponse)
>
| 是 | 注册一次环境光传感器的回调函数,上报的数据类型为LightResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info(' Illumination: ' + data.intensity);
console.info(' Illumination: ' + data.intensity);
}
}
);
);
...
@@ -1135,7 +1017,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallba
...
@@ -1135,7 +1017,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallba
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION)
once(type: sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback:
Async
Callback
<
OrientationResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback
<
OrientationResponse
>
): void
监听方向传感器数据变化一次。
监听方向传感器数据变化一次。
...
@@ -1145,15 +1027,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback
...
@@ -1145,15 +1027,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 方向传感器类型为SENSOR_TYPE_ID_ORIENTATION。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 方向传感器类型为SENSOR_TYPE_ID_ORIENTATION。 |
| callback |
Async
Callback
<
[OrientationResponse](#orientationresponse)
>
| 是 | 注册一次方向传感器的回调函数,上报的数据类型为OrientationResponse。 |
| callback | Callback
<
[OrientationResponse](#orientationresponse)
>
| 是 | 注册一次方向传感器的回调函数,上报的数据类型为OrientationResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -1164,7 +1042,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback
...
@@ -1164,7 +1042,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR)
once(type: sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback:
Async
Callback
<
RotationVectorResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback
<
RotationVectorResponse
>
): void
监听旋转矢量传感器数据变化一次。
监听旋转矢量传感器数据变化一次。
...
@@ -1174,15 +1052,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: AsyncCall
...
@@ -1174,15 +1052,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: AsyncCall
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 旋转矢量传感器类型为SENSOR_TYPE_ID_ROTATION_VECTOR。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 旋转矢量传感器类型为SENSOR_TYPE_ID_ROTATION_VECTOR。 |
| callback |
Async
Callback
<
[RotationVectorResponse](#rotationvectorresponse)
>
| 是 | 注册一次旋转矢量传感器的回调函数,上报的数据类型为RotationVectorResponse。 |
| callback | Callback
<
[RotationVectorResponse](#rotationvectorresponse)
>
| 是 | 注册一次旋转矢量传感器的回调函数,上报的数据类型为RotationVectorResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info('X-coordinate component: ' + data.x);
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('Z-coordinate component: ' + data.z);
...
@@ -1193,7 +1067,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: AsyncCall
...
@@ -1193,7 +1067,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: AsyncCall
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE)
once(type: sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, callback:
Async
Callback
<
HeartRateResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback
<
HeartRateResponse
>
): void
监听心率传感器数据变化一次。
监听心率传感器数据变化一次。
...
@@ -1205,15 +1079,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: AsyncCallback&
...
@@ -1205,15 +1079,11 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: AsyncCallback&
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 心率传感器类型为SENSOR_TYPE_ID_HEART_RATE。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 心率传感器类型为SENSOR_TYPE_ID_HEART_RATE。 |
| callback |
Async
Callback
<
[HeartRateResponse](#heartrateresponse)
>
| 是 | 注册一次心率传感器的回调函数,上报的数据类型为HeartRateResponse。 |
| callback | Callback
<
[HeartRateResponse](#heartrateresponse)
>
| 是 | 注册一次心率传感器的回调函数,上报的数据类型为HeartRateResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, function(data) {
if (error) {
console.error("Subscription failed. Error code: " + error.code + "; message: " + error.message);
return;
}
console.info("Heart rate: " + data.heartRate);
console.info("Heart rate: " + data.heartRate);
}
}
);
);
...
@@ -1222,7 +1092,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: AsyncCallback&
...
@@ -1222,7 +1092,7 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: AsyncCallback&
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION)
## sensor.once(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION)
once(type: sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback:
Async
Callback
<
WearDetectionResponse
>
): void
once(type: sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback
<
WearDetectionResponse
>
): void
监听佩戴检测传感器数据变化一次。
监听佩戴检测传感器数据变化一次。
...
@@ -1232,46 +1102,563 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: AsyncCallb
...
@@ -1232,46 +1102,563 @@ once(type: sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: AsyncCallb
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| type |
[
SensorType
](
#sensortype
)
| 是 | 佩戴检测传感器类型为SENSOR_TYPE_ID_WEAR_DETECTION。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 佩戴检测传感器类型为SENSOR_TYPE_ID_WEAR_DETECTION。 |
| callback |
Async
Callback
<
[WearDetectionResponse](#weardetectionresponse)
>
| 是 | 注册一次穿戴检测传感器的回调函数,上报的数据类型为WearDetectionResponse。 |
| callback | Callback
<
[WearDetectionResponse](#weardetectionresponse)
>
| 是 | 注册一次穿戴检测传感器的回调函数,上报的数据类型为WearDetectionResponse。 |
-
示例:
-
示例:
```
```
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, function(error, data) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, function(data) {
if (error) {
console.error("Failed to register data, error code is" + error.code + ", message: " + error.message);
return;
}
console.info("Wear status: "+ data.value);
console.info("Wear status: "+ data.value);
}
}
);
);
```
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER)
off(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback?: Callback
<
AccelerometerResponse
>
): void
取消订阅传感器数据。
**需要权限**
:ohos.permission.ACCELEROMETER, 该权限为系统权限
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的加速度传感器类型为SENSOR_TYPE_ID_ACCELEROMETER。 |
| callback | Callback
<
[AccelerometerResponse](#accelerometerresponse)
>
| 是 | 取消注册加速度传感器的回调函数,上报的数据类型为AccelerometerResponse。 |
-
示例:
```
function callback(data) {
console.info('x-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback);
```
## sensor.off(sensor. SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED)
off(type: sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback?: Callback
<
AccelerometerUncalibratedResponse
>
): void
取消订阅传感器数据。
**需要权限**
:ohos.permission.ACCELEROMETER, 该权限为系统权限
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的未校准加速度计传感器类型为SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED。 |
| callback | Callback
<
[AccelerometerUncalibratedResponse](#accelerometeruncalibratedresponse)
>
| 是 | 取消注册未校准加速度计传感器的回调函数,上报的数据类型为AccelerometerUncalibratedResponse。 |
-
示例:
```
function callback(data) {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('X-coordinate bias: ' + data.biasX);
console.info('Y-coordinate bias: ' + data.biasY);
console.info('Z-coordinate bias: ' + data.biasZ);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback);
```
## sensor.off
## sensor.off
(sensor. SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT)
off(type:
SensorType, callback?: AsyncCallback
<
void
>
): void
off(type:
sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback?: Callback
<
LightResponse
>
): void
取消订阅传感器数据。
取消订阅传感器数据。
**系统能力**
:SystemCapability.Sensors.Sensor
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| 参数名 | 类型 | 必填 | 说明 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的传感器类型。 |
| -------- | ----------------------------------------------- | ---- | ------------------------------------------------------------ |
| callback | AsyncCallback
<
void
>
| 是 | 取消订阅的传感器的回调函数,表示接口调用是否成功。 |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的环境光传感器类型为SENSOR_TYPE_ID_AMBIENT_LIGHT。 |
| callback | Callback
<
[LightResponse](#lightresponse)
>
| 是 | 取消注册环境光传感器的回调函数,上报的数据类型为LightResponse。 |
-
示例:
-
示例:
```
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, function(error) {
```
if (error) {
function callback(data) {
console.error("Failed to unsubscribe from acceleration sensor data. Error code: " + error.code + "; message: " + error.message);
console.info(' Illumination: ' + data.intensity);
return;
}
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback);
console.info("Succeeded in unsubscribing from acceleration sensor data.");
```
}
);
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE)
```
off(type: sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback?: Callback
<
AmbientTemperatureResponse
>
): void
取消订阅传感器数据。
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的环境温度传感器类型为SENSOR_TYPE_ID_AMBIENT_TEMPERATURE。 |
| callback | Callback
<
[AmbientTemperatureResponse](#ambienttemperatureresponse)
>
| 是 | 取消注册环境温度传感器的回调函数,上报的数据类型为AmbientTemperatureResponse。 |
-
示例:
```
function callback(data) {
console.info('Temperature: ' + data.temperature);
}
sensor.off( sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE)
off(type: sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback?: Callback
<
BarometerResponse
>
): void
取消订阅传感器数据。
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的气压计传感器类型为SENSOR_TYPE_ID_BAROMETER。 |
| callback | Callback
<
[BarometerResponse](#barometerresponse)
>
| 是 | 取消注册气压计传感器的回调函数,上报的数据类型为BarometerResponse。 |
-
示例:
```
function callback(data) {
console.info('Atmospheric pressure: ' + data.pressure);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY)
off(type: sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback?: Callback
<
GravityResponse
>
): void
取消订阅传感器数据。
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的重力传感器类型为SENSOR_TYPE_ID_GRAVITY。 |
| callback | Callback
<
[GravityResponse](#gravityresponse)
>
| 是 | 取消注册注册重力传感器的回调函数,上报的数据类型为GravityResponse。 |
-
示例:
```
function callback(data) {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
}
sensor.off( sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE)
off(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback?: Callback
<
GyroscopeResponse
>
): void
取消订阅传感器数据。
**需要权限**
:ohos.permission.GYROSCOPE, 该权限为系统权限
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的陀螺仪传感器类型为SENSOR_TYPE_ID_GYROSCOPE。 |
| callback | Callback
<
[GyroscopeResponse](#gyroscoperesponse)
>
| 是 | 取消注册陀螺仪传感器的回调函数,上报的数据类型为GyroscopeResponse。 |
-
示例:
```
function callback(data) {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED)
off(type: sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback?: Callback
<
GyroscopeResponse
>
): void
取消订阅传感器数据。
**需要权限**
:ohos.permission.GYROSCOPE, 该权限为系统权限
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的未校准陀螺仪传感器类型为SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED。 |
| callback | Callback
<
[GyroscopeUncalibratedResponse](#gyroscopeuncalibratedresponse)
>
| 是 | 取消注册未校准陀螺仪传感器的回调函数,上报的数据类型为GyroscopeUncalibratedResponse。 |
-
示例:
```
function callback(data) {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HALL)
off(type: sensor.SensorType.SENSOR_TYPE_ID_HALL, callback?: Callback
<
HallResponse
>
): void
取消订阅传感器数据。
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------------- | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的霍尔传感器类型为SENSOR_TYPE_ID_HALL。 |
| callback | Callback
<
[HallResponse](#hallresponse)
>
| 是 | 取消注册霍尔传感器的回调函数,上报的数据类型为
HallResponse。 |
-
示例:
```
function callback(data) {
console.info('Status: ' + data.status);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HALL, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE)
off(type: sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, callback?: Callback
<
HeartRateResponse
>
): void
取消订阅传感器数据。
**需要权限**
:ohos.permission.READ_HEALTH_DATA
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)[
SensorType
]
(#sensortype) | 是 | 要取消订阅的心率传感器类型为SENSOR_TYPE_ID_HEART_RATE。 |
| callback | Callback
<
[HeartRateResponse](#heartrateresponse)
>
| 是 | 取消注册一次心率传感器的回调函数,上报的数据类型为HeartRateResponse。 |
-
示例:
```
function callback(data) {
console.info("Heart rate: " + data.heartRate);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY)
off(type: sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback?: Callback
<
HumidityResponse
>
): void
取消订阅传感器数据。
**需要权限**
:ohos.permission.READ_HEALTH_DATA,该权限为系统权限
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的湿度传感器类型为SENSOR_TYPE_ID_HUMIDITY。 |
| callback | Callback
<
[HumidityResponse](#humidityresponse)
>
| 是 | 取消注册湿度传感器的回调函数,上报的数据类型为HumidityResponse。 |
-
示例:
```
function callback(data) {
console.info('Humidity: ' + data.humidity);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION)
off(type: sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback?: Callback
<
LinearAccelerometerResponse
>
): void
取消订阅传感器数据。
**需要权限**
:ohos.permission.ACCELEROMETER,该权限为系统权限
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的线性加速度传感器类型为SENSOR_TYPE_ID_LINEAR_ACCELERATION。 |
| callback | Callback
<
[LinearAccelerometerResponse](#linearaccelerometerresponse)
>
| 是 | 取消注册性加速度传感器的回调函数,上报的数据类型为LinearAccelerometerResponse。 |
-
示例:
```
function callback(data) {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD)
off(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback?: Callback
<
MagneticFieldResponse
>
): void
取消订阅传感器数据。
**需要权限**
:ohos.permission.ACCELEROMETER,该权限为系统权限
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| ---------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的磁场传感器类型为SENSOR_TYPE_ID_MAGNETIC_FIELD。 |
| callbackcallback | Callback
<
[MagneticFieldResponse](#magneticfieldresponse)
>
| 是 | 取消注册磁场传感器的回调函数,上报的数据类型为MagneticFieldResponse。 |
-
示例:
```
function callback(data) {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED)
off(type: sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback?: Callback
<
MagneticFieldUncalibratedResponse
>
): void
取消订阅传感器数据。
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的未校准磁场传感器类型为SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED。 |
| callback | Callback
<
[MagneticFieldUncalibratedResponse](#magneticfielduncalibratedresponse)
>
| 是 | 取消注册未校准磁场传感器的回调函数,上报的数据类型为MagneticFieldUncalibratedResponse。 |
-
示例:
```
function callback(data) {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
console.info('X-coordinate bias: ' + data.biasX);
console.info('Y-coordinate bias: ' + data.biasY);
console.info('Z-coordinate bias: ' + data.biasZ);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION)
off(type: sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback?: Callback
<
OrientationResponse
>
): void
取消订阅传感器数据。
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的方向传感器类型为SENSOR_TYPE_ID_ORIENTATION |
| callback | Callback
<
[OrientationResponse](#orientationresponse)
>
| 是 | 取消注册方向传感器的回调函数,上报的数据类型为OrientationResponse。 |
-
示例:
```
function callback(data) {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER)
off(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback?: Callback
<
PedometerResponse
>
): void
取消订阅传感器数据。
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的计步传感器类型为SENSOR_TYPE_ID_PEDOMETER。 |
| callback | Callback
<
[PedometerResponse](#pedometerresponse)
>
| 是 | 取消注册计步传感器的回调函数,上报的数据类型为PedometerResponse。 |
-
示例;
```
function callback(data) {
console.info('Steps: ' + data.steps);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION)
off(type: sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback?: Callback
<
PedometerDetectionResponse
>
): void
取消订阅传感器数据。
**需要权限**
:ohos.permission.ACTIVITY_MOTION
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的计步检测传感器类型为SENSOR_TYPE_ID_PEDOMETER_DETECTION。 |
| callback | Callback
<
[PedometerDetectionResponse](#pedometerdetectionresponse)
>
| 是 | 取消注册计步检测传感器的回调函数,上报的数据类型为PedometerDetectionResponse。 |
-
示例:
```
function callback(data) {
console.info('Scalar data: ' + data.scalar);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY)
off(type: sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback?: Callback
<
ProximityResponse
>
): void
取消订阅传感器数据。
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的接近光传感器类型为SENSOR_TYPE_ID_PROXIMITY。 |
| callback | Callback
<
[ProximityResponse](#proximityresponse)
>
| 是 | 取消注册接近光传感器的回调函数,上报的数据类型为ProximityResponse。 |
-
示例:
```
function callback(data) {
console.info('Distance: ' + data.distance);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR)
off(type: sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback?: Callback
<
RotationVectorResponse
>
): void
取消订阅传感器数据。
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的旋转矢量传感器类型为SENSOR_TYPE_ID_ROTATION_VECTOR。 |
| callback | Callback
<
[RotationVectorResponse](#rotationvectorresponse)
>
| 是 | 取消注册旋转矢量传感器的回调函数,上报的数据类型为RotationVectorResponse。 |
-
示例:
```
function callback(data) {
console.info('X-coordinate component: ' + data.x);
console.info('Y-coordinate component: ' + data.y);
console.info('Z-coordinate component: ' + data.z);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION)
off(type: sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback?: Callback
<
SignificantMotionResponse
>
): void
取消订阅传感器数据。
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的大幅动作传感器类型为SENSOR_TYPE_ID_SIGNIFICANT_MOTION。 |
| callback | Callback
<
[SignificantMotionResponse](#significantmotionresponse)
>
| 是 | 取消注册有效运动传感器的回调函数,上报的数据类型为SignificantMotionResponse。 |
-
示例:
```
function callback(data) {
console.info('Scalar data: ' + data.scalar);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback);
```
## sensor.off(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION)
off(type: sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback?: Callback
<
WearDetectionResponse
>
): void
取消订阅传感器数据。
**系统能力**
:SystemCapability.Sensors.Sensor
-
参数:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type |
[
SensorType
](
#sensortype
)
| 是 | 要取消订阅的佩戴检测传感器类型为SENSOR_TYPE_ID_WEAR_DETECTION。 |
| callback | Callback
<
[WearDetectionResponse](#weardetectionresponse)
>
| 是 | 取消注册佩戴检测传感器的回调函数,上报的数据类型为WearDetectionResponse。 |
-
示例:
```
function accCallback(data) {
console.info('Wear status: ' + data.value);
}
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, accCallback);
```
## sensor.transformCoordinateSystem
## sensor.transformCoordinateSystem
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录