bearermanagement/S60MCPR/src/s60mcpr.cpp
changeset 18 fcbbe021d614
parent 3 f7816ffc66ed
child 61 8b0c979bbe8c
equal deleted inserted replaced
4:77415202bfc8 18:fcbbe021d614
   298                 static_cast<TMpmNotificationPrefIAPAvailable&>(
   298                 static_cast<TMpmNotificationPrefIAPAvailable&>(
   299                              const_cast<TMpmNotification&>( aNotification ) );
   299                              const_cast<TMpmNotification&>( aNotification ) );
   300 
   300 
   301             //HandlePreferredIAPAvailable( const_cast<TMpmNotificationPrefIAPAvailable&>( notification ) );
   301             //HandlePreferredIAPAvailable( const_cast<TMpmNotificationPrefIAPAvailable&>( notification ) );
   302 
   302 
   303             // Check if the TPrefIAPNotifInfo contains new or old IAP. 
   303             S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMPreferredIAPAvailable IAP %d",(TInt*)this,notification.iNewIapId);
   304             //
   304 
   305             if ( ServiceProvider() &&
   305 
   306                  ((RMetaServiceProviderInterface*)ServiceProvider())->ProviderInfo().APId() != notification.iNewIapId )
   306             // Store PolicyNotification
   307                 {
   307             // This could happen if PolicyServer sends notification too early.
   308                 S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMPreferredIAPAvailable IAP %d",(TInt*)this,notification.iNewIapId);
   308             //
   309 
   309             StorePolicyNotification( aNotification );
   310                 // Store PolicyNotification
   310             
   311                 // This could happen if PolicyServer sends notification too early.
   311             // Send preferred carrier message into meshmachine.
   312                 //
   312             //
   313                 StorePolicyNotification( aNotification );
   313             RNodeInterface ni;
   314                 
   314             ni.OpenPostMessageClose( NodeId(), 
   315                 // Send preferred carrier message into meshmachine.
   315                                      NodeId(), 
   316                 //
   316                                      TCFS60MCPRMessage::TMPMPreferredCarrierAvailableMsg( (TAny*)&notification ).CRef() );
   317                 RNodeInterface ni;
   317 
   318                 ni.OpenPostMessageClose( NodeId(), 
       
   319                                          NodeId(), 
       
   320                                          TCFS60MCPRMessage::TMPMPreferredCarrierAvailableMsg( (TAny*)&notification ).CRef() );
       
   321                 }
       
   322 #ifdef _DEBUG
       
   323             else
       
   324                 {
       
   325                 S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMPreferredIAPAvailable SAME IAP %d",(TInt*)this,notification.iNewIapId );
       
   326                 }
       
   327 #endif
       
   328             break;
   318             break;
   329             }
   319             }
   330         case EMPMMobilityErrorNotification:
   320         case EMPMMobilityErrorNotification:
   331             {
   321             {
   332             TMpmNotificationError& notification = 
   322             TMpmNotificationError& notification = 
   396             if ( ServiceProvider() && 
   386             if ( ServiceProvider() && 
   397                     (((RMetaServiceProviderInterface*)ServiceProvider())->ProviderInfo().APId() == notification.iInfo.iIap ||
   387                     (((RMetaServiceProviderInterface*)ServiceProvider())->ProviderInfo().APId() == notification.iInfo.iIap ||
   398                     notification.iInfo.iIap == 0 )) 
   388                     notification.iInfo.iIap == 0 )) 
   399                 {
   389                 {
   400                 S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMStopIAPNotification IAP %d",(TInt*)this,notification.iInfo.iIap);
   390                 S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMStopIAPNotification IAP %d",(TInt*)this,notification.iInfo.iIap);
   401 
   391                 PostToClients<TDefaultClientMatchPolicy>( TNodeCtxId( 0, Id() ),
   402                 //TODO migrate to use MCPR's TStop and vertical msg down. Not supported at the moment.
   392                                                           TCFServiceProvider::TStop( KErrDisconnected ).CRef(),
   403                 /*PostToClients<TDefaultClientMatchPolicy>( TNodeCtxId( 0, Id() ),
   393                                                           TClientType( TCFClientType::EServProvider) );
   404                                                           TCFServiceProvider::TStop( KErrCancel ).CRef(),
       
   405                                                           TClientType( TCFClientType::EData) );*/
       
   406                 }
   394                 }
   407 #ifdef _DEBUG
   395 #ifdef _DEBUG
   408             else
   396             else
   409                 {
   397                 {
   410                 S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMStopIAPNotification NO MATCH! IAP %d",(TInt*)this,notification.iInfo.iIap);
   398                 S60MCPRLOGSTRING2("S60MCPR<%x>::PolicyNotification() EMPMStopIAPNotification NO MATCH! IAP %d",(TInt*)this,notification.iInfo.iIap);
   462 void CS60MetaConnectionProvider::StorePolicyNotification( TMpmNotification& aNotification )
   450 void CS60MetaConnectionProvider::StorePolicyNotification( TMpmNotification& aNotification )
   463     {
   451     {
   464     // Store PolicyNotification
   452     // Store PolicyNotification
   465     // This could happen if PolicyServer sends notification too early.
   453     // This could happen if PolicyServer sends notification too early.
   466     //
   454     //
   467     S60MCPRLOGSTRING1("S60MCPR<%x>::StorePolicyNotification()",(TInt*)this);
       
   468     if ( iPendingNotification.Length() == 0 )
   455     if ( iPendingNotification.Length() == 0 )
   469         {
   456         {
   470         S60MCPRLOGSTRING1("S60MCPR<%x>::StorePolicyNotification() iPendingNotification.Length() == 0",(TInt*)this);
   457         S60MCPRLOGSTRING1("S60MCPR<%x>::StorePolicyNotification() iPendingNotification.Length() == 0",(TInt*)this);
   471         Mem::Copy((TAny*)iPendingNotification.Ptr(), &aNotification, KMpmMessageLength);
   458         Mem::Copy((TAny*)iPendingNotification.Ptr(), &aNotification, KMpmMessageLength);
   472         S60MCPRLOGSTRING1("S60MCPR<%x>::StorePolicyNotification() Mem::Copy",(TInt*)this);
       
   473         iPendingNotification.SetLength( KMpmMessageLength );
   459         iPendingNotification.SetLength( KMpmMessageLength );
   474         S60MCPRLOGSTRING1("S60MCPR<%x>::StorePolicyNotification() iPendingNotification.SetLength",(TInt*)this);
       
   475         }
   460         }
   476 #ifdef _DEBUG
   461 #ifdef _DEBUG
   477     else
   462     else
   478         {
   463         {
   479         S60MCPRLOGSTRING2("S60MCPR<%x>::StorePolicyNotification() Notification already exists",
   464         S60MCPRLOGSTRING2("S60MCPR<%x>::StorePolicyNotification() Notification already exists",