SPSP
Simple publish-subscribe protocol. Connects low power IoT clients to MQTT.
All Classes Files Functions Variables Typedefs Enumerations
Public Member Functions | Static Public Member Functions | List of all members
SPSP::LocalAddrMAC Struct Reference

Local layer address container for MAC address. More...

#include <local_addr_mac.hpp>

Inheritance diagram for SPSP::LocalAddrMAC:
Inheritance graph
[legend]
Collaboration diagram for SPSP::LocalAddrMAC:
Collaboration graph
[legend]

Public Member Functions

 LocalAddrMAC (const uint8_t *mac=nullptr)
 Constructs a new object. More...
 
void toMAC (uint8_t *mac) const
 Converts LocalAddrMAC to MAC itself. More...
 
- Public Member Functions inherited from SPSP::LocalAddr
bool operator== (const LocalAddr &other) const
 
bool operator!= (const LocalAddr &other) const
 
bool empty () const
 Checks whether the address is empty. More...
 

Static Public Member Functions

static LocalAddrMAC local ()
 Constructs a new object from MAC address of this node. More...
 
static LocalAddrMAC zeroes ()
 Constructs a new object from 00:00:00:00:00:00 MAC address. More...
 
static LocalAddrMAC broadcast ()
 Constructs a new object from broadcast MAC address. More...
 

Additional Inherited Members

- Public Attributes inherited from SPSP::LocalAddr
std::vector< uint8_t > addr
 Internal address representation.
 
std::string str
 Printable string (also used in MQTT topic)
 

Detailed Description

Local layer address container for MAC address.

MAC as addess type is very common, so implement everything here.

Definition at line 24 of file local_addr_mac.hpp.

Constructor & Destructor Documentation

◆ LocalAddrMAC()

SPSP::LocalAddrMAC::LocalAddrMAC ( const uint8_t *  mac = nullptr)

Constructs a new object.

Parameters
macMAC address (00:00:00:00:00:00 is assumed if nullptr)

Member Function Documentation

◆ broadcast()

static LocalAddrMAC SPSP::LocalAddrMAC::broadcast ( )
static

Constructs a new object from broadcast MAC address.

Returns
New LocalAddrMAC object

◆ local()

static LocalAddrMAC SPSP::LocalAddrMAC::local ( )
static

Constructs a new object from MAC address of this node.

Returns
New LocalAddrMAC object

◆ toMAC()

void SPSP::LocalAddrMAC::toMAC ( uint8_t *  mac) const

Converts LocalAddrMAC to MAC itself.

Parameters
macMAC address storage pointer

◆ zeroes()

static LocalAddrMAC SPSP::LocalAddrMAC::zeroes ( )
static

Constructs a new object from 00:00:00:00:00:00 MAC address.

Returns
New LocalAddrMAC object

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