0.1.1 • Published 11 months ago

react-native-rfid-hsbr v0.1.1

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

react-native-rfid-hsbr

Biblioteca desenvolvida utilizando o SDK da Zebra versão 2.0.2.114 para leitores RFD8500 e RFD40. Com ela é possivel listar dispositivos pareados, connectar e ler tags rid.

Installation

npm install react-native-rfid-hsbr
or
yarn add react-native-rfid-hsbr

O link com o código nativo é feito automaticamente pelo auto-link, é necessário apenas alterar allowBackup para true em: android/app/src/main/AndroidManifest.xml

<application
    ...
    android:allowBackup="true"> // <-- change for true
    ...
</application>

Bluetooth

Listar dispositivos pareados

import { getAvailableDevices } from 'react-native-rfid-hsbr';

const devices = await getAvailableDevices();
console.log(devices);
// [
//  {"address": "6C:B2:FD:94:E7:29", "name": "RFD850022259520102038"},
//  {"address": "24:71:89:A8:27:49", "name": "RFD850018024523022658"}
// ]

Conectar dispotivo

import { connect } from 'react-native-rfid-hsbr';

const deviceName = 'RFD850022259520102038';
await connect(deviceName);

Usage

A biblioteca dispoe de um componente que captura os eventos do gatilho do leitor e recebe as tags quando lidas.

import { Receiver } from 'react-native-rfid-hsbr'; 
import { View } from 'react-native'; 

function App () => {

    return (
        <View>
            <Receiver
                onRfidRead={(tags) => {
                    console.log('Receive tags:', tags);
                }}
                onTriggerPressed={() => {
                    console.log('Start Inventory...');
                    startInventory();
                }}
                onTriggerReleased={() => {
                    console.log('Stop Inventory!');
                    stopInventory();
                }}
            />
       </View>
    )
}

export default App;

License

MIT


0.1.1

11 months ago

0.1.0

11 months ago