Fixed the Linux DLMSTP standalone test application Makefile. (#1055)

This commit is contained in:
Steve Karg
2025-07-31 09:40:18 -05:00
committed by GitHub
parent f31193998c
commit f88f5a3424
5 changed files with 54 additions and 7 deletions
+3 -2
View File
@@ -1159,9 +1159,9 @@ static char *Network_Interface = NULL;
int main(int argc, char *argv[])
{
uint16_t pdu_len = 0;
uint16_t pdu_len;
/* argv has the "COM4" or some other device */
/* argv has the "/dev/ttyUSB0" or some other device */
if (argc > 1) {
Network_Interface = argv[1];
}
@@ -1176,6 +1176,7 @@ int main(int argc, char *argv[])
MSTP_Create_And_Send_Frame(
&MSTP_Port, FRAME_TYPE_TEST_REQUEST, MSTP_Port.SourceAddress,
MSTP_Port.This_Station, NULL, 0);
(void)pdu_len;
}
return 0;
+20 -4
View File
@@ -1,15 +1,30 @@
#Makefile to build test case
CC = gcc
BASEDIR = .
BACNET_SRC_DIR ?= $(realpath ../../src)
# -g for debugging with gdb
DEFINES = -DBIG_ENDIAN=0 -DBACDL_MSTP=1 -DTEST_DLMSTP
INCLUDES = -I. -I../../
DEFINES += -DBACNET_STACK_DEPRECATED_DISABLE
INCLUDES = -I. -I$(BACNET_SRC_DIR)
CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g
SRCS = rs485.c \
dlmstp.c \
../../mstp.c \
../../crc.c
mstimer-init.c \
$(BACNET_SRC_DIR)/bacnet/datalink/cobs.c \
$(BACNET_SRC_DIR)/bacnet/datalink/crc.c \
$(BACNET_SRC_DIR)/bacnet/datalink/mstp.c \
$(BACNET_SRC_DIR)/bacnet/datalink/mstptext.c \
$(BACNET_SRC_DIR)/bacnet/basic/sys/debug.c \
$(BACNET_SRC_DIR)/bacnet/basic/sys/fifo.c \
$(BACNET_SRC_DIR)/bacnet/basic/sys/mstimer.c \
$(BACNET_SRC_DIR)/bacnet/basic/sys/ringbuf.c \
$(BACNET_SRC_DIR)/bacnet/bacaddr.c \
$(BACNET_SRC_DIR)/bacnet/bacdcode.c \
$(BACNET_SRC_DIR)/bacnet/bacint.c \
$(BACNET_SRC_DIR)/bacnet/bacreal.c \
$(BACNET_SRC_DIR)/bacnet/bacstr.c \
$(BACNET_SRC_DIR)/bacnet/indtext.c \
$(BACNET_SRC_DIR)/bacnet/npdu.c
OBJS = ${SRCS:.c=.o}
@@ -19,6 +34,7 @@ all: ${TARGET}
${TARGET}: ${OBJS}
${CC} -pthread -o $@ ${OBJS}
size $@
.c.o:
${CC} -c ${CFLAGS} $*.c -o $@