From ad7d5ffb2da390a2318507619de987e2316e8a25 Mon Sep 17 00:00:00 2001 From: Mike Beattie Date: Fri, 23 Mar 2012 08:23:51 +1300 Subject: Add mac_to_str() utility function (commented, but useful) Signed-off-by: Mike Beattie --- HouseControl.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/HouseControl.ino b/HouseControl.ino index b64e8f0..f72230e 100644 --- a/HouseControl.ino +++ b/HouseControl.ino @@ -112,6 +112,12 @@ WebServer httpServer("", 80); /* Utility functions */ /* +const char* mac_to_str(const uint8_t* macAddr) { + static char buf[32]; + sprintf(buf, "%x:%x:%x:%x:%x:%x\0", macAddr[0], macAddr[1], macAddr[2], macAddr[3], macAddr[4], macAddr[5]); + return buf; +} + const char* ip_to_str(const uint8_t* ipAddr) { static char buf[16]; sprintf(buf, "%d.%d.%d.%d\0", ipAddr[0], ipAddr[1], ipAddr[2], ipAddr[3]); -- cgit v1.2.3