提交 5fde47df 编写于 作者: G Gloria

update doc against 8865

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 3bb157d3
# Sensor # Sensor
> **NOTE** > **NOTE**
> >
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -1351,8 +1350,6 @@ off(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback?: Callback&lt;HumidityRes ...@@ -1351,8 +1350,6 @@ off(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback?: Callback&lt;HumidityRes
Unsubscribes from sensor data changes. Unsubscribes from sensor data changes.
**Required permissions**: ohos.permission.READ_HEALTH_DATA (a system permission)
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
**Parameters** **Parameters**
...@@ -1405,8 +1402,6 @@ sensor.off(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback); ...@@ -1405,8 +1402,6 @@ sensor.off(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback);
Unsubscribes from sensor data changes. Unsubscribes from sensor data changes.
**Required permissions**: ohos.permission.ACCELEROMETER (a system permission)
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
**Parameters** **Parameters**
...@@ -1488,6 +1483,8 @@ off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback?: Callback&lt;PedometerR ...@@ -1488,6 +1483,8 @@ off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback?: Callback&lt;PedometerR
Unsubscribes from sensor data changes. Unsubscribes from sensor data changes.
**Required permissions**: ohos.permission.ACTIVITY_MOTION
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
**Parameters** **Parameters**
...@@ -1718,7 +1715,7 @@ sensor.getGeomagneticField({latitude:80, longitude:0, altitude:0}, 1580486400000 ...@@ -1718,7 +1715,7 @@ sensor.getGeomagneticField({latitude:80, longitude:0, altitude:0}, 1580486400000
console.error('Operation failed. Error code: ' + err.code + '; message: ' + err.message); console.error('Operation failed. Error code: ' + err.code + '; message: ' + err.message);
return; return;
} }
console.info('sensor_getGeomagneticField_promise x: ' + data.x + ',y: ' + data.y + ',z: ' + console.info('sensor_getGeomagneticField_callback x: ' + data.x + ',y: ' + data.y + ',z: ' +
data.z + ',geomagneticDip: ' + data.geomagneticDip + ',deflectionAngle: ' + data.deflectionAngle + data.z + ',geomagneticDip: ' + data.geomagneticDip + ',deflectionAngle: ' + data.deflectionAngle +
',levelIntensity: ' + data.levelIntensity + ',totalIntensity: ' + data.totalIntensity); ',levelIntensity: ' + data.levelIntensity + ',totalIntensity: ' + data.totalIntensity);
}); });
...@@ -1900,7 +1897,6 @@ Obtains the angle change between two rotation matrices. This API uses a callback ...@@ -1900,7 +1897,6 @@ Obtains the angle change between two rotation matrices. This API uses a callback
err.message); err.message);
return; return;
} }
console.info("SensorJsAPI--->Successed to get getAngleModifiy interface get data: " + data.x);
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info("data[" + i + "]: " + data[i]); console.info("data[" + i + "]: " + data[i]);
} }
...@@ -1968,7 +1964,6 @@ Converts a rotation vector into a rotation matrix. This API uses a callback to r ...@@ -1968,7 +1964,6 @@ Converts a rotation vector into a rotation matrix. This API uses a callback to r
err.message); err.message);
return; return;
} }
console.info("SensorJsAPI--->Successed to get createRotationMatrix interface get data: " + data.x);
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info("data[" + i + "]: " + data[i]); console.info("data[" + i + "]: " + data[i]);
} }
...@@ -2035,7 +2030,6 @@ Converts a rotation vector into a quaternion. This API uses a callback to return ...@@ -2035,7 +2030,6 @@ Converts a rotation vector into a quaternion. This API uses a callback to return
err.message); err.message);
return; return;
} }
console.info("SensorJsAPI--->Successed to get createQuaternion interface get data: " + data.x);
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info("data[" + i + "]: " + data[i]); console.info("data[" + i + "]: " + data[i]);
} }
...@@ -2102,7 +2096,6 @@ Obtains the device direction based on the rotation matrix. This API uses a callb ...@@ -2102,7 +2096,6 @@ Obtains the device direction based on the rotation matrix. This API uses a callb
err.message); err.message);
return; return;
} }
console.info("SensorJsAPI--->Successed to get getDirection interface get data: " + data);
for (var i = 1; i < data.length; i++) { for (var i = 1; i < data.length; i++) {
console.info("sensor_getDirection_callback" + data[i]); console.info("sensor_getDirection_callback" + data[i]);
} }
...@@ -2170,7 +2163,6 @@ Creates a rotation matrix based on the gravity vector and geomagnetic vector. Th ...@@ -2170,7 +2163,6 @@ Creates a rotation matrix based on the gravity vector and geomagnetic vector. Th
err.message); err.message);
return; return;
} }
console.info("SensorJsAPI--->Successed to get createRotationMatrix interface get data: " + data.x);
for (var i=0; i < data.rotation.length; i++) { for (var i=0; i < data.rotation.length; i++) {
console.info("data[" + i + "]: " + data[i]) console.info("data[" + i + "]: " + data[i])
} }
...@@ -2419,9 +2411,9 @@ Describes the Hall effect sensor data. It extends from [Response](#response). ...@@ -2419,9 +2411,9 @@ Describes the Hall effect sensor data. It extends from [Response](#response).
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
| Name | Type | Readable | Writable | Description | | Name | Type| Readable| Writable| Description |
| ------ | ------ | ---- | ---- | --------------------------------- | | ------ | -------- | ---- | ---- | ------------------------------------------------------------ |
| status | number | Yes | Yes | Hall effect sensor status. This parameter specifies whether a magnetic field exists around a device. The value **0** means that a magnetic field exists around the device, and **1** means the opposite.| | status | number | Yes | Yes | Hall effect sensor status. This parameter specifies whether a magnetic field exists around a device. The value **0** means that a magnetic field does not exist, and a value greater than **0** means the opposite.|
## MagneticFieldResponse ## MagneticFieldResponse
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册