0.1.4 • Published 2 years ago

react-native-ble-manager-hooks v0.1.4

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

react-native-ble-manager-hooks

npm version npm downloads GitHub issues

This is custom hooks packages of https://github.com/innoveit/react-native-ble-manager project.

Prerequisites

This library uses react-native-ble-manager to use bluetooth functions. Therefore this library needs to be installed AND linked into your project to work.

Requirements

RN 0.60+

Supported Platforms

  • iOS 8+
  • Android (API 19+)

Install

npm i --save react-native-ble-manager-hooks

Usage

const { loading, onWriteCommand } = useWrite()

const getMacAddress = async () => {

    const data = [\x00, \x00, \x00]

    const [res, err] = onWriteCommand({
        peripheralID:"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
        serviceUUID: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
        characteristicUUID: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
        data
    })

    if(err) {
        //error logic
    }

}
0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago