Bugfix of compile error and update README

update Makefile for Mac

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2020-10-12 18:33:01 +09:00
parent 45ea265344
commit 8ceb7ee67e
3 changed files with 23 additions and 10 deletions

View File

@@ -18,6 +18,18 @@ OS := linux
SENSORNET := udp
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=../../
CONFIG_DIR=../../
@@ -74,11 +86,8 @@ $(SUBDIR)/MQTTSNSubscribeServer.c \
$(SUBDIR)/MQTTSNUnsubscribeClient.c \
$(SUBDIR)/MQTTSNUnsubscribeServer.c
CXX := g++
CPPFLAGS +=
# include directories, for MacOS/homebrew add -I/usr/local/opt/openssl/include/
INCLUDE :=
INCLUDES += $(INCLUDE) -I$(SRCDIR) \
-I$(SRCDIR)/$(OS) \
-I$(SRCDIR)/$(OS)/$(SENSORNET) \
@@ -88,8 +97,7 @@ INCLUDES += $(INCLUDE) -I$(SRCDIR) \
# preprocessor defines
DEFS :=
# library search paths, for MacOS/homebrew add -L/usr/local/opt/openssl/lib/
LIB :=
LIBS += $(LIB) -L/usr/local/lib
LDFLAGS :=

View File

@@ -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
$ cd paho.mqtt-sn.embedded-c/MQTTSNGateway
$ make [SENSORNET={udp6|xbee}]
$ make [SENSORNET={udp6|xbee|loralink}]
$ make install
$ make clean
````
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.
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
ApiMode=2
#LoRaLink
BaudrateLoRaLink=115200
DeviceRxLoRaLink=/dev/ttyLoRaLinkRx
DeviceTxLoRaLink=/dev/ttyLoRaLinkTx
# LOG
ShearedMemory=NO;

View File

@@ -214,7 +214,7 @@ void TestTopics::test(void)
for ( int i = 0; i < 10 ; i++ )
{
MQTTSN_topicid tp1;
char tp0[10];
char tp0[20];
sprintf(tp0, "Topic/%d/%d", i, i);
tp1.type = MQTTSN_TOPIC_TYPE_NORMAL;
tp1.data.long_.len = strlen(tp0);
@@ -237,7 +237,7 @@ void TestTopics::test(void)
for ( int i = 0; i < 10 ; i++ )
{
MQTTSN_topicid tp1;
char tp0[10];
char tp0[20];
sprintf(tp0, "Topic/%d", i);
tp1.type = MQTTSN_TOPIC_TYPE_NORMAL;
tp1.data.long_.len = strlen(tp0);
@@ -261,7 +261,7 @@ void TestTopics::test(void)
for ( int i = 0; i < 10 ; i++ )
{
MQTTSN_topicid tpid1;
char tp0[10];
char tp0[20];
sprintf(tp0, "TOPIC/%d/%d", i, i);
tpid1.type = MQTTSN_TOPIC_TYPE_NORMAL;
tpid1.data.long_.len = strlen(tp0);