|
1 /* |
|
2 * Copyright (c) 2010 ISB. |
|
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 * ISB - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: USB driver for test |
|
15 * |
|
16 */ |
|
17 #ifndef __deviceIF_H__ |
|
18 #define __deviceIF_H__ |
|
19 |
|
20 #include <e32cmn.h> |
|
21 #include <e32ver.h> |
|
22 |
|
23 #define BUFSIZE (100*1024) |
|
24 |
|
25 /** |
|
26 User interface for 'WebcameraDevice' |
|
27 Define of the RBusLogicalChannel that is used in the application |
|
28 */ |
|
29 class RWebcameraDevice : public RBusLogicalChannel |
|
30 { |
|
31 public: |
|
32 /** |
|
33 Structure for holding driver capabilities information |
|
34 */ |
|
35 class TCaps |
|
36 { |
|
37 public: |
|
38 TVersion iVersion; |
|
39 }; |
|
40 /** |
|
41 Structure for holding driver configuration data |
|
42 */ |
|
43 class TConfig |
|
44 { |
|
45 public: |
|
46 TInt iPddBufferSize; /**< Size of the PDD's data buffer (not modifiable) */ |
|
47 //RArray<TSize> iImageSizes /**< size the PDD support*/ //TODO:implement |
|
48 }; |
|
49 typedef TPckgBuf<TConfig> TConfigBuf; |
|
50 |
|
51 public: |
|
52 /** |
|
53 Opens a logical channel to the driver |
|
54 |
|
55 @return One of the system wide error codes. |
|
56 */ |
|
57 inline TInt Open(); |
|
58 /** |
|
59 Gets the current configuration settings. |
|
60 |
|
61 @param aConfig A structure which will be filled with the configuration settings. |
|
62 |
|
63 @return KErrNone |
|
64 */ |
|
65 inline TInt GetConfig(TConfigBuf& aConfig); |
|
66 /** |
|
67 Sets the current configuration settings. |
|
68 |
|
69 @param aConfig The new configuration settings to be used. |
|
70 |
|
71 @return KErrInUse if there are outstanding data transfer requests. |
|
72 KErrArgument if any configuration values are invalid. |
|
73 KErrNone otherwise |
|
74 */ |
|
75 inline TInt SetConfig(const TConfigBuf& aConfig); |
|
76 /** |
|
77 Request data from device. |
|
78 Only one send request may be pending at any time. |
|
79 |
|
80 @param aStatus The request to be signalled when the data has been sent. |
|
81 The result value will be set to KErrNone on success; |
|
82 or set to one of the system wide error codes when an error occurs. |
|
83 @param aData A descriptor containing the data to send. |
|
84 */ |
|
85 inline void StartViewFinder(TRequestStatus& aStatus,TDes8& aBuffer); |
|
86 /** |
|
87 Cancels a previous getdata request. |
|
88 */ |
|
89 inline void StartViewFinderCancel(); |
|
90 /** |
|
91 Cancels a previous getdata request and notice device not to send data |
|
92 */ |
|
93 inline void StopViewFinder(); |
|
94 /** |
|
95 Request data(Capture data) from device. |
|
96 Only one send request may be pending at any time. |
|
97 |
|
98 @param aStatus The request to be signalled when the data has been sent. |
|
99 The result value will be set to KErrNone on success; |
|
100 or set to one of the system wide error codes when an error occurs. |
|
101 @param aData A descriptor containing the data to send. |
|
102 */ |
|
103 inline void Capture(TRequestStatus& aStatus,TDes8& aBuffer); |
|
104 /** |
|
105 Cancels a previous getCapturedata request. |
|
106 */ |
|
107 inline void CaptureCancel(); |
|
108 /** |
|
109 Returns the driver's name |
|
110 */ |
|
111 inline static const TDesC& Name(); |
|
112 /** |
|
113 Returns the version number of the driver |
|
114 */ |
|
115 inline static TVersion VersionRequired(); |
|
116 |
|
117 public: |
|
118 /** |
|
119 Enumeration of Control messages. |
|
120 */ |
|
121 enum TControl |
|
122 { |
|
123 EGetConfig, |
|
124 ESetConfig |
|
125 }; |
|
126 /** |
|
127 Enumeration of Request messages. |
|
128 */ |
|
129 enum TRequest |
|
130 { |
|
131 EStart, |
|
132 ECapture, |
|
133 ENumRequests, |
|
134 EAllRequests = (1<<ENumRequests)-1 |
|
135 }; |
|
136 |
|
137 // Kernel side LDD channel is a friend |
|
138 friend class DDriver1Channel; |
|
139 }; |
|
140 |
|
141 // Inline functions |
|
142 #include <webcamera_driver.inl> |
|
143 |
|
144 #endif |