Skip to content

Commit

Permalink
Merge pull request #14 from rubnium/dev
Browse files Browse the repository at this point in the history
 v0.11.1 Updated documentation
  • Loading branch information
rubnium authored Jun 27, 2024
2 parents 01a4ed2 + af55585 commit daa8d63
Show file tree
Hide file tree
Showing 28 changed files with 1,032 additions and 585 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# MQTT for ESP-NOW
TFG
# LoboMQ - TFG
12 changes: 6 additions & 6 deletions doxygen_files/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ SHORT_NAMES = NO
# description.)
# The default value is: NO.

JAVADOC_AUTOBRIEF = NO
JAVADOC_AUTOBRIEF = YES

# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
# such as
Expand Down Expand Up @@ -502,7 +502,7 @@ LOOKUP_CACHE_SIZE = 0
# DOT_NUM_THREADS setting.
# Minimum value: 0, maximum value: 32, default value: 1.

NUM_PROC_THREADS = 1
NUM_PROC_THREADS = 0

# If the TIMESTAMP tag is set different from NO then each generated page will
# contain the date or date and time when the page was generated. Setting this to
Expand Down Expand Up @@ -949,7 +949,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = ../library/src #TODO: change
INPUT = ../library/src, ../library/README.md #TODO: change

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -2431,15 +2431,15 @@ ENABLE_PREPROCESSING = YES
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

MACRO_EXPANSION = NO
MACRO_EXPANSION = YES

# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
# the macro expansion is limited to the macros specified with the PREDEFINED and
# EXPAND_AS_DEFINED tags.
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

EXPAND_ONLY_PREDEF = NO
EXPAND_ONLY_PREDEF = YES

# If the SEARCH_INCLUDES tag is set to YES, the include files in the
# INCLUDE_PATH will be searched if a #include is found.
Expand Down Expand Up @@ -2472,7 +2472,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

PREDEFINED =
PREDEFINED = __attribute__(x)=

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
Expand Down
4 changes: 2 additions & 2 deletions library/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# MQTT for ESP-NOW
TFG
# LoboMQ
Library description here
1 change: 1 addition & 0 deletions library/src/LoboMQ.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @file LoboMQ.h
* @author Rubén Gómez Villegas
*
* This library is used to create a MQTT Broker using ESP32 and ESP-NOW protocol.
*/

Expand Down
1 change: 1 addition & 0 deletions library/src/LoboMQ/Broker.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @file Broker.h
* @author Rubén Gómez Villegas
*
* This library is used to create a MQTT Broker using ESP32 and ESP-NOW protocol.
*/

Expand Down
1 change: 1 addition & 0 deletions library/src/LoboMQ/BrokerTopic.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @file BrokerTopic.h
* @author Rubén Gómez Villegas
*
* This library is used to create a MQTT Broker using ESP32 and ESP-NOW protocol.
*/

Expand Down
104 changes: 58 additions & 46 deletions library/src/LoboMQ/MACAddrList.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @file MACAddrList.h
* @author Rubén Gómez Villegas
*
* This library is used to create a MQTT Broker using ESP32 and ESP-NOW protocol.
*/

Expand All @@ -26,102 +27,113 @@ class MACAddrList : public std::vector<MACAddress> {
public:

/**
* @brief Checks if a MAC address is in the list.
* @brief Checks if a MAC address is in the list.
*
* This function checks if the given MAC address is in the list.
* @param mac Pointer to the MAC address to check.
* @retval `true` if the MAC address is in the list.
* @param mac Pointer to the MAC address to check.
* @retval `true` if the MAC address is in the list.
* @retval `false` otherwise.
*/
*/
bool isInList(const uint8_t *mac) const;

/**
* @brief Checks if a MAC address is in the list.
* @brief Checks if a MAC address is in the list.
*
* This function checks if the given MAC address is in the list.
* @param mac Reference to the MAC address to check.
* @retval `true` if the MAC address is in the list.
* @param mac Reference to the MAC address to check.
* @retval `true` if the MAC address is in the list.
* @retval `false` otherwise.
*/
*/
bool isInList(const MACAddress &mac) const;

/**
* @brief 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.
* @param mac Pointer to the MAC address to add.
*/
* @brief 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.
* @param mac Pointer to the MAC address to add.
*/
void addToList(const uint8_t *mac);

/**
* @brief 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.
* @param mac Reference to the MAC address to add (e.g., `{0xAA, 0xBB, 0xCC,
* @brief 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.
* @param mac Reference to the MAC address to add (e.g., `{0xAA, 0xBB, 0xCC,
* 0xDD, 0xEE, 0xFF}`).
*/
*/
void addToList(const MACAddress &mac);

/**
* @brief 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.
* @param macStr String representation of the MAC address (e.g.,
* @brief 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.
* @param macStr String representation of the MAC address (e.g.,
* `"AA:BB:CC:DD:EE:FF"`).
*/
*/
void addToList(const String &macStr);

/**
* @brief Adds multiple MAC addresses from an array to the list.
* This function runs through a given array of MAC addresses adding them if
* @brief 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.
* @param macArray Vector of string representations of MAC addresses (e.g.,
* @param macArray Vector of string representations of MAC addresses (e.g.,
* addresses like `"AA:BB:CC:DD:EE:FF"`).
*/
*/
void addArrayToList(const std::vector<String>& macArray);

/**
* @brief Adds multiple MAC addresses from an array to the list.
* This function runs through a given array of MAC addresses adding them if
* @brief 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.
* @param macArray Vector of MACAddress objects (e.g., objects like `{0xAA,
* @param macArray Vector of MACAddress objects (e.g., objects like `{0xAA,
* 0xBB, 0xCC, 0xDD, 0xEE, 0xFF}`).
*/
*/
void addArrayToList(const std::vector<MACAddress>& macArray);

/**
* @brief Removes a MAC address from the list.
* This function finds the given MAC address in the list, and then removes
* @brief Removes a MAC address from the list.
*
* This function finds the given MAC address in the list, and then removes
* it.
* @param mac Pointer to the MAC address to remove.
* @retval `true` if the MAC address was found and removed.
* @param mac Pointer to the MAC address to remove.
* @retval `true` if the MAC address was found and removed.
* @retval `false` otherwise.
*/
*/
bool removeFromList(const uint8_t *mac);

/**
* @brief Removes a MAC address from the list.
* @brief Removes a MAC address from the list.
*
* This function finds the given MAC address in the list, and then removes
* it.
* @param mac Reference to the MAC address to remove (e.g., `{0xAA, 0xBB,
* @param mac Reference to the MAC address to remove (e.g., `{0xAA, 0xBB,
* 0xCC, 0xDD, 0xEE, 0xFF}`).
* @retval `true` if the MAC address was found and removed.
* @retval `true` if the MAC address was found and removed.
* @retval `false` otherwise.
*/
*/
bool removeFromList(const MACAddress &mac);

/**
* @brief Clears all the MAC addresses of the list.
* @brief 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.
*/
*/
void clearList();

/**
* @brief Returns a string representation of all MAC addresses in the list.
* This function runs through every position of the list, formats each MAC
* @brief 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.
* @return String containing all MAC addresses, each separated by a newline.
*/
* @return String containing all MAC addresses, each separated by a newline.
*/
String getAddressListAsString() const;
};

Expand Down
10 changes: 7 additions & 3 deletions library/src/LoboMQ/PubSub.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @file PubSub.h
* @author Rubén Gómez Villegas
*
* This library is used to create a MQTT Broker using ESP32 and ESP-NOW protocol.
*/

Expand All @@ -20,9 +21,12 @@
* clients.
*/
typedef enum __attribute__((packed)) {
MSGTYPE_SUBSCRIBE = (uint8_t)0x00, /**< Subscribe message, sent from subscriber to broker. */
MSGTYPE_UNSUBSCRIBE, /**< Unsubscribe message, sent from subscriber to broker. */
MSGTYPE_PUBLISH /**< Publish message, sent from publisher to broker or from broker to subscriber. */
/** Subscribe message, sent from subscriber to broker. */
MSGTYPE_SUBSCRIBE = (uint8_t)0x00,
/** Unsubscribe message, sent from subscriber to broker. */
MSGTYPE_UNSUBSCRIBE,
/** Publish message, sent from publisher to broker or from broker to subscriber. */
MSGTYPE_PUBLISH
} MessageType;

/**
Expand Down
17 changes: 9 additions & 8 deletions library/src/LoboMQ/commons/Includes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @file Includes.h
* @author Rubén Gómez Villegas
*
* This library is used to create a MQTT Broker using ESP32 and ESP-NOW protocol.
*/

Expand All @@ -24,24 +25,24 @@
* functions.
*/
typedef enum {
/** ! @brief No error, operation successful. */
/** No error, operation successful. */
LMQ_ERR_SUCCESS = 0,

/** ! @brief No error, valid topic. */
/** No error, valid topic. */
LMQ_ERR_VALID_TOPIC,
/** ! @brief Invalid topic (no topic, too big, contains wildcard characters
* in wrong positions, or contains non-UTF-8 characters). */
/** Invalid topic (no topic, too big, contains wildcard characters in wrong
* positions, or contains non-UTF-8 characters). */
LMQ_ERR_INVAL_TOPIC,

/** ! @brief Couldn't initialize ESP-NOW. */
/** Couldn't initialize ESP-NOW. */
LMQ_ERR_BAD_ESP_CONFIG,

/** ! @brief Couldn't send the message. */
/** Couldn't send the message. */
LMQ_ERR_ESP_SEND_FAIL,

/** ! @brief Couldn't create the broker queue. */
/** Couldn't create the broker queue. */
LMQ_ERR_XQUEUECREATE_FAIL,
/** ! @brief Couldn't create the broker task. */
/** Couldn't create the broker task. */
LMQ_ERR_XTASKCREATE_FAIL
} LMQErrType;

Expand Down
12 changes: 10 additions & 2 deletions library/src/LoboMQ/commons/Logger.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @file Logger.h
* @author Rubén Gómez Villegas
*
* This library is used to create a MQTT Broker using ESP32 and ESP-NOW protocol.
*/

Expand All @@ -21,16 +22,21 @@
* which is being logged.
*/
enum LoggerClass {
/** Broker log class. */
BROKER = 0,
/** Publisher log class. */
PUBLISHER,
/** Subscriber log class. */
SUBSCRIBER,
UNKNOWN /**< Log class unknown or generic. */
/** Log class unknown or generic. */
UNKNOWN
};

/**
* @brief Creates a logger that prints messages to the serial monitor.
*
* This function creates a logger used by the broker or client which prints
* messages to the serial monitor as most critical as the indicated.
* messages to the serial monitor as most critical as the indicated.
* @param className The log class.
* @param level The most critical level of registration in which there is
* interest.
Expand All @@ -41,6 +47,7 @@ Elog *initializeSerialLogger(LoggerClass className, Loglevel level = DEFAULT_LOG

/**
* @brief Creates a logger that prints messages to a file inside a SD card.
*
* This function creates a logger used by the broker or client which prints
* messages to a file in the SD card as most critical as the indicated.
* @param className The log class.
Expand All @@ -56,6 +63,7 @@ Elog *initializeSDLogger(LoggerClass className, int cs, int sck, int miso, int m

/**
* @brief Creates a logger without the ability to print messages.
*
* This function creates a logger used by the broker or client which will not
* print any message produced by the library.
* @return A pointer to an Elog instance set up to not log messages.
Expand Down
3 changes: 2 additions & 1 deletion tfg_report/templateAPP/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ Cotutor: Ana Rubio Ruiz
Csl: input/resources/csl/acm-sig-proceedings.csl
Department: Tecnologías y Sistemas de Información
Language: spanish
Month: Mes
Month: Julio
Name: Rubén Gómez Villegas
Technology: Sistemas de Información
Title: Protocolo de mensajería ligero inspirado en MQTT para redes ESP-NOW
Subtitle: MQTT-inspired lightweight messaging protocol for ESP-NOW networks
Tutor: Rubén Cantarero Navarro
Year: 2024
Loading

0 comments on commit daa8d63

Please sign in to comment.