TS-4900 Silex Bluetooth: Difference between revisions

From embeddedTS Manuals
No edit summary
No edit summary
 
Line 3: Line 3:
First load the driver in bluez.  For 5.10 and later, run:
First load the driver in bluez.  For 5.10 and later, run:
<source lang=bash>
<source lang=bash>
btattach -P qca -S 115200 -B /dev/ttymxc1
btattach -P qca -S 115200 -B /dev/ttymxc1 &
</source>
</source>



Latest revision as of 13:03, 7 August 2023

Support for Bluetooth is provided by the BlueZ project. BlueZ has support for many different profiles for HID, A2DP, and many more. Refer to the BlueZ documentation for more information. Please see our BLE Examples page for information on installing the latest BlueZ release, getting started, and using demo applications.

First load the driver in bluez. For 5.10 and later, run:

btattach -P qca -S 115200 -B /dev/ttymxc1 &

For kernel 4.9 and below, run:

echo 27 > /sys/class/gpio/export
echo low > /sys/class/gpio/gpio27/direction
sleep .5
echo high > /sys/class/gpio/gpio27/direction
hciattach /dev/ttymxc1 qca 115200 -t30 flow

Either will create an hci0 interface that can interface with bluez. For example, to scan devices use blutoothctl commands power on and scan on.

root@tsimx6:~# bluetoothctl
Agent registered
[CHG] Controller 84:25:3F:B6:1C:4D Pairable: yes
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# scan on
Discovery started
[CHG] Controller 84:25:3F:B6:1C:4D Discovering: yes
[NEW] Device 19:CD:41:6B:AC:09 19-CD-41-6B-AC-09