bluetoothengine/btnotif/src/BTNAuthNotifier.cpp
branchRCL_3
changeset 72 4b59561a31c0
parent 61 269724087bed
equal deleted inserted replaced
64:1934667b0e2b 72:4b59561a31c0
   105     iInfo.iPriority=ENotifierPriorityVHigh;
   105     iInfo.iPriority=ENotifierPriorityVHigh;
   106     return iInfo;
   106     return iInfo;
   107     }
   107     }
   108 
   108 
   109 // ----------------------------------------------------------
   109 // ----------------------------------------------------------
   110 // CBTAuthNotifier::ProcessStartParamsL
   110 // CBTAuthNotifier::GetParamsL
   111 // Initialize parameters and check if device is already
   111 // Initialize parameters and check if device is already
   112 // in registry. Jump to RunL as soon as possible.
   112 // in registry. Jump to RunL as soon as possible.
   113 // ----------------------------------------------------------
   113 // ----------------------------------------------------------
   114 //
   114 //
   115 void CBTAuthNotifier::ProcessStartParamsL()
   115 void CBTAuthNotifier::GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
   116     {
   116     {
   117     FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::ProcessStartParamsL()"));
   117     FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::GetParamsL()"));
       
   118 
       
   119     if( !iMessage.IsNull())
       
   120         {
       
   121         User::Leave(KErrInUse);
       
   122         }
       
   123 
       
   124     iMessage = aMessage;
       
   125     iReplySlot = aReplySlot;
   118 
   126 
   119     if ( AutoLockOnL() )
   127     if ( AutoLockOnL() )
   120         {
   128         {
   121         // The phone is locked, access denied.
   129         // The phone is locked, access denied.
   122         // Write results back to caller and complete message.	
   130         // Write results back to caller and complete message.	
   124         return;
   132         return;
   125         }
   133         }
   126     
   134     
   127     TBTAuthorisationParams param;
   135     TBTAuthorisationParams param;
   128     TPckgC<TBTAuthorisationParams> pckg(param);
   136     TPckgC<TBTAuthorisationParams> pckg(param);
   129     pckg.Set(*iParamBuffer);
   137     pckg.Set(aBuffer);
   130 
   138 
   131     iServiceUid = pckg().iUid.iUid;  // Pick up service uid from message
   139     iServiceUid = pckg().iUid.iUid;  // Pick up service uid from message
   132     iBTAddr = pckg().iBDAddr;
   140     iBTAddr = pckg().iBDAddr;
   133     if ( OtherOutgoPairing( iBTAddr ) )
   141     if ( OtherOutgoPairing( iBTAddr ) )
   134         {
   142         {
   161         // Check if device is in the registry, function of notifier base  
   169         // Check if device is in the registry, function of notifier base  
   162         GetDeviceFromRegL( iBTAddr );
   170         GetDeviceFromRegL( iBTAddr );
   163         }
   171         }
   164 
   172 
   165 #ifdef _DEBUG
   173 #ifdef _DEBUG
   166     FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::ProcessStartParamsL() Executing authorisation..."));
   174     FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::GetParamsL() Executing authorisation..."));
   167     TBuf<12> deviceAddressString;
   175     TBuf<12> deviceAddressString;
   168     pckg().iBDAddr.GetReadable(deviceAddressString);
   176     pckg().iBDAddr.GetReadable(deviceAddressString);
   169     FTRACE(FPrint(_L("[BTNOTIF]\t  BT Address: %S"), &deviceAddressString));
   177     FTRACE(FPrint(_L("[BTNOTIF]\t  BT Address: %S"), &deviceAddressString));
   170     FTRACE(FPrint(_L("[BTNOTIF]\t CBTAuthNotifier::ProcessStartParamsL Service Uid: %d = 0x%X"), iServiceUid, iServiceUid ));
   178     FTRACE(FPrint(_L("[BTNOTIF]\t CBTAuthNotifier::GetParamsL Service Uid: %d = 0x%X"), iServiceUid, iServiceUid ));
   171 #endif
   179 #endif
   172     FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::ProcessStartParamsL() completed"));
   180     FLOG(_L("[BTNOTIF]\t CBTAuthNotifier::GetParamsL() completed"));
   173     }
   181     }
   174 
   182 
   175 // ----------------------------------------------------------
   183 // ----------------------------------------------------------
   176 // CBTAuthNotifier::UpdateL
   184 // CBTAuthNotifier::UpdateL
   177 // Notifier update. Stores the received bluetooth
   185 // Notifier update. Stores the received bluetooth