satengine/satserver/Engine/src/csatmultimodeapi.cpp
changeset 48 78df25012fda
parent 33 8d5d7fcf9b59
equal deleted inserted replaced
46:2fa1fa551b0b 48:78df25012fda
    26     _LIT( KSatSDummyTsyPhoneName, "DMobile" );
    26     _LIT( KSatSDummyTsyPhoneName, "DMobile" );
    27 #endif
    27 #endif
    28 
    28 
    29 const TInt KLoopMaxTryouts = 5;
    29 const TInt KLoopMaxTryouts = 5;
    30 const TInt KLoopTimeout = 3000000;
    30 const TInt KLoopTimeout = 3000000;
       
    31 
       
    32 const TUint8 KQuarterShift( 2 );
       
    33 const TUint8 KHighNibbleShift( 4 );
       
    34 const TUint8 KDcsCharacterSet7Bit( 0x00 );
       
    35 const TUint8 KDcsCharacterSet8Bit( 0x01 );
       
    36 const TUint8 KDcsCharacterSet16Bit( 0x02 );
       
    37 const TUint8 KDcsCharacterSet7Bit2( 0x00 );
       
    38 const TUint8 KDcsCharacterSet16Bit2( 0x01 );
    31 
    39 
    32 // ================= MEMBER FUNCTIONS ==========================================
    40 // ================= MEMBER FUNCTIONS ==========================================
    33 
    41 
    34 // -----------------------------------------------------------------------------
    42 // -----------------------------------------------------------------------------
    35 // Class constructor.
    43 // Class constructor.
   421     iCall.DialEmergencyCall( aReqStatus, aNumber );
   429     iCall.DialEmergencyCall( aReqStatus, aNumber );
   422     LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::DialEmergencyCall exiting" )
   430     LOG( SIMPLE, "SATENGINE: CSatMultiModeApi::DialEmergencyCall exiting" )
   423     }
   431     }
   424 
   432 
   425 // -----------------------------------------------------------------------------
   433 // -----------------------------------------------------------------------------
       
   434 // Check validity of a given Data Coding Scheme (Dcs).
       
   435 // For the details how the DCS is validated please check TS_123038
       
   436 // -----------------------------------------------------------------------------
       
   437 //
       
   438 TBool CSatMultiModeApi::IsValidUssdDcs( const TUint8 aDcs )
       
   439     {
       
   440     LOG2( SIMPLE, 
       
   441     "SATENGINE: CSatMultiModeApi::IsValidUssdDcs calling dcs = %x", aDcs)
       
   442 
       
   443     TBool isDcsValid( EFalse );
       
   444                                                                //      76543210
       
   445     TUint8 codingGroup  = ( aDcs & 0xF0 ) >> KHighNibbleShift; // bits XXXX____
       
   446     TUint8 characterSet = ( aDcs & 0x0C ) >> KQuarterShift;    // bits ____XX__
       
   447     TUint8 lowQuartet   = ( aDcs & 0x0F );                     // bits ____XXXX
       
   448 
       
   449     LOG2( SIMPLE, 
       
   450     "SATENGINE: CSatMultiModeApi::IsValidUssdDcs codingGroup: %x", codingGroup)
       
   451     LOG2( SIMPLE, 
       
   452     "SATENGINE: CSatMultiModeApi::IsValidUssdDcs charSet: %x", characterSet)
       
   453     LOG2( SIMPLE, 
       
   454         "SATENGINE: CSatMultiModeApi::IsValidUssdDcs lowQuartet: %x", lowQuartet)
       
   455 
       
   456     switch ( codingGroup )
       
   457         {
       
   458         case 0x00:
       
   459         case 0x02:
       
   460         case 0x03:
       
   461         case 0x0F:
       
   462             {
       
   463             isDcsValid = ETrue;
       
   464             break;
       
   465             }
       
   466 
       
   467         case 0x01:
       
   468             {
       
   469             if ( ( KDcsCharacterSet7Bit2 == lowQuartet ) ||
       
   470                  ( KDcsCharacterSet16Bit2 == lowQuartet ) )
       
   471                 {
       
   472                 isDcsValid = ETrue;
       
   473                 }
       
   474             break;
       
   475             }
       
   476 
       
   477         case 0x04:
       
   478         case 0x05:
       
   479         case 0x06:
       
   480         case 0x07:
       
   481         case 0x09:
       
   482             {
       
   483             if ( ( KDcsCharacterSet7Bit == characterSet ) ||
       
   484                  ( KDcsCharacterSet8Bit == characterSet ) ||
       
   485                  ( KDcsCharacterSet16Bit == characterSet ) )
       
   486                 {
       
   487                 isDcsValid = ETrue;
       
   488                 }
       
   489             break;
       
   490             }
       
   491 
       
   492         default:
       
   493             {
       
   494             LOG2( SIMPLE, "SATENGINE: CSatMultiModeApi::IsValidUssdDcs \
       
   495                     Reserved Dcs found: %x", aDcs )
       
   496             }
       
   497         }
       
   498 
       
   499     LOG2(
       
   500         SIMPLE,
       
   501         "SATENGINE: CSatMultiModeApi::IsValidUssdDcs exiting, valid = %d",
       
   502         isDcsValid )
       
   503     return isDcsValid;
       
   504     }
       
   505 
       
   506 // -----------------------------------------------------------------------------
   426 // CSatMultiModeApi::ConstructL
   507 // CSatMultiModeApi::ConstructL
   427 // -----------------------------------------------------------------------------
   508 // -----------------------------------------------------------------------------
   428 //
   509 //
   429 void CSatMultiModeApi::ConstructL()
   510 void CSatMultiModeApi::ConstructL()
   430     {
   511     {