# WMStartParentCallback

## Definition

  `#include <nitro/wm.h>`

      typedef struct WMStartParentCallback
      {
          u16     apiid;
          u16     errcode;
          u16     wlCmdID;
          u16     wlResult;
          u16     state;
          u8      macAddress[6];
          u16     aid;
          u16     reason;
          u8      ssid[WM_SIZE_CHILD_SSID];
      } WMStartParentCallback;

## Elements

`apiid` | ID of the API that acts as the source for the callback generation. It is equivalent to the `WMApiid` enumerated type. Here, it is fixed as `WM_APIID_START_PARENT`.
`errcode` | Result of the asynchronous process. It is equivalent to the `WMErrCode` enumerated type.
`wlCmdID` | If `errcode` is `WM_ERRCODE_FAILED`, this function will store the ID of the command that was in error in the wireless firmware.
`wlResult` | If `errcode` is `WM_ERRCODE_FAILED`, this function will store the code was the source of the error in the wireless firmware.
`state` | If `errcode` is `WM_ERRCODE_SUCCESS`, the WM Cause Code generated by the callback is stored. There are five possible causes:. `WM_STATECODE_PARENT_START、WM_STATECODE_CONNECTED、WM_STATECODE_BEACON_SENT、WM_STATECODE_DISCONNECTED、WM_STATECODE_DISCONNECTED_FROM_MYSELF。`
`macAddress` | If `state` is `WM_STATECODE_CONNECTED`, the connected child's MAC address will be stored. If `state` is `WM_STATECODE_DISCONNECTED` or `WM_STATECODE_DISCONNECTED_FROM_MYSELF`, the disconnected child's MAC address will be stored.
`aid` | If `state` is `WM_STATECODE_CONNECTED`, the AID that was allocated to the child will be stored. If `state` is `WM_STATECODE_DISCONNECTED` or `WM_STATECODE_DISCONNECTED_FROM_MYSELF`, the AID that was allocated to the disconnected child will be stored.
`reason` | Stores the code showing the reason for disconnection when the state is `WM_STATECODE_DISCONNECTED` or `WM_STATECODE_DISCONNECTED_FROM_MYSELF`. This member is used internally in the library for debugging.
`ssid` | Stores the `ssid` that the child device has specified with `WM_StartConnect`.

## Description

This structure is passed to the callback function for the `WM_StartParent` function.

## Revision History

2006/02/17 Revised the description of codes returned in `state`.
2004/11/10 Added text about the `reason` member.
2004/10/05 Standardized MAC address as `u8` type.
2004/09/13 Changed `WM_STATECODE_CHILD_CONNECTED` to `WM_STATECODE_CONNECTED`.
2004/08/23 Added the `ssid` argument.
2004/08/02 Standardized structure names.
2004/07/29 Initial version.

CONFIDENTIAL