aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-05-11 16:35:01 -0700
committerJosh Blum <josh@joshknows.com>2010-05-11 16:35:01 -0700
commit81f211c94f761c92baaf1a2997a7f9b9b7718182 (patch)
tree193c188cd52ef7e14be63f69adc04fe81315025f /host/include
parent7c7b0d0a0dc8dd0cb4f0229fbc55978d6f2e253c (diff)
downloaduhd-81f211c94f761c92baaf1a2997a7f9b9b7718182.tar.gz
uhd-81f211c94f761c92baaf1a2997a7f9b9b7718182.tar.bz2
uhd-81f211c94f761c92baaf1a2997a7f9b9b7718182.zip
Moved usrp2 eeprom addr read/write to host control over i2c/eeprom interface calls.
No longer part of the dude/bro protocol. Simplified the mac and ip addr read write code in mboard impl. Modified the mac addr type to take byte_vector_t from serial.hpp types.
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/types/mac_addr.hpp16
-rw-r--r--host/include/uhd/utils/algorithm.hpp5
2 files changed, 12 insertions, 9 deletions
diff --git a/host/include/uhd/types/mac_addr.hpp b/host/include/uhd/types/mac_addr.hpp
index 3cd1fe86b..034b6a348 100644
--- a/host/include/uhd/types/mac_addr.hpp
+++ b/host/include/uhd/types/mac_addr.hpp
@@ -19,7 +19,7 @@
#define INCLUDED_UHD_TYPES_MAC_ADDR_HPP
#include <uhd/config.hpp>
-#include <boost/cstdint.hpp>
+#include <uhd/types/serial.hpp>
#include <string>
namespace uhd{
@@ -30,14 +30,12 @@ namespace uhd{
*/
class UHD_API mac_addr_t{
public:
- static const size_t hlen = 6;
-
/*!
* Create a mac address a byte array.
- * \param bytes a pointer for the byte array
+ * \param bytes a vector of bytes
* \return a new mac address
*/
- static mac_addr_t from_bytes(const boost::uint8_t *bytes);
+ static mac_addr_t from_bytes(const byte_vector_t &bytes);
/*!
* Create a mac address from a string.
@@ -48,9 +46,9 @@ namespace uhd{
/*!
* Get the byte representation of the mac address.
- * \return a pointer to the internal byte array
+ * \return a vector of bytes
*/
- const boost::uint8_t *to_bytes(void) const;
+ byte_vector_t to_bytes(void) const;
/*!
* Get the string representation of this mac address.
@@ -59,8 +57,8 @@ namespace uhd{
std::string to_string(void) const;
private:
- mac_addr_t(const boost::uint8_t *bytes); //private constructor
- boost::uint8_t _bytes[hlen]; //internal representation
+ mac_addr_t(const byte_vector_t &bytes); //private constructor
+ byte_vector_t _bytes; //internal representation
};
} //namespace uhd
diff --git a/host/include/uhd/utils/algorithm.hpp b/host/include/uhd/utils/algorithm.hpp
index 72b655745..146b56c63 100644
--- a/host/include/uhd/utils/algorithm.hpp
+++ b/host/include/uhd/utils/algorithm.hpp
@@ -26,6 +26,11 @@
*/
namespace std{
+ template<typename RangeSrc, typename RangeDst> inline
+ void copy(const RangeSrc &src, RangeDst &dst){
+ std::copy(boost::begin(src), boost::end(src), boost::begin(dst));
+ }
+
template<typename Range, typename T> inline
bool has(const Range &range, const T &value){
return boost::end(range) != std::find(boost::begin(range), boost::end(range), value);