2.9.2 HCI Application Demo-BLE-UART-BlueZ
The HCI (Human-Computer Interaction) application serves as a feature demo for RNBD451 v1.1, utilizing BlueZ and D-Bus through the attached UART HCI interface on a Linux system. This application allows you to control the RNBDv1.1 HCI mode using HCI commands provided by BlueZ. It demonstrates scanning for devices and establishing connectivity with RNBD v1.0. Additionally, it enables bidirectional data transmission, allowing you to send raw data to a remote peer and display received data.
Demo Scenario Setup
Follow these steps to set up the demo scenario:
1. Prepare RNBD451 Click Board #A
a. Program with latest firmware V1.1.0.17
2. Prepare another RNBD451 click board #B
a. program with latest firmware V1.1.0.17
3. Install ble-uart-bluez v0.7 into Linux
a. Follow the session – HCI Application Environment Setup
4. Connect RNBD451 Click Board #B to Linux.
Use the ‘hciattach’ command to connect RNBD451 Click Board#B to Linux via the attached UART interface.
Example Command: sudo hciattach /dev/ttyACM0 any 15200
1. "/dev/ttyACM0" is the device probe by Linux for MCP2200
2. Note: The ttyACM0 is enumerator by Linux and it could be different if you unplug / plug the USB cable with PC/laptop.
5. Establish Terminal Tool Connection to RNBD451 Click Board #A
a. Establish a terminal tool connection to RNBD451 Click Board #A. Can use tools like Docklight
b. Enter command mode via "$$$" before issue RN command.
c. Use 'D' command to query local address and its device name, use 'V' command to query FW version.
d. Examples of raw data for sending: "send raw data - hello" and "send raw data - hellohello"
e. when receiving data or transmitting data, it should be kept in data mode.
Execute BLE-UART-BlueZ
1. Command list scan:
Scan for BLE devices in the vicinity.
dev: List available devices, including cached devices.
conn <index>: Connect to a selected device listed in the dev command.
disc <index>: Disconnect from a selected device listed in the dev command.
raw <index> <ASCII>: Send raw data to a remote peer based on the index.
2. Scanning for BLE Devices
3. Displaying Available Devices
4. Connecting to a Device
5. Sending Raw Data
To send the raw data to a remote peer, follow the steps:
- Ensure you are connected to a remote device(RNBD451)