nn::dlp::CTR::Server::Initialize Member Function

Syntax

static nn::Result Initialize(
     nn::Handle eventHandle,
     u8 maxClientNum,
     u8 childIndex,
     void * pBuffer,
     size_t bufferSize,
     size_t blockBufferSize = MIN_NETWORK_BLOCK_BUFFER_SIZE *2,
     size_t blockBufferNum = MIN_NETWORK_BLOCK_BUFFER_NUM
);

Arguments

Name Description
in eventHandle Specifies a handle to the nn::os::Event object waiting for a signal from download play. Initialize the event in the application. Use the GetEventDesc function to get the event information.
in maxClientNum Specifies the maximum number of clients (from 1 to MAX_CLIENT_NUM) that can connect to the server.
in childIndex Specify the index (the RSF ChildIndex) of the child program to distribute. You can specify a value between 0 and 255. (A server can have up to 256 children.)
in pBuffer Pointer to the DLP working buffer. Must be 4096-byte aligned.
in bufferSize Size of working buffer. Must be 4096-byte aligned.
in blockBufferSize This is the size of the block buffer when data that has been read from a file is kept before sending. Specify a size larger than MIN_NETWORK_BLOCK_BUFFER_SIZE and smaller than MAX_NETWORK_BLOCK_BUFFER_SIZE.
in blockBufferNum This is the number of block buffers. Specify a size larger than MIN_NETWORK_BLOCK_BUFFER_NUM and smaller than MAX_NETWORK_BLOCK_BUFFER_NUM.

Return Values

The following Result values are returned as the result of the operation.

Value Description
ResultSuccess Initialization was successful.
ResultInvalidPointer pBuffer is either NULL or not 4096-byte aligned.
ResultOutOfRange maxClientNum, bufferSize, blockBufferSize, and blockBufferNum are invalid.
ResultInvalidHandle eventHandle is invalid.
ResultAlreadyOccupiedWirelessDevice The wireless device is already occupied for another purpose. Exit the other wireless process.
ResultInternalError An irrecoverable error occurred internally.
ResultWirelessOff Communications cannot occur in this state (sleep or the Wifi button is off).
ResultInvalidMediaType The media type of the parent device is not supported.
ResultFailedToAccessMedia Cannot access the media. The child program may not be properly installed on the parent or a card may have been removed.
ResultChildTooLarge The child program exceeds the standard import size (MAX_CHILD_IMPORT_SIZE).
ResultInvalidRegion The child program and the system have different regions.

Description

Initializes the server.

For the pBuffer argument, specify a 4096-byte aligned buffer of the size specified by the GetBufferSize function. Do not use device memory for the buffer. It is possible to distribute a child program of up to 32 MB. This function may block for a long time because it finalizes communications in the background, and the DLP library takes control of the communication device until Finalize is run.

Revision History

2010/08/16
Initial version.

CONFIDENTIAL