Hi all,
i am a problem with Bluetooth device searching...my code is below, can anyone tell me that why SetMajorClassOfDevice(EMajorDeviceLanAccessPoint); is not working...my code is:
// Code Here
TInt error=KErrNone;
TPtrC deviceName;
RSocketServ socketServ;
TInt ret_val;
ret_val=socketServ.Connect();
TProtocolDesc pInfo;
_LIT(KL2Cap, "BTLinkManager");
TBuf<32> tbuf_L2cap;
tbuf_L2cap=KL2Cap;
ret_val=socketServ.FindProtocol(tbuf_L2cap,pInfo);
RHostResolver hr;
ret_val=hr.Open(socketServ,pInfo.iAddrFamily,pInfo.iProtocol);
TInquirySockAddr addr;
TNameEntry entry;
addr.SetIAC(KGIAC);
TRequestStatus status;
addr.SetMajorClassOfDevice(EMajorDeviceLanAccessPoint);
/* addr.SetMinorClassOfDevice(EMinorDeviceLANFullyAvailable|EMinorDeviceLANServiceOne|EMinorDeviceLANServiceTwo
|EMinorDeviceLANServiceThree|EMinorDeviceLANServiceFour|EMinorDeviceLANServiceFive|
EMinorDeviceLANServiceSix|EMinorDeviceLANNoService);
addr.SetAction(KHostResInquiry|KHostResName|KHostResIgnoreCache);
*/
hr.GetByAddress(addr, entry,status);
User::WaitForRequest(status);
if (status == KErrNone)
{
do
{
deviceName.Set(entry().iName);
TBuf<20> Dnane=deviceName;
//CEikonEnv::Static()->AlertWin(Dnane);
error = hr.Next( entry );
}while( error != KErrHostResNoMoreResults );
}
// End Code
My problem:
1.In this when i am calling addr.SetIAC(KGIAC); function i am getting all the devices and when i am putting KLIAC instead of KGIAC then i am not getting any one devices...why...???
2.Why SetMajorClassOfDevice() is not working, when i am paasing the approapriate Major device Class to this function...???
can anyone help me...
Thanks Alot
Amit



