0.1.81 • Published 1 year ago

rn-symcode-bt v0.1.81

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

0.1.78

5 years ago

0.1.79

5 years ago

0.1.80

5 years ago

0.1.74

5 years ago

0.1.75

5 years ago

0.1.76

5 years ago

0.1.77

5 years ago

0.1.73

5 years ago

0.1.71

5 years ago

0.1.72

5 years ago

0.1.70

5 years ago

0.1.63

5 years ago

0.1.64

5 years ago

0.1.65

5 years ago

0.1.66

5 years ago

0.1.67

5 years ago

0.1.68

5 years ago

0.1.69

5 years ago

0.1.62

5 years ago

0.1.61

5 years ago

0.1.59

5 years ago

0.1.57

5 years ago

0.1.58

5 years ago

0.1.52

5 years ago

0.1.53

5 years ago

0.1.51

5 years ago

0.1.45

5 years ago

0.1.46

5 years ago

0.1.47

5 years ago

0.1.48

5 years ago

0.1.37

5 years ago

0.1.41

5 years ago

0.1.43

5 years ago

0.1.21

5 years ago

0.1.33

5 years ago

0.1.12

5 years ago

0.1.35

5 years ago

0.1.14

5 years ago

0.1.15

5 years ago

0.1.8

5 years ago

0.1.17

5 years ago

0.1.7

5 years ago

0.1.19

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago