提交 d8a597aa 编写于 作者: D dongbinbin

Fix example code.

Signed-off-by: Ndongbinbin <dongbinbin@huawei.com>
上级 c7305c59
...@@ -82,7 +82,7 @@ bindDevice(deviceId: number, onDisconnect: AsyncCallback&lt;number&gt;, ...@@ -82,7 +82,7 @@ bindDevice(deviceId: number, onDisconnect: AsyncCallback&lt;number&gt;,
```js ```js
try { try {
deviceManager.bindDevice(device.deviceId, (error, data) => { 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 +131,7 @@ bindDevice(deviceId: number, onDisconnect: AsyncCallback&lt;number&gt;): Promise ...@@ -131,7 +131,7 @@ bindDevice(deviceId: number, onDisconnect: AsyncCallback&lt;number&gt;): Promise
```js ```js
try { try {
deviceManager.bindDevice(matchDevice.deviceId, (error, data) => { 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 +169,7 @@ unbindDevice(deviceId: number, callback: AsyncCallback&lt;number&gt;): void ...@@ -169,7 +169,7 @@ unbindDevice(deviceId: number, callback: AsyncCallback&lt;number&gt;): void
```js ```js
try { try {
deviceManager.unbindDevice(matchDevice.deviceId, (error, data) => { 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 +211,7 @@ unbindDevice(deviceId: number): Promise&lt;number&gt; ...@@ -211,7 +211,7 @@ unbindDevice(deviceId: number): Promise&lt;number&gt;
```js ```js
try { try {
deviceManager.unbindDevice(matchDevice.deviceId).then(data => { 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.
先完成此消息的编辑!
想要评论请 注册