PreviousNext
Coordinator-FRCandSleep
Help > Custom DPA Handler > Examples > Coordinator-FRCandSleep

This example shows autonomous [C], which regularly sends a predefined FRC command Acknowledged broadcast - bytes to the network. It might become a seed of a sophisticated battery-powered long-life sensor network.

 

The FRC command serves two purposes. Firstly it reads the temperature value from onboard temperature sensors at the Nodes, which is its default return FRC value. Secondly, it utilizes the acknowledged broadcast feature to put Nodes in the sleep state after they return the temperature value via FRC. The embedded acknowledged DPA Request in the FRC command is an ordinary Sleep command. The [C] performs delay using the DpaTicks API variable including the safety gap after both Send and Extra result commands are executed inside the Idle event handler. Also please note a small delay inside the Init event to allow the external interface master to boot. This is necessary in the case of IQRF gateways.

 

→ Self-study tip: Change sleeping time to 2 minutes.

 

→ Self-study tip: Modify the code to return the last RSSI value instead of temperature.

 Hint: You will have to handle the FrcValue event and Acknowledged broadcast - bytes FRC command code.

 

→ Self-study tip: Utilize the Coordinator’s peripheral RAM for passing a set of Nodes to return the FRC byte value from. This is useful in the case of bigger networks (with the address above 62, see Send).
 Hint: You will have to substitute using
Send to Send Selective.

 

→ Self-study tip: Modify the code to return the state of the IQRF button.

 Hint: You will have to substitute using Acknowledged broadcast - bytes for Acknowledged broadcast - bits and add a simple FrcValue event handler.