From e786be1bc816855997f39fefb0bac8b4b6617827 Mon Sep 17 00:00:00 2001 From: Lealem Amedie Date: Mon, 22 Jan 2024 10:23:06 -0700 Subject: [PATCH] Improving and fixing typos for STM32CUBE build --- IDE/STM32CUBE/README.md | 2 +- IDE/STM32CUBE/default_conf.ftl | 6 +++++- examples/mqttsimple/mqttsimple.c | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/IDE/STM32CUBE/README.md b/IDE/STM32CUBE/README.md index f75c3381a..d39c5415d 100644 --- a/IDE/STM32CUBE/README.md +++ b/IDE/STM32CUBE/README.md @@ -14,7 +14,7 @@ The wolfMQTT Cube Pack can be found [here](https://www.wolfssl.com/files/ide/I-C 4. In the `Software Packs` configuration category of the `.ioc` file, click on the wolfMQTT pack and enable the library by checking the box. -5. The Pack defaults to using custom IO provided by the user. Modify `IDE/STM32CUBE/userio_template.h` to supply the custom IO. If you'd like to use LwIP instead, configure the wolfMQTT IO settings in the `.ioc` to enable LwIP compatibilty. You'll also have to enable LwIP in the `Middleware` configuration category of the project. +5. The Pack defaults to using custom IO provided by the user. Modify `IDE/STM32CUBE/userio_template.h` to supply the custom IO. If you'd like to use LwIP instead, configure the wolfMQTT IO settings in the `.ioc` to enable LwIP compatibilty. You'll also have to enable LwIP in the `Middleware` configuration category of the project. Make sure that `LWIP_DNS (DNS Module)` is enabled in the LwIP general settings. 6. Save your changes and select yes to the prompt asking about generating code. diff --git a/IDE/STM32CUBE/default_conf.ftl b/IDE/STM32CUBE/default_conf.ftl index effb6db8d..28338cccd 100644 --- a/IDE/STM32CUBE/default_conf.ftl +++ b/IDE/STM32CUBE/default_conf.ftl @@ -109,7 +109,7 @@ extern ${variable.value} ${variable.name}; /* ------------------------------------------------------------------------- */ /* wolfMQTT IO */ /* ------------------------------------------------------------------------- */ -#if defined(WOLFMQTT_CONF_IO) && WOLFSSH_MQTT_IO == 2 +#if defined(WOLFMQTT_CONF_IO) && WOLFMQTT_CONF_IO == 2 #define WOLFSSL_LWIP #else #define WOLFMQTT_USER_IO @@ -127,6 +127,10 @@ typedef unsigned int size_t; #define NO_MAIN_DRIVER +#ifdef WOLFSSL_LWIP + #define HAVE_SOCKET +#endif + #ifdef __cplusplus } #endif diff --git a/examples/mqttsimple/mqttsimple.c b/examples/mqttsimple/mqttsimple.c index f508512d0..5ac2c7f9e 100644 --- a/examples/mqttsimple/mqttsimple.c +++ b/examples/mqttsimple/mqttsimple.c @@ -27,15 +27,17 @@ #endif #include "wolfmqtt/mqtt_client.h" +#include "examples/mqttport.h" #include "mqttsimple.h" /* Requires BSD Style Socket */ #ifdef HAVE_SOCKET - #ifndef ENABLE_MQTT_TLS #include #include -#include +#ifndef WOLFSSL_LWIP + #include +#endif #include #include #endif