MPStartup

C Specification

#include <revolution/mp.h>
s32 MPStartup ( const MPConfig* config );

Arguments

config MP communications settings

Return Values

Returns the processing result or a negative number if processing fails.

Description

MP communications are initialized and begun with settings provided to the config argument.

When using a wireless module for Internet communications, you must end Internet communications before calling this function. Attempts to use them simultaneously will result in a MP_RESULT_ALREADY_IN_USE failure. This function calls the NWC24SuspendScheduler function internally, pausing the NWC24 auto-scheduler functionality. It is acceptable to call the NWC24SuspendScheduler() function in advance on the application side, because the NWC24SuspendScheduler() function can be called within a nested structure.

In addition, a MP_RESULT_NOT_ALLOWED failure will result when the specified wireless channel is unavailable, or when wireless itself is unavailable.

The allocator given to config->alloc must be created by allocating MEM2 memory, the start of which is aligned at a 32-byte boundary. If an allocator that allocates memory in MEM1 is given, execution fails on an MP_RESULT_NOT_ENOUGH_MEMORY error. Note that there is no problem if the memory in which config itself is located is MEM1 or if the memory pointed to by the pointer given directly to MPSend or other MP function is in MEM1.

Currently, memory allocation performed by config->alloc occurs once only in MPStartup at a size of 65,000 bytes or less. This works if allocating a heap having a total size of 65,536 bytes. However, the required memory size will increase as needed as features are added in the future.

See Also

MPCleanup(), MPDisconnect(), MPSetIndicationConfig(), MPSetPortConfig(), MPError, MPConfig

Revision History

2007/11/05 Noted that the NWC24 auto-scheduler is paused. 2007/10/04 Changed the required memory size from 32k to 64k.
2006/11/23 Added a description of the required memory size.
2006/11/21 Added information regarding the 32-byte boundary restriction.
2006/11/13 Added description of MEM2 limitation on the allocator.
2006/06/29 Initial version.


CONFIDENTIAL