diff options
Diffstat (limited to 'binding-bluetooth/bluetooth-manager.c')
-rw-r--r-- | binding-bluetooth/bluetooth-manager.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/binding-bluetooth/bluetooth-manager.c b/binding-bluetooth/bluetooth-manager.c index 407518f..2ff8925 100644 --- a/binding-bluetooth/bluetooth-manager.c +++ b/binding-bluetooth/bluetooth-manager.c @@ -1258,7 +1258,7 @@ static void *bt_event_loop_thread() BluetoothManage_InitFlag_Set(TRUE); BluetoothMonitorInit(); - g_timeout_add_seconds(5, bt_autoconnect, NULL); + BluetoothManage.autoconnect = g_timeout_add_seconds(5, bt_autoconnect, NULL); LOGD("g_main_loop_run\n"); g_main_loop_run(cli.clientloop); @@ -1493,6 +1493,11 @@ int adapter_start_discovery() return -1; } + if (BluetoothManage.autoconnect > 0) { + LOGW("Canceling autoconnection for discovery mode\n"); + g_source_remove(BluetoothManage.autoconnect); + } + value = g_dbus_connection_call_sync(cli.system_conn, BLUEZ_SERVICE, ADAPTER_PATH, ADAPTER_INTERFACE, "StartDiscovery", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, |