Fixed compilation with BACNET_SVC_SERVER=1 for apps. (#552)

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2024-01-03 10:35:03 -06:00
committed by GitHub
parent ead190584c
commit 7f3b82db9a
18 changed files with 72 additions and 5 deletions
+8
View File
@@ -125,6 +125,14 @@ readbdt:
readfdt: readfdt:
$(MAKE) -s -C apps $@ $(MAKE) -s -C apps $@
.PHONY: readprop
readprop:
$(MAKE) -s -C apps $@
.PHONY: readpropm
readpropm:
$(MAKE) -s -C apps $@
.PHONY: remove-list-element .PHONY: remove-list-element
remove-list-element: remove-list-element:
$(MAKE) -s -C apps $@ $(MAKE) -s -C apps $@
+4
View File
@@ -15,6 +15,10 @@
#define PRINT_ENABLED 1 #define PRINT_ENABLED 1
#if BACNET_SVC_SERVER
#error "App requires server-only features disabled! Set BACNET_SVC_SERVER=0"
#endif
#include "bacnet/bacdef.h" #include "bacnet/bacdef.h"
#include "bacnet/config.h" #include "bacnet/config.h"
#include "bacnet/bactext.h" #include "bacnet/bactext.h"
+4
View File
@@ -15,6 +15,10 @@
#define PRINT_ENABLED 1 #define PRINT_ENABLED 1
#if BACNET_SVC_SERVER
#error "App requires server-only features disabled! Set BACNET_SVC_SERVER=0"
#endif
#include "bacnet/bacdef.h" #include "bacnet/bacdef.h"
#include "bacnet/config.h" #include "bacnet/config.h"
#include "bacnet/bactext.h" #include "bacnet/bactext.h"
+4
View File
@@ -15,6 +15,10 @@
#define PRINT_ENABLED 1 #define PRINT_ENABLED 1
#if BACNET_SVC_SERVER
#error "App requires server-only features disabled! Set BACNET_SVC_SERVER=0"
#endif
#include "bacnet/bacdef.h" #include "bacnet/bacdef.h"
#include "bacnet/config.h" #include "bacnet/config.h"
#include "bacnet/bactext.h" #include "bacnet/bactext.h"
+4
View File
@@ -51,6 +51,10 @@
#include "bacnet/basic/tsm/tsm.h" #include "bacnet/basic/tsm/tsm.h"
#include "bacnet/datalink/dlenv.h" #include "bacnet/datalink/dlenv.h"
#if BACNET_SVC_SERVER
#error "App requires server-only features disabled! Set BACNET_SVC_SERVER=0"
#endif
/* buffer used for receive */ /* buffer used for receive */
static uint8_t Rx_Buf[MAX_MPDU] = { 0 }; static uint8_t Rx_Buf[MAX_MPDU] = { 0 };
+4
View File
@@ -35,6 +35,10 @@
#define PRINT_ENABLED 1 #define PRINT_ENABLED 1
#if BACNET_SVC_SERVER
#error "App requires server-only features disabled! Set BACNET_SVC_SERVER=0"
#endif
#include "bacnet/bacdef.h" #include "bacnet/bacdef.h"
#include "bacnet/config.h" #include "bacnet/config.h"
#include "bacnet/bactext.h" #include "bacnet/bactext.h"
+4
View File
@@ -35,6 +35,10 @@
#define PRINT_ENABLED 1 #define PRINT_ENABLED 1
#if BACNET_SVC_SERVER
#error "App requires server-only features disabled! Set BACNET_SVC_SERVER=0"
#endif
#include "bacnet/bacdef.h" #include "bacnet/bacdef.h"
#include "bacnet/config.h" #include "bacnet/config.h"
#include "bacnet/bactext.h" #include "bacnet/bactext.h"
+4
View File
@@ -56,6 +56,10 @@
#include "bacnet/datalink/dlenv.h" #include "bacnet/datalink/dlenv.h"
#include "bacnet/readrange.h" #include "bacnet/readrange.h"
#if BACNET_SVC_SERVER
#error "App requires server-only features disabled! Set BACNET_SVC_SERVER=0"
#endif
/* buffer used for receive */ /* buffer used for receive */
static uint8_t Rx_Buf[MAX_MPDU] = { 0 }; static uint8_t Rx_Buf[MAX_MPDU] = { 0 };
+4
View File
@@ -39,6 +39,10 @@
#include "bacnet/basic/tsm/tsm.h" #include "bacnet/basic/tsm/tsm.h"
#include "bacnet/datalink/dlenv.h" #include "bacnet/datalink/dlenv.h"
#if BACNET_SVC_SERVER
#error "App requires server-only features disabled! Set BACNET_SVC_SERVER=0"
#endif
/* buffer used for receive */ /* buffer used for receive */
static uint8_t Rx_Buf[MAX_MPDU] = { 0 }; static uint8_t Rx_Buf[MAX_MPDU] = { 0 };
/* target device data for the request */ /* target device data for the request */
+4
View File
@@ -54,6 +54,10 @@
#include "bacnet/basic/tsm/tsm.h" #include "bacnet/basic/tsm/tsm.h"
#include "bacnet/datalink/dlenv.h" #include "bacnet/datalink/dlenv.h"
#if BACNET_SVC_SERVER
#error "App requires server-only features disabled! Set BACNET_SVC_SERVER=0"
#endif
/* buffer used for receive */ /* buffer used for receive */
static uint8_t Rx_Buf[MAX_MPDU] = { 0 }; static uint8_t Rx_Buf[MAX_MPDU] = { 0 };
+4
View File
@@ -26,6 +26,10 @@
#include "bacnet/datalink/datalink.h" #include "bacnet/datalink/datalink.h"
#include "bacnet/datalink/dlenv.h" #include "bacnet/datalink/dlenv.h"
#if BACNET_SVC_SERVER
#error "App requires server-only features disabled! Set BACNET_SVC_SERVER=0"
#endif
/* print with flush by default */ /* print with flush by default */
#define PRINTF debug_aprintf #define PRINTF debug_aprintf
+4
View File
@@ -56,6 +56,10 @@
#define MAX_PROPERTY_VALUES 64 #define MAX_PROPERTY_VALUES 64
#endif #endif
#if BACNET_SVC_SERVER
#error "App requires server-only features disabled! Set BACNET_SVC_SERVER=0"
#endif
/* buffer used for receive */ /* buffer used for receive */
static uint8_t Rx_Buf[MAX_MPDU] = { 0 }; static uint8_t Rx_Buf[MAX_MPDU] = { 0 };
+4
View File
@@ -33,6 +33,10 @@
#define PRINT_ENABLED 1 #define PRINT_ENABLED 1
#if BACNET_SVC_SERVER
#error "App requires server-only features disabled! Set BACNET_SVC_SERVER=0"
#endif
#include "bacnet/bacdef.h" #include "bacnet/bacdef.h"
#include "bacnet/config.h" #include "bacnet/config.h"
#include "bacnet/bactext.h" #include "bacnet/bactext.h"
+6 -2
View File
@@ -559,16 +559,18 @@ void apdu_handler(BACNET_ADDRESS *src,
uint16_t apdu_len) uint16_t apdu_len)
{ {
BACNET_CONFIRMED_SERVICE_DATA service_data = { 0 }; BACNET_CONFIRMED_SERVICE_DATA service_data = { 0 };
BACNET_CONFIRMED_SERVICE_ACK_DATA service_ack_data = { 0 };
uint8_t invoke_id = 0;
uint8_t service_choice = 0; uint8_t service_choice = 0;
uint8_t *service_request = NULL; uint8_t *service_request = NULL;
uint16_t service_request_len = 0; uint16_t service_request_len = 0;
int len = 0; /* counts where we are in PDU */ int len = 0; /* counts where we are in PDU */
#if !BACNET_SVC_SERVER
uint8_t invoke_id = 0;
BACNET_CONFIRMED_SERVICE_ACK_DATA service_ack_data = { 0 };
BACNET_ERROR_CODE error_code = ERROR_CODE_SUCCESS; BACNET_ERROR_CODE error_code = ERROR_CODE_SUCCESS;
BACNET_ERROR_CLASS error_class = ERROR_CLASS_SERVICES; BACNET_ERROR_CLASS error_class = ERROR_CLASS_SERVICES;
uint8_t reason = 0; uint8_t reason = 0;
bool server = false; bool server = false;
#endif
if (apdu) { if (apdu) {
/* PDU Type */ /* PDU Type */
@@ -620,6 +622,7 @@ void apdu_handler(BACNET_ADDRESS *src,
} }
} }
break; break;
#if !BACNET_SVC_SERVER
case PDU_TYPE_SIMPLE_ACK: case PDU_TYPE_SIMPLE_ACK:
if (apdu_len < 3) { if (apdu_len < 3) {
break; break;
@@ -716,6 +719,7 @@ void apdu_handler(BACNET_ADDRESS *src,
} }
tsm_free_invoke_id(invoke_id); tsm_free_invoke_id(invoke_id);
break; break;
#endif
default: default:
break; break;
} }
+4 -3
View File
@@ -244,9 +244,10 @@
*/ */
/* /*
** Note: I've left everything enabled here in the default config.h. You should ** Note: these are enabled by default for the example apps to build.
** use a local copy of config.h with settings configured for your needs to ** Use a local copy named "bacnet-config.h" with settings configured for
** make use of any code space reductions in your device. ** the product specific needs for code space reductions in your device.
** Alternately, use a compiler and linker the have code reduction features.
**/ **/
#define BACNET_SVC_I_HAVE_A 1 #define BACNET_SVC_I_HAVE_A 1
+2
View File
@@ -351,6 +351,7 @@ int create_object_error_ack_encode(
return len; return len;
} }
#if !BACNET_SVC_SERVER
/** /**
* @brief Decode a CreateObject-Error ACK APDU * @brief Decode a CreateObject-Error ACK APDU
* *
@@ -419,3 +420,4 @@ int create_object_error_ack_service_decode(
return apdu_len; return apdu_len;
} }
#endif
+2
View File
@@ -273,6 +273,7 @@ int list_element_error_ack_encode(
return apdu_len; return apdu_len;
} }
#if !BACNET_SVC_SERVER
/** /**
* @brief Decoding for AddListElement or RemoveListElement Error Ack * @brief Decoding for AddListElement or RemoveListElement Error Ack
* AddListElement-Error ::= SEQUENCE { * AddListElement-Error ::= SEQUENCE {
@@ -361,3 +362,4 @@ int list_element_error_ack_decode(
return apdu_len; return apdu_len;
} }
#endif
+2
View File
@@ -437,6 +437,7 @@ int wpm_error_ack_encode_apdu(
return len; return len;
} }
#if !BACNET_SVC_SERVER
/** Decoding for WritePropertyMultiple Error /** Decoding for WritePropertyMultiple Error
* @ingroup DSWPM * @ingroup DSWPM
* WritePropertyMultiple-Error ::= SEQUENCE { * WritePropertyMultiple-Error ::= SEQUENCE {
@@ -571,6 +572,7 @@ int wpm_error_ack_decode_apdu(
return apdu_len; return apdu_len;
} }
#endif
/** /**
* @brief Convert an array of BACnetWriteAccessData to linked list * @brief Convert an array of BACnetWriteAccessData to linked list