Skip to content

Commit da77149

Browse files
committed
Update README.md
1 parent ed59775 commit da77149

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ controller.connect(host, options, () => {
4949
}, 60 * 1000);
5050
});
5151

52-
controller.on('serialport:open', (options) => {
52+
controller.addListener('serialport:open', (options) => {
5353
const {
5454
port,
5555
baudrate,
@@ -58,16 +58,16 @@ controller.on('serialport:open', (options) => {
5858
console.log(`Connected to the port "${port}" with a baud rate of ${baudrate}.`, { port, baudrate });
5959
});
6060

61-
controller.on('serialport:close', (options) => {
61+
controller.addListener('serialport:close', (options) => {
6262
const { port } = options;
6363
console.log(`The port "${port}" is disconnected.`);
6464
});
6565

66-
controller.on('serialport:write', (data, context) => {
66+
controller.addListener('serialport:write', (data, context) => {
6767
console.log('>', data);
6868
});
6969

70-
controller.on('serialport:read', (data) => {
70+
controller.addListener('serialport:read', (data) => {
7171
console.log('<', data);
7272
});
7373
```

0 commit comments

Comments
 (0)