# WM_StartParent

## Syntax

      #include <nitro/wm.h>

      WMErrCode WM_StartParent( WMCallbackFunc callback );

## Arguments

callback | Specifies the callback function to be called when the notification of the status for the asynchronous process is sent or when the asynchronous process completes. This callback is called from within the interrupt handler.

## Return Values

Returns the results of the `WMErrCode` enumerated type process.

## Description

Starts a parent operation based on parameters set by `WM_SetParentParameter`This function is only executable when the WM is in the `IDLE` state. This function changes the WM to the `PARENT` state. If the return value is `WM_ERRCODE_OPERATING`, a callback is generated after the setup process to be a parent is completed. If the current number of connected children is less than the number specified by `maxEntry(WM_SetParentParameter)`, it accepts children and generates a callback when a connection is completed. One callback can only obtain information for one child machine. If the beacon transmission indicator is enabled by `WM_SetBeaconIndication`, the specified callback is generated every time the beacon is transmitted. Also, when disconnecting from a connected child device, a callback indicating the AID of that child device will be generated separately.

## Note

If the machine starts working successfully as a parent after this function is called, a callback will be generated. In some cases, this callback will occur after the notification indicating that beacon transmission is complete or that a child was connected/disconnected. When initializing as a parent, do not initialize when a callback has occurred, but perform initialization before calling this function.

## See Also

`WM_SetParentParameter`, `WM_EndParent`

## Revision History

2005/06/08 Added statement about callback being called from the interrupt handler.
2005/02/07 Added caution about callbacks.
2004/10/22 Changed type of return value.
2004/08/02 Standardized structure names.
2004/07/29 Added to Description.
2004/07/23 Initial version.

CONFIDENTIAL