name=Button Form/Join Code
category=Utility

# Any string is allowable here.  Generally though it is Production Ready, Test Tool, Extension Needed
qualityString=Extension Needed
# This is one of the following:  productionReady, testTool, extend
quality=extend

# Not applicable
# introducedIn=

description=(Requires Network Creator Security + Network Creator or Network Steering plugin to function properly in Zigbee 3.0 networks.  Else, Network Find plugin is strongly recommended but not mandatory.)  This code will hook up button 0 to have specific behavior based on the current network state.  The behavior is as follows. If the device is not joined to a network, it will form a Zigbee 3.0 network (via Network Creator plugin) if it is configured as a coordinator or join a Zigbee 3.0 or ZHA legacy network (via Network Steering plugin) if it is configured as a router. If the device is joined to a network then pressing the button will broadcast a ZDO permit join to allow new devices to join.  Holding the button for 5 seconds and releasing will cause the device to leave the network.  Button 1 is not used and a callback is provided to another module wishing to use it. 

sourceFiles=button-joining.c, button-joining-cli.c

# Included by default because the HAL configuration tab enables the button handling by default.
includedByDefault=false

options=permitJoinTimeout

implementedCallbacks=emberAfHalButtonIsrCallback

permitJoinTimeout.name=Permit Join Timeout (seconds)
permitJoinTimeout.description=The length of time permit joining will be enabled in the network.  A permit join timeout of 255 is not allowed because this tells devices to allow permit joining  forever.
permitJoinTimeout.type=NUMBER:1,254
permitJoinTimeout.default=60

events=Button0, Button1
