Fix Zephyr port build issues

pull/403/head
Eric Blankenhorn 2024-07-26 15:51:09 -05:00
parent f5b497dbf0
commit d97ad88c42
4 changed files with 33 additions and 4 deletions

View File

@ -141,10 +141,27 @@ extern "C" {
#define SOCKET_INVALID (-1)
typedef zsock_fd_set fd_set;
#define FD_ZERO ZSOCK_FD_ZERO
#define FD_SET ZSOCK_FD_SET
#define FD_ISSET ZSOCK_FD_ISSET
#define select zsock_select
#ifdef WOLFSSL_ZEPHYR
/* wolfSSL takes care of most defines */
#include <wolfssl/wolfcrypt/wc_port.h>
#else
#define addrinfo zsock_addrinfo
#define getaddrinfo zsock_getaddrinfo
#define freeaddrinfo zsock_freeaddrinfo
#define socket zsock_socket
#define close zsock_close
#define SOCK_CONNECT zsock_connect
#define getsockopt zsock_getsockopt
#define setsockopt zsock_setsockopt
#define send zsock_send
#define recv zsock_recv
#define MSG_PEEK ZSOCK_MSG_PEEK
#ifndef NO_FILESYSTEM
#define XFOPEN z_fs_open
#define XFCLOSE z_fs_close

View File

@ -58,11 +58,11 @@ Follow the [instructions](https://docs.zephyrproject.org/latest/connectivity/net
sudo ./loop-slip-tap.sh
```
Run the following commands in parallel in this order in the `zephyrproject` directory to setup a MQTT broker and subscriber.
Run the following commands in parallel in this order in the `zephyrproject` directory to setup a MQTT broker and subscriber (on port 11883 as defined in the mosquitto config).
```bash
cd modules/lib/wolfmqtt && mosquitto -c scripts/broker_test/mosquitto.conf
mosquitto_sub -t sensors
mosquitto_sub -p 11883 -t sensors
```
### Build and Run client Test Application
@ -76,6 +76,8 @@ west build -t run
```
### Build and Run client TLS Test Application
Prerequisite:
Add wolfSSL Zephyr module: https://github.com/wolfSSL/wolfssl/blob/master/zephyr/README.md
build and execute `client TLS`

View File

@ -5,6 +5,13 @@
extern "C" {
#endif
#include <zephyr/net/socket_select.h>
/* If a custom user_settings file is provided use it instead */
#ifdef WOLFMQTT_SETTINGS_FILE
#include WOLFMQTT_SETTINGS_FILE
#endif
#undef NO_FILESYSTEM
#define NO_FILESYSTEM

View File

@ -5,8 +5,11 @@
extern "C" {
#endif
#ifdef CONFIG_WOLFSSL_SETTINGS_FILE
#include CONFIG_WOLFSSL_SETTINGS_FILE
#include <zephyr/net/socket_select.h>
/* If a custom user_settings file is provided use it instead */
#ifdef WOLFMQTT_SETTINGS_FILE
#include WOLFMQTT_SETTINGS_FILE
#endif
#undef NO_FILESYSTEM