Skip to content

Commit

Permalink
Refactor MQTT-SN code
Browse files Browse the repository at this point in the history
  • Loading branch information
embhorn committed Oct 31, 2023
1 parent f05089c commit 44ca39c
Show file tree
Hide file tree
Showing 12 changed files with 4,237 additions and 4,046 deletions.
25 changes: 17 additions & 8 deletions examples/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ noinst_PROGRAMS += examples/mqttclient/mqttclient \
examples/wiot/wiot \
examples/nbclient/nbclient \
examples/multithread/multithread \
examples/sn-client/sn-client \
examples/sn-client/sn-client_qos-1 \
examples/sn-client/sn-multithread \
examples/pub-sub/mqtt-pub \
examples/pub-sub/mqtt-sub
if BUILD_SN
noinst_PROGRAMS += examples/sn-client/sn-client \
examples/sn-client/sn-client_qos-1 \
examples/sn-client/sn-multithread
endif

noinst_HEADERS += examples/mqttclient/mqttclient.h \
examples/mqttsimple/mqttsimple.h \
Expand All @@ -30,8 +32,10 @@ noinst_HEADERS += examples/mqttclient/mqttclient.h \
examples/mqttport.h \
examples/nbclient/nbclient.h \
examples/multithread/multithread.h \
examples/sn-client/sn-client.h \
examples/pub-sub/mqtt-pub-sub.h
if BUILD_SN
noinst_HEADERS += examples/sn-client/sn-client.h
endif

# MQTT Client Example
examples_mqttclient_mqttclient_SOURCES = examples/mqttclient/mqttclient.c \
Expand Down Expand Up @@ -108,7 +112,7 @@ examples_wiot_wiot_LDADD = src/libwolfmqtt.la
examples_wiot_wiot_DEPENDENCIES = src/libwolfmqtt.la
examples_wiot_wiot_CPPFLAGS = -I$(top_srcdir)/examples $(AM_CPPFLAGS)


if BUILD_SN
# MQTT-SN Examples
examples_sn_client_sn_client_SOURCES = examples/sn-client/sn-client.c \
examples/mqttnet.c \
Expand All @@ -130,6 +134,7 @@ examples_sn_client_sn_multithread_SOURCES = examples/sn-client/sn-multithr
examples_sn_client_sn_multithread_LDADD = src/libwolfmqtt.la
examples_sn_client_sn_multithread_DEPENDENCIES = src/libwolfmqtt.la
examples_sn_client_sn_multithread_CPPFLAGS = -I$(top_srcdir)/examples $(AM_CPPFLAGS)
endif

# MQTT pub and sub clients
examples_pub_sub_mqtt_pub_SOURCES = examples/pub-sub/mqtt-pub.c \
Expand Down Expand Up @@ -160,9 +165,11 @@ dist_example_DATA+= examples/mqttnet.c \
examples/wiot/wiot.c
dist_example_DATA+= examples/nbclient/nbclient.c
dist_example_DATA+= examples/multithread/multithread.c
if BUILD_SN
dist_example_DATA+= examples/sn-client/sn-client.c
dist_example_DATA+= examples/sn-client/sn-client_qos-1.c
dist_example_DATA+= examples/sn-client/sn-multithread.c
endif
dist_example_DATA+= examples/pub-sub/mqtt-pub.c
dist_example_DATA+= examples/pub-sub/mqtt-sub.c

Expand All @@ -174,11 +181,13 @@ DISTCLEANFILES+= examples/mqttclient/.libs/mqttclient \
examples/wiot/.libs/wiot \
examples/nbclient/.libs/nbclient \
examples/multithread/.libs/multithread \
examples/sn-client/.libs/sn-client \
examples/sn-client/.libs/sn-client_qos-1 \
examples/sn-client/.libs/sn-multithread \
examples/pub-sub/mqtt-pub \
examples/pub-sub/mqtt-sub
if BUILD_SN
DISTCLEANFILES+= examples/sn-client/.libs/sn-client \
examples/sn-client/.libs/sn-client_qos-1 \
examples/sn-client/.libs/sn-multithread
endif

EXTRA_DIST+= examples/mqttuart.c \
examples/publish.dat \
Expand Down
5 changes: 5 additions & 0 deletions src/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ src_libwolfmqtt_la_SOURCES = src/mqtt_client.c \
src/mqtt_packet.c \
src/mqtt_socket.c

if BUILD_SN
src_libwolfmqtt_la_SOURCES += src/mqtt_sn_client.c \
src/mqtt_sn_packet.c
endif

src_libwolfmqtt_la_CFLAGS = -DBUILDING_WOLFMQTT $(AM_CFLAGS)
src_libwolfmqtt_la_CPPFLAGS = -DBUILDING_WOLFMQTT $(AM_CPPFLAGS)
src_libwolfmqtt_la_LDFLAGS = ${AM_LDFLAGS} -no-undefined -version-info ${WOLFMQTT_LIBRARY_VERSION}
Expand Down
Loading

0 comments on commit 44ca39c

Please sign in to comment.