455 OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONCACHE_USIMPBREQREAD, "CMmPhoneBookOperationCache::USimPbReqRead" ); |
457 OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONCACHE_USIMPBREQREAD, "CMmPhoneBookOperationCache::USimPbReqRead" ); |
456 |
458 |
457 |
459 |
458 TInt ret( KErrNone ); |
460 TInt ret( KErrNone ); |
459 TInt appFileID ( APPL_FILE_ID ); // Application File id for DFphonebook |
461 TInt appFileID ( APPL_FILE_ID ); // Application File id for DFphonebook |
460 // get the index to be read from phonebook |
|
461 TInt index( iIndexToRead ); |
|
462 |
462 |
463 TUiccReadLinearFixed cmdParams; |
463 TUiccReadLinearFixed cmdParams; |
464 cmdParams.messHandlerPtr = static_cast<MUiccOperationBase*> |
464 cmdParams.messHandlerPtr = static_cast<MUiccOperationBase*> |
465 ( iMmPhoneBookStoreMessHandler ); |
465 ( iMmPhoneBookStoreMessHandler ); |
466 |
466 |
467 cmdParams.filePath.Append( static_cast<TUint8>( MF_FILE >> 8 )); |
467 cmdParams.filePath.Append( static_cast<TUint8>( MF_FILE >> 8 )); |
468 cmdParams.filePath.Append( static_cast<TUint8>( MF_FILE )); |
468 cmdParams.filePath.Append( static_cast<TUint8>( MF_FILE )); |
469 cmdParams.filePath.Append( appFileID>>8); |
469 cmdParams.filePath.Append( appFileID>>8); |
470 cmdParams.filePath.Append( appFileID); |
470 cmdParams.filePath.Append( appFileID); |
471 cmdParams.filePath.Append( static_cast<TUint8>( DF_PHONEBOOK >> 8 )); |
471 |
472 cmdParams.filePath.Append( static_cast<TUint8>( DF_PHONEBOOK )); |
472 if( UICC_CARD_TYPE_UICC == iMmUiccMessHandler->GetCardType()) |
|
473 { |
|
474 cmdParams.filePath.Append( static_cast<TUint8>( DF_PHONEBOOK >> 8 )); |
|
475 cmdParams.filePath.Append( static_cast<TUint8>( DF_PHONEBOOK )); |
|
476 } |
473 |
477 |
474 // Convert Phone Book name to file id |
478 // Convert Phone Book name to file id |
475 TUint16 fileIdExt ( 0x0000 ); |
479 TUint16 fileIdExt ( 0x0000 ); |
476 TUint16 pbFileId = ConvertToPBfileId( iPhoneBookTypeName, fileIdExt ); |
480 TUint16 pbFileId = ConvertToPBfileId( iPhoneBookTypeName, fileIdExt, iMmUiccMessHandler->GetCardType() ); |
477 |
481 TUint8 pbArrayIndex = ConvertToConfArrayIndex( pbFileId ); |
478 // get the corect Location to be read from phone book |
482 |
479 if( PB_MBDN_FID == pbFileId) |
483 switch( pbFileId ) |
480 { |
484 { |
481 // Index to be read contains two types of information. |
485 case PB_ADN_FID: |
482 // The least significant byte contains the profile number |
486 case PB_FDN_FID: |
483 // and the most significant byte contains the type. |
487 case PB_SDN_FID: |
484 index = index || 0x0100; // Only subscriber profile number 1 is supported |
488 { |
485 } |
489 // For 2G ADN Phonebook EXT1 will be the extension number store |
486 |
490 cmdParams.trId = static_cast<TUiccTrId> ( aTransId ); |
487 switch( pbFileId ) |
491 cmdParams.serviceType = UICC_APPL_READ_LINEAR_FIXED; |
488 { |
492 cmdParams.record = aRecordNo; |
489 case PB_ADN_FID: |
|
490 { |
|
491 // For 2G ADN Phonebook EXT1 will be the extension number store |
|
492 cmdParams.trId = static_cast<TUiccTrId> ( aTransId ); |
|
493 cmdParams.serviceType = UICC_APPL_READ_LINEAR_FIXED; |
|
494 cmdParams.record = aRecordNo; |
|
495 |
493 |
496 // Check for Extension Data is Present or not |
494 // Check for Extension Data is Present or not |
497 if(!iExtensionToRead) |
495 if(!iExtensionToRead) |
|
496 { |
|
497 // Check for the record Number to be |
|
498 //read is valid record number |
|
499 if( iIndexToRead <= iMmPhoneBookStoreMessHandler-> |
|
500 iPBStoreConf[pbArrayIndex].iNoOfRecords) |
498 { |
501 { |
499 // Check for the record Number to be |
502 // Start from first location and Search for First Valid |
500 //read is valid record number |
503 //Entry in the Stored List And if some Entry is invalid |
501 if( iIndexToRead <= iMmPhoneBookStoreMessHandler-> |
504 // then Read From Sim and Check the Staus its Free |
502 iPBStoreConf[EPhonebookTypeAdn].iNoOfRecords) |
505 // or not till end of the records |
|
506 |
|
507 cmdParams.fileId = pbFileId; |
|
508 cmdParams.serviceType = UICC_APPL_READ_LINEAR_FIXED; |
|
509 cmdParams.record = aRecordNo; |
|
510 // till End of Record |
|
511 cmdParams.dataAmount = 0; |
|
512 // Start from begining of record |
|
513 cmdParams.dataOffset = 0; |
|
514 } |
|
515 else |
|
516 { |
|
517 ret = KErrNotFound; |
|
518 } |
|
519 } // end of if case for checking extension data |
|
520 else |
|
521 { |
|
522 // Send Request to Read Extension Data |
|
523 // Check for UST Table supports for EXT File |
|
524 if( iMmPhoneBookStoreMessHandler-> |
|
525 iPBStoreConf[pbArrayIndex].iExtension ) |
|
526 { |
|
527 // Check for Extension data record in valid |
|
528 if(iMmPhoneBookStoreMessHandler-> |
|
529 iPBStoreConf[pbArrayIndex].iExtNoOfRec >= aRecordNo) |
503 { |
530 { |
504 // Start from first location and Search for First Valid |
531 // Read Request to read that index |
505 //Entry in the Stored List And if some Entry is invalid |
532 cmdParams.fileId = fileIdExt; |
506 // then Read From Sim and Check the Staus its Free |
|
507 // or not till end of the records |
|
508 |
|
509 cmdParams.fileId = PB_ADN_FID; |
|
510 cmdParams.serviceType = UICC_APPL_READ_LINEAR_FIXED; |
533 cmdParams.serviceType = UICC_APPL_READ_LINEAR_FIXED; |
511 cmdParams.record = aRecordNo; |
534 cmdParams.record = aRecordNo; |
512 // till End of Record |
535 // till End of Record |
513 cmdParams.dataAmount = 0; |
536 cmdParams.dataAmount = 0; |
514 // Start from begining of record |
537 // Start from begining of record |
515 cmdParams.dataOffset = 0; |
538 cmdParams.dataOffset = 0; |
516 } |
539 } |
517 else |
540 else |
518 { |
541 { |
519 ret = KErrNotFound; |
|
520 } |
|
521 } // end of if case for checking extension data |
|
522 else |
|
523 { |
|
524 // Send Request to Read Extension Data |
|
525 // Check for UST Table supports for EXT File |
|
526 if( iMmPhoneBookStoreMessHandler-> |
|
527 iPBStoreConf[EPhonebookTypeAdn].iExtension ) |
|
528 { |
|
529 // Check for Extension data record in valid |
|
530 if(iMmPhoneBookStoreMessHandler-> |
|
531 iPBStoreConf[EPhonebookTypeAdn].iExtNoOfRec > aRecordNo) |
|
532 { |
|
533 // Read Request to read that index |
|
534 cmdParams.fileId = PB_EXT1_FID; |
|
535 cmdParams.serviceType = UICC_APPL_READ_LINEAR_FIXED; |
|
536 cmdParams.record = aRecordNo; |
|
537 // till End of Record |
|
538 cmdParams.dataAmount = 0; |
|
539 // Start from begining of record |
|
540 cmdParams.dataOffset = 0; |
|
541 } |
|
542 else |
|
543 { |
|
544 ret = KErrGeneral; |
|
545 } |
|
546 } |
|
547 else |
|
548 { |
|
549 ret = KErrGeneral; |
542 ret = KErrGeneral; |
550 } |
543 } |
551 } |
544 } |
|
545 else |
|
546 { |
|
547 ret = KErrGeneral; |
|
548 } |
|
549 } |
552 break; |
550 break; |
553 } |
551 } |
554 case PB_FDN_FID: |
552 default: |
555 { |
553 { |
556 // For FDN Phonebook EXT2 will be the extension number store |
|
557 cmdParams.trId = ETrIdPbReadFdn; |
|
558 cmdParams.fileId = PB_EXT2_FID; |
|
559 |
|
560 cmdParams.serviceType = UICC_APPL_READ_LINEAR_FIXED; |
|
561 cmdParams.record = aRecordNo; |
|
562 break; |
|
563 } |
|
564 default: |
|
565 { |
|
566 TFLOGSTRING("TSY: CMmPhoneBookOperationRead::USimPbReqRead - PhoenBook Not supported"); |
554 TFLOGSTRING("TSY: CMmPhoneBookOperationRead::USimPbReqRead - PhoenBook Not supported"); |
567 OstTrace0( TRACE_NORMAL, DUP1_CMMPHONEBOOKOPERATIONCACHE_USIMPBREQREAD, "CMmPhoneBookOperationCache::USimPbReqRead - PhoneBook not supported" ); |
555 OstTrace0( TRACE_NORMAL, DUP1_CMMPHONEBOOKOPERATIONCACHE_USIMPBREQREAD, "CMmPhoneBookOperationCache::USimPbReqRead - PhoneBook not supported" ); |
568 break; |
556 break; |
569 } |
557 } |
570 } |
558 } |
571 |
559 |
572 |
560 |
573 if( KErrNone == ret ) |
561 if( KErrNone == ret ) |
574 { |
562 { |
575 ret = iMmPhoneBookStoreMessHandler->UiccMessHandler()-> |
563 ret = iMmPhoneBookStoreMessHandler->UiccMessHandler()-> |
576 CreateUiccApplCmdReq( cmdParams ); |
564 CreateUiccApplCmdReq( cmdParams ); |
577 TFLOGSTRING2("TSY: CreateUiccApplCmdReq returns %d", ret); |
565 TFLOGSTRING2("TSY: CreateUiccApplCmdReq returns %d", ret); |
578 OstTraceExt1( TRACE_NORMAL, DUP2_CMMPHONEBOOKOPERATIONCACHE_USIMPBREQREAD, "CMmPhoneBookOperationCache::USimPbReqRead;ret=%hd", ret ); |
566 OstTraceExt1( TRACE_NORMAL, DUP2_CMMPHONEBOOKOPERATIONCACHE_USIMPBREQREAD, "CMmPhoneBookOperationCache::USimPbReqRead;ret=%hd", ret ); |
579 } |
567 } |
580 return ret; |
568 return ret; |
581 } |
569 } |
582 |
570 |
583 |
571 |
584 |
572 |