Setup and usage BLE device emulator with nRF Connect
masterTo test the react-native-ble-plx library using a BLE device emulator, you need the BLE-PLX-example.xml file and the nRF Connect app (available on Android and iOS).
1. Configure the GATT Server
- Open the nRF Connect app.
- Navigate to the
Configure GATT serverscreen. - Use the import option in the top bar to import
BLE-PLX-example.xml. - Go to the
ADVERTISERtab and configure the advertising packet:- Enable the
Connectablecheckbox. - Set the advertiser name to
BLX-PLX-test. - Advertising data: Add a
Complete Local Namerecord and aService UUIDrecord for theDevice time(0x1847) service. - Scan Response data: Add a
Complete Local Namerecord and aService UUIDrecord for theDevice time(0x1847) service.
- Enable the
- Click
okand turn on theBLX-PLX-testadvertiser.
2. Run the Test in the Example App
- Open the example app and click
Go to nRF test. - Enter the
Complete Local Nameyou configured in the server into theDevice name to connectfield. - Click
Start(grant BLE permissions if prompted). - Once the app starts the
Monitor current time characteristic for devicetest case, return to the nRF Connect app. - Go to the
SERVERtab. - Open the
Device Timeservice. - Click the send icon next to the
Current Time characteristicand send the valueHi, it works!asTEXT(UTF-8). - The test should complete successfully with a check mark icon.