Lines Matching refs:conn

61     struct bt_conn *conn;  member
144 static void connected(struct bt_conn *conn, u8_t err) in connected() argument
147 event_data.conn_handle = bt_conn_index(conn); in connected()
160 static void disconnected(struct bt_conn *conn, u8_t reason) in disconnected() argument
170 event_data.conn_handle = bt_conn_index(conn); in disconnected()
179 static bool le_param_req_cb(struct bt_conn *conn, struct bt_le_conn_param *param) in le_param_req_cb() argument
182 event_data.conn_handle = bt_conn_index(conn); in le_param_req_cb()
194 static void le_param_update_cb(struct bt_conn *conn, u16_t interval, u16_t latency, u16_t timeout) in le_param_update_cb() argument
197 event_data.conn_handle = bt_conn_index(conn); in le_param_update_cb()
205 static void security_changed_cb(struct bt_conn *conn, bt_security_t level, enum bt_security_err err) in security_changed_cb() argument
208 event_data.conn_handle = bt_conn_index(conn); in security_changed_cb()
233 static void auth_passkey_display(struct bt_conn *conn, unsigned int passkey) in auth_passkey_display() argument
238 memcpy(&event_data.peer_addr, bt_conn_get_dst(conn), sizeof(dev_addr_t)); in auth_passkey_display()
241 event_data.conn_handle = bt_conn_index(conn); in auth_passkey_display()
246 static void auth_passkey_confirm(struct bt_conn *conn, unsigned int passkey) in auth_passkey_confirm() argument
251 memcpy(&event_data.peer_addr, bt_conn_get_dst(conn), sizeof(dev_addr_t)); in auth_passkey_confirm()
254 event_data.conn_handle = bt_conn_index(conn); in auth_passkey_confirm()
259 static void auth_passkey_entry(struct bt_conn *conn) in auth_passkey_entry() argument
263 memcpy(&event_data.peer_addr, bt_conn_get_dst(conn), sizeof(dev_addr_t)); in auth_passkey_entry()
265 event_data.conn_handle = bt_conn_index(conn); in auth_passkey_entry()
269 static void auth_cancel(struct bt_conn *conn) in auth_cancel() argument
273 memcpy(&event_data.peer_addr, bt_conn_get_dst(conn), sizeof(dev_addr_t)); in auth_cancel()
275 event_data.conn_handle = bt_conn_index(conn); in auth_cancel()
279 static void auth_pairing_confirm(struct bt_conn *conn) in auth_pairing_confirm() argument
283 memcpy(&event_data.peer_addr, bt_conn_get_dst(conn), sizeof(dev_addr_t)); in auth_pairing_confirm()
285 event_data.conn_handle = bt_conn_index(conn); in auth_pairing_confirm()
289 static void auth_pairing_complete(struct bt_conn *conn, bool bonded) in auth_pairing_complete() argument
293 memcpy(&event_data.peer_addr, bt_conn_get_dst(conn), sizeof(dev_addr_t)); in auth_pairing_complete()
295 event_data.conn_handle = bt_conn_index(conn); in auth_pairing_complete()
301 static void auth_pairing_failed(struct bt_conn *conn, enum bt_security_err reason) in auth_pairing_failed() argument
305 memcpy(&event_data.peer_addr, bt_conn_get_dst(conn), sizeof(dev_addr_t)); in auth_pairing_failed()
307 event_data.conn_handle = bt_conn_index(conn); in auth_pairing_failed()
620 static ssize_t gatt_read_handle(struct bt_conn *conn, in gatt_read_handle() argument
626 event_data.conn_handle = bt_conn_index(conn); in gatt_read_handle()
637 return bt_gatt_attr_read(conn, attr, buf, len, offset, event_data.data, event_data.len); in gatt_read_handle()
643 static ssize_t gatt_write_handle(struct bt_conn *conn, in gatt_write_handle() argument
650 event_data.conn_handle = bt_conn_index(conn); in gatt_write_handle()
662 static int gatt_cfg_write(struct bt_conn *conn, const struct bt_gatt_attr *attr, u16_t value) in gatt_cfg_write() argument
666 event_data.conn_handle = bt_conn_index(conn); in gatt_cfg_write()
676 static bool gatt_cfg_match(struct bt_conn *conn, const struct bt_gatt_attr *attr) in gatt_cfg_match() argument
680 event_data.conn_handle = bt_conn_index(conn); in gatt_cfg_match()
772 notify->err = bt_gatt_notify(notify->conn, attr, notify->data, notify->len); in ble_gatt_attr_notify()
777 static void ble_gatt_indicate_cb(struct bt_conn *conn, in ble_gatt_indicate_cb() argument
782 event_data.conn_handle = bt_conn_index(conn); in ble_gatt_indicate_cb()
799 notify->err = bt_gatt_indicate(notify->conn, &param); in ble_gatt_attr_indicate()
808 struct bt_conn *conn; in ble_stack_gatt_notificate() local
814 conn = bt_conn_lookup_index(conn_handle); in ble_stack_gatt_notificate()
816 if (conn == NULL) { in ble_stack_gatt_notificate()
820 notify.conn = conn; in ble_stack_gatt_notificate()
828 if (notify.conn) { in ble_stack_gatt_notificate()
829 bt_conn_unref(notify.conn); in ble_stack_gatt_notificate()
838 struct bt_conn *conn; in ble_stack_gatt_indicate() local
844 conn = bt_conn_lookup_index(conn_handle); in ble_stack_gatt_indicate()
846 if (conn == NULL) { in ble_stack_gatt_indicate()
850 notify.conn = conn; in ble_stack_gatt_indicate()
858 if (notify.conn) { in ble_stack_gatt_indicate()
859 bt_conn_unref(notify.conn); in ble_stack_gatt_indicate()
870 void mtu_exchange_cb(struct bt_conn *conn, u8_t err, in mtu_exchange_cb() argument
874 event_data.conn_handle = bt_conn_index(conn); in mtu_exchange_cb()
883 struct bt_conn *conn = NULL; in ble_stack_gatt_mtu_get() local
889 conn = bt_conn_lookup_index(conn_handle); in ble_stack_gatt_mtu_get()
891 if (conn == NULL) { in ble_stack_gatt_mtu_get()
895 ret = bt_gatt_get_mtu(conn); in ble_stack_gatt_mtu_get()
897 if (conn) { in ble_stack_gatt_mtu_get()
898 bt_conn_unref(conn); in ble_stack_gatt_mtu_get()
908 struct bt_conn *conn; in ble_stack_gatt_mtu_exchange() local
914 conn = bt_conn_lookup_index(conn_handle); in ble_stack_gatt_mtu_exchange()
916 if (conn == NULL) { in ble_stack_gatt_mtu_exchange()
921 ret = bt_gatt_exchange_mtu(conn, &params); in ble_stack_gatt_mtu_exchange()
923 if (conn) { in ble_stack_gatt_mtu_exchange()
924 bt_conn_unref(conn); in ble_stack_gatt_mtu_exchange()
930 static u8_t discover_func(struct bt_conn *conn, in discover_func() argument
948 event_data.comp.conn_handle = bt_conn_index(conn); in discover_func()
957 event_data.svc.conn_handle = bt_conn_index(conn); in discover_func()
964 event_data.svc_inc.conn_handle = bt_conn_index(conn); in discover_func()
972 event_data.char_c.conn_handle = bt_conn_index(conn); in discover_func()
979 event_data.char_des.conn_handle = bt_conn_index(conn); in discover_func()
997 struct bt_conn *conn; in ble_stack_gatt_discovery() local
1007 conn = bt_conn_lookup_index(conn_handle); in ble_stack_gatt_discovery()
1009 if (conn == NULL) { in ble_stack_gatt_discovery()
1040 ret = bt_gatt_discover(conn, params); in ble_stack_gatt_discovery()
1046 if (conn) { in ble_stack_gatt_discovery()
1047 bt_conn_unref(conn); in ble_stack_gatt_discovery()
1053 static void gatt_write_cb(struct bt_conn *conn, u8_t err, struct bt_gatt_write_params *params) in gatt_write_cb() argument
1060 event_data.conn_handle = bt_conn_index(conn); in gatt_write_cb()
1101 struct bt_conn *conn = bt_conn_lookup_index(conn_handle); in ble_stack_gatt_write() local
1103 if (conn == NULL) { in ble_stack_gatt_write()
1126 ret = bt_gatt_write(conn, params); in ble_stack_gatt_write()
1128 … ret = bt_gatt_write_without_response(conn, attr_handle, data, len, type == GATT_WRITE_SINGED); in ble_stack_gatt_write()
1135 if (conn) { in ble_stack_gatt_write()
1136 bt_conn_unref(conn); in ble_stack_gatt_write()
1142 u8_t gatt_read_cb(struct bt_conn *conn, u8_t err, in gatt_read_cb() argument
1148 event_data.conn_handle = bt_conn_index(conn); in gatt_read_cb()
1174 struct bt_conn *conn; in ble_stack_gatt_read() local
1181 conn = bt_conn_lookup_index(conn_handle); in ble_stack_gatt_read()
1183 if (conn == NULL) { in ble_stack_gatt_read()
1207 ret = bt_gatt_read(conn, params); in ble_stack_gatt_read()
1209 if (conn) { in ble_stack_gatt_read()
1210 bt_conn_unref(conn); in ble_stack_gatt_read()
1220 struct bt_conn *conn; in ble_stack_gatt_read_multiple() local
1232 conn = bt_conn_lookup_index(conn_handle); in ble_stack_gatt_read_multiple()
1234 if (conn == NULL) { in ble_stack_gatt_read_multiple()
1256 ret = bt_gatt_read(conn, params); in ble_stack_gatt_read_multiple()
1258 if (conn) { in ble_stack_gatt_read_multiple()
1259 bt_conn_unref(conn); in ble_stack_gatt_read_multiple()
1282 struct bt_conn *conn = NULL; in ble_stack_connect() local
1313 conn = bt_conn_lookup_addr_le(0, &peer); in ble_stack_connect()
1316 conn = bt_conn_create_le(&peer, &conn_param); in ble_stack_connect()
1330 if (conn) { in ble_stack_connect()
1331 conn_handle = bt_conn_index(conn); in ble_stack_connect()
1332 bt_conn_unref(conn); in ble_stack_connect()
1347 struct bt_conn *conn = bt_conn_lookup_index(conn_handle); in ble_stack_disconnect() local
1349 if (conn) { in ble_stack_disconnect()
1350 ret = bt_conn_disconnect(conn, BT_HCI_ERR_REMOTE_USER_TERM_CONN); in ble_stack_disconnect()
1351 bt_conn_unref(conn); in ble_stack_disconnect()
1363 struct bt_conn *conn = bt_conn_lookup_index(conn_handle); in ble_stack_connect_info_get() local
1365 if (conn) { in ble_stack_connect_info_get()
1367 info->role = conn->role; in ble_stack_connect_info_get()
1368 info->interval = conn->le.interval; in ble_stack_connect_info_get()
1369 info->latency = conn->le.latency; in ble_stack_connect_info_get()
1370 info->timeout = conn->le.timeout; in ble_stack_connect_info_get()
1372 if (conn->role == BT_HCI_ROLE_MASTER) { in ble_stack_connect_info_get()
1373 info->local_addr.type = conn->le.init_addr.type; in ble_stack_connect_info_get()
1374 memcpy(info->local_addr.val, conn->le.init_addr.a.val, 6); in ble_stack_connect_info_get()
1375 info->peer_addr.type = conn->le.resp_addr.type; in ble_stack_connect_info_get()
1376 memcpy(info->peer_addr.val, conn->le.resp_addr.a.val, 6); in ble_stack_connect_info_get()
1378 info->local_addr.type = conn->le.resp_addr.type; in ble_stack_connect_info_get()
1379 memcpy(info->local_addr.val, conn->le.resp_addr.a.val, 6); in ble_stack_connect_info_get()
1380 info->peer_addr.type = conn->le.init_addr.type; in ble_stack_connect_info_get()
1381 memcpy(info->peer_addr.val, conn->le.init_addr.a.val, 6); in ble_stack_connect_info_get()
1384 bt_conn_unref(conn); in ble_stack_connect_info_get()
1415 struct bt_conn *conn; in ble_stack_security() local
1421 conn = bt_conn_lookup_index(conn_handle); in ble_stack_security()
1423 if (conn) { in ble_stack_security()
1424 ret = bt_conn_security(conn, level); in ble_stack_security()
1425 bt_conn_unref(conn); in ble_stack_security()
1434 struct bt_conn *conn; in ble_stack_connect_param_update() local
1440 conn = bt_conn_lookup_index(conn_handle); in ble_stack_connect_param_update()
1442 if (conn) { in ble_stack_connect_param_update()
1443 ret = bt_conn_le_param_update(conn, (struct bt_le_conn_param *)param); in ble_stack_connect_param_update()
1444 bt_conn_unref(conn); in ble_stack_connect_param_update()
1459 struct bt_conn *conn = bt_conn_lookup_index(conn_handle); in ble_stack_smp_passkey_entry() local
1461 if (conn) { in ble_stack_smp_passkey_entry()
1462 ret = bt_conn_auth_passkey_entry(conn, passkey); in ble_stack_smp_passkey_entry()
1463 bt_conn_unref(conn); in ble_stack_smp_passkey_entry()
1477 struct bt_conn *conn = bt_conn_lookup_index(conn_handle); in ble_stack_smp_cancel() local
1479 if (conn) { in ble_stack_smp_cancel()
1480 ret = bt_conn_auth_cancel(conn); in ble_stack_smp_cancel()
1481 bt_conn_unref(conn); in ble_stack_smp_cancel()
1495 struct bt_conn *conn = bt_conn_lookup_index(conn_handle); in ble_stack_smp_passkey_confirm() local
1497 if (conn) { in ble_stack_smp_passkey_confirm()
1498 ret = bt_conn_auth_passkey_confirm(conn); in ble_stack_smp_passkey_confirm()
1499 bt_conn_unref(conn); in ble_stack_smp_passkey_confirm()
1513 struct bt_conn *conn = bt_conn_lookup_index(conn_handle); in ble_stack_smp_pairing_confirm() local
1515 if (conn) { in ble_stack_smp_pairing_confirm()
1516 ret = bt_conn_auth_pairing_confirm(conn); in ble_stack_smp_pairing_confirm()
1517 bt_conn_unref(conn); in ble_stack_smp_pairing_confirm()
1531 struct bt_conn *conn = bt_conn_lookup_index(conn_handle); in ble_stack_enc_key_size_get() local
1533 if (conn) { in ble_stack_enc_key_size_get()
1535 ret = bt_conn_enc_key_size(conn); in ble_stack_enc_key_size_get()
1539 bt_conn_unref(conn); in ble_stack_enc_key_size_get()