0.1.81 • Published 6 months ago

rn-symcode-bt v0.1.81

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

rn-symcode-bt

React native library for Symcode barcodes scaner (or others) (SPP protocol)

Installation

npm install rn-symcode-bt

Usage :

  1. Select SPP mode on scaner (for others read documentation of concrete device): spp_img

  2. Pair your device in standard android bluetooth menu (or use methods: serachDevices and pairDevice)

  3. Connect device, use connect or asyncConnectWithTimeout methods
  4. For notify of scan event, use enableNotify
import Symcode from "rn-symcode-bt";

/**
 * Methods:
 */
export declare type Device = Record<'name' | 'mac', string> & Record<'isPaired', boolean>;

export default class SymcodeDriver {
  enableBluetooth(): Promise<boolean>;

  searchDevices(timeout?: number): Promise<Device[]>;

  getPairedDevices(timeout?: number): Promise<Device[]>;

  isPaired(mac: string): Promise<boolean>;

  isConnected(mac: string): Promise<boolean>;

  pairDevice(mac: string): Promise<boolean>;

  connect(mac: string): Promise<boolean>;

  asyncConnectWithTimeout(mac: string): Promise<void>;

  disconnect(): Promise<void>;

  enableNotify(eventFn: (data: Record<'barcode', string>) => Promise<void>): Promise<void>;

  disableNotify(): Promise<void>;
}

License

MIT

0.1.81

6 months ago

0.1.78

4 years ago

0.1.79

4 years ago

0.1.80

4 years ago

0.1.74

4 years ago

0.1.75

4 years ago

0.1.76

4 years ago

0.1.77

4 years ago

0.1.73

4 years ago

0.1.71

4 years ago

0.1.72

4 years ago

0.1.70

4 years ago

0.1.63

4 years ago

0.1.64

4 years ago

0.1.65

4 years ago

0.1.66

4 years ago

0.1.67

4 years ago

0.1.68

4 years ago

0.1.69

4 years ago

0.1.62

4 years ago

0.1.61

4 years ago

0.1.59

4 years ago

0.1.57

4 years ago

0.1.58

4 years ago

0.1.52

4 years ago

0.1.53

4 years ago

0.1.51

4 years ago

0.1.45

4 years ago

0.1.46

4 years ago

0.1.47

4 years ago

0.1.48

4 years ago

0.1.37

4 years ago

0.1.41

4 years ago

0.1.43

4 years ago

0.1.21

4 years ago

0.1.33

4 years ago

0.1.12

4 years ago

0.1.35

4 years ago

0.1.14

4 years ago

0.1.15

4 years ago

0.1.8

4 years ago

0.1.17

4 years ago

0.1.7

4 years ago

0.1.19

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago