This page was last modified 16:50, 23 June 2008.
How to get local Bluetooth Device Address
From Forum Nokia Wiki
Usually, the local bluetooth address of a device can be retrieved by typing the following star-hash code: *#2820# (*#BTA0#)
The following code retrieves your local bluetooth device address programatically (Symbian 3rd ed.).
Example code
Header files:
- #include <bttypes.h>
- #include <bt_subscribe.h>
Library:
bluetooth.lib
Capabilities:
LocalServices
The following Int, Uid & Uint values are provided in bt_subscribe.h:
const TInt KUidBluetoothPubSubKeyBase = 0x10203637; const TUid KPropertyUidBluetoothCategory = {KUidSystemCategoryValue}; const TUint KPropertyKeyBluetoothGetLocalDeviceAddress = (KUidBluetoothPubSubKeyBase + 0);
The following Int32 & Uid values are provided in e32_property.h (included in bt_subscribe.h):
static const TInt32 KUidSystemCategoryValue=0x101f75b6; static const TUid KUidSystemCategory={KUidSystemCategoryValue};
The following code retrieves the unique Bluetooth HEX-address:
TBuf<20> aBTAddr; TPckgBuf<TBTDevAddr> aDevAddrPckg; RProperty::Get(KUidSystemCategory, KPropertyKeyBluetoothGetLocalDeviceAddress, aDevAddrPckg); aDevAddrPckg().GetReadable(aBTAddr, KNullDesC, _L(":"), KNullDesC); aBTAddr.UpperCase();
Note: The Bluetooth HEX-address will be stored in "aBTAddr" and contains exactly 17 characters in the format 00:00:00:00:00:00 (i.e. including 5 colons).
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Getting Bluetooth address Error | kkboy1 | Symbian Networking & Messaging | 0 | 2005-07-31 02:29 |
| Is there an AT Command to get Bluetooth Address? | lezi | Bluetooth Technology | 1 | 2002-07-02 06:17 |
| Connecting to bluetooth device | roelb | Bluetooth Technology | 11 | 2004-01-09 12:18 |
| How can I get the BT address after listen for connection from a remote device | terry11 | Bluetooth Technology | 2 | 2004-07-27 07:28 |
| A question about IPv6 | buaashenzw | Mobile Java Tools & SDKs | 0 | 2003-03-28 03:33 |
