42 #include "collect-view.h"
46 PROCESS(collect_view_data_process,
"collect-view-data");
49 "collect-view-data: sensor data, power consumption, network stats",
50 &collect_view_data_process);
54 struct collect_view_data_msg msg;
55 struct collect_neighbor *n;
57 uint16_t num_neighbors;
58 uint16_t beacon_interval;
62 n = collect_neighbor_list_find(&shell_collect_conn.neighbor_list,
63 &shell_collect_conn.parent);
65 parent_etx = collect_neighbor_link_estimate(n);
69 num_neighbors = collect_neighbor_list_num(&shell_collect_conn.neighbor_list);
70 beacon_interval = broadcast_announcement_beacon_interval() /
CLOCK_SECOND;
72 collect_view_construct_message(&msg, &shell_collect_conn.parent,
73 parent_etx, shell_collect_conn.rtmetric,
74 num_neighbors, beacon_interval);
75 shell_output(&collect_view_data_command, &msg,
sizeof(msg),
"", 0);
81 shell_collect_view_init(
void)
#define PROCESS_BEGIN()
Define the beginning of a process.
Main header file for the Contiki shell
#define NULL
The null pointer.
void shell_output(struct shell_command *c, void *data1, int len1, const void *data2, int len2)
Output data from a shell command.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define PROCESS_END()
Define the end of a process.
void shell_register_command(struct shell_command *c)
Register a command with the shell.
#define PROCESS(name, strname)
Declare a process.
Neighbor discovery header file
#define SHELL_COMMAND(name, command, description, process)
Define a shell command.
#define CLOCK_SECOND
A second, measured in system clock time.