uint8_t irk_val[16];
bool pending_conn_update;
bool le_connectable;
+ struct l2cap_le_conn_info *conn_info;
#endif
};
struct l2cap_le_conn_info {
struct l2cap_le_profile_info *profile_info;
GIOChannel *io;
+ GIOChannel *accept_io;
guint io_id;
+ bool conn_req;
bool connected;
const char *dev_path;
int psm;
{
return device->gatt_connected;
}
+
+void device_set_accept_io(const struct btd_device *device, GIOChannel *io)
+{
+ struct l2cap_le_conn_info *conn_info = device->conn_info;
+ if (conn_info && conn_info->conn_req) {
+ conn_info->accept_io = io;
+ }
+}
#endif
static void append_manufacturer_data(void *data, void *user_data)
{
struct l2cap_le_conn_info *conn = p;
+ if (conn->accept_io)
+ g_io_channel_shutdown(conn->accept_io, FALSE, NULL);
+
if (conn->io_id > 0)
g_source_remove(conn->io_id);
DBUS_TYPE_INVALID);
conn->connected = false;
+ conn->conn_req = false;
info->conn = g_slist_remove(info->conn, conn);
l2cap_le_io_destroy(conn);
goto drop;
}
+ conn->conn_req = false;
+
DBG("L2CAP_LE Connected fd [%d] addr [%s], role [%s]",fd, addr,
info->role == BT_L2CAP_LE_SERVER_ROLE ? "server" : "client");
return;
drop:
+ conn->conn_req = false;
+
if (io_err)
g_error_free(io_err);
DBG("Add timer for 10 sec");
conn->conn_timer = g_timeout_add(10000, handle_conn_fail, conn);
+ conn->conn_req = true;
+ device->conn_info = conn;
+
conn->io = bt_io_connect(l2cap_le_connect_cb,
conn, NULL, &gerr,
BT_IO_OPT_SOURCE_BDADDR, src,
void btd_device_set_legacy_pairing(struct btd_device *dev, bool legacy_pairing);
void btd_device_set_svc_changed_indication(struct btd_device *dev, bool value);
bool btd_device_get_svc_changed_indication(struct btd_device *dev);
+void device_set_accept_io(const struct btd_device *device, GIOChannel *io);
#ifdef TIZEN_FEATURE_BLUEZ_BATTERY_WATCH
void device_change_pkt_type(gpointer data, gpointer user_data);
#endif /* TIZEN_FEATURE_BLUEZ_BATTERY_WATCH */
device_attach_att(device, io);
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ device_set_accept_io(device, io);
+
if (btd_device_get_svc_changed_indication(device)) {
send_service_changed_indication_on_reconnect(device,
btd_device_get_gatt_server(device));