提交 acaec369 编写于 作者: G Gloria

Update docs against 9727

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 23d820b6
...@@ -19,7 +19,7 @@ on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback&lt;Acceler ...@@ -19,7 +19,7 @@ on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback&lt;Acceler
Subscribes to data changes of the acceleration sensor. If this API is called multiple times for the same application, the last call takes effect. Subscribes to data changes of the acceleration sensor. If this API is called multiple times for the same application, the last call takes effect.
**Required permissions**: ohos.permission.ACCELEROMETER (a system permission) **Required permissions**: ohos.permission.ACCELEROMETER
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
...@@ -48,7 +48,7 @@ on(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback&lt;Line ...@@ -48,7 +48,7 @@ on(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback&lt;Line
Subscribes to data changes of the linear acceleration sensor. If this API is called multiple times for the same application, the last call takes effect. Subscribes to data changes of the linear acceleration sensor. If this API is called multiple times for the same application, the last call takes effect.
**Required permissions**: ohos.permission.ACCELEROMETER (a system permission) **Required permissions**: ohos.permission.ACCELEROMETER
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
...@@ -76,7 +76,7 @@ on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback: Callback ...@@ -76,7 +76,7 @@ on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback: Callback
Subscribes to data changes of the uncalibrated acceleration sensor. If this API is called multiple times for the same application, the last call takes effect. Subscribes to data changes of the uncalibrated acceleration sensor. If this API is called multiple times for the same application, the last call takes effect.
**Required permissions**: ohos.permission.ACCELEROMETER (a system permission) **Required permissions**: ohos.permission.ACCELEROMETER
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
...@@ -133,7 +133,7 @@ on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback&lt;GyroscopeRes ...@@ -133,7 +133,7 @@ on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback&lt;GyroscopeRes
Subscribes to data changes of the gyroscope sensor. If this API is called multiple times for the same application, the last call takes effect. Subscribes to data changes of the gyroscope sensor. If this API is called multiple times for the same application, the last call takes effect.
**Required permissions**: ohos.permission.GYROSCOPE (a system permission) **Required permissions**: ohos.permission.GYROSCOPE
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
...@@ -161,7 +161,7 @@ on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:Callback&lt;G ...@@ -161,7 +161,7 @@ on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:Callback&lt;G
Subscribes to data changes of the uncalibrated gyroscope sensor. If this API is called multiple times for the same application, the last call takes effect. Subscribes to data changes of the uncalibrated gyroscope sensor. If this API is called multiple times for the same application, the last call takes effect.
**Required permissions**: ohos.permission.GYROSCOPE (a system permission) **Required permissions**: ohos.permission.GYROSCOPE
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
...@@ -573,7 +573,7 @@ once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback&lt;Accele ...@@ -573,7 +573,7 @@ once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback&lt;Accele
Subscribes to only one data change of the acceleration sensor. Subscribes to only one data change of the acceleration sensor.
**Required permissions**: ohos.permission.ACCELEROMETER (a system permission) **Required permissions**: ohos.permission.ACCELEROMETER
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
...@@ -599,7 +599,7 @@ once(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback&lt;Li ...@@ -599,7 +599,7 @@ once(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:Callback&lt;Li
Subscribes to only one data change of the linear acceleration sensor. Subscribes to only one data change of the linear acceleration sensor.
**Required permissions**: ohos.permission.ACCELEROMETER (a system permission) **Required permissions**: ohos.permission.ACCELEROMETER
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
...@@ -625,7 +625,7 @@ once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback: Callba ...@@ -625,7 +625,7 @@ once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback: Callba
Subscribes to only one data change of the uncalibrated acceleration sensor. Subscribes to only one data change of the uncalibrated acceleration sensor.
**Required permissions**: ohos.permission.ACCELEROMETER (a system permission) **Required permissions**: ohos.permission.ACCELEROMETER
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
...@@ -678,7 +678,7 @@ once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback&lt;GyroscopeR ...@@ -678,7 +678,7 @@ once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback&lt;GyroscopeR
Subscribes to only one data change of the gyroscope sensor. Subscribes to only one data change of the gyroscope sensor.
**Required permissions**: ohos.permission.GYROSCOPE (a system permission) **Required permissions**: ohos.permission.GYROSCOPE
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
...@@ -704,7 +704,7 @@ once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback: Callback&l ...@@ -704,7 +704,7 @@ once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback: Callback&l
Subscribes to only one data change of the uncalibrated gyroscope sensor. Subscribes to only one data change of the uncalibrated gyroscope sensor.
**Required permissions**: ohos.permission.GYROSCOPE (a system permission) **Required permissions**: ohos.permission.GYROSCOPE
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
...@@ -1374,7 +1374,7 @@ off(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback?: Callback&lt; ...@@ -1374,7 +1374,7 @@ off(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback?: Callback&lt;
Unsubscribes from sensor data changes. Unsubscribes from sensor data changes.
**Required permissions**: ohos.permission.ACCELEROMETER (a system permission) **Required permissions**: ohos.permission.ACCELEROMETER
**System capability**: SystemCapability.Sensors.Sensor **System capability**: SystemCapability.Sensors.Sensor
...@@ -2159,13 +2159,10 @@ Creates a rotation matrix based on the gravity vector and geomagnetic vector. Th ...@@ -2159,13 +2159,10 @@ Creates a rotation matrix based on the gravity vector and geomagnetic vector. Th
```js ```js
sensor.createRotationMatrix([-0.27775216, 0.5351276, 9.788099], [210.87253, -78.6096, -111.44444], function(err, data) { sensor.createRotationMatrix([-0.27775216, 0.5351276, 9.788099], [210.87253, -78.6096, -111.44444], function(err, data) {
if (err) { if (err) {
console.error('SensorJsAPI--->Failed to register data, error code is: ' + err.code + ', message: ' + console.error('error code is: ' + err.code + ', message: ' + err.message);
err.message);
return; return;
} }
for (var i=0; i < data.rotation.length; i++) { console.info(JSON.stringify(data));
console.info("data[" + i + "]: " + data[i])
}
}) })
``` ```
...@@ -2196,10 +2193,7 @@ Creates a rotation matrix based on the gravity vector and geomagnetic vector. Th ...@@ -2196,10 +2193,7 @@ Creates a rotation matrix based on the gravity vector and geomagnetic vector. Th
```js ```js
const promise = sensor.createRotationMatrix([-0.27775216, 0.5351276, 9.788099], [210.87253, -78.6096, -111.44444]); const promise = sensor.createRotationMatrix([-0.27775216, 0.5351276, 9.788099], [210.87253, -78.6096, -111.44444]);
promise.then((data) => { promise.then((data) => {
console.info('createRotationMatrix_promise successed'); console.info(JSON.stringify(data));
for (var i=0; i < data.rotation.length; i++) {
console.info("data[" + i + "]: " + data[i]);
}
}).catch((err) => { }).catch((err) => {
console.info('promise failed'); console.info('promise failed');
}) })
......
...@@ -18,7 +18,7 @@ vibrate(duration: number): Promise&lt;void&gt; ...@@ -18,7 +18,7 @@ vibrate(duration: number): Promise&lt;void&gt;
Triggers vibration with a specific duration. This API uses a promise to return the execution result. Triggers vibration with a specific duration. This API uses a promise to return the execution result.
**Required permissions**: ohos.permission.VIBRATE (a system permission) **Required permissions**: ohos.permission.VIBRATE
**System capability**: SystemCapability.Sensors.MiscDevice **System capability**: SystemCapability.Sensors.MiscDevice
...@@ -50,7 +50,7 @@ vibrate(duration: number, callback?: AsyncCallback&lt;void&gt;): void ...@@ -50,7 +50,7 @@ vibrate(duration: number, callback?: AsyncCallback&lt;void&gt;): void
Triggers vibration with a specific duration. This API uses an asynchronous callback to return the execution result. Triggers vibration with a specific duration. This API uses an asynchronous callback to return the execution result.
**Required permissions**: ohos.permission.VIBRATE (a system permission) **Required permissions**: ohos.permission.VIBRATE
**System capability**: SystemCapability.Sensors.MiscDevice **System capability**: SystemCapability.Sensors.MiscDevice
...@@ -78,7 +78,7 @@ vibrate(effectId: EffectId): Promise&lt;void&gt; ...@@ -78,7 +78,7 @@ vibrate(effectId: EffectId): Promise&lt;void&gt;
Triggers vibration with a specific effect. This API uses a promise to return the execution result. Triggers vibration with a specific effect. This API uses a promise to return the execution result.
**Required permissions**: ohos.permission.VIBRATE (a system permission) **Required permissions**: ohos.permission.VIBRATE
**System capability**: SystemCapability.Sensors.MiscDevice **System capability**: SystemCapability.Sensors.MiscDevice
...@@ -108,7 +108,7 @@ vibrate(effectId: EffectId, callback?: AsyncCallback&lt;void&gt;): void ...@@ -108,7 +108,7 @@ vibrate(effectId: EffectId, callback?: AsyncCallback&lt;void&gt;): void
Triggers vibration with a specific effect. This API uses an asynchronous callback to return the execution result. Triggers vibration with a specific effect. This API uses an asynchronous callback to return the execution result.
**Required permissions**: ohos.permission.VIBRATE (a system permission) **Required permissions**: ohos.permission.VIBRATE
**System capability**: SystemCapability.Sensors.MiscDevice **System capability**: SystemCapability.Sensors.MiscDevice
...@@ -136,7 +136,7 @@ stop(stopMode: VibratorStopMode): Promise&lt;void&gt; ...@@ -136,7 +136,7 @@ stop(stopMode: VibratorStopMode): Promise&lt;void&gt;
Stops the vibration based on the specified **stopMode**. This API uses a promise to return the execution result. If the specified **stopMode** is different from the mode used to trigger the vibration, this API fails to be called. Stops the vibration based on the specified **stopMode**. This API uses a promise to return the execution result. If the specified **stopMode** is different from the mode used to trigger the vibration, this API fails to be called.
**Required permissions**: ohos.permission.VIBRATE (a system permission) **Required permissions**: ohos.permission.VIBRATE
**System capability**: SystemCapability.Sensors.MiscDevice **System capability**: SystemCapability.Sensors.MiscDevice
...@@ -166,7 +166,7 @@ stop(stopMode: VibratorStopMode, callback?: AsyncCallback&lt;void&gt;): void; ...@@ -166,7 +166,7 @@ stop(stopMode: VibratorStopMode, callback?: AsyncCallback&lt;void&gt;): void;
Stops the vibration based on the specified **stopMode**. This API uses an asynchronous callback to return the execution result. If the specified **stopMode** is different from the mode used to trigger the vibration, this API fails to be called. Stops the vibration based on the specified **stopMode**. This API uses an asynchronous callback to return the execution result. If the specified **stopMode** is different from the mode used to trigger the vibration, this API fails to be called.
**Required permissions**: ohos.permission.VIBRATE (a system permission) **Required permissions**: ohos.permission.VIBRATE
**System capability**: SystemCapability.Sensors.MiscDevice **System capability**: SystemCapability.Sensors.MiscDevice
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册