os/kernelhwsrv/kerneltest/f32test/shostmassstorage/msman/server/cusbhostsession.cpp
First public contribution.
1 // Copyright (c) 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 the License "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Implements a Session of a Symbian OS server for the RUsbMassStorage API
29 #include "msmanclientserver.h"
32 #include <d32usbdi_hubdriver.h>
36 #include "cusbhostao.h"
40 #include "cusbhostserver.h"
41 #include "cusbhostsession.h"
44 CUsbHostSession* CUsbHostSession::NewL()
47 CUsbHostSession* r = new (ELeave) CUsbHostSession();
48 CleanupStack::PushL(r);
55 CUsbHostSession::CUsbHostSession()
61 void CUsbHostSession::ConstructL()
67 void CUsbHostSession::CreateL()
70 Server().AddSession();
74 CUsbHostSession::~CUsbHostSession()
77 Server().RemoveSession();
81 void CUsbHostSession::ServiceL(const RMessage2& aMessage)
84 DispatchMessageL(aMessage);
88 void CUsbHostSession::DispatchMessageL(const RMessage2& aMessage)
93 switch (aMessage.Function())
96 ret = Start(aMessage);
99 aMessage.Panic(KUsbHostClientPncCat, EUsbHostPanicIllegalIPC);
103 aMessage.Complete(ret);
107 TInt CUsbHostSession::Start(const RMessage2& aMessage)
110 Server().iUsbHost->Start();