shill: DeviceInfo::GetAddress can be used now to lookup the device MAC address.
Also enhance ByteString with a HexEncode method used for logging.
BUG=chromium-os:19028
TEST=unit tests, tested on device
Change-Id: Ie64ebb0d009ce7fb3ed16948a7789ef721b56039
Reviewed-on: http://gerrit.chromium.org/gerrit/5766
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/byte_string.cc b/byte_string.cc
index 3c9db10..9976e0f 100644
--- a/byte_string.cc
+++ b/byte_string.cc
@@ -6,6 +6,10 @@
#include <netinet/in.h>
+#include <base/string_number_conversions.h>
+
+using std::string;
+
namespace shill {
// static
@@ -53,4 +57,8 @@
data_.insert(data_.end(), b.data_.begin(), b.data_.end());
}
+string ByteString::HexEncode() const {
+ return base::HexEncode(GetConstData(), GetLength());
+}
+
} // namespace shill