4.7.4.5 User Application Development

This section talks about the mandatory code modifications that need to be incorporated in order to implement the sleep mode functionality.

  • Include
    • definitions.h in all the files where UART will be used to print debug information.
Note: definitions.h is not specific to just UART peripheral, instead it must be included in all application source files where peripheral functionality will be exercised.
  • Step 1: app_user_edits.c
    • Some of the Harmony 3 generated files cannot be fully configured by the MPLABX Code Configurator. This file contains the instructions for the user to modify these files.

      Follow the instruction mentioned on the app_user_edits.c file and after completing the required edits, comment out or remove the #error line. Also see 14.1 User Action.

  • Step 2: zigbeeAppDeviceSelect.h
    • Default Generated: “#define CS_UID 0 //Unique Identifier (UID) determining the device extended address”.
    • Change to a unique value: “#define CS_UID 0x123bee //Unique Identifier (UID) determining the device extended address”.

      Reason: By default, the coordinator also has the same value. In a network the UID value should be unique.

      Note: The below modifications are specific to the Deep Sleep mode feature.
  • Step 3: stackConfig.h (optional)

    If the deep sleep period has to be increased/decreased according to the requirements, then it has to be changed in the stackConfig.h file as mentioned below.

    Make sure that the “CS_DEFAULT_END_DEVICE_TIMEOUT” value should be three times greater than the “CS_END_DEVICE_SLEEP_PERIOD”. For example, if the Device deep sleep period is 1 min, then the End device timeout period should be greater than 3 min.

    Related Links

    4.7.3 Zigbee Centralized Network Formation by Combined Interface