Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
direct_bt::EUI48Sub Struct Reference

A 48 bit EUI-48 sub-identifier, see EUI48. More...

#include <BTAddress.hpp>

Collaboration diagram for direct_bt::EUI48Sub:

Public Member Functions

constexpr EUI48Sub () noexcept
 
 EUI48Sub (const uint8_t *b_, const jau::nsize_t len_) noexcept
 
 EUI48Sub (const std::string &str)
 Construct a sub EUI48 via given string representation. More...
 
constexpr EUI48Sub (const EUI48Sub &o) noexcept=default
 
 EUI48Sub (EUI48Sub &&o) noexcept=default
 
constexpr EUI48Suboperator= (const EUI48Sub &o) noexcept=default
 
EUI48Suboperator= (EUI48Sub &&o) noexcept=default
 
constexpr std::size_t hash_code () const noexcept
 
void clear ()
 Method clears the underlying byte array b and sets length to zero. More...
 
jau::snsize_t indexOf (const EUI48Sub &needle) const noexcept
 Finds the index of given EUI48Sub needle within this instance haystack. More...
 
bool contains (const EUI48Sub &needle) const noexcept
 Returns true, if given EUI48Sub needle is contained in this instance haystack. More...
 
std::string toString () const noexcept
 Returns the EUI48 sub-string representation, less or equal 17 characters representing less or equal 6 bytes as upper case hexadecimal numbers separated via colon, e.g. More...
 

Static Public Member Functions

static bool scanEUI48Sub (const std::string &str, EUI48Sub &dest, std::string &errmsg)
 Fills given EUI48Sub instance via given string representation. More...
 
static jau::snsize_t indexOf (const uint8_t haystack_b[], const jau::nsize_t haystack_length, const uint8_t needle_b[], const jau::nsize_t needle_length) noexcept
 Find index of needle within haystack. More...
 

Public Attributes

uint8_t b [6]
 The <= 6 byte EUI48 sub-address. More...
 
jau::nsize_t length
 The actual length in bytes of the EUI48 sub-address, less or equal 6 bytes. More...
 

Static Public Attributes

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

Detailed Description

A 48 bit EUI-48 sub-identifier, see EUI48.

Definition at line 154 of file BTAddress.hpp.

Constructor & Destructor Documentation

◆ EUI48Sub() [1/5]

constexpr direct_bt::EUI48Sub::EUI48Sub ( )
inlineconstexprnoexcept

Definition at line 172 of file BTAddress.hpp.

◆ EUI48Sub() [2/5]

EUI48Sub::EUI48Sub ( const uint8_t *  b_,
const jau::nsize_t  len_ 
)
noexcept

Definition at line 232 of file BTTypes0.cpp.

◆ EUI48Sub() [3/5]

EUI48Sub::EUI48Sub ( const std::string &  str)

Construct a sub EUI48 via given string representation.

Implementation is consistent with EUI48Sub::toString().

Parameters
stra string of less or equal of 17 characters representing less or equal of 6 bytes as hexadecimal numbers separated via colon, e.g. 01:02:03:0A:0B:0C, 01:02:03:0A, :, (empty).
See also
EUI48Sub::scanEUI48Sub()
EUI48Sub::toString()
Exceptions
jau::IllegalArgumentExceptionif given string doesn't comply with EUI48

Definition at line 225 of file BTTypes0.cpp.

Here is the call graph for this function:

◆ EUI48Sub() [4/5]

constexpr direct_bt::EUI48Sub::EUI48Sub ( const EUI48Sub o)
constexprdefaultnoexcept

◆ EUI48Sub() [5/5]

direct_bt::EUI48Sub::EUI48Sub ( EUI48Sub &&  o)
defaultnoexcept

Member Function Documentation

◆ clear()

void direct_bt::EUI48Sub::clear ( )
inline

Method clears the underlying byte array b and sets length to zero.

Definition at line 220 of file BTAddress.hpp.

Here is the caller graph for this function:

◆ contains()

bool direct_bt::EUI48Sub::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 252 of file BTAddress.hpp.

Here is the call graph for this function:

◆ hash_code()

constexpr std::size_t direct_bt::EUI48Sub::hash_code ( ) const
inlineconstexprnoexcept

Definition at line 208 of file BTAddress.hpp.

◆ indexOf() [1/2]

jau::snsize_t direct_bt::EUI48Sub::indexOf ( const EUI48Sub needle) const
inlinenoexcept

Finds the index of given EUI48Sub needle within this instance haystack.

Parameters
needle
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.

Definition at line 242 of file BTAddress.hpp.

Here is the call graph for this function:

◆ indexOf() [2/2]

jau::snsize_t EUI48Sub::indexOf ( const uint8_t  haystack_b[],
const jau::nsize_t  haystack_length,
const uint8_t  needle_b[],
const jau::nsize_t  needle_length 
)
staticnoexcept

Find index of needle within haystack.

Parameters
haystack_bhaystack data
haystack_lengthhaystack length
needle_bneedle data
needle_lengthneedle length
Returns
index of first element of needle within haystack or -1 if not found. If the needle length is zero, 0 (found) is returned.

Definition at line 242 of file BTTypes0.cpp.

Here is the caller graph for this function:

◆ operator=() [1/2]

constexpr EUI48Sub& direct_bt::EUI48Sub::operator= ( const EUI48Sub o)
constexprdefaultnoexcept

◆ operator=() [2/2]

EUI48Sub& direct_bt::EUI48Sub::operator= ( EUI48Sub &&  o)
defaultnoexcept

◆ scanEUI48Sub()

bool EUI48Sub::scanEUI48Sub ( const std::string &  str,
EUI48Sub dest,
std::string &  errmsg 
)
static

Fills given EUI48Sub instance via given string representation.

Implementation is consistent with EUI48Sub::toString().

Parameters
stra string of less or equal of 17 characters representing less or equal of 6 bytes as hexadecimal numbers separated via colon, e.g. 01:02:03:0A:0B:0C, 01:02:03:0A, :, (empty).
destEUI48Sub to set its value
errmsgerror parsing message if returning false
Returns
true if successful, otherwise false
See also
EUI48Sub::EUI48Sub
EUI48Sub::toString()

Definition at line 186 of file BTTypes0.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

std::string EUI48Sub::toString ( ) const
noexcept

Returns the EUI48 sub-string representation, less or equal 17 characters representing less or equal 6 bytes as upper case hexadecimal numbers separated via colon, e.g.

01:02:03:0A:0B:0C, 01:02:03:0A, :, (empty).

Definition at line 166 of file BTTypes0.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ALL_DEVICE

const EUI48Sub direct_bt::EUI48Sub::ALL_DEVICE
static

EUI48 MAC address matching all device, i.e.

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

Definition at line 158 of file BTAddress.hpp.

◆ ANY_DEVICE

const EUI48Sub direct_bt::EUI48Sub::ANY_DEVICE
static

EUI48 MAC address matching any device, i.e.

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

Definition at line 156 of file BTAddress.hpp.

◆ b

uint8_t direct_bt::EUI48Sub::b[6]

The <= 6 byte EUI48 sub-address.

Definition at line 165 of file BTAddress.hpp.

◆ length

jau::nsize_t direct_bt::EUI48Sub::length

The actual length in bytes of the EUI48 sub-address, less or equal 6 bytes.

Definition at line 170 of file BTAddress.hpp.

◆ LOCAL_DEVICE

const EUI48Sub direct_bt::EUI48Sub::LOCAL_DEVICE
static

EUI48 MAC address matching local device, i.e.

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

Definition at line 160 of file BTAddress.hpp.


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