Fixed ports/xplained conversion of double warning. (#1004)
* Fixed ports/xplained conversion of double warning. * Fixed BACNET_USE_DOUBLE usage in AVR ports. * Fixed integer out-of-range in AVR port. * Fixed missing function prototype for whois_request_encode().
This commit is contained in:
@@ -13,6 +13,10 @@
|
||||
/* BACnet Stack API */
|
||||
#include "bacnet/bacint.h"
|
||||
|
||||
#ifndef BACNET_USE_SIGNED
|
||||
#define BACNET_USE_SIGNED 1
|
||||
#endif
|
||||
|
||||
int encode_unsigned16(uint8_t *apdu, uint16_t value)
|
||||
{
|
||||
if (apdu) {
|
||||
|
||||
@@ -90,7 +90,6 @@ int encode_bacnet_real(float value, uint8_t *apdu)
|
||||
}
|
||||
|
||||
#if BACNET_USE_DOUBLE
|
||||
|
||||
/* from clause 20.2.7 Encoding of a Double Precision Real Number Value */
|
||||
/* returns the number of apdu bytes consumed */
|
||||
int decode_double(const uint8_t *apdu, double *double_value)
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
/* BACnet Stack API */
|
||||
#include "bacnet/bacstr.h"
|
||||
|
||||
#ifndef BACNET_USE_OCTETSTRING /* Do we need any octet strings? */
|
||||
#define BACNET_USE_OCTETSTRING 1
|
||||
#endif
|
||||
|
||||
#ifndef BACNET_STRING_UTF8_VALIDATION
|
||||
#define BACNET_STRING_UTF8_VALIDATION 1
|
||||
#endif
|
||||
|
||||
+34
-17
@@ -331,6 +331,34 @@
|
||||
#define MAX_OCTET_STRING_BYTES (MAX_APDU - 6)
|
||||
#endif
|
||||
|
||||
/* Do we need any octet strings? */
|
||||
#ifndef BACNET_USE_OCTETSTRING
|
||||
#define BACNET_USE_OCTETSTRING 1
|
||||
#endif
|
||||
|
||||
/* Do we need any doubles? */
|
||||
#ifndef BACNET_USE_DOUBLE
|
||||
#define BACNET_USE_DOUBLE 1
|
||||
#endif
|
||||
|
||||
/* Do we need any signed integers */
|
||||
#ifndef BACNET_USE_SIGNED
|
||||
#define BACNET_USE_SIGNED 1
|
||||
#endif
|
||||
|
||||
/* if a datatype is not enabled, the BACapp helper cannot use it */
|
||||
#if (BACNET_USE_OCTETSTRING == 0)
|
||||
#undef BACAPP_OCTET_STRING
|
||||
#endif
|
||||
|
||||
#if (BACNET_USE_DOUBLE == 0)
|
||||
#undef BACAPP_DOUBLE
|
||||
#endif
|
||||
|
||||
#if (BACNET_USE_SIGNED == 0)
|
||||
#undef BACAPP_SIGNED
|
||||
#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
|
||||
@@ -339,12 +367,16 @@
|
||||
* 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
|
||||
#if !( \
|
||||
defined(BACNET_SVC_I_HAVE_A) || defined(BACNET_SVC_WP_A) || \
|
||||
defined(BACNET_SVC_RP_A) || defined(BACNET_SVC_RPM_A) || \
|
||||
defined(BACNET_SVC_DCC_A) || defined(BACNET_SVC_RD_A) || \
|
||||
defined(BACNET_SVC_TS_A) || defined(BACNET_SVC_SERVER))
|
||||
/* default to client-server device for the example apps to build. */
|
||||
#define BACNET_SVC_SERVER 0
|
||||
#endif
|
||||
|
||||
#if (BACNET_SVC_SERVER == 0)
|
||||
#if defined(BACNET_SVC_SERVER) && (BACNET_SVC_SERVER == 0)
|
||||
/* client-server device */
|
||||
#define BACNET_SVC_I_HAVE_A 1
|
||||
#define BACNET_SVC_WP_A 1
|
||||
@@ -353,9 +385,6 @@
|
||||
#define BACNET_SVC_DCC_A 1
|
||||
#define BACNET_SVC_RD_A 1
|
||||
#define BACNET_SVC_TS_A 1
|
||||
#define BACNET_USE_OCTETSTRING 1
|
||||
#define BACNET_USE_DOUBLE 1
|
||||
#define BACNET_USE_SIGNED 1
|
||||
#endif
|
||||
|
||||
/* Do them one by one */
|
||||
@@ -383,16 +412,4 @@
|
||||
#define BACNET_SVC_RD_A 0
|
||||
#endif
|
||||
|
||||
#ifndef BACNET_USE_OCTETSTRING /* Do we need any octet strings? */
|
||||
#define BACNET_USE_OCTETSTRING 0
|
||||
#endif
|
||||
|
||||
#ifndef BACNET_USE_DOUBLE /* Do we need any doubles? */
|
||||
#define BACNET_USE_DOUBLE 0
|
||||
#endif
|
||||
|
||||
#ifndef BACNET_USE_SIGNED /* Do we need any signed integers */
|
||||
#define BACNET_USE_SIGNED 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -378,9 +378,11 @@ static const int Properties_BACnetARRAY[] = {
|
||||
PROP_EXCEPTION_SCHEDULE,
|
||||
PROP_TAGS,
|
||||
PROP_ISSUER_CERTIFICATE_FILES,
|
||||
PROP_SC_HUB_FUNCTION_ACCEPT_URIS,
|
||||
PROP_NEGATIVE_ACCESS_RULES,
|
||||
PROP_POSITIVE_ACCESS_RULES,
|
||||
#if (INT_MAX > 0xFFFF)
|
||||
PROP_SC_HUB_FUNCTION_ACCEPT_URIS,
|
||||
#endif
|
||||
-1
|
||||
};
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ extern "C" {
|
||||
|
||||
/* encode service - use -1 for limit if you want unlimited */
|
||||
BACNET_STACK_EXPORT
|
||||
int whois_request_encode(uint8_t *apdu, int32_t low_limit, int32_t high_limit);
|
||||
BACNET_STACK_EXPORT
|
||||
int whois_encode_apdu(uint8_t *apdu, int32_t low_limit, int32_t high_limit);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
|
||||
Reference in New Issue
Block a user