mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-15 16:36:52 +01:00
Bugfix of compile error and update README
update Makefile for Mac Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
@@ -18,6 +18,18 @@ OS := linux
|
|||||||
SENSORNET := udp
|
SENSORNET := udp
|
||||||
TEST := tests
|
TEST := tests
|
||||||
|
|
||||||
|
# include directories, for MacOS/homebrew add -I/usr/local/opt/openssl/include/
|
||||||
|
# library search paths, for MacOS/homebrew add -L/usr/local/opt/openssl/lib/
|
||||||
|
ifeq ($(shell) uname),Darwin)
|
||||||
|
CXX := clang++
|
||||||
|
INCLUDE := -I/usr/local/opt/openssl/include/
|
||||||
|
LIB := -L/usr/local/opt/openssl/lib/
|
||||||
|
else
|
||||||
|
CXX := g++
|
||||||
|
INCLUDE :=
|
||||||
|
LIB :=
|
||||||
|
endif
|
||||||
|
|
||||||
INSTALL_DIR=../../
|
INSTALL_DIR=../../
|
||||||
CONFIG_DIR=../../
|
CONFIG_DIR=../../
|
||||||
|
|
||||||
@@ -74,11 +86,8 @@ $(SUBDIR)/MQTTSNSubscribeServer.c \
|
|||||||
$(SUBDIR)/MQTTSNUnsubscribeClient.c \
|
$(SUBDIR)/MQTTSNUnsubscribeClient.c \
|
||||||
$(SUBDIR)/MQTTSNUnsubscribeServer.c
|
$(SUBDIR)/MQTTSNUnsubscribeServer.c
|
||||||
|
|
||||||
CXX := g++
|
|
||||||
CPPFLAGS +=
|
CPPFLAGS +=
|
||||||
|
|
||||||
# include directories, for MacOS/homebrew add -I/usr/local/opt/openssl/include/
|
|
||||||
INCLUDE :=
|
|
||||||
INCLUDES += $(INCLUDE) -I$(SRCDIR) \
|
INCLUDES += $(INCLUDE) -I$(SRCDIR) \
|
||||||
-I$(SRCDIR)/$(OS) \
|
-I$(SRCDIR)/$(OS) \
|
||||||
-I$(SRCDIR)/$(OS)/$(SENSORNET) \
|
-I$(SRCDIR)/$(OS)/$(SENSORNET) \
|
||||||
@@ -88,8 +97,7 @@ INCLUDES += $(INCLUDE) -I$(SRCDIR) \
|
|||||||
# preprocessor defines
|
# preprocessor defines
|
||||||
DEFS :=
|
DEFS :=
|
||||||
|
|
||||||
# library search paths, for MacOS/homebrew add -L/usr/local/opt/openssl/lib/
|
|
||||||
LIB :=
|
|
||||||
LIBS += $(LIB) -L/usr/local/lib
|
LIBS += $(LIB) -L/usr/local/lib
|
||||||
|
|
||||||
LDFLAGS :=
|
LDFLAGS :=
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ This Gateway can run as a transparent or aggregating Gateway by specifying the g
|
|||||||
````
|
````
|
||||||
$ git clone -b develop https://github.com/eclipse/paho.mqtt-sn.embedded-c
|
$ git clone -b develop https://github.com/eclipse/paho.mqtt-sn.embedded-c
|
||||||
$ cd paho.mqtt-sn.embedded-c/MQTTSNGateway
|
$ cd paho.mqtt-sn.embedded-c/MQTTSNGateway
|
||||||
$ make [SENSORNET={udp6|xbee}]
|
$ make [SENSORNET={udp6|xbee|loralink}]
|
||||||
$ make install
|
$ make install
|
||||||
$ make clean
|
$ make clean
|
||||||
````
|
````
|
||||||
By default, a gateway for UDP is built.
|
By default, a gateway for UDP is built.
|
||||||
In order to create a gateway for UDP6 or XBee, SENSORNET argument is required.
|
In order to create a gateway for UDP6, XBee or LoRaLink, SENSORNET argument is required.
|
||||||
|
|
||||||
MQTT-SNGateway, MQTT-SNLogmonitor and *.conf files are copied into ../ directory.
|
MQTT-SNGateway, MQTT-SNLogmonitor and *.conf files are copied into ../ directory.
|
||||||
If you want to install the gateway into specific directories, enter a command line as follows:
|
If you want to install the gateway into specific directories, enter a command line as follows:
|
||||||
@@ -94,6 +94,11 @@ Baudrate=38400
|
|||||||
SerialDevice=/dev/ttyUSB0
|
SerialDevice=/dev/ttyUSB0
|
||||||
ApiMode=2
|
ApiMode=2
|
||||||
|
|
||||||
|
#LoRaLink
|
||||||
|
BaudrateLoRaLink=115200
|
||||||
|
DeviceRxLoRaLink=/dev/ttyLoRaLinkRx
|
||||||
|
DeviceTxLoRaLink=/dev/ttyLoRaLinkTx
|
||||||
|
|
||||||
# LOG
|
# LOG
|
||||||
ShearedMemory=NO;
|
ShearedMemory=NO;
|
||||||
|
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ void TestTopics::test(void)
|
|||||||
for ( int i = 0; i < 10 ; i++ )
|
for ( int i = 0; i < 10 ; i++ )
|
||||||
{
|
{
|
||||||
MQTTSN_topicid tp1;
|
MQTTSN_topicid tp1;
|
||||||
char tp0[10];
|
char tp0[20];
|
||||||
sprintf(tp0, "Topic/%d/%d", i, i);
|
sprintf(tp0, "Topic/%d/%d", i, i);
|
||||||
tp1.type = MQTTSN_TOPIC_TYPE_NORMAL;
|
tp1.type = MQTTSN_TOPIC_TYPE_NORMAL;
|
||||||
tp1.data.long_.len = strlen(tp0);
|
tp1.data.long_.len = strlen(tp0);
|
||||||
@@ -237,7 +237,7 @@ void TestTopics::test(void)
|
|||||||
for ( int i = 0; i < 10 ; i++ )
|
for ( int i = 0; i < 10 ; i++ )
|
||||||
{
|
{
|
||||||
MQTTSN_topicid tp1;
|
MQTTSN_topicid tp1;
|
||||||
char tp0[10];
|
char tp0[20];
|
||||||
sprintf(tp0, "Topic/%d", i);
|
sprintf(tp0, "Topic/%d", i);
|
||||||
tp1.type = MQTTSN_TOPIC_TYPE_NORMAL;
|
tp1.type = MQTTSN_TOPIC_TYPE_NORMAL;
|
||||||
tp1.data.long_.len = strlen(tp0);
|
tp1.data.long_.len = strlen(tp0);
|
||||||
@@ -261,7 +261,7 @@ void TestTopics::test(void)
|
|||||||
for ( int i = 0; i < 10 ; i++ )
|
for ( int i = 0; i < 10 ; i++ )
|
||||||
{
|
{
|
||||||
MQTTSN_topicid tpid1;
|
MQTTSN_topicid tpid1;
|
||||||
char tp0[10];
|
char tp0[20];
|
||||||
sprintf(tp0, "TOPIC/%d/%d", i, i);
|
sprintf(tp0, "TOPIC/%d/%d", i, i);
|
||||||
tpid1.type = MQTTSN_TOPIC_TYPE_NORMAL;
|
tpid1.type = MQTTSN_TOPIC_TYPE_NORMAL;
|
||||||
tpid1.data.long_.len = strlen(tp0);
|
tpid1.data.long_.len = strlen(tp0);
|
||||||
|
|||||||
Reference in New Issue
Block a user