mac_address.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "hebi.h"
4 #include <iostream>
5 
6 namespace hebi {
7 
12 class MacAddress final
13 {
14  public:
15  #ifndef DOXYGEN_OMIT_INTERNAL
16 
22  #endif // DOXYGEN_OMIT_INTERNAL
23 
24  private:
29  static uint8_t hexToInt(char c);
30 
34  static uint8_t byteFromHexPair(char c1, char c2);
35 
36  public:
40  MacAddress();
41 
45  static MacAddress fromBytes(
46  uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f);
47 
57  bool setToHexString(std::string mac_str);
58 
59  uint8_t& operator[](std::size_t idx);
60  const uint8_t& operator[](std::size_t idx) const;
61 
62  private:
63  /*
64  * Is 'c' a valid hex digit (0-F, upper or lower case)?
65  *
66  * \returns 'true' if yes, 'false' if no.
67  */
68  static bool isHexDigitValid(char c);
69 
70  public:
77  static bool isHexStringValid(std::string mac_str);
78 };
79 
80 } // namespace hebi
static uint8_t byteFromHexPair(char c1, char c2)
Definition: mac_address.cpp:16
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: color.hpp:5
A simple wrapper class for internal C-API HebiMacAddress objects to allow interfacing with API calls ...
Definition: mac_address.hpp:12
bool setToHexString(std::string mac_str)
Sets the value of the current MacAddress to the value given in &#39;mac_str&#39;.
Definition: mac_address.cpp:43
HebiMacAddress internal_
Definition: mac_address.hpp:21
static bool isHexDigitValid(char c)
Definition: mac_address.cpp:66
static uint8_t hexToInt(char c)
Definition: mac_address.cpp:5
static MacAddress fromBytes(uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f)
Creates a MacAddress from individual bytes.
Definition: mac_address.cpp:31
static bool isHexStringValid(std::string mac_str)
Is mac_str a valid string of format dd:dd:dd:dd:dd:dd, where &#39;d&#39; is a hex digit 0-F. Lowercase values accepted. 1 if yes, 0 if no.
Definition: mac_address.cpp:74
uint8_t & operator[](std::size_t idx)
Definition: mac_address.cpp:56
MacAddress()
Creates MAC address 00:00:00:00:00:00.
Definition: mac_address.cpp:21
EIGEN_DEVICE_FUNC const Scalar & b


hebiros
Author(s): Xavier Artache , Matthew Tesch
autogenerated on Thu Sep 3 2020 04:08:21