Namespaces
Variants
Actions

Reading Bluetooth device address returns zero (Known Issue)

Jump to: navigation, search
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.

This page was last modified on 12 March 2012, at 08:45.
102 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved