Implement parsing for proprietary events (complex-event-type) (#420)

* Implement parsing for proprietary events (complex-event-type)

* Fix unit test linking for event.c
---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Ondřej Hruška
2023-05-17 06:55:55 +02:00
committed by GitHub
parent c02a8281a7
commit dab95eec3f
4 changed files with 683 additions and 451 deletions
+634 -448
View File
File diff suppressed because it is too large Load Diff
+22
View File
@@ -48,6 +48,20 @@ typedef enum {
** Based on UnconfirmedEventNotification-Request
*/
// TODO make these configurable from env?
/** Enable decoding of complex-event-type property-values. If set to 0, the values are decoded and discarded. */
#ifndef BACNET_DECODE_COMPLEX_EVENT_TYPE_PARAMETERS
#define BACNET_DECODE_COMPLEX_EVENT_TYPE_PARAMETERS 1
#endif
/** Max complex-event-type property-values to decode. Events with more values fail to decode. */
#ifndef BACNET_COMPLEX_EVENT_TYPE_MAX_PARAMETERS
#define BACNET_COMPLEX_EVENT_TYPE_MAX_PARAMETERS 5
#endif
typedef struct BACnet_Event_Notification_Data {
uint32_t processIdentifier;
BACNET_OBJECT_ID initiatingObjectIdentifier;
@@ -168,6 +182,14 @@ typedef struct BACnet_Event_Notification_Data {
/* OPTIONAL - Set authenticationFactor.format_type to
AUTHENTICATION_FACTOR_MAX if not being used */
} accessEvent;
#if (BACNET_DECODE_COMPLEX_EVENT_TYPE_PARAMETERS == 1)
/*
* complex-event-type - a sequence of values, used for proprietary event types
*/
struct {
BACNET_PROPERTY_VALUE values[BACNET_COMPLEX_EVENT_TYPE_MAX_PARAMETERS];
} complexEventType;
#endif
} notificationParams;
} BACNET_EVENT_NOTIFICATION_DATA;