LoboMQ
|
A class for managing a list of MAC addresses. More...
#include <MACAddrList.h>
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. | |
A class for managing a list of MAC addresses.
Definition at line 27 of file MACAddrList.h.
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.
macArray | Vector of MACAddress objects (e.g., objects like {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF} ). |
Definition at line 52 of file MACAddrList.cpp.
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.
macArray | Vector of string representations of MAC addresses (e.g., addresses like "AA:BB:CC:DD:EE:FF" ). |
Definition at line 47 of file MACAddrList.cpp.
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.
mac | Reference to the MAC address to add (e.g., {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF} ). |
Definition at line 34 of file MACAddrList.cpp.
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.
macStr | String representation of the MAC address (e.g., "AA:BB:CC:DD:EE:FF" ). |
Definition at line 39 of file MACAddrList.cpp.
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.
mac | Pointer to the MAC address to add. |
Definition at line 29 of file MACAddrList.cpp.
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.
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.
Definition at line 89 of file MACAddrList.cpp.
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.
mac | Reference to the MAC address to check. |
`true` | if the MAC address is in the list. |
`false` | otherwise. |
Definition at line 20 of file MACAddrList.cpp.
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.
mac | Pointer to the MAC address to check. |
`true` | if the MAC address is in the list. |
`false` | otherwise. |
Definition at line 11 of file MACAddrList.cpp.
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.
mac | Reference to the MAC address to remove (e.g., {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF} ). |
`true` | if the MAC address was found and removed. |
`false` | otherwise. |
Definition at line 71 of file MACAddrList.cpp.
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.
mac | Pointer to the MAC address to remove. |
`true` | if the MAC address was found and removed. |
`false` | otherwise. |
Definition at line 57 of file MACAddrList.cpp.