|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
|
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
|
3 <title>TB10.1 Example Applications: examples/Base/IPC/AdvancedClientServerExample/driver/driver1.h Source File</title> |
|
4 <link href="doxygen.css" rel="stylesheet" type="text/css"> |
|
5 <link href="tabs.css" rel="stylesheet" type="text/css"> |
|
6 </head><body> |
|
7 <!-- Generated by Doxygen 1.5.3 --> |
|
8 <h1>examples/Base/IPC/AdvancedClientServerExample/driver/driver1.h</h1><a href="driver1_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).</span> |
|
9 <a name="l00002"></a>00002 <span class="comment">// All rights reserved.</span> |
|
10 <a name="l00003"></a>00003 <span class="comment">// This component and the accompanying materials are made available</span> |
|
11 <a name="l00004"></a>00004 <span class="comment">// under the terms of "Eclipse Public License v1.0"</span> |
|
12 <a name="l00005"></a>00005 <span class="comment">// which accompanies this distribution, and is available</span> |
|
13 <a name="l00006"></a>00006 <span class="comment">// at the URL "http://www.eclipse.org/legal/epl-v10.html".</span> |
|
14 <a name="l00007"></a>00007 <span class="comment">//</span> |
|
15 <a name="l00008"></a>00008 <span class="comment">// Initial Contributors:</span> |
|
16 <a name="l00009"></a>00009 <span class="comment">// Nokia Corporation - initial contribution.</span> |
|
17 <a name="l00010"></a>00010 <span class="comment">//</span> |
|
18 <a name="l00011"></a>00011 <span class="comment">// Contributors:</span> |
|
19 <a name="l00012"></a>00012 <span class="comment">//</span> |
|
20 <a name="l00013"></a>00013 <span class="comment">// Description:</span> |
|
21 <a name="l00014"></a>00014 <span class="comment">// Interface to example Logical Device Driver</span> |
|
22 <a name="l00015"></a>00015 <span class="comment">//</span> |
|
23 <a name="l00016"></a>00016 |
|
24 <a name="l00017"></a>00017 |
|
25 <a name="l00018"></a>00018 |
|
26 <a name="l00023"></a>00023 <span class="preprocessor">#ifndef __DRIVER1_H__</span> |
|
27 <a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __DRIVER1_H__</span> |
|
28 <a name="l00025"></a>00025 <span class="preprocessor"></span> |
|
29 <a name="l00026"></a>00026 <span class="preprocessor">#include <e32cmn.h></span> |
|
30 <a name="l00027"></a>00027 <span class="preprocessor">#include <e32ver.h></span> |
|
31 <a name="l00028"></a>00028 <span class="preprocessor">#ifndef __KERNEL_MODE__</span> |
|
32 <a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include <e32std.h></span> |
|
33 <a name="l00030"></a>00030 <span class="preprocessor">#endif</span> |
|
34 <a name="l00031"></a>00031 <span class="preprocessor"></span> |
|
35 <a name="l00035"></a><a class="code" href="class_r_driver1.html">00035</a> <span class="keyword">class </span><a class="code" href="class_r_driver1.html">RDriver1</a> : <span class="keyword">public</span> RBusLogicalChannel |
|
36 <a name="l00036"></a>00036 { |
|
37 <a name="l00037"></a>00037 <span class="keyword">public</span>: |
|
38 <a name="l00042"></a><a class="code" href="class_r_driver1_1_1_t_caps.html">00042</a> <span class="keyword">class </span><a class="code" href="class_r_driver1_1_1_t_caps.html">TCaps</a> |
|
39 <a name="l00043"></a>00043 { |
|
40 <a name="l00044"></a>00044 <span class="keyword">public</span>: |
|
41 <a name="l00045"></a><a class="code" href="class_r_driver1_1_1_t_caps.html#8acb73cae71002cb92ff7944036da689">00045</a> TVersion <a class="code" href="class_r_driver1_1_1_t_caps.html#8acb73cae71002cb92ff7944036da689">iVersion</a>; |
|
42 <a name="l00046"></a>00046 }; |
|
43 <a name="l00047"></a>00047 |
|
44 <a name="l00051"></a><a class="code" href="class_r_driver1_1_1_t_config.html">00051</a> <span class="keyword">class </span><a class="code" href="class_r_driver1_1_1_t_config.html">TConfig</a> |
|
45 <a name="l00052"></a>00052 { |
|
46 <a name="l00053"></a>00053 <span class="keyword">public</span>: |
|
47 <a name="l00054"></a><a class="code" href="class_r_driver1_1_1_t_config.html#1bbc5535ddf8863917bf9ca18a688d91">00054</a> TInt <a class="code" href="class_r_driver1_1_1_t_config.html#1bbc5535ddf8863917bf9ca18a688d91">iSpeed</a>; |
|
48 <a name="l00055"></a><a class="code" href="class_r_driver1_1_1_t_config.html#8355e96a67e66e79903fe0a74f17b6d2">00055</a> TInt <a class="code" href="class_r_driver1_1_1_t_config.html#8355e96a67e66e79903fe0a74f17b6d2">iPddBufferSize</a>; |
|
49 <a name="l00056"></a><a class="code" href="class_r_driver1_1_1_t_config.html#5d055bb015e0902481ced408c2c7892b">00056</a> TInt <a class="code" href="class_r_driver1_1_1_t_config.html#5d055bb015e0902481ced408c2c7892b">iMaxSendDataSize</a>; |
|
50 <a name="l00057"></a><a class="code" href="class_r_driver1_1_1_t_config.html#3b6388ffc3c59b31e9f003ca2bf12812">00057</a> TInt <a class="code" href="class_r_driver1_1_1_t_config.html#3b6388ffc3c59b31e9f003ca2bf12812">iMaxReceiveDataSize</a>; |
|
51 <a name="l00058"></a>00058 }; |
|
52 <a name="l00059"></a><a class="code" href="class_r_driver1.html#1aa1c078824a79d07da05b1a7fdae816">00059</a> <span class="keyword">typedef</span> TPckgBuf<TConfig> <a class="code" href="class_r_driver1.html#1aa1c078824a79d07da05b1a7fdae816">TConfigBuf</a>; |
|
53 <a name="l00060"></a>00060 |
|
54 <a name="l00061"></a>00061 <span class="keyword">public</span>: |
|
55 <a name="l00062"></a>00062 <span class="keyword">inline</span> TInt <a class="code" href="class_r_driver1.html#f30696b673cd91e87f9c7497a72798eb">Open</a>(); |
|
56 <a name="l00063"></a>00063 <span class="keyword">inline</span> TInt <a class="code" href="class_r_driver1.html#c728a3fa6f4d51b284bcee48d8cc3f4a">GetConfig</a>(<a class="code" href="class_r_driver1.html#1aa1c078824a79d07da05b1a7fdae816">TConfigBuf</a>& aConfig); |
|
57 <a name="l00064"></a>00064 <span class="keyword">inline</span> TInt <a class="code" href="class_r_driver1.html#22e5408e8d1216fe3581ec154c2632a1">SetConfig</a>(<span class="keyword">const</span> <a class="code" href="class_r_driver1.html#1aa1c078824a79d07da05b1a7fdae816">TConfigBuf</a>& aConfig); |
|
58 <a name="l00065"></a>00065 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_r_driver1.html#2b99c6487e8916a54720d8eb3071cd85">SendData</a>(TRequestStatus &aStatus,<span class="keyword">const</span> TDesC8& aData); |
|
59 <a name="l00066"></a>00066 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_r_driver1.html#3a9b32b811f9bec9b3317d2b187b8417">SendDataCancel</a>(); |
|
60 <a name="l00067"></a>00067 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_r_driver1.html#7e192c22f84adc61b6418cd6ffb65526">ReceiveData</a>(TRequestStatus &aStatus,TDes8& aBuffer); |
|
61 <a name="l00068"></a>00068 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_r_driver1.html#c6bee07d661dfd83a14516aa964672bb">ReceiveDataCancel</a>(); |
|
62 <a name="l00069"></a>00069 <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keyword">const</span> TDesC& <a class="code" href="class_r_driver1.html#7e98e9f7ec04a53a404d646481f589ca">Name</a>(); |
|
63 <a name="l00070"></a>00070 <span class="keyword">inline</span> <span class="keyword">static</span> TVersion <a class="code" href="class_r_driver1.html#7d1f08b59801b5890fb77666e14d5e8f">VersionRequired</a>(); |
|
64 <a name="l00071"></a>00071 <span class="keyword">private</span>: |
|
65 <a name="l00075"></a>00075 <span class="keyword">enum</span> TControl |
|
66 <a name="l00076"></a>00076 { |
|
67 <a name="l00077"></a>00077 EGetConfig, |
|
68 <a name="l00078"></a>00078 ESetConfig |
|
69 <a name="l00079"></a>00079 }; |
|
70 <a name="l00080"></a>00080 |
|
71 <a name="l00084"></a>00084 <span class="keyword">enum</span> TRequest |
|
72 <a name="l00085"></a>00085 { |
|
73 <a name="l00086"></a>00086 ESendData, |
|
74 <a name="l00087"></a>00087 EReceiveData, |
|
75 <a name="l00088"></a>00088 ENumRequests, |
|
76 <a name="l00089"></a>00089 EAllRequests = (1<<ENumRequests)-1 |
|
77 <a name="l00090"></a>00090 }; |
|
78 <a name="l00091"></a>00091 |
|
79 <a name="l00092"></a>00092 <span class="comment">// Kernel side LDD channel is a friend</span> |
|
80 <a name="l00093"></a><a class="code" href="class_r_driver1.html#3dc837125ab7311c8533472f93e390b0">00093</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_d_driver1_channel.html">DDriver1Channel</a>; |
|
81 <a name="l00094"></a>00094 }; |
|
82 <a name="l00095"></a>00095 |
|
83 <a name="l00100"></a><a class="code" href="class_r_driver1.html#7e98e9f7ec04a53a404d646481f589ca">00100</a> <span class="keyword">inline</span> <span class="keyword">const</span> TDesC& <a class="code" href="class_r_driver1.html#7e98e9f7ec04a53a404d646481f589ca">RDriver1::Name</a>() |
|
84 <a name="l00101"></a>00101 { |
|
85 <a name="l00102"></a>00102 _LIT(KDriver1Name,<span class="stringliteral">"DRIVER1"</span>); |
|
86 <a name="l00103"></a>00103 <span class="keywordflow">return</span> KDriver1Name; |
|
87 <a name="l00104"></a>00104 } |
|
88 <a name="l00105"></a>00105 |
|
89 <a name="l00110"></a><a class="code" href="class_r_driver1.html#7d1f08b59801b5890fb77666e14d5e8f">00110</a> <span class="keyword">inline</span> TVersion <a class="code" href="class_r_driver1.html#7d1f08b59801b5890fb77666e14d5e8f">RDriver1::VersionRequired</a>() |
|
90 <a name="l00111"></a>00111 { |
|
91 <a name="l00112"></a>00112 <span class="keyword">const</span> TInt KMajorVersionNumber=1; |
|
92 <a name="l00113"></a>00113 <span class="keyword">const</span> TInt KMinorVersionNumber=0; |
|
93 <a name="l00114"></a>00114 <span class="keyword">const</span> TInt KBuildVersionNumber=KE32BuildVersionNumber; |
|
94 <a name="l00115"></a>00115 <span class="keywordflow">return</span> TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber); |
|
95 <a name="l00116"></a>00116 } |
|
96 <a name="l00117"></a>00117 |
|
97 <a name="l00118"></a>00118 <span class="comment">/*</span> |
|
98 <a name="l00119"></a>00119 <span class="comment"> NOTE: The following methods would normally be exported from a seperate client DLL</span> |
|
99 <a name="l00120"></a>00120 <span class="comment"> but are included in this header file for convenience.</span> |
|
100 <a name="l00121"></a>00121 <span class="comment">*/</span> |
|
101 <a name="l00122"></a>00122 |
|
102 <a name="l00123"></a>00123 <span class="preprocessor">#ifndef __KERNEL_MODE__</span> |
|
103 <a name="l00124"></a>00124 <span class="preprocessor"></span> |
|
104 <a name="l00129"></a><a class="code" href="class_r_driver1.html#f30696b673cd91e87f9c7497a72798eb">00129</a> <span class="keyword">inline</span> TInt <a class="code" href="class_r_driver1.html#f30696b673cd91e87f9c7497a72798eb">RDriver1::Open</a>() |
|
105 <a name="l00130"></a>00130 { |
|
106 <a name="l00131"></a>00131 <span class="keywordflow">return</span> <a class="code" href="class_d_driver1_channel.html#c08720a956dbae4e7127da92944c35ad">DoCreate</a>(<a class="code" href="class_r_driver1.html#7e98e9f7ec04a53a404d646481f589ca">Name</a>(),<a class="code" href="class_r_driver1.html#7d1f08b59801b5890fb77666e14d5e8f">VersionRequired</a>(),KNullUnit,NULL,NULL,EOwnerThread); |
|
107 <a name="l00132"></a>00132 } |
|
108 <a name="l00133"></a>00133 |
|
109 <a name="l00139"></a><a class="code" href="class_r_driver1.html#c728a3fa6f4d51b284bcee48d8cc3f4a">00139</a> <span class="keyword">inline</span> TInt <a class="code" href="class_r_driver1.html#c728a3fa6f4d51b284bcee48d8cc3f4a">RDriver1::GetConfig</a>(<a class="code" href="class_r_driver1.html#1aa1c078824a79d07da05b1a7fdae816">TConfigBuf</a>& aConfig) |
|
110 <a name="l00140"></a>00140 { |
|
111 <a name="l00141"></a>00141 <span class="keywordflow">return</span> DoControl(EGetConfig,(TAny*)&aConfig); |
|
112 <a name="l00142"></a>00142 } |
|
113 <a name="l00143"></a>00143 |
|
114 <a name="l00151"></a><a class="code" href="class_r_driver1.html#22e5408e8d1216fe3581ec154c2632a1">00151</a> <span class="keyword">inline</span> TInt <a class="code" href="class_r_driver1.html#22e5408e8d1216fe3581ec154c2632a1">RDriver1::SetConfig</a>(<span class="keyword">const</span> <a class="code" href="class_r_driver1.html#1aa1c078824a79d07da05b1a7fdae816">TConfigBuf</a>& aConfig) |
|
115 <a name="l00152"></a>00152 { |
|
116 <a name="l00153"></a>00153 <span class="keywordflow">return</span> DoControl(ESetConfig,(TAny*)&aConfig); |
|
117 <a name="l00154"></a>00154 } |
|
118 <a name="l00155"></a>00155 |
|
119 <a name="l00164"></a><a class="code" href="class_r_driver1.html#2b99c6487e8916a54720d8eb3071cd85">00164</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_r_driver1.html#2b99c6487e8916a54720d8eb3071cd85">RDriver1::SendData</a>(TRequestStatus &aStatus,<span class="keyword">const</span> TDesC8& aData) |
|
120 <a name="l00165"></a>00165 { |
|
121 <a name="l00166"></a>00166 DoRequest(ESendData,aStatus,(TAny*)&aData); |
|
122 <a name="l00167"></a>00167 } |
|
123 <a name="l00168"></a>00168 |
|
124 <a name="l00172"></a><a class="code" href="class_r_driver1.html#3a9b32b811f9bec9b3317d2b187b8417">00172</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_r_driver1.html#3a9b32b811f9bec9b3317d2b187b8417">RDriver1::SendDataCancel</a>() |
|
125 <a name="l00173"></a>00173 { |
|
126 <a name="l00174"></a>00174 DoCancel(1<<ESendData); |
|
127 <a name="l00175"></a>00175 } |
|
128 <a name="l00176"></a>00176 |
|
129 <a name="l00185"></a><a class="code" href="class_r_driver1.html#7e192c22f84adc61b6418cd6ffb65526">00185</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_r_driver1.html#7e192c22f84adc61b6418cd6ffb65526">RDriver1::ReceiveData</a>(TRequestStatus &aStatus,TDes8& aBuffer) |
|
130 <a name="l00186"></a>00186 { |
|
131 <a name="l00187"></a>00187 DoRequest(EReceiveData,aStatus,(TAny*)&aBuffer); |
|
132 <a name="l00188"></a>00188 } |
|
133 <a name="l00189"></a>00189 |
|
134 <a name="l00193"></a><a class="code" href="class_r_driver1.html#c6bee07d661dfd83a14516aa964672bb">00193</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_r_driver1.html#c6bee07d661dfd83a14516aa964672bb">RDriver1::ReceiveDataCancel</a>() |
|
135 <a name="l00194"></a>00194 { |
|
136 <a name="l00195"></a>00195 DoCancel(1<<EReceiveData); |
|
137 <a name="l00196"></a>00196 } |
|
138 <a name="l00197"></a>00197 |
|
139 <a name="l00198"></a>00198 <span class="preprocessor">#endif // !__KERNEL_MODE__</span> |
|
140 <a name="l00199"></a>00199 <span class="preprocessor"></span> |
|
141 <a name="l00200"></a>00200 <span class="preprocessor">#endif // __DRIVER1_H__</span> |
|
142 <a name="l00201"></a>00201 <span class="preprocessor"></span> |
|
143 </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 21 10:32:56 2010 for TB10.1 Example Applications by |
|
144 <a href="http://www.doxygen.org/index.html"> |
|
145 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address> |
|
146 </body> |
|
147 </html> |