Packet format - Kvel2D/ecs193-wireless-sensor-network GitHub Wiki
There are two kinds of packets: reading and health packets.
Reading packets are generated at nodes connected to sensors that have "has_sensor" flag turned on in tree_data.h. These packets transfer temperature information.
Health packets are generated at all nodes that are NOT sensor nodes - which means relay nodes and the gateway node. These packets are used to confirm status of nodes.
The format in which both types of packets are printed is:
- packet age(0-65536 seconds), current id(0-254), packet number(0-254, origin id(0-254), sequence of readings(0.1-99.0 floats)
Example packet: "45, 3, 120, 7, 20.3, 25.2, 31.0, 15.4, 0.0, 0.0"
Packet age is equal to the amount of time that passed since the packet was created. Packet age caps out at 65536 seconds(no overflow).
Current id is the id of the node where the packet came from. So if node 5 got a packet from node 2, current id will be 2.
Packet number is incremented each time a packet is created on a node. Packet numbers are specific to each node.
Origin id is the id of the node where packet was created.
Readings are floats from 0.1 to 99.0. Note that 0.0 is reserved as N/A value, this value will be displayed if no sensor is connected or sensor is broken.
Health packet use readings for special additional info. For now the only one is that the first reading float is equal to the size of the packet queue at that node.