| Reply | « Previous Thread | Next Thread » |
|
Hi all,
I am using CBluetoothSocket class to get the connection from the requesting device and then get the datas sent by it. I am able to get the request but while reading the data altough i m getting the notification that data read , but I am unable to get any data in my device. the code goes here: Code:
void GetSocket()
{
TInt result;
RSocketServ socksvr;
// Connect to the socket server
result = socksvr.Connect();
if (result != KErrNone) User::Leave(result);
// Load the protocol
TProtocolDesc protocolInfo;
result = socksvr.FindProtocol(_L("L2CAP"), protocolInfo);
User::LeaveIfError(result);
m_cBTSocket = CBluetoothSocket::NewL(*this,socksvr,protocolInfo.iSockType,protocolInfo.iProtocol);
m_cBTBlankSocket = CBluetoothSocket::NewL(*this,socksvr);
m_cBTSyncLink = CBluetoothSynchronousLink::NewL(*this,socksvr);
TL2CAPSockAddr aAddr;
TBTServiceSecurity serviceSecurity;
//TUid settingsUID;
//TBTSockAddr sockaddr;
serviceSecurity.SetAuthentication(ETrue);
serviceSecurity.SetEncryption(EFalse);
serviceSecurity.SetAuthorisation(ETrue);
serviceSecurity.SetDenied(EFalse);
aAddr.SetSecurity(serviceSecurity);
aAddr.SetPort(3);
// Configure the listener port.
m_cBTSocket->SetOpt(KL2CAPGetOutboundMTU, KSolBtL2CAP, 48);
m_cBTSocket->SetOpt(KL2CAPInboundMTU, KSolBtL2CAP, 48);
result = m_cBTSocket->Bind(aAddr);
User::LeaveIfError(result);
result = m_cBTSocket->Listen(8);
User::LeaveIfError(result);
m_cBTSocket->Accept(*m_cBTBlankSocket)
}
Code:
void Read()
{
TSockXfrLength lLen(0);
TBuf8<256> lData;
TBuf16<256> lDataLen;
m_cReadStatus = m_cBTBlankSocket->RecvOneOrMore(lData,0,lLen);
lLen.Copy(lDataLen);
}
Can any one help me out in getting that where I m going wrong. thnx, Rajan. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Nokia 3250 Bluetooth Connection Problem | TalJ | Symbian Networking & Messaging | 2 | 2006-06-27 08:32 |
| how can i come to know bluetooth connection from remote device | santosh3311 | Symbian Networking & Messaging | 9 | 2005-09-12 03:46 |
| Bluetooth serial connection timeout | martin.ericsson | General Discussion | 0 | 2005-06-13 03:00 |
| Problem with Serial port connection using Nokia6600 Bluetooth | mandykahlon | General Discussion | 1 | 2005-05-31 12:42 |
| 6310 bluetooth connection with PCsuite fails | Nokia_Archive | Bluetooth Technology | 1 | 2002-05-28 16:14 |