52 #include "net/ipv6/ip64-addr.h" 59 char buf[UIPLIB_IPV6_MAX_STR_LEN];
61 SHELL_OUTPUT(output,
"%s", buf);
68 SHELL_OUTPUT(output,
"(NULL LL addr)");
72 for(i = 0; i < LINKADDR_SIZE; i++) {
73 if(i > 0 && i % 2 == 0) {
74 SHELL_OUTPUT(output,
".");
76 SHELL_OUTPUT(output,
"%02x", lladdr->u8[i]);
82 output_prompt(shell_output_func
output)
84 SHELL_OUTPUT(output,
"#");
86 SHELL_OUTPUT(output,
"> ");
89 PT_THREAD(shell_input(
struct pt *pt, shell_output_func
output,
const char *cmd))
92 static const struct shell_command_t *cmd_descr = NULL;
102 args = strchr(cmd,
' ');
108 cmd_descr = shell_command_lookup(cmd);
109 if(cmd_descr != NULL) {
110 static struct pt cmd_pt;
113 SHELL_OUTPUT(
output,
"Command not found. Type 'help' for a list of commands\n");
static uip_ipaddr_t ipaddr
Pointer to prefix information option in uip_buf.
Main header file for the Contiki shell
void shell_commands_init(void)
Initializes Shell-commands module.
void shell_output_lladdr(shell_output_func output, const linkaddr_t *lladdr)
Prints a link-layer address.
Main header file for the Contiki shell
#define PT_BEGIN(pt)
Declare the start of a protothread inside the C function implementing the protothread.
#define PT_SPAWN(pt, child, thread)
Spawn a child protothread and wait until it exits.
static uint8_t output(const linkaddr_t *localdest)
Take an IP packet and format it to be sent on an 802.15.4 network using 6lowpan.
linkaddr_t linkaddr_node_addr
The link-layer address of the node.
Header file for the IP address manipulation library.
#define PT_END(pt)
Declare the end of a protothread.
#define PT_THREAD(name_args)
Declaration of a protothread.
void shell_init(void)
Initializes Shell module.
Header file for the uIP TCP/IP stack.
void shell_output_6addr(shell_output_func output, const uip_ipaddr_t *ipaddr)
Prints an IPv6 address.
int uiplib_ipaddr_snprint(char *buf, size_t size, const uip_ipaddr_t *addr)
Write at most size - 1 characters of the IP address to the output string.