Problems with an OBEX connection

Login to reply to this topic.
Thu, 2003-11-06 16:05
Joined: 2003-10-13
Forum posts: 11
Is there someOne who can tell me what's wrong with this code about an Obex connection under p800:

This is the code:
RSocketServ socketServ;
   User::LeaveIfError(socketServ.Connect()); //si connette al socket server
   
      
   //Variabili per BlueTooth
   TBTDevAddr remoteDevAddr(0);
   TBTDeviceName remoteDevName;
   TBTDeviceClass remoteDevClass;
   TInt serviceFilter = -1; // -1 lista i device per tutti i tipi di servizi
   //Crea un btSocket
   
   
   CQBTUISelectDialog* dialog =
        new (ELeave) CQBTUISelectDialog(remoteDevAddr,
            remoteDevName,
            remoteDevClass,
            CQBTUISelectDialog::EQBTDeviceFilterAll, //device filter
            serviceFilter);
            

      if (dialog->LaunchSingleSelectDialogLD())
      {


      
      TProtocolDesc pInfo;

      TProtocolName pName(_L("BTLinkManager"));

      User::LeaveIfError(socketServ.FindProtocol(pName,pInfo));


      _LIT8(KServerTransportName,"RFCOMM");
      TObexBluetoothProtocolInfo protocolInfo;
      protocolInfo.iTransport.Copy(KServerTransportName);
      protocolInfo.iAddr.SetBTAddr(remoteDevAddr);
      protocolInfo.iAddr.SetPort(2);
      
      CObexClient* iClient;
      iClient =CObexClient::NewL(protocolInfo);
      iState=iConnect;
      iClient->Connect(status); //Here it does'n connect
      SetActive();
      
Regards,

Claudia

Fri, 2006-01-27 03:52
Joined: 2005-02-17
Forum posts: 26
Re: Problems with an OBEX connection
Claudia,

How do you know you can connect with Port #2?
This may be a problem. Check the btobjectexchange example in Series60 examples. They determine the port in a different way.

Niimidan

  • Login to reply to this topic.