1.3.4 • Published 3 years ago

react-native-serial-ports v1.3.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-native-serial-port

Only for android platform based on Android-SerialPort-API.

It is available in AndroidX

Getting started

$ npm install react-native-serial-port --save

Mostly automatic installation

$ npx react-native link react-native-serial-port

Usage

import SerialPortAPI from 'react-native-serial-port';

async function example() {
  const serialPort = await SerialPortAPI.open("/dev/ttyS4", { baudRate: 38400 });

  // subscribe received data
  const sub = serialPort.onReceived(buff => {
    console.log(buff.toString('hex').toUpperCase());
  })

  // unsubscribe
  // sub.remove();

  // send data with hex format
  await serialPort.send('00FF');

  // close
  serialPort.close();
}
1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago