buildverification/smoketest/Timew/ConsoleAlarmAlertServer/Source/ConsoleAlarmAlertServer.cpp
changeset 0 9736f095102e
equal deleted inserted replaced
-1:000000000000 0:9736f095102e
       
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "consolealarmalertserver.h"
       
    17 
       
    18 // System includes
       
    19 
       
    20 // User includes
       
    21 #include "asaltdefs.h"
       
    22 //
       
    23 #include "consolealarmalertsession.h"
       
    24 
       
    25 // Type definitions
       
    26 
       
    27 // Constants
       
    28 
       
    29 // Enumerations
       
    30 
       
    31 // Classes referenced
       
    32 
       
    33 // The Console Alarm Alert Server is migrated to a secure server in EKA2
       
    34 #include <e32base.h>
       
    35 
       
    36 
       
    37 
       
    38 const TUint KRangeCount = 1; 
       
    39 
       
    40 const TInt KOpCodeRanges[KRangeCount] = 
       
    41 	{	
       
    42 	0 // All Op Codes  from 0 to KMaxInt should pass. No restrictions	
       
    43 	};
       
    44 
       
    45 
       
    46 const TUint8 KElementsIndex[KRangeCount] =
       
    47 	{
       
    48 	CPolicyServer::EAlwaysPass, 	//All OP Codes Allways passing no capability required 
       
    49 	};
       
    50 
       
    51 
       
    52 const CPolicyServer::TPolicy KConsoleAlarmAlertServerPolicy =
       
    53 	{
       
    54 	CPolicyServer::EAlwaysPass, //specifies all connect attempts should pass
       
    55 	KRangeCount,
       
    56 	KOpCodeRanges,
       
    57 	KElementsIndex, 	// what each range is compared to 
       
    58 	KNullHandle			//Since we have no specific policy checking
       
    59 	};
       
    60  	
       
    61 
       
    62 
       
    63 //
       
    64 // ----> CConsoleAlarmAlertServer (source)
       
    65 //
       
    66 
       
    67 //*************************************************************************************
       
    68 CConsoleAlarmAlertServer::CConsoleAlarmAlertServer()
       
    69  	:CPolicyServer(CActive::EPriorityStandard, KConsoleAlarmAlertServerPolicy), iInstructionSet(NULL)
       
    70 	{
       
    71 	}
       
    72 
       
    73 
       
    74 
       
    75 //*************************************************************************************
       
    76 CConsoleAlarmAlertServer::~CConsoleAlarmAlertServer()
       
    77 	{
       
    78 	if (iAttachment)
       
    79 		delete iAttachment;	
       
    80 	}
       
    81 
       
    82 
       
    83 //*************************************************************************************
       
    84 void CConsoleAlarmAlertServer::ConstructL()
       
    85 	{
       
    86 	StartL(KAlarmAlertServerName);
       
    87 	}
       
    88 
       
    89 
       
    90 //*************************************************************************************
       
    91 CConsoleAlarmAlertServer* CConsoleAlarmAlertServer::NewLC()
       
    92 	{
       
    93 	CConsoleAlarmAlertServer* self = new(ELeave) CConsoleAlarmAlertServer();
       
    94 	CleanupStack::PushL(self);
       
    95 	self->ConstructL();
       
    96 	return self;
       
    97 	}
       
    98 
       
    99 //
       
   100 //
       
   101 //
       
   102 
       
   103 
       
   104 //*************************************************************************************
       
   105 CSession2* CConsoleAlarmAlertServer::NewSessionL(const TVersion& aVersion,const RMessage2& /*aMessage*/) const
       
   106 	{
       
   107 	const TVersion KServerVersion(KASAltVersionMajor, KASAltVersionMinor, KASAltVersionBuild);
       
   108 	if	(!User::QueryVersionSupported(KServerVersion, aVersion))
       
   109 		User::Leave(KErrNotSupported);
       
   110 	//
       
   111 	return CConsoleAlarmAlertSession::NewL((CConsoleAlarmAlertServer*)this);
       
   112 	}
       
   113 
       
   114 
       
   115 //
       
   116 //
       
   117 //
       
   118 
       
   119 
       
   120 //*************************************************************************************
       
   121 TInt CConsoleAlarmAlertServer::RunError(TInt /*Error*/)
       
   122 	{
       
   123 	return KErrNone;
       
   124 	}
       
   125 
       
   126 void CConsoleAlarmAlertServer::SetAttachment(HBufC8* data)
       
   127 	{
       
   128 	if (iAttachment)
       
   129 		delete iAttachment;
       
   130 	iAttachment = data;
       
   131 	}