0.1.80 • Published 3 years ago

rn-symcode-bt v0.1.80

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years 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.78

3 years ago

0.1.79

3 years ago

0.1.80

3 years ago

0.1.74

3 years ago

0.1.75

3 years ago

0.1.76

3 years ago

0.1.77

3 years ago

0.1.73

3 years ago

0.1.71

3 years ago

0.1.72

3 years ago

0.1.70

3 years ago

0.1.63

3 years ago

0.1.64

3 years ago

0.1.65

3 years ago

0.1.66

3 years ago

0.1.67

3 years ago

0.1.68

3 years ago

0.1.69

3 years ago

0.1.62

3 years ago

0.1.61

3 years ago

0.1.59

3 years ago

0.1.57

3 years ago

0.1.58

3 years ago

0.1.52

3 years ago

0.1.53

3 years ago

0.1.51

3 years ago

0.1.45

3 years ago

0.1.46

3 years ago

0.1.47

3 years ago

0.1.48

3 years ago

0.1.37

3 years ago

0.1.41

3 years ago

0.1.43

3 years ago

0.1.21

3 years ago

0.1.33

3 years ago

0.1.12

3 years ago

0.1.35

3 years ago

0.1.14

3 years ago

0.1.15

3 years ago

0.1.8

3 years ago

0.1.17

3 years ago

0.1.7

3 years ago

0.1.19

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago