# WMGameInfo

## Definitions

  `#include <nitro/wm.h>`

      typedef struct WMGameInfo
      {
        u16 magicNumber;
        u8 ver;
        u8 reserved[1];
        u32 ggid;
        u16 tgid;
        u8 userGameInfoLength;
        u8 attribute;
        u16 parentMaxSize;
        u16 childMaxSize;
        union {
          u16 userGameInfo[WM_SIZE_USER_GAMEINFO/sizeof(u16)];
          struct {
            u16 userName[WM_SIZE_USERNAME/sizeof(u16)];
            u16 gameName[WM_SIZE_GAMENAME/sizeof(u16)];
            u16 padd1[44];
          } old_type;
        };
      } WMGameInfo;

## Elements

magicNumber | Magic number of this structure. Fixed at WM_GAMEINFO_MAGIC_NUMBER (== 0x0001).
ver | Version number of this structure. It is managed in the library and the user does not need to be concerned with it.
ggid | Game group ID. This is a unique value for identifying game applications with compatible communication.
tgid | Temporary group ID. This is a dynamic value set on the parent side to allow uniqueness when the same device and same game application establish multiple communication.
userGameInfoLength | Size, in byte units, of available data stored in `userGameInfo`. Maximum is 112 bytes.
userGameInfo | Array in which any information characteristic to the application is stored.
`attribute` | The value showing parent attributes, such as "download play possible while receiving entry".
parentMaxSize | Maximum size of parent send data in MP communication.
childMaxSize | Maximum size of child send data in MP communication.
reserved | The reserved region. The user does not need to use this argument.
old_type | Provided for compatibility with old format. The user does not need to use this argument.

## Description

The structure stores information of parent discovered by result of search by `WM_StartScan` function.

`attribute` field consists of the following logical sums.

WM_ATTR_FLAG_ENTRY | "Receiving entry" flag
WM_ATTR_FLAG_MB | "Download play possible" flag
WM_ATTR_FLAG_KS | "Key sharing" flagNot currently used.
WM_ATTR_FLAG_CS | Continuation communication mode. Not currently used

Before any fields of the WMGameInfo structure can be accessed, it is necessary to check that the magicNumber field equals WM-GAMEINFO_MAGIC_NUMBER (== 0x0001). The WM_IsValidGameInfo or WM_IsValidGameBeacon functions can be used to check the magicNumber field. In addition, since the WMGameInfo structure is extended for backward compatibility as long as the magicNumber is equal, if the ver field contains an unknown value, be sure to assume this version has the same functions as the current one.

## Revision History

02/20/2006 Deleted version and added magicNumber and ver. Added descriptions.
12/08/2005 Deleted a description related to key sharing.
03/02/2005 Added statement regarding the range for `userGameInfoLength` member.
12/20/2004 Added explanation of `gameNameCount_attribute`.
11/12/2004 Corrected the unit of `userGameInfoLength`.
10/06/2004 Initial version.

CONFIDENTIAL