×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Super Contributor
    Join Date
    Jun 2004
    Location
    SymbianLand
    Posts
    763

    Datagram style communication over BT?

    Hi,
    I am trying to create a datagram socket over BT but the socket
    fails to open which is making me ask this basic question that
    is Datagram style communication is even possible over BT?
    Thanks.
    --Mayur.

  2. #2
    Super Contributor
    Join Date
    Jun 2004
    Location
    SymbianLand
    Posts
    763
    Hi ,
    I have been trying to get this code working but every time it leaves
    with KErrArgument.
    Code:
     errCode = iSockServ.Connect();
     if(errCode == KErrNone){
      //TInt RSocket::Open(RSocketServ& aServer,TUint addrFamily,TUint sockType,TUint protocol);
      errCode = iWaitForDataSock.Open(iSockServ,KBTAddrFamily,KSockSeqPacket,KL2CAP);
    
      if(errCode != KErrNone){
       aTitle.Copy(_L("SockOpen err"));
       goto _JMPTOERRMSG;
      }
    
      iBtUdpSockState = EConnected;
    
      //get the local device address so that u can use
      TRequestStatus iStatus;
      iWaitForDataSock.Ioctl(KHCILocalAddressIoctl,iStatus,&iDevAddrPckg,KSolBtHCI);
      User::WaitForRequest(iStatus);
    
      if(iStatus.Int() != KErrNone){ 
       errCode = iStatus.Int();
       aTitle.Copy(_L("SockIoCtl err"));
       goto _JMPTOERRMSG;
      }
    
      iLocalDevAddr = iDevAddrPckg();
      iLocalBtSockAddr.SetBTAddr(iLocalDevAddr);
      iLocalBtSockAddr.SetPort(2);
      //keep a udp socket waiting for some data.
      errCode = iWaitForDataSock.Bind(iLocalBtSockAddr);
    Also can anybody tell me whats wrong in this piece of code.
    Any ideas whether a UDP style socket is possible to be created over BT?
    Thanks.
    --Mayur.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×