NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

OMAP Wireless Connectivity Bluetooth GUI

From Texas Instruments Wiki
Jump to: navigation, search

Introduction[edit]

The Bluetooth Demo is an application written in Qt designed to test some Bluetooth capabilities on TI boards. The main features are:

  1. Scanning and showing Bluetooth devices and their capabilities.
  2. Streaming audio for Bluetooth devices (speakers, headphones, …)
  3. To test Bluetooth keyboards and mices.

The other technologies used in this application are: BlueZ, obex-data-server and dbus.

Using the Bluetooth Demo[edit]

Main View[edit]

When you start the BT_Demo for the very first time, the application should look like the image below.

Main view.png
The Bluetooth GUI application running for the first time


After the application is launched it automatically starts scanning for Bluetooth devices. When it receives the signal DeviceFound (from BlueZ) the device is appended into the list, but this signal does not send all information of the device at the first moment, like name. So initially the device is shown using just the address and as soon as it receives the other informations, the item in the list is updated, as you can see in the next image.

Main view2.png
Bluetooth GUI showing some devices


In the image below the parts that compose the view are enumerated.

Main view details.png
Important parts of the view


  1. An icon showing the kind of the device (input, audio, cell phone, …).
  2. The profiles implemented by the device.
  3. This icon indicates whether the device is paired (green) or not (red).
  4. A device not paired.
  5. This button has two functions, start/stop the device scanning. When the label is showing "Stop scan", it means the application is scanning (the scan time is 60 seconds, after that the application stops scanning and the label is changed) and if it is clicked the scanning is stopped immediately.
  6. Start listen SPP.
  7. Quit the application without killing bluetoothd nor removing the Bluetooth driver.
  8. Quit and kill the bluetoothd and remove the device driver.

Important thing to consider in this view[edit]

Once a device has been paired it always appears as soon as the application is launched, it happens because the device is known by the Bluetooth adapter (it can easily be checked in /var/lib/Bluetooth/<adpater_address>/*). This is expected behavior and can be verified in other Bluetooth applications as well (gnome-Bluetooth, blueman, …).

Pairing a device[edit]

When a device which is not paired (the right icon with red) is clicked the images below should appear.

Pairing view.png
Pairing



Pairing view keyboard.png
Requesting the pin code


The Device View[edit]

When a paired device is clicked the application should look like the next image

Device view.png
Device tests view


Only the tests which can be handled by the device are enabled.

The HID View[edit]

Provides support for devices such as mice, joysticks, keyboards. Bluetooth HID is a lightweight wrapper of the Human Interface Device protocol defined for USB. The use of the HID protocol simplifies host implementation by enabling the re-use of some of the existing support for USB HID to also support Bluetooth HID.

Hardware Setup[edit]

To run this demo you need a Bluetooth HID device like Bluetooth mouse or Bluetooth keyboard that support the BT HID profile
BT HID setup.jpg


The HID test should look like the image below

Hid view.png
HID test view


It's important to say that there is a well known bug with this profile in the kernel. Once a HID device has been disconnected it cannot be used anymore.

Activating Bluetooth Mouse[edit]

Before activating the bluetooth mouse we need to make a special export in order for the Bluetooth mouse to work properly:

  • On EVM, edit the file: /etc/init.d/matrix-gui-2.0
  • Replace the line export QWS_MOUSE_PROTO=Tslib:/dev/input/touchscreen0 with export QWS_MOUSE_PROTO="Tslib:/dev/input/touchscreen0 Auto"
  • Save and reboot

Please note that with the export above, you now will need to press double click on the touch screen icons instead of single click.
Now you may test the bluetooth mouse (HID Test).

In order to go back to the previous behavior, once you finish the Bluetooth mouse test do the following:

  • On EVM, edit the file: /etc/init.d/matrix-gui-2.0
  • Replace the line export QWS_MOUSE_PROTO="Tslib:/dev/input/touchscreen0 Auto" with export QWS_MOUSE_PROTO=Tslib:/dev/input/touchscreen0
  • Save and reboot

HID Mouse Use Case[edit]

In this use case we would like to test the HID on a Bluetooth mouse device.
As stated earlier, we need to make a special export when working with Bluetooth mouse device. We do it as follows:

  • On EVM, edit the file: /etc/init.d/matrix-gui-2.0

To Enable both Mouse and touchscreen simultaneously: Replace

 export  QWS_MOUSE_PROTO=Tslib:/dev/input/touchscreen0

with

 export  QWS_MOUSE_PROTO="Tslib:/dev/input/touchscreen0 Auto"
  • Save and reboot


for more information access the link: <Mouse with Matrix>

Now we locate the mouse in the Bluetooth device list. In our case the mouse device name is Logitech MX Revolution Mouse

HID1.png

Once we click on it, the pairing process starts. This is because the device is not paired yet.
The pairing process prompts for the PIN code. In our case it is four zeros.
We enter the four zeros using the virtual keyboard as shown below:

AtDP2.png

Once the pairing is successful, we will get a message notification as follows:

AtDP3.png

  • now Press the Done button


HID1.png

  • In order to enter test mode, click on the Logitech MX Revolution Mouse device again. and now the capabilities menu of the device will show up the HID option.
  • Choose the HID Test as shown below:


HID2.png

Click/press on “HID Test” (highest) button to start HID test. And press “connect” button on a Bluetooth mouse at the same time. The following screen will be displayed:

BT HID 4 1.JPG

And right after this the HID test screen will be opened:
Hid view.png

At this point, we should be able to move the mouse cursor using the Bluetooth mouse device.
After quitting the test, we need to reset the modified export as follows:

  • On EVM, edit the file: /etc/init.d/matrix-gui-2.0
  • Replace the line export QWS_MOUSE_PROTO="Tslib:/dev/input/touchscreen0 Auto" with export QWS_MOUSE_PROTO=Tslib:/dev/input/touchscreen0
  • Save and reboot




HID Keyboard Use Case[edit]

In this use case we would like to test the HID on a Bluetooth keyboard device.
We locate the keyboard in the Bluetooth device list. In our case the mouse device name is Microsoft Keyboard

HID3.png

Once we click on it, the pairing process starts. This is because the device is not paired yet.
The pairing process prompts for the PIN code. In our case it is four zeros.
We enter the four zeros using the virtual keyboard as shown below:

AtDP2.png

Once the pairing is successful, we will get a message notification as follows:

AtDP3.png

We now press the Done button, and then click on the Microsoft Keyboard device again. We now enter the capabilities menu of the device.
We choose the HID Test as shown below:

HID2.png

Following is the screen we see when choosing the HID Test and typing some text using the Bluetooth keyboard:
Note: Sometime it takes up to 1 minute delay till the typing is possible

HID4.png

The Audio View[edit]

The Advanced Audio Distribution Profile (A2DP) is a Bluetooth profile that allows for the wireless transmission of stereo audio from an A2DP source (typically a phone or computer) to an A2DP Sink (a set of Bluetooth headphones or stereo system).
The EVM can have the role of Source or Sink.

A2DP Source Hardware Setup[edit]

To run this demo, you need a set of stereo BT Headphones (such as the Motorola MOTOROKR S9-HD, or any other headset that supports the BT A2DP profile).
A2DP Demo setup.jpg

The A2DP test should look like the image below

Atdp view.png
A2DP test view


Just select a wav file (this is the only kind of files enabled) and then click in the play button, the audio then will start to play on device. To stop the audio, just click the stop or done button.

A2DP Source Use Case[edit]

In this use case, we will connect to a Bluetooth headset and listen to music using the Bluetooth GUI application.
In the main screen, we can see our device which is the Samsung SBH500.

AtDP1.png

Once we click on it, the pairing process starts. This is because the device is not paired yet.
The pairing process prompts for the PIN code. In our case it is four zeros.
We enter the four zeros using the virtual keyboard as shown below:

AtDP2.png

Once the pairing is successful, we will get a message notification as follows:

AtDP3.png

We now press the Done button, and then click on the Samsung SBH500 device again. We now enter the capabilities menu of the device.
We choose the A2DP Test as shown below:

Playing Music[edit]


AtDP4.png

When selecting the A2DP, we will have to select a WAV file to listen to. We navigate to the WAV file which is found in our example under:
/usr/share/wl1271-demos/bluetooth/gallery/Pop.wav

AtDP5.png

We select the file and then click on the play button to start listening to music.

AtDP6.png

A2DP Sink Hardware Setup[edit]

To run this demo, you need the following components:

  • Two EVM's
  • USB hub with external power supply. The USB hub should be connected to the EVM's USB entry.
  • External USB sound card which can convert from USB plug to audio out plug. The USB external sound card should be connected to the USB hub.
  • Headset, which will be connected to the external USB sound card


A2DPS HW.png

A2DP Sink Use Case[edit]

In this use case, we will connect to a two EVM's, where one will have the Source role, and the other will have Sink role.
The EVM's we have are:

  1. AM335x, which will be the Source
  2. AM37x, which will be the Sink

First of all, we pair the EVM's as shown below:

A2DPS Discover.jpg

Once we click on the a37x-evm, the pairing starts automatically. All we need to do is to confirm the Pass key:
A2DPS Confirm.jpg

We go now to the Sink EVM (am37x-evm) and press on the am335x-evm (which is green since it is paired):
A2DPS Paired.jpg

When we tap on the am335x-evm device we will have the following screen:
A2DPS Main.jpg

You can see now a test called A2DP Sink, when clicking on the test we will have a "Connecting..." screen for a few seconds, followed by the screen:
A2DPS Play.jpg

We are ready now to listen to incoming music from the Source. This is done by going to the am335x-evm, choosing the am37x-evm (Sink) and perform the procedure of Playing Music
You may change the Volume scroll bar value to change the Volume on the A2DP Sink device.

The SPP View[edit]

This profile emulates a serial cable to provide a simple substitute for existing RS-232, including the familiar control signals. The SPP test is pretty simple, it is an application designed to send and receive messages. When you click on it, you will wait that other device connect and send messages for you (when you are the listener, you just receive, you cannot send any message).

We can perform this demo in two ways:

EVM to EVM[edit]

Hardware Setup[edit]

To perform this demo, we'll need

  • Two EVMs: One EVM will register for the SPP service while the other EVM will connect to it and send data
  • USB Keyboard for typing messages to be sent via SPP
  • USB hub with external power supply in order to supply sufficient power for the USB keyboard


SPP EVM2EVM.PNG

First step would be pairing the EVMs via the BT GUI application as show below:

A2DPS Discover.jpg

Assuming we want to connect to am37x-evm in the list, once we click on the a37x-evm, the pairing starts automatically. All we need to do is to confirm the Pass key:

A2DPS Confirm.jpg

Now that we have the EVMs paired, we click on "Listen SPP" button(second button from the left) on the first EVM as shown below:

A2DPS Discover Paired.jpg

Once we do it, we will see the SPP Listen screen:

SPP Listen1.jpg

Now the first EVM is ready to receive SPP data transfer.
On the second EVM, we choose the first EVM from the list and click on "SPP Test" button:

SPP Test Button.jpg

The following screen will be opened:

SPP Client Screen.jpg

Now, we are ready to send a text message: assume we type (using the connected keyboard) the word "hi", followed by "Enter" on the second EVM, then the word will appear in the first EVM as follows:

SPP Listen 2.jpg

PC to EVM[edit]

Hardware Setup[edit]

To perform this demo, you need a PC with bluetooth support or with Bluetooth dongle. Also, make sure that Bluetooth in your laptop is configured to be discoverable or "available to be searched". This may require changing the security level settings on the PC Bluetooth Connection Manager.
BT FTP setup.jpg
NOTE

The description here refers to the EVM side and not to the PC side. This is because the PC can have different SPP clients and the configuration depends on the client.
It's up to the user to configure the SPP on the PC side.


First step would be pairing the EVMs via the BT GUI application as show below:

A2DPS Discover.jpg

Assuming we wan tot connect to moosa-laptop in the list, once we click on the moosa-laptop, the pairing starts automatically. All we need to do is to confirm the Pass key:

A2DPS Confirm.jpg

Incoming SPP Data[edit]

If we want the EVM to listen to incoming SPP data, we click on "Listen SPP" button(second button from the left) on the first EVM as shown below:

A2DPS Discover Paired.jpg

The SPP test should look like the image below

Spp view.png

The PC Bluetooth client should establish an SPP connection to the EVM. Once the connection is established, you can send text via the PC Bluetooth client to the EVM.
The text should appear on the EVM once it is sent from the PC.

Sending Data to PC[edit]

If we want the EVM to send data via SPP, we choose the PC from the devices list and click on "SPP Test" button:

SPP Test Button.jpg

The following screen will be opened:

SPP Client Screen.jpg

Now, we are ready to send a text message to the PC by typing the text followed by the "Enter" key.

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article OMAP Wireless Connectivity Bluetooth GUI here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article OMAP Wireless Connectivity Bluetooth GUI here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article OMAP Wireless Connectivity Bluetooth GUI here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article OMAP Wireless Connectivity Bluetooth GUI here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article OMAP Wireless Connectivity Bluetooth GUI here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article OMAP Wireless Connectivity Bluetooth GUI here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article OMAP Wireless Connectivity Bluetooth GUI here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article OMAP Wireless Connectivity Bluetooth GUI here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article OMAP Wireless Connectivity Bluetooth GUI here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity