This is MQTT v5 client implementation, with limited support of TLS v1.3 protocol, third-party cryptography library. verified on different embedded system platforms (currently STM32F4 and Raspberry PI development board).
This section guides you on integrating your custom application with this MQTT client library.
- Clear previous build
make clean - Copy
mqttclient-sample.conftomqttclient.conf. - Edit
mqttclient.confto specify yourmiddleware,cryptolib,brokeraddr,brokerport, and for embedded systems,os,hw_platform,rtos_hw_build_path,toolchain_basepath, andesp_proj_home(if using ESP8266). - Run
make configto generate build files based on your configuration:make config MQC_CFG_FULLPATH=$PWD/mqttclient.conf
- Clear previous build
make clean -C ./third_party - Download external dependencies:
make download_3party
- Build them. For both Linux of embedded systems (e.g., ESP8266_AT_parser)
make gen_3pty_libs
- Build the core
libmqttclient.a:make gen_lib BUILD_DIR=/path/to/external-app/build APPCFG_BASEPATH=/path/to/your-app/cfg
APPCFG_BASEPATHindicates the path to your application configuration, essential for embedded system buildBUILD_DIR, absollute path of the build directory for output library.
- Place your application's source files (e.g.,
my_app.c) in a directory (e.g.,my_apps/). - Use
make buildappto compile your application. You must specify :APP_NAME(your executable name)APP_BASEPATH(the directory containing your source files).BUILD_DIR, absollute path of the build directory for target image application .
- For Linux:
make demo BUILD_DIR=/path/to/external-app/build
- For embedded systems, you must also provide the OS and hardware-specific variables (if not already in
mqttclient.conf):make buildapp BUILD_DIR=/path/to/external-app/build APP_NAME=my_app APP_BASEPATH=my_apps \ OS=<your_os> HW_PLATFORM=<your_hw> RTOS_HW_BUILD_PATH=<your_rtos_path> \ TOOLCHAIN_BASEPATH=<your_toolchain_path> ESP_PROJ_HOME=<your_esp_path> make demo BUILD_DIR=/path/to/external-app/build - The compiled application will be found in the
build/directory.
Check out build helper document :
make help