January
2006, Issue 186
Electronic
Scarecrow
OUTGOING
PACKETS
After
the replies are processed, the code figures out whether
or not it’s time to send a packet. If the last sent
packet wasn’t acknowledged, it’s sent again. Otherwise,
it checks whether or not a new request packet is needed.
A
data packet is sent if the sensor status changes from
the last time it was sent. The data packet contains
the current sensor status and a sensor data value.
If
a switch is activated, indicating that you want to enable
or disable the system remotely, an enable/disable packet
is sent along with the switch status. This enables you
to enter the protected area without triggering the system.
You can enable the system again when you leave.
If
it’s time to send a ping, the sensor test routines are
executed and the results are sent along with the battery
and charger voltages. If enough time has passed that
the sensor offsets may have drifted, they’re reread
as well.
A
download data request packet is sent when Download mode
is enabled. The packet is sent using maximum transmit
power. It’s followed by a longer receive timeout than
usual in order to boost the integrity of the download
process.