Bluetooth: controller: Add helper for CC event with status only
A lot of commands return CC event with status parameter only, especially when error is returned. This patch adds a helper to create such event, similar to cmd_status. Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
This commit is contained in:
parent
c088b02872
commit
dd1ac8d0a6
1 changed files with 63 additions and 130 deletions
|
@ -129,6 +129,18 @@ static struct net_buf *cmd_status(uint8_t status)
|
||||||
return bt_hci_cmd_status_create(_opcode, status);
|
return bt_hci_cmd_status_create(_opcode, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct net_buf *cmd_complete_status(uint8_t status)
|
||||||
|
{
|
||||||
|
struct net_buf *buf;
|
||||||
|
struct bt_hci_evt_cc_status *ccst;
|
||||||
|
|
||||||
|
buf = bt_hci_cmd_complete_create(_opcode, sizeof(*ccst));
|
||||||
|
ccst = net_buf_add(buf, sizeof(*ccst));
|
||||||
|
ccst->status = status;
|
||||||
|
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
static void *meta_evt(struct net_buf *buf, uint8_t subevt, uint8_t melen)
|
static void *meta_evt(struct net_buf *buf, uint8_t subevt, uint8_t melen)
|
||||||
{
|
{
|
||||||
struct bt_hci_evt_le_meta_event *me;
|
struct bt_hci_evt_le_meta_event *me;
|
||||||
|
@ -202,29 +214,23 @@ static int link_control_cmd_handle(uint16_t ocf, struct net_buf *cmd,
|
||||||
static void set_event_mask(struct net_buf *buf, struct net_buf **evt)
|
static void set_event_mask(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_set_event_mask *cmd = (void *)buf->data;
|
struct bt_hci_cp_set_event_mask *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
|
|
||||||
event_mask = sys_get_le64(cmd->events);
|
event_mask = sys_get_le64(cmd->events);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(0x00);
|
||||||
ccst->status = 0x00;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_event_mask_page_2(struct net_buf *buf, struct net_buf **evt)
|
static void set_event_mask_page_2(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_set_event_mask_page_2 *cmd = (void *)buf->data;
|
struct bt_hci_cp_set_event_mask_page_2 *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
|
|
||||||
event_mask_page_2 = sys_get_le64(cmd->events_page_2);
|
event_mask_page_2 = sys_get_le64(cmd->events_page_2);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(0x00);
|
||||||
ccst->status = 0x00;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reset(struct net_buf *buf, struct net_buf **evt)
|
static void reset(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
|
|
||||||
#if defined(CONFIG_BT_HCI_MESH_EXT)
|
#if defined(CONFIG_BT_HCI_MESH_EXT)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -245,8 +251,7 @@ static void reset(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
|
||||||
if (buf) {
|
if (buf) {
|
||||||
ll_reset();
|
ll_reset();
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(0x00);
|
||||||
ccst->status = 0x00;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CONN)
|
#if defined(CONFIG_BT_CONN)
|
||||||
|
@ -736,12 +741,10 @@ static int status_cmd_handle(uint16_t ocf, struct net_buf *cmd,
|
||||||
static void le_set_event_mask(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_event_mask(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_set_event_mask *cmd = (void *)buf->data;
|
struct bt_hci_cp_set_event_mask *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
|
|
||||||
le_event_mask = sys_get_le64(cmd->events);
|
le_event_mask = sys_get_le64(cmd->events);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(0x00);
|
||||||
ccst->status = 0x00;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_read_buffer_size(struct net_buf *buf, struct net_buf **evt)
|
static void le_read_buffer_size(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
@ -771,13 +774,11 @@ static void le_read_local_features(struct net_buf *buf, struct net_buf **evt)
|
||||||
static void le_set_random_address(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_random_address(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_random_address *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_random_address *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_addr_set(1, &cmd->bdaddr.val[0]);
|
status = ll_addr_set(1, &cmd->bdaddr.val[0]);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_FILTER)
|
#if defined(CONFIG_BT_CTLR_FILTER)
|
||||||
|
@ -793,34 +794,31 @@ static void le_read_wl_size(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
|
||||||
static void le_clear_wl(struct net_buf *buf, struct net_buf **evt)
|
static void le_clear_wl(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
uint8_t status;
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
status = ll_wl_clear();
|
||||||
ccst->status = ll_wl_clear();
|
|
||||||
|
*evt = cmd_complete_status(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_add_dev_to_wl(struct net_buf *buf, struct net_buf **evt)
|
static void le_add_dev_to_wl(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_add_dev_to_wl *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_add_dev_to_wl *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_wl_add(&cmd->addr);
|
status = ll_wl_add(&cmd->addr);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_rem_dev_from_wl(struct net_buf *buf, struct net_buf **evt)
|
static void le_rem_dev_from_wl(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_rem_dev_from_wl *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_rem_dev_from_wl *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_wl_remove(&cmd->addr);
|
status = ll_wl_remove(&cmd->addr);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTLR_FILTER */
|
#endif /* CONFIG_BT_CTLR_FILTER */
|
||||||
|
|
||||||
|
@ -911,7 +909,6 @@ static void le_read_supp_states(struct net_buf *buf, struct net_buf **evt)
|
||||||
static void le_set_adv_param(struct net_buf *buf, struct net_buf **evt)
|
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;
|
struct bt_hci_cp_le_set_adv_param *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint16_t min_interval;
|
uint16_t min_interval;
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
|
@ -924,9 +921,7 @@ static void le_set_adv_param(struct net_buf *buf, struct net_buf **evt)
|
||||||
if ((min_interval > max_interval) ||
|
if ((min_interval > max_interval) ||
|
||||||
(min_interval < 0x0020) ||
|
(min_interval < 0x0020) ||
|
||||||
(max_interval > 0x4000)) {
|
(max_interval > 0x4000)) {
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(BT_HCI_ERR_INVALID_PARAM);
|
||||||
ccst->status = BT_HCI_ERR_INVALID_PARAM;
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -943,8 +938,7 @@ static void le_set_adv_param(struct net_buf *buf, struct net_buf **evt)
|
||||||
cmd->filter_policy);
|
cmd->filter_policy);
|
||||||
#endif /* !CONFIG_BT_CTLR_ADV_EXT */
|
#endif /* !CONFIG_BT_CTLR_ADV_EXT */
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_read_adv_chan_tx_power(struct net_buf *buf, struct net_buf **evt)
|
static void le_read_adv_chan_tx_power(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
@ -961,7 +955,6 @@ static void le_read_adv_chan_tx_power(struct net_buf *buf, struct net_buf **evt)
|
||||||
static void le_set_adv_data(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_adv_data(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_adv_data *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_adv_data *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_ADV_EXT)
|
#if defined(CONFIG_BT_CTLR_ADV_EXT)
|
||||||
|
@ -970,14 +963,12 @@ static void le_set_adv_data(struct net_buf *buf, struct net_buf **evt)
|
||||||
status = ll_adv_data_set(cmd->len, &cmd->data[0]);
|
status = ll_adv_data_set(cmd->len, &cmd->data[0]);
|
||||||
#endif /* !CONFIG_BT_CTLR_ADV_EXT */
|
#endif /* !CONFIG_BT_CTLR_ADV_EXT */
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_set_scan_rsp_data(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_scan_rsp_data(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_scan_rsp_data *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_scan_rsp_data *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_ADV_EXT)
|
#if defined(CONFIG_BT_CTLR_ADV_EXT)
|
||||||
|
@ -986,14 +977,12 @@ static void le_set_scan_rsp_data(struct net_buf *buf, struct net_buf **evt)
|
||||||
status = ll_adv_scan_rsp_set(cmd->len, &cmd->data[0]);
|
status = ll_adv_scan_rsp_set(cmd->len, &cmd->data[0]);
|
||||||
#endif /* !CONFIG_BT_CTLR_ADV_EXT */
|
#endif /* !CONFIG_BT_CTLR_ADV_EXT */
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_set_adv_enable(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_adv_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_adv_enable *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_adv_enable *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_ADV_EXT) || defined(CONFIG_BT_HCI_MESH_EXT)
|
#if defined(CONFIG_BT_CTLR_ADV_EXT) || defined(CONFIG_BT_HCI_MESH_EXT)
|
||||||
|
@ -1006,8 +995,7 @@ static void le_set_adv_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
status = ll_adv_enable(cmd->enable);
|
status = ll_adv_enable(cmd->enable);
|
||||||
#endif /* !CONFIG_BT_CTLR_ADV_EXT || !CONFIG_BT_HCI_MESH_EXT */
|
#endif /* !CONFIG_BT_CTLR_ADV_EXT || !CONFIG_BT_HCI_MESH_EXT */
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_BROADCASTER */
|
#endif /* CONFIG_BT_BROADCASTER */
|
||||||
|
|
||||||
|
@ -1015,7 +1003,6 @@ static void le_set_adv_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
static void le_set_scan_param(struct net_buf *buf, struct net_buf **evt)
|
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;
|
struct bt_hci_cp_le_set_scan_param *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint16_t interval;
|
uint16_t interval;
|
||||||
uint16_t window;
|
uint16_t window;
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
@ -1026,14 +1013,12 @@ static void le_set_scan_param(struct net_buf *buf, struct net_buf **evt)
|
||||||
status = ll_scan_params_set(cmd->scan_type, interval, window,
|
status = ll_scan_params_set(cmd->scan_type, interval, window,
|
||||||
cmd->addr_type, cmd->filter_policy);
|
cmd->addr_type, cmd->filter_policy);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_set_scan_enable(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_scan_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_scan_enable *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_scan_enable *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
#if CONFIG_BT_CTLR_DUP_FILTER_LEN > 0
|
#if CONFIG_BT_CTLR_DUP_FILTER_LEN > 0
|
||||||
|
@ -1048,8 +1033,7 @@ static void le_set_scan_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
|
||||||
status = ll_scan_enable(cmd->enable);
|
status = ll_scan_enable(cmd->enable);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_OBSERVER */
|
#endif /* CONFIG_BT_OBSERVER */
|
||||||
|
|
||||||
|
@ -1101,25 +1085,21 @@ static void le_create_connection(struct net_buf *buf, struct net_buf **evt)
|
||||||
static void le_create_conn_cancel(struct net_buf *buf, struct net_buf **evt,
|
static void le_create_conn_cancel(struct net_buf *buf, struct net_buf **evt,
|
||||||
void **node_rx)
|
void **node_rx)
|
||||||
{
|
{
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_connect_disable(node_rx);
|
status = ll_connect_disable(node_rx);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_set_host_chan_classif(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_host_chan_classif(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_host_chan_classif *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_host_chan_classif *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_chm_update(&cmd->ch_map[0]);
|
status = ll_chm_update(&cmd->ch_map[0]);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_LE_ENC)
|
#if defined(CONFIG_BT_CTLR_LE_ENC)
|
||||||
|
@ -1309,7 +1289,6 @@ static void le_write_default_data_len(struct net_buf *buf,
|
||||||
struct net_buf **evt)
|
struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_write_default_data_len *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_write_default_data_len *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint16_t max_tx_octets;
|
uint16_t max_tx_octets;
|
||||||
uint16_t max_tx_time;
|
uint16_t max_tx_time;
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
@ -1318,8 +1297,7 @@ static void le_write_default_data_len(struct net_buf *buf,
|
||||||
max_tx_time = sys_le16_to_cpu(cmd->max_tx_time);
|
max_tx_time = sys_le16_to_cpu(cmd->max_tx_time);
|
||||||
status = ll_length_default_set(max_tx_octets, max_tx_time);
|
status = ll_length_default_set(max_tx_octets, max_tx_time);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_read_max_data_len(struct net_buf *buf, struct net_buf **evt)
|
static void le_read_max_data_len(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
@ -1366,7 +1344,6 @@ static void le_read_phy(struct net_buf *buf, struct net_buf **evt)
|
||||||
static void le_set_default_phy(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_default_phy(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_default_phy *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_default_phy *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
if (cmd->all_phys & BT_HCI_LE_PHY_TX_ANY) {
|
if (cmd->all_phys & BT_HCI_LE_PHY_TX_ANY) {
|
||||||
|
@ -1378,8 +1355,7 @@ static void le_set_default_phy(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
|
||||||
status = ll_phy_default_set(cmd->tx_phys, cmd->rx_phys);
|
status = ll_phy_default_set(cmd->tx_phys, cmd->rx_phys);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_set_phy(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_phy(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
@ -1440,34 +1416,30 @@ static void le_set_phy(struct net_buf *buf, struct net_buf **evt)
|
||||||
static void le_add_dev_to_rl(struct net_buf *buf, struct net_buf **evt)
|
static void le_add_dev_to_rl(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_add_dev_to_rl *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_add_dev_to_rl *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_rl_add(&cmd->peer_id_addr, cmd->peer_irk, cmd->local_irk);
|
status = ll_rl_add(&cmd->peer_id_addr, cmd->peer_irk, cmd->local_irk);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_rem_dev_from_rl(struct net_buf *buf, struct net_buf **evt)
|
static void le_rem_dev_from_rl(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_rem_dev_from_rl *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_rem_dev_from_rl *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_rl_remove(&cmd->peer_id_addr);
|
status = ll_rl_remove(&cmd->peer_id_addr);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_clear_rl(struct net_buf *buf, struct net_buf **evt)
|
static void le_clear_rl(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
uint8_t status;
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
status = ll_rl_clear();
|
||||||
|
|
||||||
ccst->status = ll_rl_clear();
|
*evt = cmd_complete_status(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_read_rl_size(struct net_buf *buf, struct net_buf **evt)
|
static void le_read_rl_size(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
@ -1507,35 +1479,31 @@ static void le_read_local_rpa(struct net_buf *buf, struct net_buf **evt)
|
||||||
static void le_set_addr_res_enable(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_addr_res_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_addr_res_enable *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_addr_res_enable *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
uint8_t status;
|
||||||
uint8_t enable = cmd->enable;
|
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
status = ll_rl_enable(cmd->enable);
|
||||||
ccst->status = ll_rl_enable(enable);
|
|
||||||
|
*evt = cmd_complete_status(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_set_rpa_timeout(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_rpa_timeout(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_rpa_timeout *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_rpa_timeout *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint16_t timeout = sys_le16_to_cpu(cmd->rpa_timeout);
|
uint16_t timeout = sys_le16_to_cpu(cmd->rpa_timeout);
|
||||||
|
|
||||||
ll_rl_timeout_set(timeout);
|
ll_rl_timeout_set(timeout);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(0x00);
|
||||||
ccst->status = 0x00;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_set_privacy_mode(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_privacy_mode(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_privacy_mode *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_privacy_mode *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_priv_mode_set(&cmd->id_addr, cmd->mode);
|
status = ll_priv_mode_set(&cmd->id_addr, cmd->mode);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTLR_PRIVACY */
|
#endif /* CONFIG_BT_CTLR_PRIVACY */
|
||||||
|
|
||||||
|
@ -1552,26 +1520,22 @@ static void le_read_tx_power(struct net_buf *buf, struct net_buf **evt)
|
||||||
static void le_rx_test(struct net_buf *buf, struct net_buf **evt)
|
static void le_rx_test(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_rx_test *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_rx_test *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_test_rx(cmd->rx_ch, 0x01, 0);
|
status = ll_test_rx(cmd->rx_ch, 0x01, 0);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_tx_test(struct net_buf *buf, struct net_buf **evt)
|
static void le_tx_test(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_tx_test *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_tx_test *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_test_tx(cmd->tx_ch, cmd->test_data_len, cmd->pkt_payload,
|
status = ll_test_tx(cmd->tx_ch, cmd->test_data_len, cmd->pkt_payload,
|
||||||
0x01);
|
0x01);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_test_end(struct net_buf *buf, struct net_buf **evt)
|
static void le_test_end(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
@ -1589,26 +1553,22 @@ static void le_test_end(struct net_buf *buf, struct net_buf **evt)
|
||||||
static void le_enh_rx_test(struct net_buf *buf, struct net_buf **evt)
|
static void le_enh_rx_test(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_enh_rx_test *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_enh_rx_test *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_test_rx(cmd->rx_ch, cmd->phy, cmd->mod_index);
|
status = ll_test_rx(cmd->rx_ch, cmd->phy, cmd->mod_index);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_enh_tx_test(struct net_buf *buf, struct net_buf **evt)
|
static void le_enh_tx_test(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_enh_tx_test *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_enh_tx_test *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_test_tx(cmd->tx_ch, cmd->test_data_len, cmd->pkt_payload,
|
status = ll_test_tx(cmd->tx_ch, cmd->test_data_len, cmd->pkt_payload,
|
||||||
cmd->phy);
|
cmd->phy);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTLR_DTM_HCI */
|
#endif /* CONFIG_BT_CTLR_DTM_HCI */
|
||||||
|
|
||||||
|
@ -1619,13 +1579,11 @@ static void le_set_adv_set_random_addr(struct net_buf *buf,
|
||||||
struct net_buf **evt)
|
struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_adv_set_random_addr *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_adv_set_random_addr *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_adv_aux_random_addr_set(cmd->handle, &cmd->bdaddr.val[0]);
|
status = ll_adv_aux_random_addr_set(cmd->handle, &cmd->bdaddr.val[0]);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_set_ext_adv_param(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_ext_adv_param(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
@ -1660,33 +1618,28 @@ static void le_set_ext_adv_param(struct net_buf *buf, struct net_buf **evt)
|
||||||
static void le_set_ext_adv_data(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_ext_adv_data(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_ext_adv_data *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_ext_adv_data *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_adv_aux_ad_data_set(cmd->handle, cmd->op, cmd->frag_pref,
|
status = ll_adv_aux_ad_data_set(cmd->handle, cmd->op, cmd->frag_pref,
|
||||||
cmd->len, cmd->data);
|
cmd->len, cmd->data);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_set_ext_scan_rsp_data(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_ext_scan_rsp_data(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_ext_scan_rsp_data *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_ext_scan_rsp_data *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_adv_aux_sr_data_set(cmd->handle, cmd->op, cmd->frag_pref,
|
status = ll_adv_aux_sr_data_set(cmd->handle, cmd->op, cmd->frag_pref,
|
||||||
cmd->len, cmd->data);
|
cmd->len, cmd->data);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_set_ext_adv_enable(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_ext_adv_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_ext_adv_enable *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_ext_adv_enable *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
struct bt_hci_ext_adv_set *s;
|
struct bt_hci_ext_adv_set *s;
|
||||||
uint8_t set_num;
|
uint8_t set_num;
|
||||||
uint8_t enable;
|
uint8_t enable;
|
||||||
|
@ -1695,15 +1648,12 @@ static void le_set_ext_adv_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
set_num = cmd->set_num;
|
set_num = cmd->set_num;
|
||||||
if (!set_num) {
|
if (!set_num) {
|
||||||
if (cmd->enable) {
|
if (cmd->enable) {
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(BT_HCI_ERR_INVALID_PARAM);
|
||||||
ccst->status = BT_HCI_ERR_INVALID_PARAM;
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: Implement disable of all advertising sets */
|
/* FIXME: Implement disable of all advertising sets */
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL);
|
||||||
ccst->status = BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL;
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1728,8 +1678,7 @@ static void le_set_ext_adv_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
s++;
|
s++;
|
||||||
} while (--set_num);
|
} while (--set_num);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_read_max_adv_data_len(struct net_buf *buf, struct net_buf **evt)
|
static void le_read_max_adv_data_len(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
@ -1758,31 +1707,26 @@ static void le_read_num_adv_sets(struct net_buf *buf, struct net_buf **evt)
|
||||||
static void le_remove_adv_set(struct net_buf *buf, struct net_buf **evt)
|
static void le_remove_adv_set(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_remove_adv_set *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_remove_adv_set *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_adv_aux_set_remove(cmd->handle);
|
status = ll_adv_aux_set_remove(cmd->handle);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_clear_adv_sets(struct net_buf *buf, struct net_buf **evt)
|
static void le_clear_adv_sets(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_adv_aux_set_clear();
|
status = ll_adv_aux_set_clear();
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_BT_CTLR_ADV_PERIODIC)
|
#if defined(CONFIG_BT_CTLR_ADV_PERIODIC)
|
||||||
static void le_set_per_adv_param(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_per_adv_param(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_per_adv_param *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_per_adv_param *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint16_t interval;
|
uint16_t interval;
|
||||||
uint16_t flags;
|
uint16_t flags;
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
@ -1792,33 +1736,28 @@ static void le_set_per_adv_param(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
|
||||||
status = ll_adv_sync_param_set(cmd->handle, interval, flags);
|
status = ll_adv_sync_param_set(cmd->handle, interval, flags);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_set_per_adv_data(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_per_adv_data(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_per_adv_data *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_per_adv_data *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_adv_sync_ad_data_set(cmd->handle, cmd->op, cmd->len,
|
status = ll_adv_sync_ad_data_set(cmd->handle, cmd->op, cmd->len,
|
||||||
cmd->data);
|
cmd->data);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_set_per_adv_enable(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_per_adv_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_per_adv_enable *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_per_adv_enable *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
status = ll_adv_sync_enable(cmd->handle, cmd->enable);
|
status = ll_adv_sync_enable(cmd->handle, cmd->enable);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_CTLR_ADV_PERIODIC */
|
#endif /* CONFIG_BT_CTLR_ADV_PERIODIC */
|
||||||
#endif /* CONFIG_BT_BROADCASTER */
|
#endif /* CONFIG_BT_BROADCASTER */
|
||||||
|
@ -1827,7 +1766,6 @@ static void le_set_per_adv_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
static void le_set_ext_scan_param(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_ext_scan_param(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_ext_scan_param *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_ext_scan_param *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
struct bt_hci_ext_scan_phy *p;
|
struct bt_hci_ext_scan_phy *p;
|
||||||
uint8_t own_addr_type;
|
uint8_t own_addr_type;
|
||||||
uint8_t filter_policy;
|
uint8_t filter_policy;
|
||||||
|
@ -1891,14 +1829,12 @@ static void le_set_ext_scan_param(struct net_buf *buf, struct net_buf **evt)
|
||||||
phys_bitmask &= (phys_bitmask - 1);
|
phys_bitmask &= (phys_bitmask - 1);
|
||||||
} while (phys_bitmask);
|
} while (phys_bitmask);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void le_set_ext_scan_enable(struct net_buf *buf, struct net_buf **evt)
|
static void le_set_ext_scan_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_le_set_ext_scan_enable *cmd = (void *)buf->data;
|
struct bt_hci_cp_le_set_ext_scan_enable *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
#if CONFIG_BT_CTLR_DUP_FILTER_LEN > 0
|
#if CONFIG_BT_CTLR_DUP_FILTER_LEN > 0
|
||||||
|
@ -1914,8 +1850,7 @@ static void le_set_ext_scan_enable(struct net_buf *buf, struct net_buf **evt)
|
||||||
/* FIXME: Add implementation to use duration and period parameters. */
|
/* FIXME: Add implementation to use duration and period parameters. */
|
||||||
status = ll_scan_enable(cmd->enable);
|
status = ll_scan_enable(cmd->enable);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(status);
|
||||||
ccst->status = status;
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_OBSERVER */
|
#endif /* CONFIG_BT_OBSERVER */
|
||||||
|
|
||||||
|
@ -2375,12 +2310,10 @@ uint8_t bt_read_static_addr(struct bt_hci_vs_static_addr addrs[], uint8_t size)
|
||||||
static void vs_write_bd_addr(struct net_buf *buf, struct net_buf **evt)
|
static void vs_write_bd_addr(struct net_buf *buf, struct net_buf **evt)
|
||||||
{
|
{
|
||||||
struct bt_hci_cp_vs_write_bd_addr *cmd = (void *)buf->data;
|
struct bt_hci_cp_vs_write_bd_addr *cmd = (void *)buf->data;
|
||||||
struct bt_hci_evt_cc_status *ccst;
|
|
||||||
|
|
||||||
ll_addr_set(0, &cmd->bdaddr.val[0]);
|
ll_addr_set(0, &cmd->bdaddr.val[0]);
|
||||||
|
|
||||||
ccst = hci_cmd_complete(evt, sizeof(*ccst));
|
*evt = cmd_complete_status(0x00);
|
||||||
ccst->status = 0x00;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vs_read_build_info(struct net_buf *buf, struct net_buf **evt)
|
static void vs_read_build_info(struct net_buf *buf, struct net_buf **evt)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue