telephonyserverplugins/simatktsy/inc/CSatNotifyLocalInfo.h
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 /*
       
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Name        : CSatNotifyLocalInfo.h
       
    16 * Part of     : Common SIM ATK TSY / commonsimatktsy
       
    17 * Specific notifications class
       
    18 * Version     : 1.0
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 
       
    24 #ifndef CSATNOTIFYLOCALINFO_H
       
    25 #define CSATNOTIFYLOCALINFO_H
       
    26 
       
    27 
       
    28 //  INCLUDES
       
    29 #include "MSatNotificationsBase.h"  // The base class header
       
    30 #include "TSatUtility.h"            // For operator code length
       
    31 #include "CSatNotificationsTsy.h"   // For Local Information
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CSatDataPackage;
       
    35 class TTlv;
       
    36 
       
    37 
       
    38 /**
       
    39 * DESCRIPTION
       
    40 * SAT Notify local information notification class.
       
    41 * This command is handled completely in the TSY and does not require any 
       
    42 * interaction with the Symbian OS side.
       
    43 * @lib Commonsimatktsy
       
    44 * @since 3.1 
       
    45 */
       
    46 NONSHARABLE_CLASS ( CSatNotifyLocalInfo ) : public CBase,
       
    47                               public MSatNotificationsBase
       
    48     {	        
       
    49     public:  // Constructors and destructor
       
    50         
       
    51         /**
       
    52         * Two-phased constructor.
       
    53         * @param aNotificationsTsy: Pointer to NotificationsTsy
       
    54         * @return created object 
       
    55         */
       
    56         static CSatNotifyLocalInfo* NewL( 
       
    57         	CSatNotificationsTsy* aNotificationsTsy );
       
    58 
       
    59         /**
       
    60         * C++ Destructor.
       
    61         */
       
    62         ~CSatNotifyLocalInfo();
       
    63 
       
    64 	private:
       
    65         /**
       
    66         * By default C++ constructor is private.
       
    67         * @param aNotificationsTsy: Pointer to NotificationsTsy
       
    68         */
       
    69         CSatNotifyLocalInfo( CSatNotificationsTsy* aNotificationsTsy );
       
    70 
       
    71         /**
       
    72         * Class attributes are created in ConstructL. 
       
    73         */
       
    74         void ConstructL();
       
    75 
       
    76     public: // Functions from base classes
       
    77                 
       
    78         /**
       
    79         * Notification request received from client
       
    80         * @param aTsyReqHandle: request handle from ETel
       
    81         * @param aPackage: Packed data
       
    82         * @return KErrNone
       
    83         */
       
    84         TInt Notify( const TTsyReqHandle aTsyReqHandle,
       
    85             const TDataPackage& aPackage );
       
    86 
       
    87         /**
       
    88         * Cancels notification request about Local info.
       
    89         * @param aReqHandle: Notify request handle
       
    90         * @return KErrNone
       
    91         */
       
    92         TInt CancelNotification( const TTsyReqHandle aReqHandle );
       
    93         
       
    94         /**
       
    95         * Completes the notification request received from client
       
    96         * @param aDataPackage: Packaged return data
       
    97         * @param aErrorCode: Possible error code
       
    98         * @return KErrNone/KErrCorrupt
       
    99         */
       
   100         TInt CompleteNotifyL( CSatDataPackage* aDataPackage, TInt aErrorCode );
       
   101 
       
   102         /**
       
   103         * Handles the Local info terminal response
       
   104         * @param aRsp: Response structure
       
   105         * @return KErrNone/ KErrCorrupt
       
   106         */
       
   107         TInt TerminalResponseL( TDes8* aRsp );
       
   108                                  
       
   109     public: // New methods 
       
   110     
       
   111         /**
       
   112         * Create notification specific terminal response data
       
   113         * @param aPCmdNumber: Proactive command number
       
   114         * @param aGeneralResult: Result of the proactive command
       
   115         * @param aAdditionalInfo: Additional info for terminal response
       
   116         * @return Success/Failure value
       
   117         */
       
   118         TInt CreateTerminalRespL( TUint8 aPCmdNumber, TUint8 aGeneralResult,
       
   119                                  TDesC16& aAdditionalInfo );    
       
   120         
       
   121         /**
       
   122         * Unpacks local info response data, calls CreateTerminalRespL
       
   123         * @param aDataPackage: terminal response data
       
   124         * @param aErrorCode: Possible error code    
       
   125         * @return KErrNone
       
   126         */
       
   127         TInt CompleteTerminalRespDataL( CSatDataPackage* aDataPackage, 
       
   128                                		TInt aErrorCode );
       
   129         /**
       
   130         * Update local info data
       
   131         * @param aDataPackage: Packed location area code, cell id and operator
       
   132         * code
       
   133         * @param aErrorCode: Possible error code        
       
   134         */                               
       
   135 		void CompleteUpdateLocalInfo( CSatDataPackage* aDataPackage, 
       
   136                                		TInt aErrorCode );
       
   137         /**
       
   138         * Update NMR and BCCHChannel list
       
   139         * @param aDataPackage: Packed NMR and BCCH channel list
       
   140         * @param aErrorCode: Possible error code        
       
   141         */                                                                                           
       
   142 		void CompleteUpdateNetInfo( CSatDataPackage* aDataPackage, 
       
   143                        				TInt aErrorCode );
       
   144         /**
       
   145         * Update Timing advance and ME status
       
   146         * @param aDataPackage: Packed timing advance and ME status
       
   147         * @param aErrorCode: Possible error code        
       
   148         */                        		
       
   149 		void CompleteUpdateTimingAdvAndMEStatus( CSatDataPackage* aDataPackage, 
       
   150                        				TInt aErrorCode );
       
   151         /**
       
   152         * Update Current access technology
       
   153         * @param aDataPackage: Packed access technology
       
   154         * @param aErrorCode: Possible error code        
       
   155         */                        		
       
   156         void CompleteUpdateAccTech( CSatDataPackage* aDataPackage, 
       
   157                        				TInt aErrorCode );
       
   158         /**
       
   159         * Update IMEI
       
   160         * @param aDataPackage: Packed IMEI
       
   161         * @param aErrorCode: Possible error code        
       
   162         */                        		
       
   163         void CompleteUpdateIMEI( CSatDataPackage* aDataPackage, 
       
   164                        				TInt aErrorCode );
       
   165         /**
       
   166         * Update Timezone
       
   167         * @param aDataPackage: Packed timezone
       
   168         * @param aErrorCode: Possible error code        
       
   169         */                         		  
       
   170         void CompleteUpdateTimeZone( CSatDataPackage* aDataPackage,
       
   171                        				TInt aErrorCode );
       
   172                        				
       
   173         /**
       
   174         * Returns the current local info data
       
   175         * @return Location info: Location area code, Operator code and Cell ID
       
   176         */
       
   177         const CSatNotificationsTsy::TLocalInformation& LocalInformation();
       
   178         
       
   179     private:
       
   180 
       
   181         /**
       
   182         * Set Date, Time and Timezone into local info structure
       
   183         */     
       
   184     	void SetDateTimeTimeZone();  
       
   185 
       
   186         /**
       
   187         * Sets NMR and BCCHChannelList to tlv data
       
   188         * @param aTlvSpecificData: tlv data structure   
       
   189         */
       
   190 		void SetInformationNmr( TTlv* aTlvSpecificData );
       
   191 		    	                 		                       	
       
   192     private:    // Data
       
   193 	
       
   194 		// Flag
       
   195         TBool iLocalInfoIsOngoing;
       
   196         // Timing advance
       
   197         TUint8 iTimingAdvance;
       
   198         // Time zone            
       
   199         TUint8 iTimeZone;
       
   200         // Imei code
       
   201         TBuf8<16> iIMEI;
       
   202         // Location info data 
       
   203         CSatNotificationsTsy::TLocalInformation iLocalInformation;
       
   204         // Network measurement result
       
   205         TBuf8<16> iNMR;
       
   206         // For storing BCCH channel list 
       
   207         TBuf<32> iBCCHChannelList;
       
   208         // Variable for storing ME Status
       
   209         TUint8 iMEStatus;
       
   210         // Variable for storing Current Access Technology
       
   211         TUint8 iCurrentAccTech;
       
   212         // Notify Local Info struct. Package allocated
       
   213         // in this class and received from ETel
       
   214         RSat::TLocalInfoV3Pckg* iLocalInfoV3Pckg; 
       
   215         // Response package
       
   216         RSat::TLocalInfoRspV3 iLocalInfoRspV3;
       
   217         // Pointer to the notifications Tsy class
       
   218         CSatNotificationsTsy* iNotificationsTsy;
       
   219 
       
   220     };
       
   221 
       
   222 #endif // CSATNOTIFYLOCALINFO_H