You need to sign in or sign up before continuing.
提交 9cd1e381 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 7f5c1996
...@@ -82,7 +82,8 @@ You need to use [deviceManager.queryDevices](#devicemanagerquerydevices) to obta ...@@ -82,7 +82,8 @@ You need to use [deviceManager.queryDevices](#devicemanagerquerydevices) to obta
```js ```js
try { try {
deviceManager.bindDevice(device.deviceId, (error, data) => { // For example, deviceId is 12345678. You can use queryDevices() to obtain the deviceId.
deviceManager.bindDevice(12345678, (error, data) => {
console.error('Device is disconnected'); console.error('Device is disconnected');
}, (error, data) => { }, (error, data) => {
if (error) { if (error) {
...@@ -131,7 +132,8 @@ You need to use [deviceManager.queryDevices](#devicemanagerquerydevices) to obta ...@@ -131,7 +132,8 @@ You need to use [deviceManager.queryDevices](#devicemanagerquerydevices) to obta
```js ```js
try { try {
deviceManager.bindDevice(matchDevice.deviceId, (error, data) => { // For example, deviceId is 12345678. You can use queryDevices() to obtain the deviceId.
deviceManager.bindDevice(12345678, (error, data) => {
console.error('Device is disconnected'); console.error('Device is disconnected');
}).then(data => { }).then(data => {
console.info('bindDevice success'); console.info('bindDevice success');
...@@ -169,7 +171,8 @@ Unbinds a peripheral device. This API uses an asynchronous callback to return th ...@@ -169,7 +171,8 @@ Unbinds a peripheral device. This API uses an asynchronous callback to return th
```js ```js
try { try {
deviceManager.unbindDevice(matchDevice.deviceId, (error, data) => { // For example, deviceId is 12345678. You can use queryDevices() to obtain the deviceId.
deviceManager.unbindDevice(12345678, (error, data) => {
if (error) { if (error) {
console.error('unbindDevice async fail. Code is ${error.code}, message is ${error.message}'); console.error('unbindDevice async fail. Code is ${error.code}, message is ${error.message}');
return; return;
...@@ -211,7 +214,8 @@ Unbinds a peripheral device. This API uses a promise to return the result. ...@@ -211,7 +214,8 @@ Unbinds a peripheral device. This API uses a promise to return the result.
```js ```js
try { try {
deviceManager.unbindDevice(matchDevice.deviceId).then(data => { // For example, deviceId is 12345678. You can use queryDevices() to obtain the deviceId.
deviceManager.unbindDevice(12345678).then(data => {
console.info('unbindDevice success'); console.info('unbindDevice success');
}, error => { }, error => {
console.error('unbindDevice async fail. Code is ${error.code}, message is ${error.message}'); console.error('unbindDevice async fail. Code is ${error.code}, message is ${error.message}');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册