MPDSGetData

C Specification

#include <revolution/mp.h>
const u8* MPDSGetData ( const MPDSContext* context, const MPDSDataSet dataSet, u32 aid );

Arguments

context A pointer to the MPDSContext structure used to maintain the DataSharing status.
dataSet A pointer to the MPDSDataSet structure used to store shared data.
aid The AID from which data is to be gotten

Return Values

Returns a pointer to the data sent by the specified AID, from among the shared data. NULL is returned if no data exists or if the process failed in some way.

Description

Extracts the data sent by a specified AID from the shared data gotten using either the MPDSStep() function or the MPDSTryStep() function and returns a pointer to it.

The following would be cases in which NULL would be returned.

  1. Blank data read immediately after starting DataSharing
  2. The child device for the relevant AID is not connected
  3. An internal error occurred

Blank data is read immediately after starting once if double mode is disabled, twice if double mode is enabled.

You can confirm whether a child device is connected by checking the return value.
However, when child devices can connect freely, if another child device connects immediately after one disconnects, the system won't know that one has been swapped for another.
One way of dealing with that is to use the MPSetEntryFlag() and MPUpdateBeacon() functions to stop accepting connection from a new child device once the game has begun.
In addition, configuring the callback function for the mpdsCallback field in the MPDSConfig structure will allow for direct receipt of child device connection and disconnection notifications.

See Also

MPDSStep(), MPDSTryStep()

Revision History

2007/11/28 Initial version.


CONFIDENTIAL