bluetoothengine/btsap/src/BTSapSocketHandler.cpp
changeset 70 f5508c13dfe0
parent 0 f63038272f30
equal deleted inserted replaced
67:16e4b9007960 70:f5508c13dfe0
   277     // On return, _should_ contain a free RFCOMM port
   277     // On return, _should_ contain a free RFCOMM port
   278     err = iListener.Bind(addr);
   278     err = iListener.Bind(addr);
   279     
   279     
   280     if(err)
   280     if(err)
   281         {
   281         {
   282         TInt freeChnl;
       
   283         err = iListener.GetOpt(KRFCOMMGetAvailableServerChannel, KSolBtRFCOMM, freeChnl);
       
   284         if (err == KErrNone)
       
   285             {
       
   286             err = iListener.SetLocalPort(freeChnl);
       
   287             iChannel = freeChnl;
       
   288             }
       
   289         }
       
   290     if(err)
       
   291         {
       
   292         // Try to bind using KRfcommPassiveAutoBind
   282         // Try to bind using KRfcommPassiveAutoBind
   293         iChannel = KRfcommPassiveAutoBind;
   283         iChannel = KRfcommPassiveAutoBind;
   294         addr.SetPort(iChannel);
   284         addr.SetPort(iChannel);
   295         err = iListener.Bind(addr);
   285         err = iListener.Bind(addr);
   296         }
   286         }