Bluetooth: Add LE Connection Update Complete Event handler
Adds handler for LE Connection Update complete event. Change-Id: Ie33b7b01c5b7f828b41225f8ae1337205812fcdd Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com> Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This commit is contained in:
parent
0f507833f8
commit
cf7423a9d2
1 changed files with 29 additions and 0 deletions
|
@ -932,6 +932,32 @@ static int le_conn_param_req(struct bt_buf *buf)
|
|||
return le_conn_param_req_reply(handle, min, max, latency, timeout);
|
||||
}
|
||||
|
||||
static void le_conn_update_complete(struct bt_buf *buf)
|
||||
{
|
||||
struct bt_hci_evt_le_conn_update_complete *evt = (void *)buf->data;
|
||||
struct bt_conn *conn;
|
||||
uint16_t handle, interval;
|
||||
|
||||
handle = sys_le16_to_cpu(evt->handle);
|
||||
interval = sys_le16_to_cpu(evt->interval);
|
||||
|
||||
BT_DBG("status %u, handle %u", evt->status, handle);
|
||||
|
||||
conn = bt_conn_lookup_handle(handle);
|
||||
if (!conn) {
|
||||
BT_ERR("Unable to lookup conn for handle %u\n", handle);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!evt->status) {
|
||||
conn->le_conn_interval = interval;
|
||||
}
|
||||
|
||||
/* TODO Notify about connection */
|
||||
|
||||
bt_conn_put(conn);
|
||||
}
|
||||
|
||||
static void check_pending_conn(const bt_addr_le_t *addr, uint8_t evtype,
|
||||
struct bt_keys *keys)
|
||||
{
|
||||
|
@ -1076,6 +1102,9 @@ static void hci_le_meta_event(struct bt_buf *buf)
|
|||
case BT_HCI_EVT_LE_CONN_COMPLETE:
|
||||
le_conn_complete(buf);
|
||||
break;
|
||||
case BT_HCI_EVT_LE_CONN_UPDATE_COMPLETE:
|
||||
le_conn_update_complete(buf);
|
||||
break;
|
||||
case BT_HCI_EVT_LE_ADVERTISING_REPORT:
|
||||
le_adv_report(buf);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue