name=End Device Support
category=Utility

description=Ember implementation of polling for end devices.  Note that the Poll Control Server plugin sets the long and short poll intervals at startup.  If both plugins are enabled, the long and short poll intervals set here will not be used.

qualityString=Production Ready
quality=production

sourceFiles=end-device-support.c, end-device-move.c, end-device-support-cli.c, polling-common.c
sourceFilesSoc=polling-soc.c
sourceFilesHost=polling-host.c

trigger.enable_plugin=ZIGBEE_DEVICE_TYPE:END_DEVICE
trigger.disable_plugin=ZIGBEE_DEVICE_TYPE:!END_DEVICE

includedByDefault=false

implementedCallbacks=emberAfPluginEndDeviceSupportStackStatusCallback, emberPollCompleteHandler, emberAfPreNcpResetCallback, ezspPollCompleteHandler, emberAfAddToCurrentAppTasksCallback, emberAfRemoveFromCurrentAppTasksCallback, emberAfGetCurrentAppTasksCallback, emberAfGetLongPollIntervalMsCallback, emberAfGetLongPollIntervalQsCallback, emberAfSetLongPollIntervalMsCallback, emberAfSetLongPollIntervalQsCallback, emberAfGetShortPollIntervalMsCallback, emberAfGetShortPollIntervalQsCallback, emberAfSetShortPollIntervalMsCallback, emberAfSetShortPollIntervalQsCallback, emberAfGetCurrentPollIntervalMsCallback, emberAfGetCurrentPollIntervalQsCallback, emberAfGetWakeTimeoutMsCallback, emberAfGetWakeTimeoutQsCallback, emberAfSetWakeTimeoutMsCallback, emberAfSetWakeTimeoutQsCallback, emberAfGetWakeTimeoutBitmaskCallback, emberAfSetWakeTimeoutBitmaskCallback, emberAfGetCurrentPollControlCallback, emberAfGetDefaultPollControlCallback, emberAfSetDefaultPollControlCallback, emberAfStartMoveCallback, emberAfStopMoveCallback

setup(bookkeeping) {
  init=emberAfPluginEndDeviceSupportInitCallback
  tick=emberAfPluginEndDeviceSupportTickCallback
}

events=Polling, Move

Polling.type=network
Move.type=network

options=shortPollIntervalSeconds, longPollIntervalSeconds, wakeTimeoutSeconds, wakeTimeoutBitmask, maxMissedPolls, maxRejoinAttempts, enablePollCompletedCallback, allowRejoinsWithWellKnownLinkKey, enhancedSleepSupport

shortPollIntervalSeconds.name=Short Poll Interval (seconds)
shortPollIntervalSeconds.description=The amount of time (in seconds) the device will wait between MAC data polls when it is expecting data.
shortPollIntervalSeconds.type=NUMBER
shortPollIntervalSeconds.default=1

longPollIntervalSeconds.name=Long Poll Interval (seconds)
longPollIntervalSeconds.description=The amount of time (in seconds) the device will wait between MAC data polls to ensure connectivity with its parent.
longPollIntervalSeconds.type=NUMBER
longPollIntervalSeconds.default=300

wakeTimeoutSeconds.name=Wake Timeout (seconds)
wakeTimeoutSeconds.description=The amount of time (in seconds) the device will wait for a task in the wake bitmask to finish.  While waiting, the device will short poll.
wakeTimeoutSeconds.type=NUMBER
wakeTimeoutSeconds.default=3

wakeTimeoutBitmask.name=Wake Timeout Bitmask
wakeTimeoutBitmask.description=The bitmask that determines which tasks will timeout automatically and which tasks require manual removal from the task list.  The default value corresponds to EMBER_AF_WAITING_FOR_ZDO_RESPONSE (0x00000008) and EMBER_AF_WAITING_FOR_ZCL_RESPONSE (0x00000010).  See EmberAfApplicationTask for more information.
wakeTimeoutBitmask.type=NUMBER
wakeTimeoutBitmask.default=0x00000018

maxMissedPolls.name=Max Number of Missed Polls
maxMissedPolls.description=The maximum number of missed MAC data polls that will trigger a move (rejoin).
maxMissedPolls.type=NUMBER
maxMissedPolls.default=3

maxRejoinAttempts.name=Max Number of Sequential Rejoin (move) attempts
maxRejoinAttempts.description=This is the maximum number of sequential attempts that will be made to rejoin the ZigBee network and find a new parent the device will make before giving up.  If this is set to 255, then the device will never stop attempting to rejoin when it has lost its parent.  A successful rejoin resets the number of attempts to 0.
maxRejoinAttempts.type=NUMBER:0,255
maxRejoinAttempts.default=3
maxRejoinAttempts.define=EMBER_AF_REJOIN_ATTEMPTS_MAX

enablePollCompletedCallback.name=Enable Poll Completed Callback
enablePollCompletedCallback.description=This option enables a callback function when a poll is completed. Enabling this option on hosts will result in increased traffic between the host and the NCP.
enablePollCompletedCallback.type=BOOLEAN
enablePollCompletedCallback.default=false

allowRejoinsWithWellKnownLinkKey.name=Attempt Rejoins using a well-known Trust Center Link Key (NOT RECOMMENDED, NOT SECURE)
allowRejoinsWithWellKnownLinkKey.description=This option will allow Trust Center Rejoin (unsecure rejoin) attempts when the device is using a well-known key, such as "ZigBeeAlliance09".  This exposes a potential security hole on the Trust Center side but is an option for backward compatibility with networks that need it. Note that the Trust Center may have its own policy for handling insecure rejoins and may choose to not send the network key to the rejoining device if it is using a well known link key.
allowRejoinsWithWellKnownLinkKey.type=BOOLEAN
allowRejoinsWithWellKnownLinkKey.default=false

enhancedSleepSupport.name=Enhanced Sleep Support
enhancedSleepSupport.description=This provides enhanced sleep support on the device. For example, setting this option to TRUE will cause end devices that are already on a network to read their parent data from a token instead of sending an orphan notification message. If the device is powering down a lot (for example, going to EM4), then this is option is important. The default is FALSE to preserve backwards functionality.
enhancedSleepSupport.type=BOOLEAN
enhancedSleepSupport.default=FALSE