Open
Conversation
…c (WOLFMQTT_STATIC_MEMEORY).
There was a problem hiding this comment.
Pull request overview
This pull request implements a simple MQTT v5.0 broker for the wolfMQTT library. The implementation provides a lightweight, embeddable broker that supports both static and dynamic memory allocation, making it suitable for both resource-constrained embedded systems and server environments. The broker includes essential MQTT features such as pub/sub messaging, retained messages, Last Will and Testament (LWT), QoS 0-1 support, client authentication, and optional TLS encryption.
Changes:
- Added complete broker implementation with support for MQTT v3.1.1 and v5.0 protocols
- Exposed packet encoding/decoding functions as public API for broker use via WOLFMQTT_BROKER build option
- Fixed existing bug in MQTT_CONNECT_FLAG_GET_QOS macro (missing & operator)
- Added comprehensive test suite with 14 test cases covering core functionality and TLS support
- Integrated broker into build systems (autotools and CMake) and CI/CD pipeline
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| wolfmqtt/mqtt_types.h | Added XSTRCMP macro for string comparison abstraction |
| wolfmqtt/mqtt_packet.h | Changed WOLFMQTT_LOCAL to WOLFMQTT_API for broker-needed functions; fixed QoS extraction macro bug; added broker-specific decode/encode API declarations |
| wolfmqtt/mqtt_broker.h | New header defining broker types (MqttBroker, BrokerClient, BrokerSub, etc.) and public API |
| src/mqtt_packet.c | Implemented broker-side packet decode/encode functions (Connect, ConnectAck, Subscribe, Unsubscribe, UnsubscribeAck, Disconnect) |
| src/mqtt_broker.c | Main broker implementation (2371 lines) with client management, subscription handling, retained messages, topic matching, and LWT support |
| wolfmqtt/include.am | Added mqtt_broker.h to installed headers |
| src/include.am | Added mqtt_broker binary to build |
| scripts/include.am | Added broker.test script to distribution |
| scripts/broker.test | Comprehensive test script with 14 test cases using mosquitto_pub/sub clients |
| scripts/broker_test/*.pem | Test certificates for TLS testing |
| configure.ac | Added --enable-broker option; fixed trailing whitespace |
| CMakeLists.txt | Added WOLFMQTT_BROKER option and broker executable target |
| .gitignore | Added configure~ and src/mqtt_broker to ignore list |
| .github/workflows/broker-check.yml | New CI workflow testing broker with 4 configurations (dynamic/static memory, with/without TLS) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…d exit code fixes
…ng, extended tests and v5 property fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.