Easy Bluetooth Low Energy
A Library for easy implementation of Serial Bluetooth Low Energy on React Native. 💙
Looking for Bluetooth Classic? Look here.
Requirements
- React Native >= 0.40.0
- Android 4.3 (API 18)
- iOS soon...
Use
Configuration
; ... var config = "uuidService": "e7810a71-73ae-499d-8c15-faa9aef0c3f2" "uuidCharacteristic": "bef8d6c9-9c21-4c9e-b632-bd58c1009f9f" "deviceName": "Bluetooth Example Project" "bufferSize": 1024 "characterDelimiter": "\n" EasyBluetooth ;
Scanning
EasyBluetooth ;
Connecting
EasyBluetooth
Writing
EasyBluetooth
Events
{ thisonDeviceFoundEvent = EasyBluetooth; thisonStatusChangeEvent = EasyBluetooth; thisonDataReadEvent = EasyBluetooth; thisonDeviceNameEvent = EasyBluetooth;}... { console; console; } { console; console; } { console; console; } { console; console; }... { thisonDeviceFoundEvent; thisonStatusChangeEvent; thisonDataReadEvent; thisonDeviceNameEvent;}
Install
-
Run in console:
npm i -S easy-bluetooth-le -
Link:
react-native link easy-bluetooth-le -
Add jitpack repository in
android/build.gradle
:allprojects {repositories {...maven { url "https://jitpack.io" }}}
Known issues
- Location needs to be enabled for Bluetooth Low Energy Scanning on Android 6.0 http://stackoverflow.com/a/33045489/2826279
Contribute
New features, bug fixes and improvements are welcome! For questions and suggestions use the issues.
Licence
The MIT License (MIT)
Copyright (c) 2017 Douglas Nassif Roma Junior
See the full licence file.