# Name of the plugin.
name=Poll Control Server Cluster
category=Home Automation

# Any string is allowable here.  Generally it is either: Production Ready, Test Tool, or Extension Needed
qualityString=Production Ready
# This must be one of the following:  productionReady, testTool, extensionNeeded
quality=production

introducedIn=ha-latest

# Description of the plugin.
description=Ember implementation of Poll Control server cluster.  The plugin will periodically check in with Poll Control clients to see if any client wants to manage the poll period of the server.  Any device listed in the binding table for the Poll Control cluster is assumed to be a client.  At startup, this plugin will set the long and short poll intervals of the device to the values of the long and short poll interval attributes.

providedApis=tc-connectivity

# List of .c files that need to be compiled and linked in.
sourceFiles=poll-control-server.c

# List of callbacks implemented by this plugin
implementedCallbacks=emberAfPollControlClusterServerInitCallback,emberAfPollControlClusterServerTickCallback,emberAfPollControlClusterServerPreAttributeChangedCallback,emberAfPollControlClusterServerAttributeChangedCallback,emberAfPollControlClusterCheckInResponseCallback,emberAfPollControlClusterFastPollStopCallback,emberAfPollControlClusterSetLongPollIntervalCallback,emberAfPollControlClusterSetShortPollIntervalCallback, emberAfPluginPollControlServerStackStatusCallback

# Turn this on by default
includedByDefault=true

# Which clusters does it depend on
dependsOnClusterServer=Poll Control

# Required API
requiredApis=binding

# Plugin options
options=maxClients,checkInResponseTimeout,acceptSetLongPollIntervalCommand,acceptSetShortPollIntervalCommand,trustCenterCheckInFailureThreshold

maxClients.name=Maximum Clients Supported
maxClients.description=Maximum number of clients supported
maxClients.type=NUMBER:1,255
maxClients.default=4

checkInResponseTimeout.name=Check-in timeout duration (in QS)
checkInResponseTimeout.description=The amount of time, in quarter seconds, the plugin will wait for Check-In Response commands from Poll Control clients.
checkInResponseTimeout.type=NUMBER
checkInResponseTimeout.default=32

acceptSetLongPollIntervalCommand.name=Accept Set Long Poll Interval commands
acceptSetLongPollIntervalCommand.description=Indicates whether this device will process the optional Set Long Poll Interval command from Poll Control clients.  The Set Long Poll Interval command allows clients to remotely change the long poll interval of this device.
acceptSetLongPollIntervalCommand.type=BOOLEAN
acceptSetLongPollIntervalCommand.default=TRUE

acceptSetShortPollIntervalCommand.name=Accept Set Short Poll Interval commands
acceptSetShortPollIntervalCommand.description=Indicates whether this device will process the optional Set Short Poll Interval command from Poll Control clients.  This Set Short Poll Interval command allows clients to remotely change the short poll interval of this device.
acceptSetShortPollIntervalCommand.type=BOOLEAN
acceptSetShortPollIntervalCommand.default=TRUE

trustCenterCheckInFailureThreshold.name=Maximum poll control checkin failures
trustCenterCheckInFailureThreshold.description=The amount of poll control checkin failures with a trust center permitted before a callback is fired.
trustCenterCheckInFailureThreshold.type=NUMBER
trustCenterCheckInFailureThreshold.default=3

events=checkIn
checkIn.type=endpoint

setup(bookkeeping) {
  resetAttributes=emAfPluginPollControlServerResetAttributesCallback
}