diff options
Diffstat (limited to 'samples')
-rw-r--r-- | samples/bluetooth/handsfree/README.rst | 23 | ||||
-rw-r--r-- | samples/bluetooth/hci_uart/src/main.c | 11 | ||||
-rw-r--r-- | samples/bluetooth/hci_usb/src/main.c | 11 | ||||
-rw-r--r-- | samples/bluetooth/peripheral_sc_only/README.rst | 26 |
4 files changed, 55 insertions, 16 deletions
diff --git a/samples/bluetooth/handsfree/README.rst b/samples/bluetooth/handsfree/README.rst new file mode 100644 index 000000000..f67f1e8ec --- /dev/null +++ b/samples/bluetooth/handsfree/README.rst @@ -0,0 +1,23 @@ +.. _bt_handsfree: + +Bluetooth: Handsfree +#################### + +Overview +******** + +Application demonstrating usage of the Hands-free Profile (HFP) APIs. + +Requirements +************ + +* BlueZ running on the host, or +* A board with Bluetooth BR/EDR (Classic) support + +Building and Running +******************** + +This sample can be found under :file:`samples/bluetooth/handsfree` in +the Zephyr tree. + +See :ref:`bluetooth setup section <bluetooth_setup>` for details. diff --git a/samples/bluetooth/hci_uart/src/main.c b/samples/bluetooth/hci_uart/src/main.c index 39fdafd13..35a09e575 100644 --- a/samples/bluetooth/hci_uart/src/main.c +++ b/samples/bluetooth/hci_uart/src/main.c @@ -22,6 +22,7 @@ #include <net/buf.h> #include <bluetooth/bluetooth.h> +#include <bluetooth/l2cap.h> #include <bluetooth/log.h> #include <bluetooth/hci.h> #include <bluetooth/buf.h> @@ -31,19 +32,13 @@ static struct device *hci_uart_dev; static BT_STACK_NOINIT(tx_thread_stack, CONFIG_BLUETOOTH_HCI_TX_STACK_SIZE); /* HCI command buffers */ -#define CMD_BUF_SIZE (CONFIG_BLUETOOTH_HCI_SEND_RESERVE + \ - sizeof(struct bt_hci_cmd_hdr) + \ - CONFIG_BLUETOOTH_MAX_CMD_LEN) - +#define CMD_BUF_SIZE BT_BUF_RX_SIZE NET_BUF_POOL_DEFINE(cmd_tx_pool, CONFIG_BLUETOOTH_HCI_CMD_COUNT, CMD_BUF_SIZE, BT_BUF_USER_DATA_MIN, NULL); #define BT_L2CAP_MTU 65 /* 64-byte public key + opcode */ /** Data size needed for ACL buffers */ -#define BT_BUF_ACL_SIZE (CONFIG_BLUETOOTH_HCI_RECV_RESERVE + \ - sizeof(struct bt_hci_acl_hdr) + \ - 4 /* L2CAP header size */ + \ - BT_L2CAP_MTU) +#define BT_BUF_ACL_SIZE BT_L2CAP_BUF_SIZE(BT_L2CAP_MTU) #if defined(CONFIG_BLUETOOTH_CONTROLLER_TX_BUFFERS) #define TX_BUF_COUNT CONFIG_BLUETOOTH_CONTROLLER_TX_BUFFERS diff --git a/samples/bluetooth/hci_usb/src/main.c b/samples/bluetooth/hci_usb/src/main.c index bea2cd2b0..35b281a21 100644 --- a/samples/bluetooth/hci_usb/src/main.c +++ b/samples/bluetooth/hci_usb/src/main.c @@ -15,6 +15,7 @@ #include <net/buf.h> #include <bluetooth/buf.h> #include <bluetooth/hci_raw.h> +#include <bluetooth/l2cap.h> #include "usb_device.h" #include "usb_common.h" @@ -74,19 +75,13 @@ static struct device *btusb_dev; static K_FIFO_DEFINE(rx_queue); /* HCI command buffers */ -#define CMD_BUF_SIZE (CONFIG_BLUETOOTH_HCI_SEND_RESERVE + \ - sizeof(struct bt_hci_cmd_hdr) + \ - CONFIG_BLUETOOTH_MAX_CMD_LEN) - +#define CMD_BUF_SIZE BT_BUF_RX_SIZE NET_BUF_POOL_DEFINE(tx_pool, CONFIG_BLUETOOTH_HCI_CMD_COUNT, CMD_BUF_SIZE, sizeof(uint8_t), NULL); #define BT_L2CAP_MTU 64 /** Data size needed for ACL buffers */ -#define BT_BUF_ACL_SIZE (CONFIG_BLUETOOTH_HCI_RECV_RESERVE + \ - sizeof(struct bt_hci_acl_hdr) + \ - 4 /* L2CAP header size */ + \ - BT_L2CAP_MTU) +#define BT_BUF_ACL_SIZE BT_L2CAP_BUF_SIZE(BT_L2CAP_MTU) NET_BUF_POOL_DEFINE(acl_tx_pool, 2, BT_BUF_ACL_SIZE, sizeof(uint8_t), NULL); diff --git a/samples/bluetooth/peripheral_sc_only/README.rst b/samples/bluetooth/peripheral_sc_only/README.rst new file mode 100644 index 000000000..9bb537cfe --- /dev/null +++ b/samples/bluetooth/peripheral_sc_only/README.rst @@ -0,0 +1,26 @@ +.. _peripheral_sc_only: + +Bluetooth: Peripheral SC-only +############################# + +Overview +******** + +Similar to the :ref:`Peripheral <ble_peripheral>` sample, except that this +application enables the Secure Connections Only mode, i.e. will only +accept connections that are secured using security level 4 (FIPS). + + +Requirements +************ + +* BlueZ running on the host, or +* A board with BLE support + +Building and Running +******************** + +This sample can be found under :file:`samples/bluetooth/peripheral_sc_only` +in the Zephyr tree. + +See :ref:`bluetooth setup section <bluetooth_setup>` for details. |