[riot-notifications] [RIOT-OS/RIOT] shell_commands: include RSSI in ping output (#11092)

Marian Buschsieweke notifications at github.com
Wed Mar 6 09:49:26 CET 2019

maribu requested changes on this pull request.

To me the RSSI info would be a nice addition to the ping info :-)
Please have a look at the inline comments.

> @@ -362,6 +363,9 @@ static void _print_reply(_ping_data_t *data, gnrc_pktsnip_t *icmpv6,
         printf("%u bytes from %s: icmp_seq=%u ttl=%u", (unsigned)icmpv6->size,
                from_str, recv_seq, hoplimit);
+        if (netif_hdr && netif_hdr->rssi) {
+            printf(" rssi=%d dBm", netif_hdr->rssi);

[`gnrc_netif_hdr_t::rssi`](api.riot-os.org/structgnrc__netif__hdr__t.html) is of type `int16_t`, so the format string should be `" rssi=%" PRId16 " dBm"`.

> @@ -322,7 +322,8 @@ static void _pinger(_ping_data_t *data)
 static void _print_reply(_ping_data_t *data, gnrc_pktsnip_t *icmpv6,
-                         ipv6_addr_t *from, unsigned hoplimit)
+                         ipv6_addr_t *from, unsigned hoplimit,
+                         gnrc_netif_hdr_t* netif_hdr)

I think it might be a more consistent API to expect `int16_t rssi` directly here, not the full netif header. But I'm not insisting on this.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190306/ece5eabe/attachment.html>

More information about the notifications mailing list