telephonyserverplugins/simatktsy/inc/CSatNotifySendSm.h
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 /*
       
     2 * Copyright (c) 2005-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        : CSatNotifySendSm.h
       
    16 * Part of     : Common SIM ATK TSY / commonsimatktsy
       
    17 * Specific notifications class
       
    18 * Version     : 1.0
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 
       
    24 #ifndef CSATNOTIFYSENDSM_H
       
    25 #define CSATNOTIFYSENDSM_H
       
    26 
       
    27 
       
    28 //  INCLUDES
       
    29 #include <etelsat.h>
       
    30 #include "MSatNotificationsBase.h"
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CSatDataPackage;
       
    34 class CSatNotificationsTsy;
       
    35 class CBerTlv;
       
    36 /**
       
    37 * DESCRIPTION
       
    38 * SAT Send SM notification class.
       
    39 * Created when client requests to be notified when Send SM
       
    40 * command arrives from NAA.
       
    41 * @lib Commonsimatktsy
       
    42 * @since 3.1
       
    43 */
       
    44 NONSHARABLE_CLASS ( CSatNotifySendSm ) : public CBase,
       
    45                            public MSatNotificationsBase
       
    46     {
       
    47     public:   // Constructors and destructor
       
    48        
       
    49         /**
       
    50         * Two-phased constructor.
       
    51         * @param aNotificationsTsy: Pointer to NotificationsTsy
       
    52         * return created object 
       
    53         */
       
    54         static CSatNotifySendSm* NewL( 
       
    55         	CSatNotificationsTsy* aNotificationsTsy );
       
    56 
       
    57         /**
       
    58         * C++ Destructor.
       
    59         */
       
    60         ~CSatNotifySendSm();
       
    61 
       
    62 	private:
       
    63 	
       
    64         /**
       
    65         * By default C++ constructor is private.
       
    66         * @param aNotificationsTsy: Pointer to NotificationsTsy
       
    67         * @return None
       
    68         */
       
    69         CSatNotifySendSm( CSatNotificationsTsy* aNotificationsTsy );
       
    70 
       
    71         /**
       
    72         * Class attributes are created in ConstructL. 
       
    73         * @param None
       
    74         * @return None
       
    75         */
       
    76         void ConstructL();
       
    77 
       
    78     public: // Functions from base classes
       
    79 
       
    80         /**
       
    81         * Send Sm Notification request received from client
       
    82         * @param aTsyReqHandle: Request handle from ETel
       
    83         * @param aPackage: Packed data
       
    84         * @return KErrNone
       
    85         */
       
    86         TInt Notify( const TTsyReqHandle aTsyReqHandle,
       
    87             const TDataPackage& aPackage );
       
    88 
       
    89         /**
       
    90         * Cancels notification request for Send Sm.
       
    91         * @param aReqHandle: Notify request handle
       
    92         * @return KErrNone
       
    93         */
       
    94         TInt CancelNotification( const TTsyReqHandle aReqHandle );
       
    95                  
       
    96         /**
       
    97         * Completes Send Sm message to client
       
    98         * @param aDataPackage: Packaged return data
       
    99         * @param aErrorCode: Possible error code
       
   100         * @return KErrNone/ KErrCorrupt
       
   101         */
       
   102         TInt CompleteNotifyL( CSatDataPackage* aDataPackage, TInt aErrorCode );
       
   103 
       
   104         /**
       
   105         * From CSatNotificationsBase handles Send Sm terminal response 
       
   106         * coming from client.
       
   107         * @param aRsp: Response structure
       
   108         * @return KErrNone/ KErrCorrupt
       
   109         */
       
   110         TInt TerminalResponseL( TDes8* aRsp );
       
   111         
       
   112 	public: // New functions
       
   113 	
       
   114         /**
       
   115         * Create notification specific terminal response data
       
   116         * @param aPCmdNumber: Proactive command number
       
   117         * @param aGeneralResult: Result of the proactive command
       
   118         * @param aAdditionalInfo: Additional info for terminal response
       
   119         * @return Success/Failure value
       
   120         */
       
   121         TInt CreateTerminalRespL( TUint8 aPCmdNumber, TUint8 aGeneralResult,
       
   122             TDesC16& aAdditionalInfo );  
       
   123 
       
   124 	private: // New functions
       
   125 
       
   126 		/**
       
   127         * Set Alpha id and Address into send sm structure
       
   128         * @param aBerTlv: bertlv data
       
   129         * @param aSendSmV1: Etel sm structure
       
   130         * @return None
       
   131         */
       
   132 		void SetAlphaIdAndAddressData( CBerTlv* aBerTlv, 
       
   133 			RSat::TSendSmV1& aSendSmV1 );
       
   134 			
       
   135 		/**
       
   136         * Check TPDU validity
       
   137         * @param aTpdu: TPDU to be checked
       
   138         * @return KErrNone or KErrCorrupt
       
   139         */
       
   140         TInt CheckTpdu( TPtrC8 aTpdu );
       
   141 
       
   142 		/**
       
   143         * Get TP-UDL(User Data Length) field from Tpdu
       
   144         * @param aTpdu: Tpdu where to read TP-UDL or TP-CDL
       
   145         * @return TP-UDL
       
   146         */
       
   147         TUint8 GetTpUdl( TPtrC8 aTpdu );
       
   148 
       
   149 		/**
       
   150         * Get TP-DCS field from Tpdu
       
   151         * @param aTpdu: TPDU to be analyzed
       
   152         * @return TP-DCS
       
   153         */
       
   154         TUint8 GetTpDcs( TPtrC8 aTpdu );
       
   155 
       
   156 		/**
       
   157         * Pack SMS if it is required by the sim
       
   158         * @param aTpdu: Received Tpdu
       
   159         * @param aSendSm: Package where to store packed sms
       
   160         * @return KErrNone/KErrCorrupt
       
   161         */
       
   162         TInt PackSms( TPtrC8 aTpdu, TTpdu& aSendSm );
       
   163 
       
   164     private: // Data
       
   165 
       
   166         // Send Sm package store. Package received from ETel
       
   167         RSat::TSendSmV1Pckg* iSendSmV1Pckg;
       
   168         // Requested response format
       
   169         TUint8 iRequestedRspFormat;
       
   170         // Pointer to the notifications Tsy class
       
   171         CSatNotificationsTsy* iNotificationsTsy;
       
   172     };
       
   173 
       
   174 #endif // CSATNOTIFYSENDSM_H