ESP32 Transceiver IEEE 802.15.4 Library
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ieee802154::Address Class Reference

IEEE 802.15.4 Address abstraction. More...

#include <Frame.h>

Public Member Functions

 Address ()=default
 Default constructor. Initializes address mode to NONE.
 
 Address (const uint8_t *addr, addr_mode_t mode)
 Construct an Address from a pointer and mode.
 
template<size_t N>
 Address (const uint8_t(&addr)[N])
 Template constructor to deduce address length and mode at compile time.
 
uint8_t * data ()
 Get a pointer to the address bytes.
 
addr_mode_t mode ()
 Get the address mode (NONE, SHORT, EXTENDED).
 
const char * to_str () const
 Get a human-readable string representation of the address.
 

Static Public Member Functions

static const char * to_str (const uint8_t *addr, addr_mode_t mode)
 Get a human-readable string for a raw address and mode.
 
static const char * to_str (const uint8_t *addr, int len)
 Get a human-readable string for a raw address and length.
 

Protected Attributes

addr_mode_t local_addr_mode = addr_mode_t::NONE
 Local address mode (NONE, SHORT, EXTENDED).
 
uint8_t local_address [8] = {0}
 Local address bytes (0, 2, or 8 bytes used).
 

Detailed Description

IEEE 802.15.4 Address abstraction.

Represents a short (16-bit) or extended (64-bit) address for IEEE 802.15.4 frames. Provides constructors for both address types and utility methods for access and string conversion.

Constructor & Destructor Documentation

◆ Address() [1/3]

ieee802154::Address::Address ( )
default

Default constructor. Initializes address mode to NONE.

◆ Address() [2/3]

ieee802154::Address::Address ( const uint8_t *  addr,
addr_mode_t  mode 
)
inline

Construct an Address from a pointer and mode.

Parameters
addrPointer to address bytes (2 or 8 bytes).
modeAddressing mode (SHORT or EXTENDED).

◆ Address() [3/3]

template<size_t N>
ieee802154::Address::Address ( const uint8_t(&)  addr[N])
inline

Template constructor to deduce address length and mode at compile time.

Template Parameters
NAddress length (must be 2 or 8).
Parameters
addrArray of address bytes.

Member Function Documentation

◆ data()

uint8_t * ieee802154::Address::data ( )
inline

Get a pointer to the address bytes.

Returns
Pointer to address data (2 or 8 bytes).

◆ mode()

addr_mode_t ieee802154::Address::mode ( )
inline

Get the address mode (NONE, SHORT, EXTENDED).

Returns
Address mode.

◆ to_str() [1/3]

const char * ieee802154::Address::to_str ( ) const
inline

Get a human-readable string representation of the address.

Returns
Pointer to static string buffer.

◆ to_str() [2/3]

static const char * ieee802154::Address::to_str ( const uint8_t *  addr,
addr_mode_t  mode 
)
inlinestatic

Get a human-readable string for a raw address and mode.

Parameters
addrPointer to address bytes.
modeAddress mode (NONE, SHORT, EXTENDED).
Returns
Pointer to static string buffer.

◆ to_str() [3/3]

static const char * ieee802154::Address::to_str ( const uint8_t *  addr,
int  len 
)
inlinestatic

Get a human-readable string for a raw address and length.

Parameters
addrPointer to address bytes.
lenLength of address (2 or 8).
Returns
Pointer to static string buffer.

Member Data Documentation

◆ local_addr_mode

addr_mode_t ieee802154::Address::local_addr_mode = addr_mode_t::NONE
protected

Local address mode (NONE, SHORT, EXTENDED).

◆ local_address

uint8_t ieee802154::Address::local_address[8] = {0}
protected

Local address bytes (0, 2, or 8 bytes used).


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