Consolodated the datalink environment variable for building demos on Linux and Windows into a single module (dlenv). Adjusted most demo makefiles.
This commit is contained in:
@@ -32,7 +32,7 @@ endif
|
||||
ifeq (${BACNET_PORT},win32)
|
||||
TARGET_BIN = ${TARGET}.exe
|
||||
LIBRARY1=-L=$(BACNET_LIB_DIR),-l$(BACNET_LIB_NAME)
|
||||
LIBRARY2=-lws2_32,-lgcc,-lm,-liphlpapi
|
||||
LIBRARY2=-lws2_32,-lgcc,-lm,-liphlpapi,-lwinmm
|
||||
LIBRARIES=$(LIBRARY1),$(LIBRARY2)
|
||||
endif
|
||||
#build for release (default) or debug
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "handlers.h"
|
||||
#include "client.h"
|
||||
#include "txbuf.h"
|
||||
#include "dlenv.h"
|
||||
|
||||
static void Init_Service_Handlers(
|
||||
void)
|
||||
@@ -107,9 +108,9 @@ static void Init_DataLink(
|
||||
}
|
||||
pEnv = getenv("BACNET_MSTP_BAUD");
|
||||
if (pEnv) {
|
||||
RS485_Set_Baud_Rate(strtol(pEnv, NULL, 0));
|
||||
dlmstp_set_baud_rate(strtol(pEnv, NULL, 0));
|
||||
} else {
|
||||
RS485_Set_Baud_Rate(38400);
|
||||
dlmstp_set_baud_rate(38400);
|
||||
}
|
||||
pEnv = getenv("BACNET_MSTP_MAC");
|
||||
if (pEnv) {
|
||||
@@ -118,6 +119,15 @@ static void Init_DataLink(
|
||||
dlmstp_set_mac_address(127);
|
||||
}
|
||||
#endif
|
||||
pEnv = getenv("BACNET_APDU_TIMEOUT");
|
||||
if (pEnv) {
|
||||
apdu_timeout_set(strtol(pEnv, NULL, 0));
|
||||
fprintf(stderr, "BACNET_APDU_TIMEOUT=%s\r\n", pEnv);
|
||||
} else {
|
||||
#if defined(BACDL_MSTP)
|
||||
apdu_timeout_set(60000);
|
||||
#endif
|
||||
}
|
||||
if (!datalink_init(getenv("BACNET_IFACE"))) {
|
||||
exit(1);
|
||||
}
|
||||
@@ -273,7 +283,7 @@ int main(int argc, char *argv[]) {
|
||||
/* setup my info */
|
||||
Device_Set_Object_Instance_Number(BACNET_MAX_INSTANCE);
|
||||
Init_Service_Handlers();
|
||||
Init_DataLink();
|
||||
dlenv_init();
|
||||
Send_UCOV_Notify(&Handler_Transmit_Buffer[0], &cov_data);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user