nn::hio::CTR::SerialChannel::GetReadableSize Member Function

Syntax

#include <nn/hio.h>
Result GetReadableSize(
     size_t * pSize,
     bit32 attr = ATTRIBUTE_NONE
);

Arguments

Name Description
out pSize Location where the size of the data is stored.
in attr Reception attribute.
When ATTRIBUTE_NONE is specified, this function gets the loadable size from the CTR-side buffer.
When ATTRIBUTE_IN_PC is specified, this function gets the sum of the loadable sizes of the CTR-side and PC-side buffers.

Return Values

Returns the result of the operation.

Description

Gets the loadable size from the buffer(s) and returns the result of the operation.

Differences in Data Sizes Obtained

Buffers used for HostIO communication are provided on both the CTR and PC. The method for obtaining samples differs greatly depending on the attributes set by attr, and this will greatly affect the results as well.

If you specify ATTRIBUTE_NONE, then the size of data not yet received by the CTR from the PC is returned. Thus if Read has not been performed even once, a value of 0 will be obtained.

When ATTRIBUTE_IN_PC is specified, the communication with PC is performed and this function returns the sum of the loadable sizes of the CTR-side and PC-side buffers. Thus the value obtained will be the size of the data that has been sent from the PC, but not received by the CTR. There is a delay of a few dozen milliseconds for communication between the PC and CTR.

Specify ATTRIBUTE_IN_PC as the attribute for attr to obtain the size of the data that has been sent from the PC, but has not yet been received by the CTR. Note the meaning of the value obtained when ATTRIBUTE_NONE is specified.

ATTRIBUTE_NONE obtains the size of the data remaining on the CTR. It is thus able to return a value quickly, without locking, thread switching, or communication between the PC and CTR. Thus, for certain uses delays can be minimized by using ATTRIBUTE_NONE when it is possible to perform processing using only the data in the buffer remaining on the CTR.

Revision History

2011/02/23
Added descriptions of attributes when obtaining the size of data that can be received.
2010/11/10
Initial version.

CONFIDENTIAL