未验证 提交 ede2e66a 编写于 作者: O openharmony_ci 提交者: Gitee

!2564 示例代码修改

Merge pull request !2564 from zengyawen/master
...@@ -3058,7 +3058,6 @@ Reads the buffer from the audio capturer. This API uses an asynchronous callback ...@@ -3058,7 +3058,6 @@ Reads the buffer from the audio capturer. This API uses an asynchronous callback
audioCapturer.read(bufferSize, true, async(err, buffer) => { audioCapturer.read(bufferSize, true, async(err, buffer) => {
if (!err) { if (!err) {
console.log("Success in reading the buffer data"); console.log("Success in reading the buffer data");
var number = fileio.writeSync(fd, buffer);
} }
}; };
``` ```
......
...@@ -1311,7 +1311,7 @@ Disconnects an A2DP connection. ...@@ -1311,7 +1311,7 @@ Disconnects an A2DP connection.
```js ```js
let a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE); let a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE);
let boolean ret = a2dpSrc.disconnect('XX:XX:XX:XX:XX:XX'); let ret = a2dpSrc.disconnect('XX:XX:XX:XX:XX:XX');
``` ```
......
...@@ -563,7 +563,7 @@ Enables listening for error events of the UDPSocket connection. This API uses an ...@@ -563,7 +563,7 @@ Enables listening for error events of the UDPSocket connection. This API uses an
**Example** **Example**
``` ```
let udp = socket.constructUDPSocketInstance() let udp = socket.constructUDPSocketInstance();
udp.on('error', err => { udp.on('error', err => {
console.log("on error, err:" + JSON.stringify(err)) console.log("on error, err:" + JSON.stringify(err))
}); });
...@@ -591,7 +591,7 @@ Disables listening for error events of the UDPSocket connection. This API uses a ...@@ -591,7 +591,7 @@ Disables listening for error events of the UDPSocket connection. This API uses a
**Example** **Example**
``` ```
let udp = socket.constructUDPSocketInstance() let udp = socket.constructUDPSocketInstance();
let callback = err =>{ let callback = err =>{
console.log("on error, err:" + JSON.stringify(err)); console.log("on error, err:" + JSON.stringify(err));
} }
......
...@@ -3000,7 +3000,6 @@ read(size: number, isBlockingRead: boolean, callback: AsyncCallback<ArrayBuffer\ ...@@ -3000,7 +3000,6 @@ read(size: number, isBlockingRead: boolean, callback: AsyncCallback<ArrayBuffer\
audioCapturer.read(bufferSize, true, async(err, buffer) => { audioCapturer.read(bufferSize, true, async(err, buffer) => {
if (!err) { if (!err) {
console.log("Success in reading the buffer data"); console.log("Success in reading the buffer data");
var number = fileio.writeSync(fd, buffer);
} }
}; };
``` ```
......
...@@ -1311,7 +1311,7 @@ disconnect(device: string): boolean ...@@ -1311,7 +1311,7 @@ disconnect(device: string): boolean
```js ```js
let a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE); let a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE);
let boolean ret = a2dpSrc.disconnect('XX:XX:XX:XX:XX:XX'); let ret = a2dpSrc.disconnect('XX:XX:XX:XX:XX:XX');
``` ```
......
...@@ -563,7 +563,7 @@ on\(type: 'error', callback: ErrorCallback\): void ...@@ -563,7 +563,7 @@ on\(type: 'error', callback: ErrorCallback\): void
**示例:** **示例:**
``` ```
let udp = socket.constructUDPSocketInstance() let udp = socket.constructUDPSocketInstance();
udp.on('error', err => { udp.on('error', err => {
console.log("on error, err:" + JSON.stringify(err)) console.log("on error, err:" + JSON.stringify(err))
}); });
...@@ -591,7 +591,7 @@ off\(type: 'error', callback?: ErrorCallback\): void ...@@ -591,7 +591,7 @@ off\(type: 'error', callback?: ErrorCallback\): void
**示例:** **示例:**
``` ```
let udp = socket.constructUDPSocketInstance() let udp = socket.constructUDPSocketInstance();
let callback = err =>{ let callback = err =>{
console.log("on error, err:" + JSON.stringify(err)); console.log("on error, err:" + JSON.stringify(err));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册