Skip to content

Commit

Permalink
Merge pull request #403 from embhorn/docs-fix
Browse files Browse the repository at this point in the history
Fix Doxygen issues
  • Loading branch information
julek-wolfssl authored Jul 29, 2024
2 parents d4e3797 + d97ad88 commit 0c07630
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 11 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/macos-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
runs-on: macos-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@master
- uses: actions/checkout@master
with:
repository: wolfssl/wolfssl
Expand All @@ -30,20 +31,22 @@ jobs:
run: ./autogen.sh
- name: wolfssl configure
working-directory: ./wolfssl
run: ./configure --enable-enckeys
run: ./configure --enable-enckeys --prefix=$GITHUB_WORKSPACE/build-dir
- name: wolfssl make
working-directory: ./wolfssl
run: make
- name: wolfssl make install
working-directory: ./wolfssl
run: make install

- uses: actions/checkout@master
- name: Check wolfSSL install dir
run: ls $GITHUB_WORKSPACE/build-dir

- name: autogen
run: ./autogen.sh

- name: configure
run: ./configure
run: ./configure --with-libwolfssl-prefix=$GITHUB_WORKSPACE/build-dir
- name: make
run: make
- name: make check
Expand All @@ -57,21 +60,21 @@ jobs:
run: make check

- name: configure with SN Enabled
run: ./configure --enable-sn
run: ./configure --enable-sn --with-libwolfssl-prefix=$GITHUB_WORKSPACE/build-dir
- name: make
run: make
- name: make check
run: make check

- name: configure with Non-Block
run: ./configure --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK"
run: ./configure --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" --with-libwolfssl-prefix=$GITHUB_WORKSPACE/build-dir
- name: make
run: make
- name: make check
run: make check

- name: configure with Non-Block and Multi-threading
run: ./configure --enable-mt --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK"
run: ./configure --enable-mt --enable-nonblock CFLAGS="-DWOLFMQTT_TEST_NONBLOCK" --with-libwolfssl-prefix=$GITHUB_WORKSPACE/build-dir
- name: make
run: make
- name: make check
Expand Down
17 changes: 17 additions & 0 deletions examples/mqttport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion wolfmqtt/mqtt_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ WOLFMQTT_API int MqttClient_Init(

/*! \brief Cleans up resources allocated to the MqttClient structure
* \param client Pointer to MqttClient structure
* \return none
*/
WOLFMQTT_API void MqttClient_DeInit(MqttClient *client);

Expand Down Expand Up @@ -360,6 +359,7 @@ WOLFMQTT_API int MqttClient_Publish_ex(
with message data
* Note: MqttPublish and MqttMessage are same
structure.
* \param pubCb Function pointer to callback routine
* \return MQTT_CODE_SUCCESS, MQTT_CODE_CONTINUE (for non-blocking) or
MQTT_CODE_ERROR_* (see enum MqttPacketResponseCodes)
\sa MqttClient_Publish
Expand Down
6 changes: 4 additions & 2 deletions zephyr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`

Expand Down
7 changes: 7 additions & 0 deletions zephyr/samples/client/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions zephyr/samples/client_tls/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c07630

Please sign in to comment.