diff options
author | Mike Beattie <mike@ethernal.org> | 2012-03-23 08:23:51 +1300 |
---|---|---|
committer | Mike Beattie <mike@ethernal.org> | 2012-03-23 08:23:51 +1300 |
commit | ad7d5ffb2da390a2318507619de987e2316e8a25 (patch) | |
tree | 011e355b7e667f3a4840c43299ff8d34235f1723 | |
parent | e9f7ad821642c9324de5dbd6dab807813065c898 (diff) |
Add mac_to_str() utility function (commented, but useful)
Signed-off-by: Mike Beattie <mike@ethernal.org>
-rw-r--r-- | HouseControl.ino | 6 |
1 files changed, 6 insertions, 0 deletions
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]); |