fd = g_io_channel_unix_get_fd(spp_ctx->channel);
- if (spp_ctx->new_connection)
+ if (spp_ctx->new_connection && state == BT_SOCKET_CONNECTED)
spp_ctx->new_connection(spp_ctx->uuid, device_name,
fd, spp_ctx->new_connection_data);
DBG("device path %s", device_path);
+ notify_connection_state(device_path, BT_SOCKET_DISCONNECTED, spp_ctx);
+
g_io_channel_unref(spp_ctx->channel);
spp_ctx->channel = NULL;
- notify_connection_state(device_path, BT_SOCKET_DISCONNECTED, spp_ctx);
-
g_dbus_method_invocation_return_value(invocation, NULL);
}
socket_connection_state_node = node_data;
return BT_SUCCESS;
-
- return BT_SUCCESS;
}
int bt_socket_unset_connection_requested_cb(void)