# WMStateCode

## C Specification

      #include <nitro/wm.h>

      typedef enum WMStateCode
      {
          WM_STATECODE_PARENT_START     = 0 ,
          WM_STATECODE_BEACON_SENT      = 2 ,

          WM_STATECODE_SCAN_START       = 3 ,
          WM_STATECODE_PARENT_NOT_FOUND = 4 ,
          WM_STATECODE_PARENT_FOUND     = 5 ,

          WM_STATECODE_CONNECT_START    = 6 ,
          WM_STATECODE_BEACON_LOST      = 8 ,

          WM_STATECODE_CONNECTED        = 7 ,
          WM_STATECODE_CHILD_CONNECTED  = 7 ,
          WM_STATECODE_DISCONNECTED     = 9 ,

          WM_STATECODE_MP_START         = 10 ,
          WM_STATECODE_MPEND_IND        = 11 ,
          WM_STATECODE_MP_IND           = 12 ,
          WM_STATECODE_MPACK_IND        = 13 ,

          WM_STATECODE_DCF_START        = 14 ,
          WM_STATECODE_DCF_IND          = 15 ,

          WM_STATECODE_BEACON_RECV      = 16 ,
          WM_STATECODE_DISASSOCIATE     = 17 ,
          WM_STATECODE_REASSOCIATE      = 18 ,
          WM_STATECODE_AUTHENTICATE     = 19 ,

          WM_STATECODE_PORT_SEND        = 20 ,
          WM_STATECODE_PORT_RECV        = 21 ,

          WM_STATECODE_FIFO_ERROR       = 22 ,

      } WMStateCode;

## Description

This enumerated type indicates the callback type that is used jointly as the `state` member of each structure that is passed to a WM asynchronous function's callback function.

## Arguments

`WM_STATECODE_PARENT_START` | Generated as a callback for `WM_StartParent`. Generated when a system begins communications processing as a parent.
`WM_STATECODE_CHILD_CONNECTED` | Integrated into `WM_STATECODE_CONNECTED`.
`WM_STATECODE_BEACON_SENT` | Generated as a callback for `WM_StartParent`. Generated each time beacon transmission to a child completes.
`WM_STATECODE_SCAN_START` | The specification of `WM_StartScan` has changed; this state code will no longer be generated.
`WM_STATECODE_PARENT_NOT_FOUND` | Generated as a callback for `WM_StartScan`. Indicates the result of a scan for a parent: no parent was found in the specified time.
`WM_STATECODE_PARENT_FOUND` | Generated as a callback for `WM_StartScan`. Indicates the result of a scan for a parent: one parent was found.
`WM_STATECODE_CONNECT_START` | Generated as a callback for `WM_StartConnect`. Generated when a system begins connection processing as a child.
`WM_STATECODE_BEACON_LOST` | Generated as a callback for `WM_StartConnect`. Generated when the beacon, transmitted periodically by the parent in order to synchronize communication, could not be received in a fixed period of time.
`WM_STATECODE_CONNECTED` | Generated as a callback for `WM_StartParent` or `WM_StartConnect`. Generated when the connection with the target is established. For a parent, it is generated every time children send connection request.
`WM_STATECODE_CHILD_CONNECTED` | Integrated into `WM_STATECODE_CONNECTED`.
`WM_STATECODE_DISCONNECTED` | Generated as a callback for `WM_StartParent` or `WM_StartConnect`. Generated when a communications party disconnects.
`WM_STATECODE_MP_START` | Generated as a callback for `WM_StartMP`. Generated when MP communications begins.
`WM_STATECODE_MPEND_IND` | Generated as a callback for `WM_StartMP`. Generated each time MP communications completes transmission of one MP packet. Only generated when communicating as a parent.
`WM_STATECODE_MP_IND` | Generated as a callback for `WM_StartMP`. Generated each time MP communications receives data from a parent. Only generated when communicating as a child..
`WM_STATECODE_MPACK_IND` | Generated as a callback for `WM_StartMP`. Generated each time the MP communication is completed.
`WM_STATECODE_DCF_START` | Generated as a callback for `WM_StartDCF`. Generated when DCF communications begins.
`WM_STATECODE_DCF_IND` | Generated as a callback for `WM_StartDCF`. Generated each time DCF communications receives data.
`WM_STATECODE_BEACON_RECV` | Generated as the callback specified by `WM_SetIndCallback`. Generated each time a system receives a beacon as a child.
`WM_STATECODE_DISASSOCIATE` | Generated as the callback specified by `WM_SetIndCallback`. Generated as a mid-term report on a disconnect process.
`WM_STATECODE_REASSOCIATE` | Generated as the callback specified by `WM_SetIndCallback`. Generated when a child that has once been disconnected is reconnected.
`WM_STATECODE_AUTHENTICATE` | Generated as the callback specified by `WM_SetIndCallback`. Generated as a mid-term report on a disconnect process.
`WM_STATECODE_PORT_SEND` | Generated as a callback when the data transmission to the port has completed.
`WM_STATECODE_PORT_RECV` | Generated as a callback specified with `WM_SetPortCallback`. Generated when receiving the data to be sent to the port, and when detecting the connection or disconnection of a child.
`WM_STATECODE_FIFO_ERROR` | Generated when the automatic process generated in the ARM7 side could not be recorded in the queue.

## Revision History

11/02/2004 Fixed omissions relating to the integration of past revisions
09/13/2004 Changed `WM_STATECODE_CHILD_CONNECTED` to `WM_STATECODE_CONNECTED`
08/20/2004 Revised because of specification changes of the scan functions
08/11/2004 Added description on the addition of WM specifications
07/29/2004 Initial version