GetReadableSize

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

Syntax

#include <nn/hio.h>

Result GetReadableSize(
     size_t * pSize,
     bit32 attr = ATTRIBUTE_NONE
);

Parameters

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 for HostIO communication are provided on both the CTR and PC sides. Use the attr argument to specify one of two distinct measurements. The size information returned by these methods differs greatly.

If ATTRIBUTE_NONE is specified, the function returns the amount of data on the CTR that has been received from the PC and also read. Thus if Read has not yet been called, the obtained value is 0.

When ATTRIBUTE_IN_PC 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.

If 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 ATTRIBUTE_IN_PC. Be aware of the meaning of the value returned when you use ATTRIBUTE_NONE.

ATTRIBUTE_NONE 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 ATTRIBUTE_NONE to reduce latency if your processing requirements are restricted primarily by the amount of data in the buffer stored on the CTR.

Revision History

2011/02/23
Added description of attributes when retrieving receivable sizes.
2010/11/10
Initial version.

CONFIDENTIAL