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.h b/byte_string.h
index 0077ff0..22ac750 100644
--- a/byte_string.h
+++ b/byte_string.h
@@ -48,6 +48,7 @@
// Returns true on success
bool ConvertToNetUInt32(uint32 *val) const;
+ bool IsEmpty() const { return GetLength() == 0; }
bool IsZero() const;
bool Equals(const ByteString &b) const;
void Append(const ByteString &b);
@@ -55,6 +56,8 @@
data_.resize(size, 0);
}
+ std::string HexEncode() const;
+
private:
std::vector<unsigned char> data_;
// NO DISALLOW_COPY_AND_ASSIGN -- we assign ByteStrings in STL hashes