It is that i don't know how to get the name incoming device, after a remote device connect me and i accept it.
i can only use
TSockAddr tSockAddr;
iSock.RemoteName(tSockAddr);
TBTDevAddr tBTDevAddr = static_cast(tSockAddr).BTAddr();
to get the address.
but how can i get the name with any class and method??
I am very sorry that i didnt express my meaning very well.
my meaning is that : supposing there several user and their bluetooth's name of mobile device is u1, u2, u3. etc. and u1 is server(slave) and the others are client (master), then u1 advertise its server and the other's connect to u1. i want to get use2, use3......'s name (u2, u3....), but i don't know how to do it.
i expect you help.
and i thank your reply very much , i have learned a lot about the devices.
Forum posts: 26
Hi i m not getting ur problem ..
can you explain it.. please.
Ruchi.
Forum posts: 5
OK
It is that i don't know how to get the name incoming device, after a remote device connect me and i accept it.(tSockAddr).BTAddr();
i can only use
TSockAddr tSockAddr;
iSock.RemoteName(tSockAddr);
TBTDevAddr tBTDevAddr = static_cast
to get the address.
but how can i get the name with any class and method??
thanks for u reply
Forum posts: 26
Please check the RServiceResolver API. It may help you.
Ruchi.
Forum posts: 5
thanks at first
the class RServiceResolver is "Provides an interface to resolver service names and ports."
but my question is that how to get the client's (master) name which connected to the server (slave)??
what will i do??
ws07
Forum posts: 26
If you are looking for which device(mobile Model) is connected to system then must be this link helps you.
http://www.newlc.com/How-to-identify-a-mobile-at.html
Ruchi.
Forum posts: 5
I am very sorry that i didnt express my meaning very well.
my meaning is that : supposing there several user and their bluetooth's name of mobile device is u1, u2, u3. etc. and u1 is server(slave) and the others are client (master), then u1 advertise its server and the other's connect to u1. i want to get use2, use3......'s name (u2, u3....), but i don't know how to do it.
i expect you help.
and i thank your reply very much , i have learned a lot about the devices.
thank u.
ws07
Forum posts: 1
Atleast I could get a connected device name like this:
TInquirySockAddr inqAddr;
inqAddr.SetIAC(KGIAC /*KLIAC*/);
inqAddr.SetAction(KHostResInquiry | KHostResName | KHostResIgnoreCache);
RSocketServ ss;
ss.Connect();
TProtocolDesc pInfo;
ss.FindProtocol(_L("BTLinkManager"), pInfo);
RHostResolver hr;
hr.Open(ss,pInfo.iAddrFamily,pInfo.iProtocol);
TNameRecord nameEntry;
TNameEntry namebuffer(nameEntry);
TInt error = hr.GetByAddress(inqAddr, namebuffer );
if ( error != KErrNone ) {
// error handling here if needed
return;
}
aName.Copy(namebuffer().iName);
hr.Close();
ss.Close();
In which the aName is TDes& type of argument to the function in which this code is located. This is the bt server side code as requested.
This example was partly taken from forum Nokia page here http://discussion.forum.nokia.com/forum/showthread.php?t=24873
--
Petech
Forum posts: 5
Thank u very much.
i have been gloomy for it.
i will try it .