How does the polling mechanism work?
In AppBuilder there are two different places where you can setup polling values. There is an "End Device Support" plugin and a "Home Automation > Poll Control Support Cluster.” They aren’t checked against each other, so be aware of a potential conflict if you configure both. Currently, any value declared in both places (long poll interval, short poll interval) will be initialized as the "End Device Support" plugin's values.
The "End Device Support" plugin maintains two different polling intervals. There is a short poll interval and a long poll interval. When a device is using the long poll interval it is referred to as hibernating. This means that it will poll at the rate you set your long poll interval, but when it is not polling, the radio will be turned off. It will continue to stay in long poll timing unless the parent has a message queued up for the end device which the end device knows about (data pending bit set, and end device polls). In this case, the end device will begin polling at the short poll interval for a set period of time. This time is determined by either a wake timeout occurring or a response that the end device is waiting on when the data pending bit is not set.
Whether or not the wake timeout will be used is determined by the wake bitmask (details on the bitmask can be found in af-types.h). Also, the length of time that the parent will hold on to a message is determined by the EMBER_INDIRECT_TRANSMISSION_TIMEOUT (~7.68 seconds, should not be changed). Once the end device receives the message and gets the response or hits the wake timeout value, it will go back to polling at the long poll interval.
If you are using the Poll Control Cluster in HA1.2, there is an additional element named "Check In." This is really an Application layer interval where an end device (Poll Control Server) contacts another node, the Poll Control Client, which does not have to be – and usually is not --its parent. The point of this particular check-in is to see if there is information waiting at the Client, which can reside there for much longer than if it had been sent "normally" through the parent.
Check In > Long Poll > Short Poll
Example: (Check In = 2 hrs) > (Long Poll = 5 min) > (Short Poll = 1 sec)
The Poll Control Cluster Check In interval is longer than the Long Poll Interval and longer, by definition, than the Short Poll Interval as well. There is also a Check In Timeout. These are set in Simplicity Studio App Builder as Cluster Attributes and in the Poll Control Client and Server plugin fields, and can be set programmatically as well.
The Poll Control Client optionally has some control over the Poll Control Server's Long and Short Poll intervals as well.
The "Poll Control Support Cluster” introduces a concept of fast polling. The important distinction to note between the fast polling and the short poll interval is that fast polling is a mode and short polling interval is a value. To elaborate on this, a device can only be put into "fast polling mode" by receiving a check-in message (a message unique to the Poll Control Support cluster). A check-in message will be sent to a device, and a device will begin the fast polling mode.
Once it enters this mode it will begin to use the short polling interval. That means that the sleep end device will poll at the same rate as it would if it expected a message from the device's parent. However, fast polling mode does not use the wake timeout. Instead, there is a fast poll timeout. This timeout is the only way, besides sending a stop fast polling command, for a device to end the fast polling mode. Once the device leaves the fast polling mode, it will begin to use the long poll interval.
Note: If both the End Device Support plugin and the Poll Control Support cluster put the device into a short polling interval mode, the device will continue to poll at that rate until BOTH the plugin and cluster indicate that the device should poll at the long poll interval.
For more information on the Poll Control Support Cluster, please visit the Zigbee.org website, more specifically the latest ZigBee Cluster Library Specification.
For an additional discussion of Poll Control Support Cluster activities with an example, please see the KBA The Poll Control Cluster: a reliable way for SED to receive asynchronous transmissions from other devices without frequent polling.
For more information on polling in general, please see UG391: Zigbee Application Framework Developer’s Guide.