How dotintent/react-native-ble-plx works
react-native-ble-plx is a React Native BLE client library. An app uses the exported BleManager API to observe adapter state, scan for peripherals, connect, discover GATT services, and perform characteristic or descriptor operations; results and events return through the JavaScript/native bridge. Platform code performs BLE operations, while JavaScript model objects expose devices and GATT resources. The README also documents RSSI, MTU negotiation, iOS background support, and an Expo config plugin. Native implementation details beyond the sampled Android and bridge files are represented only at the subsystem level.
Main entry points: BlePlxModule.java Android module · BleModule.js Native module bridge · BleManager.js BLE manager · withBLE.ts Expo config plugin
Components 17
JavaScript API
- Public exports
src/index.js - BLE manager
src/BleManager.js - Native module bridge
src/BleModule.js - GATT models
src/Service.js
Native BLE
- Android module
android/src/main/java/com/bleplx/BlePlxModule.java - Android BLE adapter
android/src/main/java/com/bleplx/adapter/BleAdapter.java - Android GATT models
android/src/main/java/com/bleplx/adapter/Service.java - Native converters
android/src/main/java/com/bleplx/converter/ServiceToJsObjectConverter.java - iOS native bridge
ios/BlePlx.h - iOS BLE adapter
ios
App configuration
- Expo config plugin
plugin/src/withBLE.ts - Android permissions
plugin/src/withBluetoothPermissions.ts - iOS background modes
plugin/src/withBLEBackgroundModes.ts
BLE environment
- Bluetooth LE system
- BLE peripheral
Other components
- React Native app
- Expo app config
Connections 17
- React Native app → Public exports: imports API
- Public exports → BLE manager: exports manager
- BLE manager → Native module bridge: invokes native API
- BLE manager → GATT models: creates models
- Native module bridge → Android module: bridges calls
- Android module → Android BLE adapter: uses adapter
- Android BLE adapter → Bluetooth LE system: performs BLE
- Bluetooth LE system → BLE peripheral: communicates
- Android module → Android GATT models: uses GATT data
- Android module → Native converters: converts results
- Native converters → Native module bridge: returns objects
- Native module bridge → iOS native bridge: bridges calls
- iOS native bridge → iOS BLE adapter: exposes adapter
- iOS BLE adapter → Bluetooth LE system: performs BLE
- Expo app config → Expo config plugin: configures app
- Expo config plugin → Android permissions: configures permissions
- Expo config plugin → iOS background modes: sets background modes