Veethree D7 SDK
Loading...
Searching...
No Matches
Bluetooth RFCOMM

Table of Contents

< Bluetooth

This is an example to establish Bluetooth serial communication between a D7 and a remote linux device such as on Ubuntu PC

Using RFCOMM

To use RFCOMM, enable Bluetooth on the remote device and make the remote device discoverable.

Open the D7 shell, enable Bluetooth and create a pairing request to the remote device using commands given in Bluetooth Basics.

Once the devices are paired, follow the instructions given below in the same order.

Register a Serial Port Profile Service (SPP) by running the following command on both remote device and D7 shell-

$ sdptool add SP

On the D7 shell start an RFCOMM server and wait for incoming connections using:

# rfcomm listen <DEVICE> <CHANNEL>
$ rfcomm listen 0 1

Connect to the D7 by running the connect command on remote device shell:

# rfcomm connect <DEVICE> <D7 MAC> <CHANNEL>
$ rfcomm connect 0 <D7-MAC> 1

Open a new shell on both the remote device and the D7 and start a serial terminal session using:

# picocom /dev/rfcomm<DEVICE>
$ picocom --echo --omap crcrlf /dev/rfcomm0

Use this session as a serial terminal and type in your messages.

Note: QML Bluetooth chat application included in examples/gui/qml-bluetooth-chat/ provides a GUI for RFCOMM server/client implementations.