USRP Hardware Driver and USRP Manual  Version: 003.008.001-0-g2474ac32
UHD and USRP Manual
mac_addr.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010 Ettus Research LLC
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef INCLUDED_UHD_TYPES_MAC_ADDR_HPP
19 #define INCLUDED_UHD_TYPES_MAC_ADDR_HPP
20 
21 #include <uhd/config.hpp>
22 #include <uhd/types/serial.hpp>
23 #include <string>
24 
25 namespace uhd{
26 
32  public:
38  static mac_addr_t from_bytes(const byte_vector_t &bytes);
39 
45  static mac_addr_t from_string(const std::string &mac_addr_str);
46 
51  byte_vector_t to_bytes(void) const;
52 
57  std::string to_string(void) const;
58 
59  private:
60  mac_addr_t(const byte_vector_t &bytes); //private constructor
61  const byte_vector_t _bytes; //internal representation
62  };
63 
64 } //namespace uhd
65 
66 #endif /* INCLUDED_UHD_TYPES_MAC_ADDR_HPP */
#define UHD_API
Definition: config.hpp:79
Definition: convert.hpp:28
std::vector< boost::uint8_t > byte_vector_t
Definition: serial.hpp:31
Definition: mac_addr.hpp:31