LoboMQ
Loading...
Searching...
No Matches
MACAddrList Class Reference

A class for managing a list of MAC addresses. More...

#include <MACAddrList.h>

Inheritance diagram for MACAddrList:

Public Member Functions

bool isInList (const uint8_t *mac) const
 Checks if a MAC address is in the list.
 
bool isInList (const MACAddress &mac) const
 Checks if a MAC address is in the list.
 
void addToList (const uint8_t *mac)
 Adds a MAC address to the list if it is not already present.
 
void addToList (const MACAddress &mac)
 Adds a MAC address to the list if it is not already present.
 
void addToList (const String &macStr)
 Adds a MAC address to the list if it is not already present.
 
void addArrayToList (const std::vector< String > &macArray)
 Adds multiple MAC addresses from an array to the list.
 
void addArrayToList (const std::vector< MACAddress > &macArray)
 Adds multiple MAC addresses from an array to the list.
 
bool removeFromList (const uint8_t *mac)
 Removes a MAC address from the list.
 
bool removeFromList (const MACAddress &mac)
 Removes a MAC address from the list.
 
void clearList ()
 Clears all the MAC addresses of the list.
 
String getAddressListAsString () const
 Returns a string representation of all MAC addresses in the list.
 

Detailed Description

A class for managing a list of MAC addresses.

Definition at line 27 of file MACAddrList.h.

Member Function Documentation

◆ addArrayToList() [1/2]

void MACAddrList::addArrayToList ( const std::vector< MACAddress > & macArray)

Adds multiple MAC addresses from an array to the list.

This function runs through a given array of MAC addresses adding them if they're not already present in the list.

Parameters
macArrayVector of MACAddress objects (e.g., objects like {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF}).

Definition at line 52 of file MACAddrList.cpp.

◆ addArrayToList() [2/2]

void MACAddrList::addArrayToList ( const std::vector< String > & macArray)

Adds multiple MAC addresses from an array to the list.

This function runs through a given array of MAC addresses adding them if they're not already present in the list.

Parameters
macArrayVector of string representations of MAC addresses (e.g., addresses like "AA:BB:CC:DD:EE:FF").

Definition at line 47 of file MACAddrList.cpp.

◆ addToList() [1/3]

void MACAddrList::addToList ( const MACAddress & mac)

Adds a MAC address to the list if it is not already present.

This function adds a MAC address to the list after checking that it isn't already present.

Parameters
macReference to the MAC address to add (e.g., {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF}).

Definition at line 34 of file MACAddrList.cpp.

◆ addToList() [2/3]

void MACAddrList::addToList ( const String & macStr)

Adds a MAC address to the list if it is not already present.

This function adds a MAC address to the list after checking that it isn't already present.

Parameters
macStrString representation of the MAC address (e.g., "AA:BB:CC:DD:EE:FF").

Definition at line 39 of file MACAddrList.cpp.

◆ addToList() [3/3]

void MACAddrList::addToList ( const uint8_t * mac)

Adds a MAC address to the list if it is not already present.

This function adds a MAC address to the list after checking that it isn't already present.

Parameters
macPointer to the MAC address to add.

Definition at line 29 of file MACAddrList.cpp.

◆ clearList()

void MACAddrList::clearList ( )

Clears all the MAC addresses of the list.

This function empties every position of the list, resulting in a list with no elements or MAC addresses.

Definition at line 85 of file MACAddrList.cpp.

◆ getAddressListAsString()

String MACAddrList::getAddressListAsString ( ) const

Returns a string representation of all MAC addresses in the list.

This function runs through every position of the list, formats each MAC address to human readable (e.g., "AA:BB:CC:DD:EE:FF") and concatenates it to a String.

Returns
String containing all MAC addresses, each separated by a newline.

Definition at line 89 of file MACAddrList.cpp.

◆ isInList() [1/2]

bool MACAddrList::isInList ( const MACAddress & mac) const

Checks if a MAC address is in the list.

This function checks if the given MAC address is in the list.

Parameters
macReference to the MAC address to check.
Return values
`true`if the MAC address is in the list.
`false`otherwise.

Definition at line 20 of file MACAddrList.cpp.

◆ isInList() [2/2]

bool MACAddrList::isInList ( const uint8_t * mac) const

Checks if a MAC address is in the list.

This function checks if the given MAC address is in the list.

Parameters
macPointer to the MAC address to check.
Return values
`true`if the MAC address is in the list.
`false`otherwise.

Definition at line 11 of file MACAddrList.cpp.

◆ removeFromList() [1/2]

bool MACAddrList::removeFromList ( const MACAddress & mac)

Removes a MAC address from the list.

This function finds the given MAC address in the list, and then removes it.

Parameters
macReference to the MAC address to remove (e.g., {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF}).
Return values
`true`if the MAC address was found and removed.
`false`otherwise.

Definition at line 71 of file MACAddrList.cpp.

◆ removeFromList() [2/2]

bool MACAddrList::removeFromList ( const uint8_t * mac)

Removes a MAC address from the list.

This function finds the given MAC address in the list, and then removes it.

Parameters
macPointer to the MAC address to remove.
Return values
`true`if the MAC address was found and removed.
`false`otherwise.

Definition at line 57 of file MACAddrList.cpp.


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