1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../../../css/manpage.css" type="text/css" />
7<title>GetReadableSize</title>
8  </head>
9  <body>
10<h1><CODE><a href="../../../../nn/Overview.html">nn</a>::<a href="../../../../nn/hio/Overview.html">hio</a>::<a href="../../../../nn/hio/CTR/Overview.html">CTR</a>::<a href="../../../../nn/hio/CTR/SerialChannel/Overview.html">SerialChannel</a>::GetReadableSize</CODE> Member Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">#include &lt;nn/hio.h&gt;
14
15<a href="../../../../nn/Result/Overview.html">Result</a> GetReadableSize(
16     size_t * pSize,
17     <a href="../../../../nn_types/bit32.html">bit32</a> attr = ATTRIBUTE_NONE
18);
19</pre>
20    </div>
21<h2>Parameters</h2>
22    <div class="section">
23      <table class="arguments">
24        <thead>
25          <tr>
26            <td width="15" />
27<th>Name</th>
28<td>Description</td>
29          </tr>
30        </thead>
31        <tr>
32<td>out</td>
33<th>pSize</th>
34<td>Location where the size of the data is stored.</td>
35        </tr>
36        <tr>
37<td>in</td>
38<th>attr</th>
39<td>Reception attribute.<br />When <CODE>ATTRIBUTE_NONE</CODE> is specified, this function gets the loadable size from the CTR-side buffer.<br />When <CODE>ATTRIBUTE_IN_PC</CODE> is specified, this function gets the sum of the loadable sizes of the CTR-side and PC-side buffers.</td>
40        </tr> </table>
41    </div>
42<h2>Return Values</h2>
43<div class="section">Returns the result of the operation. </div>
44<h2>Description</h2>
45    <div class="section">
46<p>Gets the loadable size from the buffer(s) and returns the result of the operation.</p><h3>Differences in Data Sizes Obtained</h3><p>
47Buffers for HostIO communication are provided on both the CTR and PC sides. Use the <SPAN class="argument">attr</SPAN> argument to specify one of two distinct measurements. The size information returned by these methods differs greatly.
48            </p><p>
49If <CODE>ATTRIBUTE_NONE</CODE> is specified, the function returns the amount of data on the CTR that has been received from the PC and also read. Thus if <CODE>Read</CODE> has not yet been called, the obtained value is <CODE>0</CODE>.
50            </p><p>
51When <CODE>ATTRIBUTE_IN_PC</CODE> is specified, this function communicates with the PC, and gets the sum of the loadable sizes of the CTR-side and PC-side buffers. The value obtained in this case is the amount of data sent from the PC but not yet read by the CTR. A delay of a few dozen milliseconds occurs during communication between the PC and CTR.
52            </p><p>
53If you want to use this function to get the size of data that has been sent from the PC but not yet read by the CTR, specify <CODE>ATTRIBUTE_IN_PC</CODE>. Be aware of the meaning of the value returned when you use <CODE>ATTRIBUTE_NONE</CODE>.
54            </p><p>
55<CODE>ATTRIBUTE_NONE</CODE> obtains the size of the data accumulated on the CTR side. It is thus able to get the value quickly, without locks, thread switching, or communication between the PC and CTR. Use <CODE>ATTRIBUTE_NONE</CODE> to reduce latency if your processing requirements are restricted primarily by the amount of data in the buffer stored on the CTR.
56            </p></div>
57<h2>Revision History</h2>
58    <div class="section">
59      <dl class="history">
60        <dt>2011/02/23</dt>
61<dd>Added description of attributes when retrieving receivable sizes.<br />
62        </dd>
63        <dt>2010/11/10</dt>
64<dd>Initial version.<br />
65        </dd>
66      </dl>
67    </div>
68  <hr><p>CONFIDENTIAL</p></body>
69</html>
70