44 PROCESS(shell_neighbors_process,
"neighbors");
47 "neighbors: dump neighbor list in binary format",
48 &shell_neighbors_process);
50 static uint8_t listening_for_neighbors = 0;
54 received_announcement(
struct announcement *a,
const linkaddr_t *from,
55 uint16_t
id, uint16_t value)
64 if(listening_for_neighbors) {
65 memset(&msg, 0,
sizeof(msg));
68 msg.rssi = packetbuf_attr(PACKETBUF_ATTR_RSSI);
69 msg.lqi = packetbuf_attr(PACKETBUF_ATTR_LINK_QUALITY);
70 shell_output(&neighbors_command, &msg,
sizeof(msg),
"", 0);
82 listening_for_neighbors = 1;
87 listening_for_neighbors = 0;
93 shell_rime_neighbors_init(
void)
96 SHELL_RIME_ANNOUNCEMENT_IDENTIFIER_NEIGHBORS,
97 received_announcement);
void announcement_remove(struct announcement *a)
Remove a previously registered announcement.
int etimer_expired(struct etimer *et)
Check if an event timer has expired.
void announcement_register(struct announcement *a, uint16_t id, announcement_callback_t callback)
Register an announcement.
#define PROCESS_BEGIN()
Define the beginning of a process.
Main header file for the Contiki shell
Header file for the Rime stack
void shell_output(struct shell_command *c, void *data1, int len1, const void *data2, int len2)
Output data from a shell command.
void linkaddr_copy(linkaddr_t *dest, const linkaddr_t *src)
Copy a Rime address.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define PROCESS_END()
Define the end of a process.
#define PROCESS_EXITHANDLER(handler)
Specify an action when a process exits.
void shell_register_command(struct shell_command *c)
Register a command with the shell.
#define PROCESS_WAIT_EVENT_UNTIL(c)
Wait for an event to be posted to the process, with an extra condition.
void announcement_listen(int time)
Listen for announcements for a specific amount of announcement periods.
#define PROCESS(name, strname)
Declare a process.
Representation of an announcement.
void etimer_set(struct etimer *et, clock_time_t interval)
Set an event timer.
void announcement_set_value(struct announcement *a, uint16_t value)
Set the value of an announcement.
#define SHELL_COMMAND(name, command, description, process)
Define a shell command.
#define CLOCK_SECOND
A second, measured in system clock time.