# example_polling_application_coordinator_afzdo.c File Reference

Resets Radio, configures this device to be a Zigbee Coordinator, and waits When button is pressed, sends a message to the end device. Demonstrates how end device automatically polls. More...

`#include "../HAL/hal.h"`
`#include "../ZNP/znp_interface.h"`
`#include "../ZNP/application_configuration.h"`
`#include "../ZNP/af_zdo.h"`
`#include "../ZNP/znp_interface_spi.h"`
`#include "Messages/infoMessage.h"`
`#include "header.h"`
`#include "znp_example_utils.h"`

## Defines
#define | TEST_CLUSTER 0x77
#define | FLAG_BUTTON_PRESSED 0x01
signed int | returnValue
unsigned char | znpBuf [100]
signed int | znpResult
void(* | buttonIsr )(void)
unsigned int | applicationFlags = 0x00
void | waitForDeviceState (unsigned char expectedState)
void | handleButtonPress (void)
int | main (void)

## Detailed Description

Resets Radio, configures this device to be a Zigbee Coordinator, and waits When button is pressed, sends a message to the end device. Demonstrates how end device automatically polls.

See also:
  http://processors.wiki.ti.com/index.php/Tutorial_on_the_Examples and http://e2e.ti.com/support/low_power_rf/default.aspx

Rev
  598

Author
  dsmith

Date
  2010-06-14 16:08:43 -0700 (Mon, 14 Jun 2010)

YOU ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.

## Function Documentation

int main | ( | void |  | ) |

Now, we know where to send the message, so wait until a button is pressed

void waitForDeviceState | ( | unsigned char | expectedState | ) |

Blocking wait until a message is received. Exits if received message is a ZDO_STATE_CHANGE_IND and the state matches what we want. Else loops.

Parameters:

  | expectedState | the deviceState we are expecting - DEV_ZB_COORD etc.

Wait until a message is received. Exits if received message is a ZDO_STATE_CHANGE_IND and the state matches what we want. Else loops.

Parameters:

  | expectedState | the deviceState we are expecting - DEV_ZB_COORD etc.

Returns:
  0 if success, -1 if timeout

## Variable Documentation

void(* buttonIsr)(void)

function pointer (in hal file) for the function that gets called when a button is pressed

All Data Structures Files Functions Variables Defines