Reading Bluetooth device address returns zero (Known Issue)
Article Metadata
Tested with
Devices(s): All devices based on Symbian
Compatibility
Platform(s): Symbian, all
Platform Security
Capabilities: LocalServices
Article
Keywords: KPropertyKeyBluetoothGetLocalDeviceAddress, TBTDevAddr
Created: User:Kbwiki
(03 Jun 2010)
Last edited: hamishwillee
(12 Mar 2012)
Description
Trying to retrieve a Bluetooth Device Address returns zero (or NULL) if Bluetooth has never been used. This is apparent when using the *#2820# code, which will result in Bluetooth device address: without any value at all.
Also, the following code:
TBuf<20> bluetoothAddress;
TPckgBuf<TBTDevAddr> aDevAddrPckg;
RProperty::Get(KUidSystemCategory,
KPropertyKeyBluetoothGetLocalDeviceAddress, aDevAddrPckg);
aDevAddrPckg().GetReadable(bluetoothAddress, KNullDesC, KNullDesC, KNullDesC);
will return 000000000000 as bluetoothAddress.
This can be problematic if using Bluetooth address for identifying a device.
Solution
If the returned value is zero, Bluetooth needs to be turned on at least once. After this, the value can be received, and it also persists when phone is turned off.


(no comments yet)