Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/driver1__dev_8h-source.html
changeset 1 25a17d01db0c
equal deleted inserted replaced
0:89d6a7a84779 1:25a17d01db0c
       
     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_dev.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_dev.h</h1><a href="driver1__dev_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">// Kernel side interfaces to the example Logical and Physical Device Drivers</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_DEV_H__</span>
       
    27 <a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __DRIVER1_DEV_H__</span>
       
    28 <a name="l00025"></a>00025 <span class="preprocessor"></span>
       
    29 <a name="l00029"></a><a class="code" href="class_d_driver1_factory.html">00029</a> <span class="keyword">class </span><a class="code" href="class_d_driver1_factory.html">DDriver1Factory</a> : <span class="keyword">public</span> DLogicalDevice
       
    30 <a name="l00030"></a>00030         {
       
    31 <a name="l00031"></a>00031 <span class="keyword">public</span>:
       
    32 <a name="l00032"></a>00032         <a class="code" href="class_d_driver1_factory.html#28b03d2a83e475c0ef628d87f574b326">DDriver1Factory</a>();
       
    33 <a name="l00033"></a>00033         <a class="code" href="class_d_driver1_factory.html#2826ff8e0deb203cdabd8a5d31d4eccd">~DDriver1Factory</a>();
       
    34 <a name="l00034"></a>00034         
       
    35 <a name="l00035"></a>00035         <span class="comment">//      Inherited from DLogicalDevice</span>
       
    36 <a name="l00036"></a>00036         <span class="keyword">virtual</span> TInt <a class="code" href="class_d_driver1_factory.html#7aa17c3f9b4d020f1d48fa89bf587452">Install</a>();
       
    37 <a name="l00037"></a>00037         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_d_driver1_factory.html#f6c76eec10ac39e32d1095b9b3a7ecc0">GetCaps</a>(TDes8&amp; aDes) <span class="keyword">const</span>;
       
    38 <a name="l00038"></a>00038         <span class="keyword">virtual</span> TInt <a class="code" href="class_d_driver1_factory.html#2c28467be74fbe3022b3ae998c18894a">Create</a>(DLogicalChannelBase*&amp; aChannel);
       
    39 <a name="l00039"></a>00039         };
       
    40 <a name="l00040"></a>00040 
       
    41 <a name="l00041"></a>00041 <span class="keyword">class </span><a class="code" href="class_d_driver1.html">DDriver1</a>;
       
    42 <a name="l00042"></a>00042 
       
    43 <a name="l00046"></a><a class="code" href="class_d_driver1_channel.html">00046</a> <span class="keyword">class </span><a class="code" href="class_d_driver1_channel.html">DDriver1Channel</a> : <span class="keyword">public</span> DLogicalChannel
       
    44 <a name="l00047"></a>00047         {
       
    45 <a name="l00048"></a>00048 <span class="keyword">public</span>:
       
    46 <a name="l00049"></a>00049         <a class="code" href="class_d_driver1_channel.html#d8a91a9260da7cfc7ee245a77b853d6e">DDriver1Channel</a>();
       
    47 <a name="l00050"></a>00050         <span class="keyword">virtual</span> <a class="code" href="class_d_driver1_channel.html#2739d21598133597f0ac408b20280049">~DDriver1Channel</a>();
       
    48 <a name="l00051"></a>00051         
       
    49 <a name="l00052"></a>00052         <span class="comment">//      Inherited from DObject</span>
       
    50 <a name="l00053"></a>00053         <span class="keyword">virtual</span> TInt <a class="code" href="class_d_driver1_channel.html#b06d988aab9e3c39aaf6e5dabe389f70">RequestUserHandle</a>(DThread* aThread, TOwnerType aType);
       
    51 <a name="l00054"></a>00054         
       
    52 <a name="l00055"></a>00055         <span class="comment">// Inherited from DLogicalChannelBase</span>
       
    53 <a name="l00056"></a>00056         <span class="keyword">virtual</span> TInt <a class="code" href="class_d_driver1_channel.html#c08720a956dbae4e7127da92944c35ad">DoCreate</a>(TInt aUnit, <span class="keyword">const</span> TDesC8* anInfo, <span class="keyword">const</span> TVersion&amp; aVer);
       
    54 <a name="l00057"></a>00057         
       
    55 <a name="l00058"></a>00058         <span class="comment">// Inherited from DLogicalChannel</span>
       
    56 <a name="l00059"></a>00059         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_d_driver1_channel.html#dc1467b94ce109571581efa52f43e380">HandleMsg</a>(TMessageBase* aMsg);
       
    57 <a name="l00060"></a>00060 <span class="keyword">private</span>:
       
    58 <a name="l00061"></a>00061         <span class="comment">// Panic reasons</span>
       
    59 <a name="l00062"></a>00062         <span class="keyword">enum</span> TPanic
       
    60 <a name="l00063"></a>00063                 {
       
    61 <a name="l00064"></a>00064                 <span class="comment">// A request was issued when one is outstanding.</span>
       
    62 <a name="l00065"></a>00065                 ERequestAlreadyPending = 1
       
    63 <a name="l00066"></a>00066                 };
       
    64 <a name="l00067"></a>00067                 
       
    65 <a name="l00068"></a>00068         <span class="comment">// Implementation of the different kinds of messages sent through RBusLogicalChannel</span>
       
    66 <a name="l00069"></a>00069         TInt DoControl(TInt aFunction, TAny* a1, TAny* a2);
       
    67 <a name="l00070"></a>00070         TInt DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2);
       
    68 <a name="l00071"></a>00071         <span class="keywordtype">void</span> DoCancel(TUint aMask);
       
    69 <a name="l00072"></a>00072         <span class="comment">// Accessor for the PDD</span>
       
    70 <a name="l00073"></a>00073         <span class="keyword">inline</span> <a class="code" href="class_d_driver1.html">DDriver1</a>* Pdd();
       
    71 <a name="l00074"></a>00074         <span class="comment">// Methods for configuration</span>
       
    72 <a name="l00075"></a>00075         TInt GetConfig(TDes8* aConfigBuf);
       
    73 <a name="l00076"></a>00076         TInt SetConfig(<span class="keyword">const</span> TDesC8* aConfigBuf);
       
    74 <a name="l00077"></a>00077         <span class="keywordtype">void</span> CurrentConfig(<a class="code" href="class_r_driver1_1_1_t_config.html">RDriver1::TConfig</a>&amp; aConfig);
       
    75 <a name="l00078"></a>00078         <span class="comment">// Methods for processing a SendData request</span>
       
    76 <a name="l00079"></a>00079         TInt SendData(TRequestStatus* aStatus,<span class="keyword">const</span> TDesC8* aData);
       
    77 <a name="l00080"></a>00080         <span class="keywordtype">void</span> SendDataCancel();
       
    78 <a name="l00081"></a>00081         <span class="keywordtype">void</span> DoSendDataComplete();
       
    79 <a name="l00082"></a>00082         <span class="keyword">static</span> <span class="keywordtype">void</span> SendDataDfc(TAny* aPtr);
       
    80 <a name="l00083"></a>00083         <span class="comment">// Methods for processing a ReceiveData request</span>
       
    81 <a name="l00084"></a>00084         TInt ReceiveData(TRequestStatus* aStatus,TDes8* aBuffer);
       
    82 <a name="l00085"></a>00085         <span class="keywordtype">void</span> ReceiveDataCancel();
       
    83 <a name="l00086"></a>00086         <span class="keywordtype">void</span> DoReceiveDataComplete();
       
    84 <a name="l00087"></a>00087         <span class="keyword">static</span> <span class="keywordtype">void</span> ReceiveDataDfc(TAny* aPtr);
       
    85 <a name="l00088"></a>00088 <span class="keyword">public</span>:
       
    86 <a name="l00089"></a>00089         <span class="comment">// Interface methods for use by PDD</span>
       
    87 <a name="l00090"></a>00090         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_d_driver1_channel.html#4ddf64ba96fa2febc011034d3fcb46c8">SendDataComplete</a>(TInt aResult);
       
    88 <a name="l00091"></a>00091         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_d_driver1_channel.html#c5102a3cbbcb3fe11357481d8d204523">ReceiveDataComplete</a>(TInt aResult);
       
    89 <a name="l00092"></a>00092 <span class="keyword">private</span>:
       
    90 <a name="l00093"></a>00093         DThread* iClient;
       
    91 <a name="l00094"></a>00094         <span class="comment">// Members used for processing a SendData request</span>
       
    92 <a name="l00095"></a>00095         TRequestStatus* iSendDataStatus;
       
    93 <a name="l00096"></a>00096         TDfc iSendDataDfc;
       
    94 <a name="l00097"></a>00097         TInt iSendDataResult;
       
    95 <a name="l00098"></a>00098         TBuf8&lt;256&gt; iSendDataBuffer;
       
    96 <a name="l00099"></a>00099         <span class="comment">// Members used for processing a ReceiveData request</span>
       
    97 <a name="l00100"></a>00100         TDes8* iReceiveDataDescriptor;
       
    98 <a name="l00101"></a>00101         TRequestStatus* iReceiveDataStatus;
       
    99 <a name="l00102"></a>00102         TDfc iReceiveDataDfc;
       
   100 <a name="l00103"></a>00103         TInt iReceiveDataResult;
       
   101 <a name="l00104"></a>00104         TBuf8&lt;256&gt; iReceiveDataBuffer;
       
   102 <a name="l00105"></a>00105         };
       
   103 <a name="l00106"></a>00106 
       
   104 <a name="l00107"></a>00107 <span class="keyword">inline</span> <a class="code" href="class_d_driver1.html">DDriver1</a>* DDriver1Channel::Pdd()
       
   105 <a name="l00108"></a>00108         { <span class="keywordflow">return</span> (<a class="code" href="class_d_driver1.html">DDriver1</a>*)iPdd; }
       
   106 <a name="l00109"></a>00109 
       
   107 <a name="l00113"></a><a class="code" href="class_d_driver1.html">00113</a> <span class="keyword">class </span><a class="code" href="class_d_driver1.html">DDriver1</a> : <span class="keyword">public</span> DBase
       
   108 <a name="l00114"></a>00114         {
       
   109 <a name="l00115"></a>00115 <span class="keyword">public</span>:
       
   110 <a name="l00119"></a><a class="code" href="class_d_driver1_1_1_t_caps.html">00119</a>         <span class="keyword">class </span><a class="code" href="class_d_driver1_1_1_t_caps.html">TCaps</a>
       
   111 <a name="l00120"></a>00120                 {
       
   112 <a name="l00121"></a>00121         <span class="keyword">public</span>:
       
   113 <a name="l00122"></a><a class="code" href="class_d_driver1_1_1_t_caps.html#018c460e7889415ad931cc75abb0dfee">00122</a>                 TVersion iVersion;
       
   114 <a name="l00123"></a>00123                 };
       
   115 <a name="l00124"></a>00124 <span class="keyword">public</span>:
       
   116 <a name="l00125"></a>00125         <span class="keyword">virtual</span> TInt BufferSize() <span class="keyword">const</span> =0;
       
   117 <a name="l00126"></a>00126         <span class="keyword">virtual</span> TInt Speed() <span class="keyword">const</span> =0;
       
   118 <a name="l00127"></a>00127         <span class="keyword">virtual</span> TInt SetSpeed(TInt aSpeed) =0;
       
   119 <a name="l00128"></a>00128         <span class="keyword">virtual</span> TInt SendData(<span class="keyword">const</span> TDesC8&amp; aData) =0;
       
   120 <a name="l00129"></a>00129         <span class="keyword">virtual</span> <span class="keywordtype">void</span> SendDataCancel() =0;
       
   121 <a name="l00130"></a>00130         <span class="keyword">virtual</span> TInt ReceiveData(TDes8&amp; aBuffer) =0;
       
   122 <a name="l00131"></a>00131         <span class="keyword">virtual</span> <span class="keywordtype">void</span> ReceiveDataCancel() =0;
       
   123 <a name="l00132"></a>00132 <span class="keyword">public</span>:
       
   124 <a name="l00133"></a><a class="code" href="class_d_driver1.html#8af44708d43002e2485765269d99d846">00133</a>         <a class="code" href="class_d_driver1_channel.html">DDriver1Channel</a>* iLdd;
       
   125 <a name="l00134"></a>00134         };
       
   126 <a name="l00135"></a>00135 
       
   127 <a name="l00136"></a>00136 <span class="preprocessor">#endif</span>
       
   128 <a name="l00137"></a>00137 <span class="preprocessor"></span>
       
   129 </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&nbsp;
       
   130 <a href="http://www.doxygen.org/index.html">
       
   131 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
       
   132 </body>
       
   133 </html>