This page was last modified 07:22, 9 May 2008.
How to get and set the local device name
From Forum Nokia Wiki
In 2nd edition devices you could use 'CBTMCMSettings' GetLocalBTName() to fetch the Host device bluetooth name and to set the device name you could use SetLocalBTName(). But for 3rd edition devices these libraries files are deprecated.
Hence forth one could use the following code.Eventhough the code is found in the sdk help it didnt work as expected.I was unable to Open RHostResolver in both N73 and also in 6681.Both failed with an error -5(The operation requested is not supported).
This code worked for me.
For 3rd edition phones check: http://wiki.forum.nokia.com/index.php/Bluetooth_Engine_API
// 1. Connect to the socket server
RSocketServ socketServ; User::LeaveIfError(socketServ.Connect()); TProtocolDesc pInfo;
// 2.Use BTLinkManager as the Protocol instead of L2CAP as mentioned in the sdk
_LIT(BTLinkManager, "BTLinkManager");
TInt FindRet = socketServ.FindProtocol(BTLinkManager(),pInfo);
if(KErrNone==FindRet)
{
RHostResolver hr;
TInt ret = hr.Open(socketServ,pInfo.iAddrFamily,pInfo.iProtocol);
if(KErrNone==ret)
{
THostName name;
hr.GetHostName(name);
hr.Close();
}
}
socketServ.Close();
One could also use SetHostName() to set the local bluetooth address.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Documented 3650 HTTP Connect issue... | queenflame | Mobile Java General | 3 | 2003-11-12 05:37 |
| can I set Rintone of Device | giz155 | Mobile Java Media (Graphics & Sounds) | 1 | 2006-06-01 18:47 |
| There is question to forum Experts, Firewall for mobile | DmitryRyb | Symbian Tools & SDKs | 4 | 2006-03-06 12:05 |
| Cannot create project on network drive | jdw | General Symbian C++ | 3 | 2007-06-01 11:34 |
| javax.bluetooth | bobby | Bluetooth Technology | 8 | 2006-10-12 16:06 |
