Bluetooth: Consolidate all role configuration
Since role support is fundamental to both the Host and the Controller, move the role configuration options to the top-level file and rename them to fit the GAP specification, avoiding confusion between GAP and LL names. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
3e3a47dfef
commit
5d38c99761
4 changed files with 34 additions and 34 deletions
|
@ -57,6 +57,29 @@ config BLUETOOTH_CENTRAL
|
|||
help
|
||||
Select this for LE Central role support.
|
||||
|
||||
menu "Broadcaster"
|
||||
visible if !BLUETOOTH_PERIPHERAL
|
||||
|
||||
config BLUETOOTH_BROADCASTER
|
||||
bool "Broadcaster Role support"
|
||||
default y if BLUETOOTH_PERIPHERAL
|
||||
default y if !BLUETOOTH_OBSERVER
|
||||
help
|
||||
Select this for LE Broadcaster role support.
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Observer"
|
||||
visible if !BLUETOOTH_CENTRAL
|
||||
|
||||
config BLUETOOTH_OBSERVER
|
||||
bool "Observer Role support"
|
||||
default y if BLUETOOTH_CENTRAL
|
||||
help
|
||||
Select this for LE Observer role support.
|
||||
|
||||
endmenu
|
||||
|
||||
config BLUETOOTH_CONN
|
||||
# Virtual/hidden option
|
||||
bool
|
||||
|
|
|
@ -30,33 +30,10 @@ endchoice
|
|||
|
||||
comment "BLE Controller configuration"
|
||||
|
||||
menu "Advertiser"
|
||||
visible if !BLUETOOTH_PERIPHERAL
|
||||
|
||||
config BLUETOOTH_CONTROLLER_STATE_ADV
|
||||
bool "Enable Advertiser"
|
||||
default y if BLUETOOTH_PERIPHERAL
|
||||
default y if !BLUETOOTH_CONTROLLER_STATE_SCAN
|
||||
help
|
||||
Enable support for advertising state in the Controller.
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Scanner"
|
||||
visible if !BLUETOOTH_CENTRAL
|
||||
|
||||
config BLUETOOTH_CONTROLLER_STATE_SCAN
|
||||
bool "Enable Scanner"
|
||||
default y if BLUETOOTH_CENTRAL
|
||||
help
|
||||
Enable support for scanning state in the Controller.
|
||||
|
||||
endmenu
|
||||
|
||||
config BLUETOOTH_CONTROLLER_DUP_FILTER_LEN
|
||||
prompt "Number of addresses in the scan duplicate filter"
|
||||
int
|
||||
depends on BLUETOOTH_CONTROLLER_STATE_SCAN
|
||||
depends on BLUETOOTH_OBSERVER
|
||||
default 16
|
||||
help
|
||||
Set the number of unique BLE addresses that can be filtered as
|
||||
|
|
|
@ -566,7 +566,7 @@ static void le_read_supp_states(struct net_buf *buf, struct net_buf **evt)
|
|||
sys_put_le64(0x000003ffffffffff, rp->le_states);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BLUETOOTH_CONTROLLER_STATE_ADV)
|
||||
#if defined(CONFIG_BLUETOOTH_BROADCASTER)
|
||||
static void le_set_adv_param(struct net_buf *buf, struct net_buf **evt)
|
||||
{
|
||||
struct bt_hci_cp_le_set_adv_param *cmd = (void *)buf->data;
|
||||
|
@ -628,9 +628,9 @@ static void le_set_adv_enable(struct net_buf *buf, struct net_buf **evt)
|
|||
ccst = cmd_complete(evt, sizeof(*ccst));
|
||||
ccst->status = (!status) ? 0x00 : BT_HCI_ERR_CMD_DISALLOWED;
|
||||
}
|
||||
#endif /* CONFIG_BLUETOOTH_CONTROLLER_STATE_ADV */
|
||||
#endif /* CONFIG_BLUETOOTH_BROADCASTER */
|
||||
|
||||
#if defined(CONFIG_BLUETOOTH_CONTROLLER_STATE_SCAN)
|
||||
#if defined(CONFIG_BLUETOOTH_OBSERVER)
|
||||
static void le_set_scan_param(struct net_buf *buf, struct net_buf **evt)
|
||||
{
|
||||
struct bt_hci_cp_le_set_scan_param *cmd = (void *)buf->data;
|
||||
|
@ -668,7 +668,7 @@ static void le_set_scan_enable(struct net_buf *buf, struct net_buf **evt)
|
|||
ccst = cmd_complete(evt, sizeof(*ccst));
|
||||
ccst->status = (!status) ? 0x00 : BT_HCI_ERR_CMD_DISALLOWED;
|
||||
}
|
||||
#endif /* CONFIG_BLUETOOTH_CONTROLLER_STATE_SCAN */
|
||||
#endif /* CONFIG_BLUETOOTH_OBSERVER */
|
||||
|
||||
#if defined(CONFIG_BLUETOOTH_CONN)
|
||||
#if defined(CONFIG_BLUETOOTH_CENTRAL)
|
||||
|
@ -1030,7 +1030,7 @@ static int controller_cmd_handle(u8_t ocf, struct net_buf *cmd,
|
|||
le_read_supp_states(cmd, evt);
|
||||
break;
|
||||
|
||||
#if defined(CONFIG_BLUETOOTH_CONTROLLER_STATE_ADV)
|
||||
#if defined(CONFIG_BLUETOOTH_BROADCASTER)
|
||||
case BT_OCF(BT_HCI_OP_LE_SET_ADV_PARAM):
|
||||
le_set_adv_param(cmd, evt);
|
||||
break;
|
||||
|
@ -1050,9 +1050,9 @@ static int controller_cmd_handle(u8_t ocf, struct net_buf *cmd,
|
|||
case BT_OCF(BT_HCI_OP_LE_SET_ADV_ENABLE):
|
||||
le_set_adv_enable(cmd, evt);
|
||||
break;
|
||||
#endif /* CONFIG_BLUETOOTH_CONTROLLER_STATE_ADV */
|
||||
#endif /* CONFIG_BLUETOOTH_BROADCASTER */
|
||||
|
||||
#if defined(CONFIG_BLUETOOTH_CONTROLLER_STATE_SCAN)
|
||||
#if defined(CONFIG_BLUETOOTH_OBSERVER)
|
||||
case BT_OCF(BT_HCI_OP_LE_SET_SCAN_PARAM):
|
||||
le_set_scan_param(cmd, evt);
|
||||
break;
|
||||
|
@ -1060,7 +1060,7 @@ static int controller_cmd_handle(u8_t ocf, struct net_buf *cmd,
|
|||
case BT_OCF(BT_HCI_OP_LE_SET_SCAN_ENABLE):
|
||||
le_set_scan_enable(cmd, evt);
|
||||
break;
|
||||
#endif /* CONFIG_BLUETOOTH_CONTROLLER_STATE_SCAN */
|
||||
#endif /* CONFIG_BLUETOOTH_OBSERVER */
|
||||
|
||||
#if defined(CONFIG_BLUETOOTH_CONN)
|
||||
#if defined(CONFIG_BLUETOOTH_CENTRAL)
|
||||
|
|
|
@ -3,6 +3,6 @@ ccflags-y += -I$(srctree)/subsys/bluetooth/controller
|
|||
ccflags-y += -I$(srctree)/subsys/bluetooth
|
||||
|
||||
obj-y += crypto.o ctrl.o ll.o
|
||||
obj-$(CONFIG_BLUETOOTH_CONTROLLER_STATE_ADV) += ll_adv.o
|
||||
obj-$(CONFIG_BLUETOOTH_CONTROLLER_STATE_SCAN) += ll_scan.o
|
||||
obj-$(CONFIG_BLUETOOTH_BROADCASTER) += ll_adv.o
|
||||
obj-$(CONFIG_BLUETOOTH_OBSERVER) += ll_scan.o
|
||||
obj-$(CONFIG_BLUETOOTH_CENTRAL) += ll_master.o
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue