accessoryservices/pluggeddisplay/pluggeddisplayengine/src/hdmicablestaterejected.cpp
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 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:  Implementation of "Rejected" state of HDMI Cable Status FSM.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <e32def.h>
       
    21 #include <e32cmn.h>
       
    22 
       
    23 
       
    24 #include "pdeconstants.h"
       
    25 #include "hdmicablestatusfsm.h"
       
    26 #include "hdmicablestaterejected.h"
       
    27 #include "tvoutconfigforhdmi.h"
       
    28 #include "edidhandler.h"
       
    29 #include "trace.h"
       
    30 
       
    31 
       
    32 
       
    33 
       
    34 // ======== LOCAL FUNCTIONS ========
       
    35 
       
    36 
       
    37 // ======== MEMBER FUNCTIONS ========
       
    38 
       
    39 
       
    40 // ---------------------------------------------------------------------------
       
    41 //Symbian two-phased constructor
       
    42 // ---------------------------------------------------------------------------
       
    43 //
       
    44 CHDMICableStateRejected* CHDMICableStateRejected::NewL( 
       
    45         MFSMForState& aFSMForState, 
       
    46         CTVOutConfigForHDMI& aTVOutConfigForHDMI,
       
    47         CEDIDHandler& aEDIDHandler )
       
    48     {
       
    49     FUNC_LOG;
       
    50     CHDMICableStateRejected* self = new ( ELeave ) CHDMICableStateRejected(
       
    51             aFSMForState,
       
    52             aTVOutConfigForHDMI,
       
    53             aEDIDHandler );
       
    54     CleanupStack::PushL( self );
       
    55     self->ConstructL();
       
    56     CleanupStack::Pop( self );
       
    57     return self;
       
    58     }
       
    59 
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 // Destructor
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 CHDMICableStateRejected::~CHDMICableStateRejected()
       
    66     {
       
    67     FUNC_LOG;
       
    68     }
       
    69 
       
    70 
       
    71 // ---------------------------------------------------------------------------
       
    72 // From MFSMState.
       
    73 // ---------------------------------------------------------------------------
       
    74 //
       
    75 void CHDMICableStateRejected::Enter( )
       
    76     {
       
    77     FUNC_LOG;
       
    78     Name();
       
    79     iEDIDHandler.ResetData();
       
    80     iTVOutConfigForHDMI.ListenForDisconnection();
       
    81     }
       
    82 
       
    83 
       
    84 // ---------------------------------------------------------------------------
       
    85 // From MFSMState.
       
    86 // ---------------------------------------------------------------------------
       
    87 //
       
    88 void CHDMICableStateRejected::Input(
       
    89         TFSMInterfaceId aInterfaceId ,
       
    90         TFSMEventId aEvent )
       
    91     {
       
    92     FUNC_LOG;    
       
    93     switch ( aInterfaceId )
       
    94     {
       
    95     case EPDEIfTVOutConfig:
       
    96         {       
       
    97         INFO( "Interface: TPDEIfTVOutConfig" );        
       
    98         if ( EIfTVOutConfigEventCableDisconnected == aEvent ||  EIfTVOutConfigEventCableStatusListenFailed == aEvent )
       
    99             {
       
   100             INFO( "Event: EIfTVOutConfigEventCableDisconnected" );        
       
   101             iFSMForState.Transit( EHDMICableStateIdle ); 
       
   102             }
       
   103         else
       
   104             {
       
   105             INFO_1( "Unknown/unexpected Event Id: %i", aEvent );        
       
   106             }
       
   107         break;
       
   108         }
       
   109     default:
       
   110         {
       
   111         INFO_1( "Unknown/unexpected Interface Id: %i", aInterfaceId );        
       
   112         break;
       
   113         }
       
   114     }
       
   115     }
       
   116 
       
   117 
       
   118 // ---------------------------------------------------------------------------
       
   119 // From MFSMState.
       
   120 // ---------------------------------------------------------------------------
       
   121 //
       
   122 TFSMState CHDMICableStateRejected::Id()
       
   123     {
       
   124     FUNC_LOG;
       
   125     TFSMState tempStateId( EHDMICableStateRejected );
       
   126     INFO_1( "State's id: %i", tempStateId );
       
   127     return tempStateId;
       
   128     }
       
   129 
       
   130 // ---------------------------------------------------------------------------
       
   131 // From MFSMState.
       
   132 // ---------------------------------------------------------------------------
       
   133 //
       
   134 TPtrC CHDMICableStateRejected::Name()
       
   135     {
       
   136     FUNC_LOG;
       
   137     TPtrC temp( KHDMICableStateRejected );
       
   138     INFO_1( "State's name: %s", temp.Ptr() );
       
   139     return temp;
       
   140     }
       
   141 
       
   142 // ---------------------------------------------------------------------------
       
   143 // From MFSMState.
       
   144 // ---------------------------------------------------------------------------
       
   145 //
       
   146 TFSMState CHDMICableStateRejected::SubId()
       
   147     {
       
   148     FUNC_LOG;
       
   149     TFSMState tempSubstateId( iSubState );
       
   150     INFO_1( "Substate's id: %i", tempSubstateId );
       
   151     return tempSubstateId;
       
   152     }
       
   153 
       
   154 // ---------------------------------------------------------------------------
       
   155 // ConstructL
       
   156 // ---------------------------------------------------------------------------
       
   157 //
       
   158 void CHDMICableStateRejected::ConstructL()
       
   159     {
       
   160     FUNC_LOG;
       
   161     }
       
   162 
       
   163 
       
   164 // ---------------------------------------------------------------------------
       
   165 //  C++ constructor
       
   166 // ---------------------------------------------------------------------------
       
   167 //
       
   168 CHDMICableStateRejected::CHDMICableStateRejected(
       
   169         MFSMForState& aFSMForState, 
       
   170         CTVOutConfigForHDMI& aTVOutConfigForHDMI,
       
   171         CEDIDHandler& aEDIDHandler ):
       
   172     iFSMForState( aFSMForState ),
       
   173     iTVOutConfigForHDMI( aTVOutConfigForHDMI ),
       
   174     iEDIDHandler( aEDIDHandler )
       
   175         
       
   176     {
       
   177     FUNC_LOG;
       
   178     }
       
   179 
       
   180 
       
   181 // ======== GLOBAL FUNCTIONS ========
       
   182