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

Use the “scan” command to initiate a 5-second scan for BLE devices in the vicinity. Discovered devices will be listed, showing their addresses and names (if available)
after scan stop, following scan result will be printed, note that only RSSI > -70 dB will be printed.

3. Displaying Available Devices

Utilize the “dev” command to display the currently available devices. It's advisable to execute this command before performing other operations to ensure you have an up-to-date list of devices.

4. Connecting to a Device

Use the “conn <index> command to establish a connection with a selected device from the list. The index corresponding to the device that is wished to connect to.

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)

- Switch to raw mode using the “SW 4” command.
- Use the “raw <index> <raw data> “ command to send raw data to the remote peer.
- On peer side, raw data is shown
- Raw data can be sent from the peer side.
- HCI application will receive the raw data on following