0.01.00
ot::Mac::Address Class Reference

This class represents an IEEE 802.15.4 Short or Extended Address. More...

#include <src/core/mac/mac_frame.hpp>

Public Types

enum  Type {
  kTypeNone,
  kTypeShort,
  kTypeExtended
}
 This enumeration specifies the IEEE 802.15.4 Address type. More...
 
typedef ExtAddress::InfoString InfoString
 This type defines the fixed-length String object returned from ToString().
 

Public Member Functions

 Address (void)
 This constructor initializes an Address.
 
Type GetType (void) const
 This method gets the address type (Short Address, Extended Address, or none). More...
 
bool IsNone (void) const
 This method indicates whether or not there is an address. More...
 
bool IsShort (void) const
 This method indicates whether or not the Address is a Short Address. More...
 
bool IsExtended (void) const
 This method indicates whether or not the Address is an Extended Address. More...
 
ShortAddress GetShort (void) const
 This method gets the address as a Short Address. More...
 
const ExtAddressGetExtended (void) const
 This method gets the address as an Extended Address. More...
 
ExtAddressGetExtended (void)
 This method gets the address as an Extended Address. More...
 
void SetNone (void)
 This method sets the address to none (i.e., clears the address). More...
 
void SetShort (ShortAddress aShortAddress)
 This method sets the address with a Short Address. More...
 
void SetExtended (const ExtAddress &aExtAddress)
 This method sets the address with an Extended Address. More...
 
void SetExtended (const uint8_t *aBuffer, bool aReverse)
 This method sets the address with an Extended Address given as byte array. More...
 
bool IsBroadcast (void) const
 This method indicates whether or not the address is a Short Broadcast Address. More...
 
bool IsShortAddrInvalid (void) const
 This method indicates whether or not the address is a Short Invalid Address. More...
 
InfoString ToString (void) const
 This method converts an address to a null-terminated string. More...
 

Detailed Description

This class represents an IEEE 802.15.4 Short or Extended Address.

Member Enumeration Documentation

§ Type

This enumeration specifies the IEEE 802.15.4 Address type.

Enumerator
kTypeNone 

No address.

kTypeShort 

IEEE 802.15.4 Short Address.

kTypeExtended 

IEEE 802.15.4 Extended Address.

Member Function Documentation

§ GetExtended() [1/2]

const ExtAddress& ot::Mac::Address::GetExtended ( void  ) const
inline

This method gets the address as an Extended Address.

This method MUST be used only if the address type is Extended Address.

Returns
A constant reference to the Extended Address.

§ GetExtended() [2/2]

ExtAddress& ot::Mac::Address::GetExtended ( void  )
inline

This method gets the address as an Extended Address.

This method MUST be used only if the address type is Extended Address.

Returns
A reference to the Extended Address.

§ GetShort()

ShortAddress ot::Mac::Address::GetShort ( void  ) const
inline

This method gets the address as a Short Address.

This method MUST be used only if the address type is Short Address.

Returns
The Short Address.

§ GetType()

Type ot::Mac::Address::GetType ( void  ) const
inline

This method gets the address type (Short Address, Extended Address, or none).

Returns
The address type.

§ IsBroadcast()

bool ot::Mac::Address::IsBroadcast ( void  ) const
inline

This method indicates whether or not the address is a Short Broadcast Address.

Returns
TRUE if address is Short Broadcast Address, FALSE otherwise.

§ IsExtended()

bool ot::Mac::Address::IsExtended ( void  ) const
inline

This method indicates whether or not the Address is an Extended Address.

Returns
TRUE if it is an Extended Address, FALSE otherwise.

§ IsNone()

bool ot::Mac::Address::IsNone ( void  ) const
inline

This method indicates whether or not there is an address.

Returns
TRUE if there is no address (i.e. address type is kTypeNone), FALSE otherwise.

§ IsShort()

bool ot::Mac::Address::IsShort ( void  ) const
inline

This method indicates whether or not the Address is a Short Address.

Returns
TRUE if it is a Short Address, FALSE otherwise.

§ IsShortAddrInvalid()

bool ot::Mac::Address::IsShortAddrInvalid ( void  ) const
inline

This method indicates whether or not the address is a Short Invalid Address.

Returns
TRUE if address is Short Invalid Address, FALSE otherwise.

§ SetExtended() [1/2]

void ot::Mac::Address::SetExtended ( const ExtAddress aExtAddress)
inline

This method sets the address with an Extended Address.

The type is also updated to indicate that the address is Extended.

Parameters
[in]aExtAddressAn Extended Address

§ SetExtended() [2/2]

void ot::Mac::Address::SetExtended ( const uint8_t *  aBuffer,
bool  aReverse 
)

This method sets the address with an Extended Address given as byte array.

The type is also updated to indicate that the address is Extended.

Parameters
[in]aBufferPointer to a array containing the Extended Address. OT_EXT_ADDRESS_SIZE bytes from buffer are copied to form the Extended Address.
[in]aReverseIf true then OT_EXT_ADDRESS_SIZE bytes from aBuffer are copied in reverse order, otherwise they are copied as provided.

§ SetNone()

void ot::Mac::Address::SetNone ( void  )
inline

This method sets the address to none (i.e., clears the address).

Address type will be updated to kTypeNone.

§ SetShort()

void ot::Mac::Address::SetShort ( ShortAddress  aShortAddress)
inline

This method sets the address with a Short Address.

The type is also updated to indicate that address is Short.

Parameters
[in]aShortAddressA Short Address

§ ToString()

Address::InfoString ot::Mac::Address::ToString ( void  ) const

This method converts an address to a null-terminated string.

Returns
A String representing the address.

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