Show data.xml syntax highlighted
<main>
<sensor_data mote_id="158" timestamp_mote_transmitted="123451234" timestamp_mote_server_received="123451234">
<!-- XML is not typed, so it can be int, char, long, string -->
<sensor type="131" value="25555"/>
</sensor_data>
<!-- sympathy data -->
<sympathy_data mote_id="158" time_awake_mins="123451234">
<!-- if no failure, congestion, or sink, then omit printing completely -->
<failure_type>3</failure_type>
<root_cause>3</root_cause>
<failure_localization>3</failure_localization>
<congestion_detected>1</congestion_detected>
<sink>1</sink>
<packet_table>
<packet type="NEIGHBOR" number_rx="52" />
<packet type="ROUTE" number_rx="30" />
<packet type="SYMPATHY" number_rx="30" />
<packet type="BEACON" number_rx="30" />
</packet_table>
<!-- print the following ONLY when they change -->
<neighbor_list>
<node mote_id="159" ingress="245" egress="235" avg_rssi="34" />
</neighbor_list>
<!-- print the following ONLY when we received an update -->
<routing_table>
<sink mote_id="2" next_hop_address="158" path_quality="245"/>
<sink mote_id="3" next_hop_address="158" path_quality="235"/>
</routing_table>
<!-- print this ONLY when it changed -->
<!-- we dont need this if it can be calculated by the data-base -->
<!-- <routing_children>
<node mote_id="5"/>
<node mote_id="30"/>
</routing_children> -->
<!-- print the following ONLY when it changed. -->
<num_neighbors_heard_this_node>5</num_neighbors_heard_this_node>
...
</sympathy_data>
</main>
<!--
2) Sympathy Data, provided for each node:
typedef struct sympathy_data {
int node_address;
** neighbor_t neighbor_list[MAX_NEIGHBORS];
** route_t routing_table[MAX_SINKS];
int (char *?) failure_type;
bool congestion_detected;
bool sink; /* Is this the sink */
** packet_t packet_table[MAX_PACKET_TYPES];
int routing_children[MAX_CHILDREN]; /* Who are children of this node */
int neighbors_heard_this_node[MAX_NEIGHBORS];
}
typedef struct packet {
pkt_type type; /* an enum? */
int number_rx; /* Number received from this node */
int minutes_since_last_received;
} packet_t;
enum {
NEIGHBOR = 0,
ROUTING,
COMP_1,
COMP_2,
MAX_PACKETS
} pkt_type;
typedef struct neighbor {
int address;
uint8_t ingress;
uint8_t egress;
} neighbor_t;
typedef struct route {
int sink_address;
int next_hop_address;
uint8_t path_quality;
} route_t;
-->
See more files for this project here