I need to access the local Bluetooth address in an application I'm developing. The phone is an N70, so I'm using Series 60 SDK 2.6.
There is a previous thread on this, with respect to Symbian v7.0s:
In fact, that code does work on a v7.0s phone that I have. However, with version 8.0a, I'm receiving all zeros as the Bluetooth address. Here are two code snippets I have tried:
The first, based on that previous post:
iSocket.Ioctl(KHCILocalAddressIoctl, aStatus, &iDevAddr, KSolBtHCI);
iDevAddr().GetReadable(aAddr, _L("btaddr: "), _L(":"), _L("Q"));
lvb().iLMPSubversion=0; // just for testing if nothing happens
iSocket.Ioctl(KHCILocalVersionIoctl, aStatus, &lvb, KSolBtHCI);
iLog->WriteFormat(_L("%d %d %d %d %d\n"),
Much to my surprise, this code successfully reads the local version information, but not the bluetooth address.
Here is another snippet I've tried, which also returns all zeros for the Bluetooth address:
TInt result = iListeningSocket.Open(iSocketServer, KServerTransportName /*RFCOMM*/);
if (result != KErrNone)
// Get a channel to listen on - same as the socket's port number
iDevAddr = listeningAddress.BTAddr();
iDevAddr.GetReadable(aAddr, _L("BTADDR: "), _L(":"), _L("R"));
I often get channel 4 out of this snippet, but no bluetooth address.
I'm guessing there is some kind of API change between v7.0s and v8.0a/v8.1a that affects this behavior, since there were similar changes wrt the Bluetooth security settings.
I'm building this stuff in Carbide C++ Express v1.1 with the ARMI target for S60 2.6.
Can anybody help me out?