From 5bd58bc309e959537e3e820abfa39ee629b140a5 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 7 Oct 2014 09:39:25 +0200 Subject: Reorganized firmware/ subdirectory (x300->usrp3, zpu->usrp2) --- firmware/x300/lib/print_addrs.c | 64 ----------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 firmware/x300/lib/print_addrs.c (limited to 'firmware/x300/lib/print_addrs.c') diff --git a/firmware/x300/lib/print_addrs.c b/firmware/x300/lib/print_addrs.c deleted file mode 100644 index 6a710f75c..000000000 --- a/firmware/x300/lib/print_addrs.c +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2013 Ettus Research LLC - -#include -#include -#include -#include - -#define MAX_MAC_CHARS 24 -#define MAX_IP_CHARS 16 - -static const char hex[16] = "0123456789ABCDEF"; - -char *mac_addr_to_str_r(const void *addr, char *str) -{ - uint8_t *p = (uint8_t *)addr; - size_t j = 0; - for(size_t i = 0; i < 6; i++) - { - if (i) str[j++] = ':'; - str[j++] = hex[(p[i] >> 4) & 0xf]; - str[j++] = hex[p[i] & 0xf]; - } - str[j++] = '\0'; - return str; -} - -char *ip_addr_to_str_r(const void *addr, char *str) -{ - uint8_t *p = (uint8_t *)addr; - sprintf(str, "%d.%d.%d.%d", p[0], p[1], p[2], p[3]); - return str; -} - -char *mac_addr_to_str(const void *addr) -{ - static size_t index = 0; - index = (index + 1) % 4; - static char str[4][MAX_MAC_CHARS]; - return mac_addr_to_str_r(addr, str[index]); -} - -char *ip_addr_to_str(const void *addr) -{ - static size_t index = 0; - index = (index + 1) % 4; - static char str[4][MAX_IP_CHARS]; - return ip_addr_to_str_r(addr, str[index]); -} - -/* -void print_mac_addr(const void *addr) -{ - char str[MAX_MAC_CHARS]; - mac_addr_to_str_r(addr, str); - printf("%s", str); -} - -void print_ip_addr(const void *addr) -{ - char str[MAX_IP_CHARS]; - ip_addr_to_str_r(addr, str); - printf("%s", str); -} -*/ -- cgit v1.2.3