Skip to content

Commit

Permalink
Merge pull request #391 from lealem47/gh382
Browse files Browse the repository at this point in the history
Improving and fixing typos for STM32CUBE build
  • Loading branch information
dgarske committed Jan 22, 2024
2 parents 6c806d5 + e786be1 commit ff496d6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion IDE/STM32CUBE/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 5 additions & 1 deletion IDE/STM32CUBE/default_conf.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -127,6 +127,10 @@ typedef unsigned int size_t;

#define NO_MAIN_DRIVER

#ifdef WOLFSSL_LWIP
#define HAVE_SOCKET
#endif

#ifdef __cplusplus
}
#endif
Expand Down
6 changes: 4 additions & 2 deletions examples/mqttsimple/mqttsimple.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#ifndef WOLFSSL_LWIP
#include <netinet/in.h>
#endif
#include <netdb.h>
#include <unistd.h>
#endif
Expand Down

0 comments on commit ff496d6

Please sign in to comment.