0.0.25 • Published 11 months ago

@juanjofp/serialport-observable v0.0.25

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Publish package in npm

Serialport Observable

Serialport-observable is a library for RxJS that allows you to read and write data from/to a serial port.

install

npm install @juanjofp/serialport-observable

Usage

const uartDevice = createSerialPortObservable('/dev/ttyAMA0', {
    baudRate: 9600,
    highWaterMark: 100000
});

await uartDevice.open();

let subscription: Subscription | undefined;
const obsValue = await new Promise<Buffer>(resolve => {
    subscription = uartDevice.data().subscribe(resolve);
    uartDevice.write([0x01, 0x02, 0x03]);
});

subscription?.unsubscribe();
await uartDevice.close();

expect(uartDevice.isConnected()).toBe(false);
expect(obsValue.byteLength).toBeGreaterThanOrEqual(1);
0.0.25

11 months ago

0.0.20

1 year ago

0.0.21

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.19

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.3

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.6

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago