Reduced MS/TP MAX_APDU to use 480 by default in examples (#683)
* Reduced MS/TP MAX_APDU to 480 from 1476 so that devices not use new MS/TP extended frame types which older routers do not understand. * Added extra objects to STM32F4xx example to elicit edge cases in object-list for testing.
This commit is contained in:
@@ -249,8 +249,8 @@ bool Analog_Input_Object_Name(
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(
|
||||
text_string, sizeof(text_string), "ANALOG INPUT %u",
|
||||
object_instance);
|
||||
text_string, sizeof(text_string), "ANALOG INPUT %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text_string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -514,8 +514,8 @@ bool Analog_Output_Object_Name(
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "ANALOG OUTPUT %u",
|
||||
object_instance);
|
||||
snprintf(name_text, sizeof(name_text), "ANALOG OUTPUT %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,8 +257,8 @@ bool Analog_Value_Object_Name(
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(
|
||||
text_string, sizeof(text_string), "ANALOG VALUE %u",
|
||||
object_instance);
|
||||
text_string, sizeof(text_string), "ANALOG VALUE %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, text_string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,8 +513,8 @@ bool Binary_Output_Object_Name(
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "BINARY OUTPUT %u",
|
||||
object_instance);
|
||||
snprintf(name_text, sizeof(name_text), "BINARY OUTPUT %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,8 +464,8 @@ bool Multistate_Input_Object_Name(
|
||||
status = characterstring_init_ansi(object_name,
|
||||
pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "MULTI-STATE INPUT %u",
|
||||
object_instance);
|
||||
snprintf(name_text, sizeof(name_text), "MULTI-STATE INPUT %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,8 +607,8 @@ bool Multistate_Output_Object_Name(
|
||||
status = characterstring_init_ansi(object_name,
|
||||
pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "MULTI-STATE OUTPUT %u",
|
||||
object_instance);
|
||||
snprintf(name_text, sizeof(name_text), "MULTI-STATE OUTPUT %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,8 +464,8 @@ bool Multistate_Value_Object_Name(
|
||||
status =
|
||||
characterstring_init_ansi(object_name, pObject->Object_Name);
|
||||
} else {
|
||||
snprintf(name_text, sizeof(name_text), "MULTI-STATE INPUT %u",
|
||||
object_instance);
|
||||
snprintf(name_text, sizeof(name_text), "MULTI-STATE INPUT %lu",
|
||||
(unsigned long)object_instance);
|
||||
status = characterstring_init_ansi(object_name, name_text);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-8
@@ -4,17 +4,17 @@
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date 2004
|
||||
* @section LICENSE
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004 Steve Karg <skarg@users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
#ifndef BACNET_CONFIG_H_
|
||||
#define BACNET_CONFIG_H_
|
||||
|
||||
/**
|
||||
* @note configurations are default to values used in the example apps build.
|
||||
* Use a local copy named "bacnet-config.h" with settings configured for
|
||||
* @note configurations are default to values used in the example apps build.
|
||||
* Use a local copy named "bacnet-config.h" with settings configured for
|
||||
* the product specific needs for code space reductions in your device.
|
||||
* Alternately, use a compiler and linker to override these defines.
|
||||
*/
|
||||
@@ -98,6 +98,7 @@
|
||||
#if defined(BACNET_SECURITY)
|
||||
#define MAX_APDU 412
|
||||
#else
|
||||
/* note: MS/TP extended frames can be up to 1476 bytes */
|
||||
#define MAX_APDU 1476
|
||||
#endif
|
||||
#else
|
||||
@@ -185,7 +186,7 @@
|
||||
#define BACAPP_OBJECT_ID
|
||||
#endif
|
||||
|
||||
#if defined (BACAPP_TYPES_EXTRA)
|
||||
#if defined (BACAPP_TYPES_EXTRA)
|
||||
#define BACAPP_DOUBLE
|
||||
#define BACAPP_TIMESTAMP
|
||||
#define BACAPP_DATETIME
|
||||
@@ -236,14 +237,14 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @note Control the selection of services etc to enable code size reduction
|
||||
* for those compiler suites which do not handle removing of unused functions
|
||||
* @note Control the selection of services etc to enable code size reduction
|
||||
* for those compiler suites which do not handle removing of unused functions
|
||||
* in modules so well.
|
||||
*
|
||||
* We will start with the A type services code first as these are least likely
|
||||
* to be required in embedded systems using the stack.
|
||||
*/
|
||||
#ifndef BACNET_SVC_SERVER
|
||||
#ifndef BACNET_SVC_SERVER
|
||||
/* default to client-server device for the example apps to build. */
|
||||
#define BACNET_SVC_SERVER 0
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user