HEBI C++ API  3.4.0
hebi::MacAddress Class Referencefinal

A simple wrapper class for internal C-API HebiMacAddress objects to allow interfacing with API calls that use MAC addresses. More...

#include <mac_address.hpp>

Public Member Functions

 MacAddress ()
 Creates MAC address 00:00:00:00:00:00. More...
 
bool setToHexString (std::string mac_str)
 Sets the value of the current MacAddress to the value given in 'mac_str'. More...
 
uint8_t & operator[] (std::size_t idx)
 
const uint8_t & operator[] (std::size_t idx) const
 

Static Public Member Functions

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. More...
 
static bool isHexStringValid (std::string mac_str)
 Is mac_str a valid string of format dd:dd:dd:dd:dd:dd, where 'd' is a hex digit 0-F. Lowercase values accepted. 1 if yes, 0 if no. More...
 

Detailed Description

A simple wrapper class for internal C-API HebiMacAddress objects to allow interfacing with API calls that use MAC addresses.

Constructor & Destructor Documentation

◆ MacAddress()

hebi::MacAddress::MacAddress ( )

Creates MAC address 00:00:00:00:00:00.

Member Function Documentation

◆ fromBytes()

MacAddress hebi::MacAddress::fromBytes ( uint8_t  a,
uint8_t  b,
uint8_t  c,
uint8_t  d,
uint8_t  e,
uint8_t  f 
)
static

Creates a MacAddress from individual bytes.

◆ setToHexString()

bool hebi::MacAddress::setToHexString ( std::string  mac_str)

Sets the value of the current MacAddress to the value given in 'mac_str'.

This value must be a valid string of format dd:dd:dd:dd:dd:dd, where 'd' is a hex digit (0-F, uppercase or lowercase).

Returns
'true' on success (valid mac_str), 'false' on failure.

◆ operator[]() [1/2]

uint8_t & hebi::MacAddress::operator[] ( std::size_t  idx)

◆ operator[]() [2/2]

const uint8_t & hebi::MacAddress::operator[] ( std::size_t  idx) const

◆ isHexStringValid()

bool hebi::MacAddress::isHexStringValid ( std::string  mac_str)
static

Is mac_str a valid string of format dd:dd:dd:dd:dd:dd, where 'd' is a hex digit 0-F. Lowercase values accepted. 1 if yes, 0 if no.

Returns
'true' if mac_str is valid, 'false' otherwise.

The documentation for this class was generated from the following files: