0
|
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 the License "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 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// INCLUDE FILES
|
|
19 |
#include "cusbpnserversession.h"
|
|
20 |
#include "cusbpnserver.h"
|
|
21 |
#include "usbpndefinitions.h"
|
|
22 |
#include "usbpntrace.h"
|
|
23 |
|
|
24 |
#include "osttracedefinitions.h"
|
|
25 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
26 |
#include "cusbpnserversessionTraces.h"
|
|
27 |
#endif
|
|
28 |
|
|
29 |
// EXTERNAL DATA STRUCTURES
|
|
30 |
// EXTERNAL FUNCTION PROTOTYPES
|
|
31 |
// CONSTANTS
|
|
32 |
// MACROS
|
|
33 |
// LOCAL CONSTANTS AND MACROS
|
|
34 |
// MODULE DATA STRUCTURES
|
|
35 |
// LOCAL FUNCTION PROTOTYPES
|
|
36 |
// FORWARD DECLARATIONS
|
|
37 |
|
|
38 |
// ============================= LOCAL FUNCTIONS ===============================
|
|
39 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
40 |
|
|
41 |
// -----------------------------------------------------------------------------
|
|
42 |
// CUsbPnServerSession::CUsbPnServerSession
|
|
43 |
// C++ default constructor can NOT contain any code, that
|
|
44 |
// might leave.
|
|
45 |
// -----------------------------------------------------------------------------
|
|
46 |
//
|
|
47 |
CUsbPnServerSession::CUsbPnServerSession( CUsbPnServer& aServer )
|
|
48 |
:iUsbPnServer( aServer )
|
|
49 |
{
|
|
50 |
OstTrace0( TRACE_NORMAL, CUSBPNSERVERSESSION_CUSBPNSERVERSESSION_ENTRY, "CUsbPnServerSession::CUsbPnServerSession" );
|
|
51 |
OstTrace0( TRACE_NORMAL, CUSBPNSERVERSESSION_CUSBPNSERVERSESSION_EXIT, "CUsbPnServerSession::CUsbPnServerSession - return" );
|
|
52 |
C_TRACE( ( _T( "CUsbPnServerSession::CUsbPnServerSession()" ) ) );
|
|
53 |
C_TRACE( ( _T( "CUsbPnServerSession::CUsbPnServerSession() - return" ) ) );
|
|
54 |
}
|
|
55 |
|
|
56 |
// Destructor
|
|
57 |
CUsbPnServerSession::~CUsbPnServerSession()
|
|
58 |
{
|
|
59 |
OstTrace0( TRACE_NORMAL, CUSBPNSERVERSESSION_CUSBPNSERVERSESSION_DESTRUCTOR_ENTRY, "CUsbPnServerSession::~CUsbPnServerSession" );
|
|
60 |
C_TRACE( ( _T( "CUsbPnServerSession::~CUsbPnServerSession()" ) ) );
|
|
61 |
iUsbPnServer.SessionClosed();
|
|
62 |
OstTrace0( TRACE_NORMAL, CUSBPNSERVERSESSION_CUSBPNSERVERSESSION_DESTRUCTOR_EXIT, "CUsbPnServerSession::~CUsbPnServerSession - return" );
|
|
63 |
C_TRACE( ( _T( "CUsbPnServerSession::~CUsbPnServerSession() - return" ) ) );
|
|
64 |
}
|
|
65 |
|
|
66 |
|
|
67 |
// -----------------------------------------------------------------------------
|
|
68 |
// CUsbPnServerSession::ServiceL
|
|
69 |
// ?implementation_description
|
|
70 |
// (other items were commented in a header).
|
|
71 |
// -----------------------------------------------------------------------------
|
|
72 |
//
|
|
73 |
void CUsbPnServerSession::ServiceL(
|
|
74 |
const RMessage2& aMessage )
|
|
75 |
{
|
|
76 |
OstTrace0( TRACE_NORMAL, CUSBPNSERVERSESSION_SERVICEL_ENTRY, "CUsbPnServerSession::ServiceL" );
|
|
77 |
C_TRACE( ( _T( "CUsbPnServerSession::ServiceL()" ) ) );
|
|
78 |
|
|
79 |
TInt ret = KErrNone;
|
|
80 |
switch( aMessage.Function() )
|
|
81 |
{
|
|
82 |
case EPnDetach:
|
|
83 |
{
|
|
84 |
OstTrace0( TRACE_NORMAL, CUSBPNSERVERSESSION_SERVICEL, "CUsbPnServerSession::ServiceL - EPnDisconnect" );
|
|
85 |
C_TRACE( ( _T( "CUsbPnServerSession::ServiceL - EPnDisconnect" ) ) );
|
|
86 |
iUsbPnServer.Detach();
|
|
87 |
break;
|
|
88 |
}
|
|
89 |
default:
|
|
90 |
{
|
|
91 |
OstTrace0( TRACE_NORMAL, CUSBPNSERVERSESSION_SERVICEL_DUP1, "CUsbPnServerSession::ServiceL - Wrong param from client" );
|
|
92 |
C_TRACE( ( _T( "CUsbPnServerSession::ServiceL - Wrong param from client" ) ) );
|
|
93 |
aMessage.Panic(KUsbPnPanicCat, KErrArgument);
|
|
94 |
break;
|
|
95 |
}
|
|
96 |
}
|
|
97 |
|
|
98 |
aMessage.Complete(ret);
|
|
99 |
|
|
100 |
OstTrace0( TRACE_NORMAL, CUSBPNSERVERSESSION_SERVICEL_EXIT, "CUsbPnServerSession::ServiceL - return void" );
|
|
101 |
C_TRACE( ( _T( "CUsbPnServerSession::ServiceL() - return void" ) ) );
|
|
102 |
}
|
|
103 |
|
|
104 |
// -----------------------------------------------------------------------------
|
|
105 |
// CUsbPnServerSession::CreateL
|
|
106 |
// ?implementation_description
|
|
107 |
// (other items were commented in a header).
|
|
108 |
// -----------------------------------------------------------------------------
|
|
109 |
//
|
|
110 |
void CUsbPnServerSession::CreateL()
|
|
111 |
{
|
|
112 |
OstTrace0( TRACE_NORMAL, CUSBPNSERVERSESSION_CREATEL_ENTRY, "CUsbPnServerSession::CreateL" );
|
|
113 |
C_TRACE( ( _T( "CUsbPnServerSession::CreateL()" ) ) );
|
|
114 |
iUsbPnServer.SessionOpened();
|
|
115 |
OstTrace0( TRACE_NORMAL, CUSBPNSERVERSESSION_CREATEL_EXIT, "CUsbPnServerSession::CreateL - return void" );
|
|
116 |
C_TRACE( ( _T( "CUsbPnServerSession::CreateL() - return void" ) ) );
|
|
117 |
}
|
|
118 |
|
|
119 |
// ========================== OTHER EXPORTED FUNCTIONS =========================
|
|
120 |
|
|
121 |
// End of File
|