# WXCStateCode

## Definition

  `#include <nitro/wxc.h>`

      typedef enum
      {
          /* Internal state that can be obtained with the WXC_GetStatus function */
          WXC_STATE_END,            /* State before WXC library initialization */
          WXC_STATE_ENDING,         /* After WXC_End function and during end processing */
          WXC_STATE_READY,         /* After WXC_Init function and before the WXC_Start function */
          WXC_STATE_ACTIVE,         /* After the WXC_Start function and wireless is enabled */

          /* Internal event notification sent to system callback */
          WXC_STATE_CONNECTED,      /* Connection notification (argument is pointer to WXCUserInfo structure that stores the information of the connection partner) */
          WXC_STATE_EXCHANGE_DONE,  /* Data exchange completed (The argument is receive buffer specified by user) */
          WXC_STATE_BEACON_RECV     /* Beacon receive (Argument is WXCBeaconFoundCallback structure) */
      }
      WXCStateCode;

## Description

This shows the enumerator constants that indicate WXC library internal states. The meaning of each enumerator constant is shown in the following table:
Value obtained with the WXC_GetStateCode function

Value | State | System callback specified with the WXC_Init function
WXC_STATE_END | This is the state before the initialization of the WXC library or after the completion of the end process function, WXC_End. | Notified when end processing by the WXC_End function is completed. A pointer to the work memory allocated with the WXC_Init function is passed as an argument. This memory will have already been released to the user application at the point when this callback occurs.
WXC_STATE_ENDING | State in which the WXC_End function is called and the wireless end process is performed. | Notified immediately from inside the WXC_End function call. NULL is always passed to an argument.
WXC_STATE_READY | State after the WXC_Init function is called and before the WXC_Start function is called. | Notified from inside the WXC_Init function call or when the state transition process by WXC_Stop function has completed. NULL is always passed to an argument.
WXC_STATE_ACTIVE | State in which internal wireless is active after a call of the WXC_Start function. | Notified immediately from inside the WXC_Start function call. NULL is always passed to an argument.

Value communicated only to the system callback specified with WXC_Init function.

Value | System callback specified with the WXC_Init function
WXC_STATE_CONNECTED | When started as a parent, notified each time a child is connected. A pointer to the WXCUserInfo structure is passed as an argument.
WXC_STATE_BEACON_RECV | Notified each time a beacon from a parent that is a possible connection target is detected. A pointer to the WXCBeaconFoundCallback structure is passed as an argument.

Value communicated only to the user callback specified with WXC_RegisterCommonData function.

Value | User callback specified with the WXC_RegisterCommonData function
WXC_STATE_EXCHANGE_DONE | Notified each time data exchange completes. The passed argument is a pointer to the WXCBlockDataFormat structure that holds the received data.

## See Also

`WXCCallback
WXCBeaconFoundCallback
WXCUserInfo
WXC_Init
WXC_Start
WXC_End
WXC_GetStateCode`

## Revision History

2006/02/20 Added descriptions for `WXC_STATE_EXCHANGE_DONE`.
2005/11/04 Added descriptions for `WXC_STATE_BEACON_RECV`.
2005/10/11 Modified descriptions for `WXC_STATE_READY`.
2005/08/04 Initial version.

CONFIDENTIAL