eventsui/eventshandlerui/eventshandlerserver/src/evthandlerserversession.cpp
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2008 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:  session handling for Events Handler Server
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <AknGlobalNote.h> 	// CAknGlobalNote
       
    20 
       
    21 #include "evthandlerserverconsts.h"
       
    22 #include "evthandlerclientserver.h"
       
    23 #include "evthandlerserverpanic.h"
       
    24 #include "evtdebug.h"
       
    25 
       
    26 #include "evthandlerserversession.h"
       
    27 
       
    28 // ---------------------------------------------------------------------------
       
    29 // CEvtHandlerServerSession::CreateL()
       
    30 // ---------------------------------------------------------------------------
       
    31 //
       
    32 void CEvtHandlerServerSession::CreateL()
       
    33 	{
       
    34 	}
       
    35 
       
    36 // ---------------------------------------------------------------------------
       
    37 // CEvtHandlerServerSession::~CEvtHandlerServerSession()
       
    38 // ---------------------------------------------------------------------------
       
    39 //
       
    40 CEvtHandlerServerSession::~CEvtHandlerServerSession()
       
    41 	{
       
    42 	}
       
    43 
       
    44 // ---------------------------------------------------------------------------
       
    45 // CEvtHandlerServerSession::ServiceL()
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 void CEvtHandlerServerSession::ServiceL( const RMessage2& aMessage )
       
    49 	{
       
    50     EVTUIDEBUG( "+ CEvtHandlerServerSession::ServiceL()" );
       
    51     TInt function = aMessage.Function();
       
    52 	switch ( function )
       
    53 		{
       
    54 		case ESendEventId:
       
    55 			{
       
    56 			EVTUIDEBUG( "Received Client Message" );
       
    57 			// Read the Event ID from the message structure
       
    58             TBuf<KMaxEvtHandlerMessage> message;
       
    59             aMessage.ReadL( 0, message );
       
    60 			
       
    61             TInt64 eventId = 0;	
       
    62             TLex lex( message );
       
    63             User::LeaveIfError( lex.Val( eventId ));	
       
    64 			
       
    65 			// Get the Accuracy Value
       
    66 			TInt accuracy = aMessage.Int1();
       
    67 				
       
    68 			// Pass it along to the server to handle the message
       
    69 			Server().HandleNewEventL( eventId, accuracy );
       
    70 		    
       
    71 		    // Successful handling complete. Complete the outstanding message
       
    72 		    aMessage.Complete( KErrNone );	
       
    73 			break;
       
    74 			}
       
    75 		default:
       
    76 			{
       
    77 			aMessage.Complete( KErrArgument );
       
    78 			break;
       
    79 			}
       
    80 		}
       
    81     EVTUIDEBUG( "- CEvtHandlerServerSession::ServiceL()" );
       
    82 	}
       
    83 
       
    84 // ---------------------------------------------------------------------------
       
    85 // CEvtHandlerServerSession::ServiceError()
       
    86 // ---------------------------------------------------------------------------
       
    87 //
       
    88 void CEvtHandlerServerSession::ServiceError( 
       
    89                                     const RMessage2& aMessage, 
       
    90                                           TInt      aError )
       
    91 	{
       
    92     EVTUIDEBUG( "+ CEvtHandlerServerSession::ServiceError()" );
       
    93 	aMessage.Complete( aError );
       
    94     EVTUIDEBUG( "- CEvtHandlerServerSession::ServiceError()" );
       
    95 	}
       
    96 
       
    97 // End of File