Skip to content
Snippets Groups Projects
Commit c7dec592 authored by Cenk Gündoğan's avatar Cenk Gündoğan
Browse files

Merge pull request #4580 from authmillenon/shell/fix/nano

shell: commands: fix selective outputs for nano specs
parents a4a8e83a 950b80cc
No related branches found
No related tags found
No related merge requests found
...@@ -102,10 +102,10 @@ int _handle_reply(gnrc_pktsnip_t *pkt, uint32_t time) ...@@ -102,10 +102,10 @@ int _handle_reply(gnrc_pktsnip_t *pkt, uint32_t time)
min_seq_expected++; min_seq_expected++;
} }
printf("%u bytes from %s: id=%" PRIu16 " seq=%" PRIu16 " hop limit=%" PRIu8 printf("%u bytes from %s: id=%" PRIu16 " seq=%" PRIu16 " hop limit=%u time = %"
" time = %" PRIu32 ".%03" PRIu32 " ms\n", (unsigned) icmpv6->size, PRIu32 ".%03" PRIu32 " ms\n", (unsigned) icmpv6->size,
ipv6_addr_to_str(ipv6_str, &(ipv6_hdr->src), sizeof(ipv6_str)), ipv6_addr_to_str(ipv6_str, &(ipv6_hdr->src), sizeof(ipv6_str)),
byteorder_ntohs(icmpv6_hdr->id), seq, ipv6_hdr->hl, byteorder_ntohs(icmpv6_hdr->id), seq, (unsigned)ipv6_hdr->hl,
time / MS_IN_USEC, time % MS_IN_USEC); time / MS_IN_USEC, time % MS_IN_USEC);
gnrc_ipv6_nc_still_reachable(&ipv6_hdr->src); gnrc_ipv6_nc_still_reachable(&ipv6_hdr->src);
} }
......
...@@ -201,6 +201,7 @@ static void _netif_list(kernel_pid_t dev) ...@@ -201,6 +201,7 @@ static void _netif_list(kernel_pid_t dev)
netopt_state_t state; netopt_state_t state;
netopt_enable_t enable; netopt_enable_t enable;
bool linebreak = false; bool linebreak = false;
#ifdef MODULE_GNRC_IPV6_NETIF #ifdef MODULE_GNRC_IPV6_NETIF
gnrc_ipv6_netif_t *entry = gnrc_ipv6_netif_get(dev); gnrc_ipv6_netif_t *entry = gnrc_ipv6_netif_get(dev);
char ipv6_addr[IPV6_ADDR_MAX_STR_LEN]; char ipv6_addr[IPV6_ADDR_MAX_STR_LEN];
...@@ -255,7 +256,7 @@ static void _netif_list(kernel_pid_t dev) ...@@ -255,7 +256,7 @@ static void _netif_list(kernel_pid_t dev)
if (res >= 0) { if (res >= 0) {
res = gnrc_netapi_get(dev, NETOPT_CSMA, 0, &enable, sizeof(enable)); res = gnrc_netapi_get(dev, NETOPT_CSMA, 0, &enable, sizeof(enable));
if ((res >= 0) && (enable == NETOPT_ENABLE)) { if ((res >= 0) && (enable == NETOPT_ENABLE)) {
printf(" CSMA Retries: %" PRIu8 " ", *((uint8_t *) &u8)); printf(" CSMA Retries: %u ", (unsigned)u8);
} }
} }
...@@ -320,7 +321,7 @@ static void _netif_list(kernel_pid_t dev) ...@@ -320,7 +321,7 @@ static void _netif_list(kernel_pid_t dev)
#ifdef MODULE_GNRC_IPV6_NETIF #ifdef MODULE_GNRC_IPV6_NETIF
if (entry != NULL) { if (entry != NULL) {
printf("MTU:%" PRIu16 " ", entry->mtu); printf("MTU:%" PRIu16 " ", entry->mtu);
printf("HL:%" PRIu8 " ", entry->cur_hl); printf("HL:%u ", (unsigned)entry->cur_hl);
if (entry->flags & GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN) { if (entry->flags & GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN) {
printf("6LO "); printf("6LO ");
} }
...@@ -370,8 +371,7 @@ static void _netif_list(kernel_pid_t dev) ...@@ -370,8 +371,7 @@ static void _netif_list(kernel_pid_t dev)
if (ipv6_addr_to_str(ipv6_addr, &entry->addrs[i].addr, if (ipv6_addr_to_str(ipv6_addr, &entry->addrs[i].addr,
IPV6_ADDR_MAX_STR_LEN)) { IPV6_ADDR_MAX_STR_LEN)) {
printf("%s/%" PRIu8 " scope: ", ipv6_addr, printf("%s/%u scope: ", ipv6_addr, (unsigned)entry->addrs[i].prefix_len);
entry->addrs[i].prefix_len);
if ((ipv6_addr_is_link_local(&entry->addrs[i].addr))) { if ((ipv6_addr_is_link_local(&entry->addrs[i].addr))) {
printf("local"); printf("local");
...@@ -526,6 +526,7 @@ static int _netif_set_addr(kernel_pid_t dev, netopt_t opt, char *addr_str) ...@@ -526,6 +526,7 @@ static int _netif_set_addr(kernel_pid_t dev, netopt_t opt, char *addr_str)
static int _netif_set_state(kernel_pid_t dev, char *state_str) static int _netif_set_state(kernel_pid_t dev, char *state_str)
{ {
netopt_state_t state; netopt_state_t state;
if ((strcmp("off", state_str) == 0) || (strcmp("OFF", state_str) == 0)) { if ((strcmp("off", state_str) == 0) || (strcmp("OFF", state_str) == 0)) {
state = NETOPT_STATE_OFF; state = NETOPT_STATE_OFF;
} }
...@@ -930,7 +931,7 @@ int _netif_config(int argc, char **argv) ...@@ -930,7 +931,7 @@ int _netif_config(int argc, char **argv)
gnrc_ipv6_netif_t *entry; gnrc_ipv6_netif_t *entry;
if (((hl = atoi(argv[3])) < 0) || (hl > UINT8_MAX)) { if (((hl = atoi(argv[3])) < 0) || (hl > UINT8_MAX)) {
printf("error: Hop limit must be between %" PRIu16 " and %" PRIu16 "\n", printf("error: Hop limit must be between %" PRIu16 " and %" PRIu16 "\n",
(uint16_t)0, (uint16_t)UINT16_MAX); (uint16_t)0, (uint16_t)UINT16_MAX);
return 1; return 1;
} }
if ((entry = gnrc_ipv6_netif_get(dev)) == NULL) { if ((entry = gnrc_ipv6_netif_get(dev)) == NULL) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment