#include <nnsys/mcs.h>
void NNS_McsRegisterRecvCallback(
NNSMcsRecvCBInfo* pInfo,
u16 channel,
NNSMcsRecvCallback cbFunc,
u32 userData);
| pInfo | Pointer to the structure holding the callback function's information. |
| channel | Value for identifying a stream. You can specify in the range 0-0x3FFF. 0x4000-0x7FFF is reserved for NITRO-System applications. 0x8000-0xFFFF is reserved for the MCS system. |
| cbFunc | The callback function to register. |
| userData | User's optional value. |
None.
Registers the function to be called back when data is received
Type NNSMcsRecvCallback of cbFunc is defined as the following. The definition of the function to register is shown below.
typedef void (*NNSMcsRecvCallback)( const void* recv, u32 recvSize, u32 userData, u32 offset, u32 totalSize);
| recv | Pointer to the buffer that stores a portion or all of the received data. |
| recvSize | Size of the data that is stored in the buffer indicated by recv. |
| userData | A value specified with the argument userData of NNS_McsRegisterRecvCallback. |
| offset | 0 if all of the received data is stored in the buffer that is indicated by recv.Offset location that uses 0, which is for all of the received data, as a reference if a portion of the received data is stored. |
| totalSize | Total size of the received data. |
If the received data is large, callback function is called multiple times. When it happens, the buffer indicated by recv stores a part of the data, and in offset the offset value from the entire data that is stored. In totalSize, the total size of the received data is always used.
Do not send or receive data from inside this registered callback function. In addition, do not perform a wait-for-interrupt loop, since interrupts are sometimes prohibited.
NNS_McsRegisterStreamRecvBuffer, NNS_McsUnregisterRecvResource
2004/11/29 Added the description of callback function
2004/10/08 Added a description of the channel argument. Added NNS_McsUnregisterRecvResource in See Also.
2004/08/26 Changed the argument channel type.
2004/06/01 Initial version.
CONFIDENTIAL