2015-04-13 19:39:47 +08:00
|
|
|
Bluetooth subsystem
|
|
|
|
|
|
|
|
= Building =
|
|
|
|
|
2015-04-17 19:56:53 +08:00
|
|
|
Build samples
|
|
|
|
|
2015-04-13 19:39:47 +08:00
|
|
|
$ make -C samples/bluetooth/<app>
|
|
|
|
|
2015-06-11 20:05:50 +08:00
|
|
|
= Bluetooth Sample application =
|
2015-04-13 19:39:47 +08:00
|
|
|
|
2015-06-11 20:05:50 +08:00
|
|
|
Host Bluetooth controller is connected to the second qemu serial line
|
2015-04-13 19:39:47 +08:00
|
|
|
through a UNIX socket (qemu option -serial unix:/tmp/bt-server-bredr).
|
2015-06-11 20:05:50 +08:00
|
|
|
This option is already added to qemu through QEMU_EXTRA_FLAGS in Makefile.
|
2015-04-13 19:39:47 +08:00
|
|
|
|
|
|
|
On the host side BlueZ allows to "connect" Bluetooth controller through
|
|
|
|
a so-called user channel. Use the btproxy tool for that:
|
|
|
|
|
|
|
|
$ sudo tools/btproxy -u
|
|
|
|
Listening on /tmp/bt-server-bredr
|
|
|
|
|
2015-06-11 20:05:50 +08:00
|
|
|
Note that before calling btproxy make sure that Bluetooth controller is down.
|
|
|
|
|
|
|
|
Now running qemu result connecting second serial line to 'bt-server-bredr'
|
|
|
|
UNIX socket. When Bluetooth (CONFIG_BLUETOOTH) and Bluetooth HCI UART driver
|
2015-12-08 02:58:05 +08:00
|
|
|
(CONFIG_BLUETOOTH_H4) are enabled, Bluetooth driver registers to the system.
|
2015-06-11 20:05:50 +08:00
|
|
|
From now on Bluetooth might be used by the application. To run application in
|
|
|
|
the qemu run:
|
2015-04-13 19:39:47 +08:00
|
|
|
|
2015-06-10 22:06:20 +08:00
|
|
|
$ make qemu
|
2015-04-17 19:56:53 +08:00
|
|
|
|
2015-11-30 21:48:15 +08:00
|
|
|
== Bluetooth IPSP application ==
|
|
|
|
|
|
|
|
To test IPSP please take a look at samples/net/README, in addition to running
|
|
|
|
echo-client it is necessary to enable 6LowPAN module in Linux with the
|
|
|
|
following commands:
|
|
|
|
|
|
|
|
$ modprobe bluetooth_6lowpan
|
|
|
|
$ echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable
|
|
|
|
|
|
|
|
Then to connect:
|
|
|
|
|
|
|
|
echo "connect <bdaddr> <type>" > /sys/kernel/debug/bluetooth/6lowpan_control
|
|
|
|
|
|
|
|
Once connected a dedicated interface will be created, usually bt0, which can
|
|
|
|
then be used as following:
|
|
|
|
|
|
|
|
$ echo-client -i bt0 <ip>
|
|
|
|
|
2015-06-11 20:05:50 +08:00
|
|
|
= Bluetooth sanity check =
|
2015-04-17 19:56:53 +08:00
|
|
|
|
|
|
|
There is smoke test application in nanokernel and microkernel test
|
|
|
|
directories which gets run in sanity check script:
|
|
|
|
|
2016-03-31 12:56:57 +08:00
|
|
|
$ scripts/sanity_chk/sanitycheck [-P <platform>]
|
2015-04-17 19:56:53 +08:00
|
|
|
|
2016-03-31 12:56:57 +08:00
|
|
|
To only run Bluetooth tests use the -t bluetooth switch:
|
2015-04-17 19:56:53 +08:00
|
|
|
|
2016-03-31 12:56:57 +08:00
|
|
|
$ scripts/sanity_chk/sanitycheck -t bluetooth
|