×
Namespaces

Variants
Actions
(Difference between revisions)

Bluetooth discovery in Qt Mobility may not report devices (Nokia C6)

From Nokia Developer Wiki
Jump to: navigation, search
Devnull (Talk | contribs)
(Devnull -)
Devnull (Talk | contribs)
(Devnull -)
Line 23: Line 23:
 
== Description==
 
== Description==
  
Qt Bluetooth device discovery is achieved using the Qt Mobility API [http://doc.qt.nokia.com/qtmobility-1.2/qbluetoothdevicediscoveryagent.html QBluetoothDeviceDiscoveryAgent] {{Icode|start()}} method. On Symbian this will only discover ''new'' devices, ignoring those that have been previously cached.
+
Qt Bluetooth device discovery is achieved using the Qt Mobility API [http://doc.qt.nokia.com/qtmobility-1.2/qbluetoothdevicediscoveryagent.html QBluetoothDeviceDiscoveryAgent] {{Icode|start()}} method. On Symbian this may not result any devices when both bluetooth audi and wireless data connection are active.
 
+
The reason for this is that the Symbian implementation explicitly ignores cached results by setting the {{Icode|KHostResIgnoreCache}} flag:
+
<code cpp>
+
void BluetoothLinkManagerDeviceDiscoverer::startDiscovery(const uint discoveryType)
+
{
+
...
+
m_addr.SetAction(KHostResInquiry | KHostResName | KHostResIgnoreCache);
+
...
+
}
+
</code>
+
  
 
== How to reproduce ==
 
== How to reproduce ==
  
Connect the Bluetooth headset and start listen an internet radio over the wireless lan.
+
Connect a Bluetooth headset and start listening an internet radio over the wireless network.
  
Attempt to discover bluetooth devices. No devices are discovered - and in the Qt Creator debug window you can see the following messages  
+
Attempt to discover bluetooth devices with the API. No devices are discovered - and in the Qt Creator debug window you can see the following messages  
 
<code text>
 
<code text>
 
[Qt Message] void QtMobility::BluetoothLinkManagerDeviceDiscoverer::RunL() 0  
 
[Qt Message] void QtMobility::BluetoothLinkManagerDeviceDiscoverer::RunL() 0  
Line 45: Line 35:
 
</code>
 
</code>
 
Where -25 means {{Icode|KErrHostResNoMoreResults}}.
 
Where -25 means {{Icode|KErrHostResNoMoreResults}}.
 
The example code:
 
http://doc.qt.nokia.com/qtmobility-1.2/btscanner.html
 
 
The QBluetoothDeviceDiscoveryAgent API documentatiojn:
 
http://doc.qt.nokia.com/qtmobility-1.2/qbluetoothdevicediscoveryagent.html
 
  
 
== Solution ==
 
== Solution ==
  
 
There is no known solution or workaround for the problem.
 
There is no known solution or workaround for the problem.

Revision as of 16:47, 30 November 2011

Bluetooth discovery in Qt Mobility may not report devices.

Article Metadata
Code ExampleTested with
Devices(s): Nokia C6-01
Compatibility
Platform(s): Qt mobility 1.2.1 and later
Symbian
Device(s): All with internal Bluetooth
Platform Security
Signing Required: DevCert required
Capabilities: ReadDeviceData LocalServices WriteDeviceData
Article
Keywords: QBluetoothDeviceDiscoveryAgent, BluetoothLinkManagerDeviceDiscoverer
Created: Devnull (24 Nov 2011)
Last edited: Devnull (30 Nov 2011)

Description

Qt Bluetooth device discovery is achieved using the Qt Mobility API QBluetoothDeviceDiscoveryAgent start() method. On Symbian this may not result any devices when both bluetooth audi and wireless data connection are active.

How to reproduce

Connect a Bluetooth headset and start listening an internet radio over the wireless network.

Attempt to discover bluetooth devices with the API. No devices are discovered - and in the Qt Creator debug window you can see the following messages

[Qt Message] void QtMobility::BluetoothLinkManagerDeviceDiscoverer::RunL() 0 
[Qt Message] void QtMobility::BluetoothLinkManagerDeviceDiscoverer::RunL() -25

Where -25 means KErrHostResNoMoreResults.

Solution

There is no known solution or workaround for the problem.

133 page views in the last 30 days.
×