# WMStartParentCallback

## C Specification

      #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;

## Description

The structure that is passed to the callback function that is related to `WM_StartParent`.

## Arguments

`apiid` | Specifies the ID of the API that has become the callback generation source. This argument is the same as the `WMApiid` enumerated type. Here, it is fixed as `WM_APIID_START_PARENT`.
`errcode` | Asynchronous process results. This argument is the same as 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` that generated the callback will be stored. There are 4 causes: `WM_STATECODE_PARENT_START`, `WM_STATECODE_CONNECTED`, `WM_STATECODE_BEACON_SENT`, `WM_STATECODE_DISCONNECTED`.
`macAddress` | If `state` is `WM_STATECODE_CONNECTED`, the connected child's MAC address will be stored. If state is `WM_STATECODE_DISCONNECTED`, 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`, the AID that was allocated to the child will be stored.
`reason` | Stores the code showing the reason for disconnection when the state is `WM_STATECODE_DISCONNECTED`. This argument is used internally for debugging the library.

## Revision History

11/10/2004 Added text about the `reason` argument.
10/05/2004 Standardized MAC address as `u8` type
09/13/2004 Changed `WM_STATECODE_CHILD_CONNECTED` to `WM_STATECODE_CONNECTED`
08/23/2004 Added the `ssid` argument
08/02/2004 Standardized structure names
07/29/2004 Initial version