Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
jau::EUI48 Struct Reference

A packed 48 bit EUI-48 identifier, formerly known as MAC-48 or simply network device MAC address (Media Access Control address). More...

#include <eui48.hpp>

Collaboration diagram for jau::EUI48:

Public Member Functions

constexpr EUI48 () noexcept
 
constexpr EUI48 (const EUI48 &o) noexcept=default
 
 EUI48 (const std::string &str)
 
 EUI48 (const uint8_t *source, const lb_endian_t byte_order) noexcept
 
 EUI48 (EUI48 &&o) noexcept=default
 
void clear ()
 
bool contains (const EUI48Sub &needle) const noexcept
 
constexpr std::size_t hash_code () const noexcept
 
jau::snsize_t indexOf (const EUI48Sub &needle, const lb_endian_t byte_order) const noexcept
 
constexpr EUI48operator= (const EUI48 &o) noexcept=default
 
EUI48operator= (EUI48 &&o) noexcept=default
 
jau::nsize_t put (uint8_t *const sink, const lb_endian_t byte_order) const noexcept
 
std::string toString () const noexcept
 

Static Public Member Functions

static bool scanEUI48 (const std::string &str, EUI48 &dest, std::string &errmsg)
 

Public Attributes

uint8_t b [6]
 

Static Public Attributes

static const EUI48 ALL_DEVICE
 EUI48 MAC address matching all device, i.e. More...
 
static const EUI48 ANY_DEVICE
 EUI48 MAC address matching any device, i.e. More...
 
static const EUI48 LOCAL_DEVICE
 EUI48 MAC address matching local device, i.e. More...
 

Detailed Description

A packed 48 bit EUI-48 identifier, formerly known as MAC-48 or simply network device MAC address (Media Access Control address).

Stores value in lb_endian::native byte order.

Examples
dbt_peripheral00.cpp, dbt_repeater00.cpp, and dbt_scanner10.cpp.

Definition at line 324 of file eui48.hpp.

Constructor & Destructor Documentation

◆ EUI48() [1/5]

constexpr jau::EUI48::EUI48 ( )
inlineconstexprnoexcept

Definition at line 324 of file eui48.hpp.

◆ EUI48() [2/5]

EUI48::EUI48 ( const uint8_t *  source,
const lb_endian_t  byte_order 
)
noexcept
  • Copy address bytes from given source and byte_order, * while converting them to lb_endian::native byte order. * *
    Parameters
    sourceaddress bytes *
    byte_orderlb_endian::little or lb_endian::big byte order of given source, one may pass lb_endian::native.

Definition at line 233 of file eui48.cpp.

◆ EUI48() [3/5]

EUI48::EUI48 ( const std::string &  str)
  • Construct instance via given string representation. *

* Implementation is consistent with EUI48::toString(). *

*

Parameters
stra string of exactly 17 characters representing 6 bytes as hexadecimal numbers separated via colon 01:02:03:0A:0B:0C. *
See also
EUI48::scanEUI48() *
EUI48::toString() *
Exceptions
jau::IllegalArgumentExceptionif given string doesn't comply with EUI48

Definition at line 226 of file eui48.cpp.

◆ EUI48() [4/5]

constexpr jau::EUI48::EUI48 ( const EUI48 o)
constexprdefaultnoexcept

◆ EUI48() [5/5]

jau::EUI48::EUI48 ( EUI48 &&  o)
defaultnoexcept

Member Function Documentation

◆ scanEUI48()

bool EUI48::scanEUI48 ( const std::string &  str,
EUI48 dest,
std::string &  errmsg 
)
static
  • Fills given EUI48 instance via given string representation. *

* Implementation is consistent with EUI48::toString(). *

*

Parameters
stra string of exactly 17 characters representing 6 bytes as hexadecimal numbers separated via colon 01:02:03:0A:0B:0C. *
destEUI48 to set its value *
errmsgerror parsing message if returning false *
Returns
true if successful, otherwise false *
See also
EUI48::EUI48 *
EUI48::toString()

Definition at line 202 of file eui48.cpp.

Here is the caller graph for this function:

◆ operator=() [1/2]

constexpr EUI48 & jau::EUI48::operator= ( const EUI48 o)
constexprdefaultnoexcept

◆ operator=() [2/2]

EUI48 & jau::EUI48::operator= ( EUI48 &&  o)
defaultnoexcept

◆ hash_code()

constexpr std::size_t jau::EUI48::hash_code ( ) const
inlineconstexprnoexcept

Definition at line 324 of file eui48.hpp.

Here is the caller graph for this function:

◆ clear()

void jau::EUI48::clear ( )
inline
  • Method clears the underlying byte array b.

Definition at line 324 of file eui48.hpp.

Here is the caller graph for this function:

◆ indexOf()

jau::snsize_t jau::EUI48::indexOf ( const EUI48Sub needle,
const lb_endian_t  byte_order 
) const
inlinenoexcept
  • Finds the index of given EUI48Sub needle within this instance haystack. * * The returned index will be adjusted for the desired byte order. * - lb_endian::big will return index 0 for the leading byte like the string representation from left (MSB) to right (LSB). * - lb_endian::little will return index 5 for the leading byte * *
    Parameters
    needle*
    byte_orderbyte order will adjust the returned index, lb_endian::big is equivalent to the string representation from left (MSB) to right (LSB). *
    Returns
    index of first element of needle within this instance haystack or -1 if not found. If the needle length is zero, 0 (found) is returned. *
    See also
    indexOf()

Definition at line 324 of file eui48.hpp.

Here is the caller graph for this function:

◆ contains()

bool jau::EUI48::contains ( const EUI48Sub needle) const
inlinenoexcept
  • Returns true, if given EUI48Sub needle is contained in this instance haystack. *

* If the sub is zero, true is returned. *


Definition at line 324 of file eui48.hpp.

Here is the caller graph for this function:

◆ toString()

std::string EUI48::toString ( ) const
noexcept
  • Returns the EUI48 string representation with MSB first (lb_endian::big), * exactly 17 characters representing 6 bytes as upper case hexadecimal numbers separated via colon 01:02:03:0A:0B:0C. *
    See also
    EUI48::EUI48()

Definition at line 167 of file eui48.cpp.

Here is the caller graph for this function:

◆ put()

jau::nsize_t EUI48::put ( uint8_t *const  sink,
const lb_endian_t  byte_order 
) const
noexcept
  • Method transfers all bytes representing this instance into the given * destination array at the given position and in the given byte order. *

* Implementation is consistent with EUI48(byte[], int, ByteOrder). *

*

Parameters
sinkthe destination array *
byte_orderdestination buffer byte order *
See also
#EUI48(byte[], int, ByteOrder)

Definition at line 241 of file eui48.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ ANY_DEVICE

const EUI48 jau::EUI48::ANY_DEVICE
static

EUI48 MAC address matching any device, i.e.

0:0:0:0:0:0.

Definition at line 324 of file eui48.hpp.

◆ ALL_DEVICE

const EUI48 jau::EUI48::ALL_DEVICE
static

EUI48 MAC address matching all device, i.e.

ff:ff:ff:ff:ff:ff.

Definition at line 324 of file eui48.hpp.

◆ LOCAL_DEVICE

const EUI48 jau::EUI48::LOCAL_DEVICE
static

EUI48 MAC address matching local device, i.e.

0:0:0:ff:ff:ff.

Definition at line 324 of file eui48.hpp.

◆ b

uint8_t jau::EUI48::b[6]
  • The 6 byte EUI48 address.

Definition at line 324 of file eui48.hpp.


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