All Projects → douglasjunior → react-native-easybluetooth-classic

douglasjunior / react-native-easybluetooth-classic

Licence: MIT license
⚛ A Library for easy implementation of Serial Bluetooth Classic on React Native (Android Only).

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-easybluetooth-classic

daydream-node
Quick Node.js module to connect to the Daydream controller and receive all the data
Stars: ✭ 17 (-61.36%)
Mutual labels:  bluetooth, bluetooth-low-energy
py-bluetooth-utils
Python module containing bluetooth utility functions, in particular for easy BLE scanning and advertising
Stars: ✭ 60 (+36.36%)
Mutual labels:  bluetooth, bluetooth-low-energy
Bluetooth
Cross-platform Bluetooth API for Go and TinyGo.
Stars: ✭ 246 (+459.09%)
Mutual labels:  bluetooth, bluetooth-low-energy
Radareeye
A tool made for specially scanning nearby devices[BLE, Bluetooth & Wifi] and execute our given command on our system when the target device comes in-between range.
Stars: ✭ 218 (+395.45%)
Mutual labels:  bluetooth, bluetooth-low-energy
SwiftyTeeth
A simple, lightweight library intended to take away some of the cruft and tediousness of using CoreBluetooth
Stars: ✭ 21 (-52.27%)
Mutual labels:  bluetooth, bluetooth-low-energy
Python Bluezero
A simple Python interface to Bluez
Stars: ✭ 222 (+404.55%)
Mutual labels:  bluetooth, bluetooth-low-energy
BLE
No description or website provided.
Stars: ✭ 25 (-43.18%)
Mutual labels:  bluetooth, bluetooth-low-energy
H Ble
Android Ble类库,基于回调,暴露搜索、连接、发送、接收、断开连接等接口,无需关心细节操作即可进行Ble通信。
Stars: ✭ 171 (+288.64%)
Mutual labels:  bluetooth, bluetooth-low-energy
angular-web-bluetooth-starter
A Starter for the Angular Web Bluetooth module
Stars: ✭ 15 (-65.91%)
Mutual labels:  bluetooth, bluetooth-low-energy
ESP32 Thing Plus
ESP32 Thing-compatible board using the WROOM module and a QWIIC connector.
Stars: ✭ 18 (-59.09%)
Mutual labels:  bluetooth, bluetooth-low-energy
Continuity
Apple Continuity Protocol Reverse Engineering and Dissector
Stars: ✭ 180 (+309.09%)
Mutual labels:  bluetooth, bluetooth-low-energy
ble-serial
"RFCOMM for BLE" a UART over Bluetooth low energy (4.0+) bridge for Linux, Mac and Windows
Stars: ✭ 134 (+204.55%)
Mutual labels:  bluetooth, bluetooth-low-energy
Androidbluetoothlibrary
A Library for easy implementation of Serial Bluetooth Classic and Low Energy on Android. 💙
Stars: ✭ 171 (+288.64%)
Mutual labels:  bluetooth, bluetooth-low-energy
Gatt Python
Bluetooth GATT SDK for Python
Stars: ✭ 233 (+429.55%)
Mutual labels:  bluetooth, bluetooth-low-energy
Reactivebeacons
Android library scanning BLE beacons nearby with RxJava
Stars: ✭ 171 (+288.64%)
Mutual labels:  bluetooth, bluetooth-low-energy
bluetooth-terminal
ES6 class for serial communication with your own Bluetooth Low Energy (Smart) devices
Stars: ✭ 43 (-2.27%)
Mutual labels:  bluetooth, bluetooth-low-energy
Airpodsbattery Monitor For Mac
Simple Widget to display your AirPods battery levels from the Mac Status bar
Stars: ✭ 165 (+275%)
Mutual labels:  bluetooth, bluetooth-low-energy
Bluetoothkit
Easily communicate between iOS/OSX devices using BLE
Stars: ✭ 2,027 (+4506.82%)
Mutual labels:  bluetooth, bluetooth-low-energy
ble
Bluetooth Low Energy for Linux / macOS
Stars: ✭ 264 (+500%)
Mutual labels:  bluetooth, bluetooth-low-energy
home assistant-ble
Companion application for home-assistant, sending bluetooth low energy detection
Stars: ✭ 21 (-52.27%)
Mutual labels:  bluetooth, bluetooth-low-energy

Easy Bluetooth Classic

Licence MIT npm version npm downloads

A Library for easy implementation of Serial Bluetooth Classic on React Native. 💙

Looking for Bluetooth Low Energy? Look here.

Requirements

  • Android 4.1 (API 16)
  • React Native >= 0.40.0

Use

Configuration

import EasyBluetooth from 'easy-bluetooth-classic';

...

    var config = {
      "uuid": "00001101-0000-1000-8000-00805f9b34fb",
      "deviceName": "Bluetooth Example Project",
      "bufferSize": 1024,
      "characterDelimiter": "\n"
    }

    EasyBluetooth.init(config)
      .then(function (config) {
        console.log("config done!");
      })
      .catch(function (ex) {
        console.warn(ex);
      });

Scanning

    EasyBluetooth.startScan()
      .then(function (devices) {
        console.log("all devices found:");
        console.log(devices);
      })
      .catch(function (ex) {
        console.warn(ex);
      });

Connecting

    EasyBluetooth.connect(device)
      .then(() => {
        console.log("Connected!");
      })
      .catch((ex) => {
        console.warn(ex);
      })

Writing

    EasyBluetooth.writeln("Works in React Native!")
      .then(() => {
        console.log("Writing...")
      })
      .catch((ex) => {
        console.warn(ex);
      })

Events

componentWillMount() {
    this.onDeviceFoundEvent = EasyBluetooth.addOnDeviceFoundListener(this.onDeviceFound.bind(this));
    this.onStatusChangeEvent = EasyBluetooth.addOnStatusChangeListener(this.onStatusChange.bind(this));
    this.onDataReadEvent = EasyBluetooth.addOnDataReadListener(this.onDataRead.bind(this));
    this.onDeviceNameEvent = EasyBluetooth.addOnDeviceNameListener(this.onDeviceName.bind(this));
}
...
  onDeviceFound(device) {
    console.log("onDeviceFound");
    console.log(device);
  }

  onStatusChange(status) {
    console.log("onStatusChange");
    console.log(status);
  }

  onDataRead(data) {
    console.log("onDataRead");
    console.log(data);
  }
  
  onDeviceName(name) {
    console.log("onDeviceName");
    console.log(name);
  }
...
componentWillUnmount() {
    this.onDeviceFoundEvent.remove();
    this.onStatusChangeEvent.remove();
    this.onDataReadEvent.remove();
    this.onDeviceNameEvent.remove();
}

Install

  1. Run in console:

    npm i -S easy-bluetooth-classic
  2. Link:

    react-native link easy-bluetooth-classic
  3. Add jitpack repository in android/build.gradle:

    allprojects {
     repositories {
         ...
         maven { url "https://jitpack.io" }
     }
    }
    

Known issues

Contribute

New features, bug fixes and improvements are welcome! For questions and suggestions use the issues.

Become a Patron! Donate

Licence

The MIT License (MIT)

Copyright (c) 2017 Douglas Nassif Roma Junior

See the full licence file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].