adaptationlayer/tsy/nokiatsy_dll/inc/cmmuiccmesshandler.h
changeset 5 8ccc39f9d787
parent 0 63b37f68c1ce
child 8 6295dc2169f3
equal deleted inserted replaced
4:510c70acdbf6 5:8ccc39f9d787
    33 
    33 
    34 // CONSTANTS
    34 // CONSTANTS
    35 const TUint8 KFilePathLength( 16 );
    35 const TUint8 KFilePathLength( 16 );
    36 const TUint8 KFileDataLength( 200 );
    36 const TUint8 KFileDataLength( 200 );
    37 const TUint16 KApduDataLength( 270 );
    37 const TUint16 KApduDataLength( 270 );
       
    38 
       
    39 // Constants for descriptors in 3G SIM
       
    40 const TUint8 KFileDescriptor( 0x82 );
       
    41 const TUint8 KFileIdentifier( 0x83 );
       
    42 const TUint8 KFileSize( 0x80 );
       
    43 const TUint8 KPINStatusTemplateDO( 0xC6 );
       
    44 
       
    45 // Constants for descriptors in 2G SIM
       
    46 const TUint8 KFileStatus( 11 );
       
    47 const TUint8 KRecordLength2( 14 );
       
    48 const TUint8 KFileSize2( 2 );
       
    49 const TUint8 KFileId( 4 );
       
    50 
    38 
    51 
    39 // UICC master file
    52 // UICC master file
    40 const TUint16 KMasterFileId( 0x3F00 );
    53 const TUint16 KMasterFileId( 0x3F00 );
    41 
    54 
    42 // ADFusim
    55 // ADFusim
    72 const TUint16 KElemFileMessageWaitingIndStatus    ( 0x6FCA );
    85 const TUint16 KElemFileMessageWaitingIndStatus    ( 0x6FCA );
    73 const TUint16 KElemSimServiceTable                ( 0x6F38 );
    86 const TUint16 KElemSimServiceTable                ( 0x6F38 );
    74 const TUint16 KElemGba                            ( 0x6FD6 );
    87 const TUint16 KElemGba                            ( 0x6FD6 );
    75 const TUint16 KElemEst                            ( 0x6F56 );
    88 const TUint16 KElemEst                            ( 0x6F56 );
    76 const TUint16 KElemCphsInformation                ( 0x6F16 );
    89 const TUint16 KElemCphsInformation                ( 0x6F16 );
       
    90 const TUint16 KElemFileSmsParams                  ( 0x6F42 );
       
    91 const TUint16 KElemFileAcl                        ( 0x6F57 );
       
    92 const TUint16 KElemFileOpl                        ( 0x6FC6 );
       
    93 const TUint16 KElemFilePlmnNetworkName            ( 0x6FC5 );
       
    94 const TUint16 KElemFileFixedDiallingNumbers       ( 0x6F3B );
       
    95 const TUint16 KElemEmergencyCallCodes             ( 0x6FB7 );
    77 
    96 
    78 const TUint8 KEfSstSize (0xFF);
    97 const TUint8 KEfSstSize (0xFF);
    79 const TUint8 KEfUstSize (0xFF);
    98 const TUint8 KEfUstSize (0xFF);
    80 const TUint8 KEfCphsInfoSize (0xFF);
    99 const TUint8 KEfCphsInfoSize (0xFF);
       
   100 
       
   101 const TUint8 KMaxPbTrIdCount (20);
    81 
   102 
    82 // Unique transaction IDs for all UICC operations
   103 // Unique transaction IDs for all UICC operations
    83 enum TUiccTrId
   104 enum TUiccTrId
    84     {
   105     {
    85     ETrIdNotDefined = 0,
   106     ETrIdNotDefined = 0,
   147     ETrIdReadSMS,
   168     ETrIdReadSMS,
   148     ETrIdWriteSMS,
   169     ETrIdWriteSMS,
   149     ETrIdReadSMSRecordCount,
   170     ETrIdReadSMSRecordCount,
   150     ETrIdReadSMSForComplete,     // 65
   171     ETrIdReadSMSForComplete,     // 65
   151     ETrIdPbInit,
   172     ETrIdPbInit,
   152     ETrIdPbInitFDN,
   173     ETrIdPbReadAdn,
   153     ETrIdPbRead,
   174     ETrIdPbReadFdn,
   154     ETrIdPbReadADN,
   175     ETrIdPbReadSdn,
   155     ETrIdPbUpdate,              // 70
   176     ETrIdPbUpdate,              // 70
   156     ETrIdPbDelete,
   177     ETrIdPbDelete,
   157     ETrIdSetFdnStateReadEst,
   178     ETrIdSetFdnStateReadEst,
   158     ETrIdSetFdnStateWriteEst,
   179     ETrIdSetFdnStateWriteEst,
   159     ETrIdSetFdnIcc,
   180     ETrIdSetFdnIcc,
   160     ETrIdSetFdnStateReadFileInfo, // 75
   181     ETrIdSetFdnStateReadFileInfo, // 75
   161     ETrIdGetFdnStateReadEst,
   182     ETrIdGetFdnStateReadEst,
   162     ETrIdGetFdnStateReadFileInfo,
   183     ETrIdGetFdnStateReadFileInfo,
   163     ETrIdCphsCache,
   184     ETrIdCphsCache,
       
   185     ETrIdDeleteSMS,
       
   186     ETrIdDeleteAllSMSs,
       
   187     ETrIdUpdateSMSStatusReadSMS,
       
   188     ETrIdUpdateSMSStatusWriteSMS,
       
   189     ETrIdGetSmspEntries,
       
   190     ETrIdWriteSmspEntry,
       
   191     ETrIdPbReadMbdn,             //85
       
   192     ETrIdPbReadVmbx,
       
   193     ETrIdPbReadBdn,
       
   194     ETrIdPbOperationStart,       // 88
       
   195     ETrIdPbOperationEnd = ETrIdPbOperationStart+KMaxPbTrIdCount,  // Transaction Id inbetween used by Phonebook operations
       
   196     ETrIdReadOplRecordCount,
       
   197     ETrIdReadOplRecord, // 110
       
   198     ETrIdAclStatusReadEfEst,
       
   199     ETrIdAclStatusWriteEfEst,
       
   200     ETrIdAclReadEfAcl,
       
   201     ETrIdAclWriteEfAcl,
       
   202     ETrIdReadOperatorName, // 115
       
   203     ETrIdReadPnn,
       
   204     ETrIdEnStoreRead,
       
   205     ETrIdEnStoreGetInfo,
   164     ENumOfUiccTrIds
   206     ENumOfUiccTrIds
   165     };
   207     };
   166 
   208 
   167 // Common parameters needed in UICC_APPL_READ_TRANSPARENT,
   209 // Common parameters needed in UICC_APPL_READ_TRANSPARENT,
   168 // UICC_APPL_UPDATE_TRANSPARENT, UICC_APPL_READ_LINEAR_FIXED,
   210 // UICC_APPL_UPDATE_TRANSPARENT, UICC_APPL_READ_LINEAR_FIXED,
   178         MUiccOperationBase* messHandlerPtr; // Pointer to message handler
   220         MUiccOperationBase* messHandlerPtr; // Pointer to message handler
   179         TUiccTrId trId; // Unique transaction ID for every UICC operation
   221         TUiccTrId trId; // Unique transaction ID for every UICC operation
   180         TUint16 fileId; // ID of elementary file
   222         TUint16 fileId; // ID of elementary file
   181         TUint8 fileIdSfi; // Filled only in case SFI is present
   223         TUint8 fileIdSfi; // Filled only in case SFI is present
   182         TUint8 serviceType; // UICC service type
   224         TUint8 serviceType; // UICC service type
   183         TBuf8<KFilePathLength> filePath; // Elementary file path, (DF ) + EF
   225         TBuf8<KFilePathLength> filePath; // Elementary file path + DF
   184                                         // If same as fileId, no need to fill
       
   185     } ;
   226     } ;
   186 
   227 
   187 // Parameters needed in UICC_APPL_FILE_INFO
   228 // Parameters needed in UICC_APPL_FILE_INFO
   188 class TUiccApplFileInfo: public TUiccParamsBase
   229 class TUiccApplFileInfo: public TUiccParamsBase
   189     {
   230     {
   256         // Data
   297         // Data
   257         TUint8 action; //   UICC_SB_APDU_ACTIONS / Action
   298         TUint8 action; //   UICC_SB_APDU_ACTIONS / Action
   258         // Data
   299         // Data
   259         TBuf8<KApduDataLength> apduData; // APDU data
   300         TBuf8<KApduDataLength> apduData; // APDU data
   260     } ;
   301     } ;
       
   302 
       
   303 /**
       
   304 *  Class used to handle FCI data.
       
   305 */
       
   306 class TFci
       
   307 {
       
   308 private:
       
   309     const TDesC8& iData; // == aFileData
       
   310 
       
   311     /**
       
   312     * Returns length of the FCI sub block
       
   313     * @return TInt
       
   314     */
       
   315     TInt GetLength();
       
   316 
       
   317 public:
       
   318 
       
   319     /**
       
   320     * Returns type of the card
       
   321     * @return TUint8
       
   322     */
       
   323     TUint8 GetTypeOfCard();
       
   324 
       
   325     /**
       
   326     * Returns type offset of the TLV in FCI sub block
       
   327     * @param TUint8 aDescription
       
   328     * @return TUint8
       
   329     */
       
   330     TInt GetOffsetOfTLV( TUint8 aDescription );
       
   331 
       
   332     /**
       
   333     * Returns number of the records on SIM
       
   334     * @return TInt
       
   335     */
       
   336     TInt GetNumberOfRecords();
       
   337 
       
   338     /**
       
   339     * Returns length of the record on SIM
       
   340     * @return TInt
       
   341     */
       
   342     TInt GetRecordLength();
       
   343 
       
   344     /**
       
   345     * Returns file size on SIM
       
   346     * @return TInt
       
   347     */
       
   348     TInt GetSizeOfFile();
       
   349 
       
   350     /**
       
   351     * Returns file identifier on SIM
       
   352     * @return TInt
       
   353     */
       
   354     TInt GetFileIdentifier();
       
   355 
       
   356     /**
       
   357     * Returns file status on SIM (ICC)
       
   358     * @return TInt
       
   359     */
       
   360     TUint8 GetFileStatus();
       
   361 
       
   362     // Constructor (the whole FCI sub block is given as the parameter).
       
   363     TFci( const TDesC8& aFCI_sb )
       
   364     :iData( aFCI_sb )
       
   365     {
       
   366     }
       
   367     // Destructor
       
   368     ~TFci()
       
   369     {
       
   370     }
       
   371 
       
   372 } ;
   261 
   373 
   262 // FORWARD DECLARATIONS
   374 // FORWARD DECLARATIONS
   263     class CMmPhoNetSender;
   375     class CMmPhoNetSender;
   264     class CMmPhoNetReceiver;
   376     class CMmPhoNetReceiver;
   265     class CMmMessageRouter;
   377     class CMmMessageRouter;
   372         TInt CreateUiccCardReq( const TUiccParamsBase& aParams );
   484         TInt CreateUiccCardReq( const TUiccParamsBase& aParams );
   373 
   485 
   374         /**
   486         /**
   375         * Caches SIM service table (EFust or EFsst depending
   487         * Caches SIM service table (EFust or EFsst depending
   376         * on card type in use)
   488         * on card type in use)
       
   489         * @param aComplete Information if complete is needed
   377         * @return none
   490         * @return none
   378         */
   491         */
   379         void InitializeSimServiceTableCache();
   492         void InitializeSimServiceTableCache( TBool aComplete = ETrue );
   380 
   493 
   381         /**
   494         /**
   382         * Gets service status from service table
   495         * Gets service status from service table
   383         * (from EFust or EFsst depending on card type)
   496         * (from EFust or EFsst depending on card type)
   384         * on card type in use)
   497         * on card type in use)
   400         * @return KErrNone or error code
   513         * @return KErrNone or error code
   401         */
   514         */
   402         TInt ProcessUiccMsg(
   515         TInt ProcessUiccMsg(
   403             TInt aTraId,
   516             TInt aTraId,
   404             TInt aStatus,
   517             TInt aStatus,
       
   518             TUint8 aDetails,
   405             const TDesC8& aFileData );
   519             const TDesC8& aFileData );
   406 
   520 
   407         /**
   521         /**
   408         * Checks is ISim application found during boot
   522         * Checks is ISim application found during boot
   409         * @return TBool ETrue if ISIM application found, otherwise EFalse
   523         * @return TBool ETrue if ISIM application found, otherwise EFalse
   446         * (CPHS information is read form elementary file CPHS Information.
   560         * (CPHS information is read form elementary file CPHS Information.
   447         * file identifies is 0x6F16 )
   561         * file identifies is 0x6F16 )
   448         * @return ETrue if service supported, otherwise EFalse
   562         * @return ETrue if service supported, otherwise EFalse
   449         */
   563         */
   450         TBool GetCphsInformationStatus( TUint8 aServiceNo );
   564         TBool GetCphsInformationStatus( TUint8 aServiceNo );
       
   565 
       
   566         /**
       
   567         * Length of FCI (File Control Info)
       
   568         * @param aFileData Descriptor for file data
       
   569         * @return length
       
   570         */
       
   571         TInt GetUICCFCILength( const TDesC8& aFileData );
       
   572 
       
   573         /**
       
   574         * UICC card type
       
   575         * @param aFileData Descriptor for file data
       
   576         * @return UICC card type
       
   577         */
       
   578         TUint8 GetUICCCardType( const TDesC8& aFileData );
       
   579 
       
   580         /**
       
   581         * Index of data if searched by the description of file.
       
   582         * @param description Description
       
   583         * @param aFileData Descriptor for file data
       
   584         * @return index, zero is returned if description is not found.
       
   585         */
       
   586         TInt ReturnIndexOfData( const TUint8 aDescription,
       
   587                                 const TDesC8& aFileData );
       
   588 
       
   589         /**
       
   590         * UICC Get number of records
       
   591         * @param aFileData Descriptor for file data
       
   592         * @return UICC card type
       
   593         */
       
   594         TInt GetUICCNumberOfRecords( const TDesC8& aFileData );
       
   595 
       
   596         /**
       
   597         * UICC Get record length
       
   598         * @param aFileData Descriptor for file data
       
   599         * @return UICC card type
       
   600         */
       
   601         TInt GetUICCRecordLength( const TDesC8& aFileData );
       
   602 
       
   603         /**
       
   604         * UICC Get size of the file
       
   605         * @param aFileData Descriptor for file data
       
   606         * @return UICC card type
       
   607         */
       
   608         TInt GetUICCFileSize( const TDesC8& aFileData );
       
   609 
       
   610         /**
       
   611         * UICC Get file identifier
       
   612         * @param aFileData Descriptor for file data
       
   613         * @return UICC card type
       
   614         */
       
   615         TInt GetUICCFileIdentifier( const TDesC8& aFileData );
       
   616 
       
   617         /**
       
   618         * Get UICC client ID
       
   619         * @return UICC client ID
       
   620         */
       
   621         TUint8 GetUiccClientId();
   451 
   622 
   452     public: // Functions from base classes
   623     public: // Functions from base classes
   453 
   624 
   454     protected:  // New functions
   625     protected:  // New functions
   455 
   626 
   663         TBuf8<KEfCphsInfoSize> iCPHSInformation;
   834         TBuf8<KEfCphsInfoSize> iCPHSInformation;
   664         // Store AID of active application
   835         // Store AID of active application
   665         RMobilePhone::TAID iAid;
   836         RMobilePhone::TAID iAid;
   666         // Store active PIN
   837         // Store active PIN
   667         RMobilePhone::TMobilePhoneSecurityCode iActivePin;
   838         RMobilePhone::TMobilePhoneSecurityCode iActivePin;
       
   839         // Flag to indicate should EMmTsyBootNotifySimStatusReadyIPC be
       
   840         // completed when service table has been cached
       
   841         TBool iCompleteSimStatusReady;
   668 
   842 
   669     };
   843     };
   670 
   844 
   671 #endif      // _CMMUICCMESSHANDLER_
   845 #endif      // _CMMUICCMESSHANDLER_
   672 
   846