Quick Bluetooth Connectivity
Unsolved
Mobile and Embedded
-
Currently, I am performing a scan for nearby Bluetooth using the followings:
agent = new QBluetoothDeviceDiscoveryAgent; connect(agent, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)), this, SLOT(deviceDiscovered(QBluetoothDeviceInfo))); agent->start();
and then the app tries to connect user-selected BT when discovery finished signal is emitted.
connect(agent, &QBluetoothDeviceDiscoveryAgent::finished, this, &bluetooth_server::connectToDevice);
this takes too long to connect, how can I make it quick and efficient?
-
Ah, I see what you are doing here.
When does the user select the device: before or after the discovery?
If it's before discovery, no need to do a discovery at all. Connect immediately.
If during the discovery, no need to wait for finished() at all, connect as soon as user selects it (stop the discovery first) .