zephyr/samples/bluetooth
Szymon Janc 6645d3f485 Bluetooth: GATT: Remove destroy callback from bt_gatt_discover_params
Instead of destroy callback, call discovery_func with NULL attribute to
indicated that discovery has completed. This makes it clear when
discovery is completed and parameters used for it are no longer used.
Thanks to this application doesn't need to abuse user data destroy
callback for detecting if discovery has completed.

Also note that bt_gatt_discover doesn't take any user data parameter
and that destroy callback was acctually called with discovery
parameters.

If application would require to pass user data along with parameters
it may use CONTAINER_OF macro along with bt_gatt_discover_params.

Change-Id: Iec4eb9795975ef2555502e13a682e13ff37742e0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:25:32 -05:00
..
beacon Bluetooth: nble: Remove enabling debug by default 2016-02-05 20:25:31 -05:00
central Bluetooth: Rename prj_x86.conf to prj.conf 2016-02-05 20:25:20 -05:00
central_hr Bluetooth: GATT: Remove destroy callback from bt_gatt_discover_params 2016-02-05 20:25:32 -05:00
init Bluetooth: Rename prj_x86.conf to prj.conf 2016-02-05 20:25:20 -05:00
init_h5 Bluetooth: Rename prj_x86.conf to prj.conf 2016-02-05 20:25:20 -05:00
ipsp Bluetooth: samples: Use sizeof() to evaluate fixed name length 2016-02-05 20:25:31 -05:00
peripheral Bluetooth: nble: Remove enabling debug by default 2016-02-05 20:25:31 -05:00
peripheral_dis Bluetooth: samples: Use sizeof() to evaluate fixed name length 2016-02-05 20:25:31 -05:00
peripheral_sc_only Bluetooth: samples: Use sizeof() to evaluate fixed name length 2016-02-05 20:25:31 -05:00
shell Bluetooth: GATT: Remove destroy callback from bt_gatt_discover_params 2016-02-05 20:25:32 -05:00
test_bluetooth Bluetooth: Convert driver header info to hidden Kconfig options 2016-02-05 20:24:45 -05:00
tester Bluetooth: GATT: Remove destroy callback from bt_gatt_discover_params 2016-02-05 20:25:32 -05:00
README Bluetooth: Fix HCI driver Kconfig references in samples 2016-02-05 20:25:03 -05:00

Bluetooth subsystem

= Building =

Build samples

$ make -C samples/bluetooth/<app>

= Bluetooth Sample application =

Host Bluetooth controller is connected to the second qemu serial line
through a UNIX socket (qemu option -serial unix:/tmp/bt-server-bredr).
This option is already added to qemu through QEMU_EXTRA_FLAGS in Makefile.

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

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
(CONFIG_BLUETOOTH_H4) are enabled, Bluetooth driver registers to the system.
From now on Bluetooth might be used by the application. To run application in
the qemu run:

$ make qemu

== 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>

= Bluetooth sanity check =

There is smoke test application in nanokernel and microkernel test
directories which gets run in sanity check script:

$ scripts/sanity_chk/sanity_chk [-P <platform>]

For quick regression test use bt_regression, it only check Bluetooth test

$ samples/bluetooth/bt_regression.sh