bluetooth/btstack/secman/pairingserver.cpp
branchRCL_3
changeset 8 2b6718f05bdb
parent 0 29b1cd4cb562
child 12 8a27654f7b62
--- a/bluetooth/btstack/secman/pairingserver.cpp	Tue Feb 02 01:12:20 2010 +0200
+++ b/bluetooth/btstack/secman/pairingserver.cpp	Fri Feb 19 23:56:55 2010 +0200
@@ -780,6 +780,7 @@
 	iProxySap->SetNotify(this);
 	iProxySap->SetRemName(addr);
 	iProxySap->ActiveOpen();
+	DoAccessRequestL();
 	}
 
 void CDedicatedBondingSession::CleanupStartMessage(TAny* aPtr)
@@ -815,6 +816,7 @@
 			addr.SetBTAddr(iProxySap->RemoteAddress());
 			iProxySap->SetRemName(addr); // triggers finding a link again.
 			iProxySap->ActiveOpen();
+			DoAccessRequestL();
 			break;
 			}
 		// else not deferred so complete now....
@@ -830,6 +832,12 @@
 			err = KErrAccessDenied;
 			}
 		break;
+	case EInitialConnectionPending:
+	case EFinalConnectionPending:
+		// Access request shouldn't successfully complete if the connection is still pending
+		__ASSERT_DEBUG(aResult != EBTSecManAccessGranted,  PANIC(KPairingServerFaultCat, EPairingServerUnexpectedAccessCallback));
+		// We should get the MSocketNotify::Error callback, so don't do anything else
+		break;
 	default:
 		LOG1(_L("Unexpected Access Request Complete in state %d"), iState);
 		__ASSERT_DEBUG(EFalse, PANIC(KPairingServerFaultCat, EPairingServerUnexpectedAccessCallback));
@@ -863,11 +871,9 @@
 		{
 	case EInitialConnectionPending:
 		iState = EInitialConnection;
-		DoAccessRequestL();
 		break;
 	case EFinalConnectionPending:
 		iState = EFinalConnection;
-		DoAccessRequestL();
 		break;
 	case EInitialConnection:
 	case EFinalConnection: