os/kernelhwsrv/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/inc/usbmsshared.h
Update contrib.
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 // Shared client/server definitions
26 #ifndef __USBMSSHARED_H__
27 #define __USBMSSHARED_H__
33 const TInt KUsbMsSrvMajorVersionNumber = 1;
34 const TInt KUsbMsSrvMinorVersionNumber = 0;
35 const TInt KUsbMsSrvBuildVersionNumber = 0;
37 const TInt KUsbMsResourceVersion = 0;
39 _LIT(KUsbMsServerName, "usbmsserver");
42 /** Types of requests USB mass storage class controller can make */
54 The USB Class Controller identifier.
56 const TUid KUsbMsClassControllerUID={0x10204BBC};
62 The Publish & Subscribe Category for all USB Mass Storage events.
64 const TUid KUsbMsDriveState_Category={KFileServerUidValue};
70 The Publish & Subscribe event subkey enumeration.
72 enum TUsbMsDriveState_Subkey
74 EUsbMsDriveState_DriveStatus,
75 EUsbMsDriveState_KBytesRead,
76 EUsbMsDriveState_KBytesWritten,
77 EUsbMsDriveState_MediaError
84 Possible values for each of EUsbMsDriveState_DriveStatus status codes.
86 enum EUsbMsDriveStates
88 /** File system not available for Mass Storage */
89 EUsbMsDriveState_Disconnected =0x0,
90 /** Host has required connection */
91 EUsbMsDriveState_Connecting =0x1,
92 /** File system available to Mass Storage */
93 EUsbMsDriveState_Connected =0x2,
94 /** Disconnecting from Mass Storage */
95 EUsbMsDriveState_Disconnecting =0x3,
96 /** Critical write - do not remove card */
97 EUsbMsDriveState_Active =0x4,
98 /** Connected, but locked with a password */
99 EUsbMsDriveState_Locked =0x5,
100 /** Connected, but card not present */
101 EUsbMsDriveState_MediaNotPresent=0x6,
102 /** Card removed while active */
103 EUsbMsDriveState_Removed =0x7,
105 EUsbMsDriveState_Error =0x8
113 A collection of integers, contained in a TBuf8 for compatibility
114 with RProperty. Used for the EUsbMsDriveState_KBytesRead/Written
117 class TUsbMsBytesTransferred : public TBuf8<KUsbMsMaxDrives*sizeof(TInt)>
120 inline TUsbMsBytesTransferred();
121 inline TInt& operator[](TUint aLun);
126 TUsbMsBytesTransferred::TUsbMsBytesTransferred()
128 SetLength(MaxLength());
136 Return one of the integers contained in this buffer.
137 @return Bytes transferred count for the specified drive.
138 @param aLun Drive index
140 TInt& TUsbMsBytesTransferred::operator[](TUint aLun)
142 __ASSERT_DEBUG(aLun < static_cast<TUint>(MaxLength()), User::Invariant());
143 return *(reinterpret_cast<TInt*>(const_cast<TUint8*>(Ptr())) + aLun);
146 #endif //__USBMSSHARED_H__