Add option to subscribe to single property COV (#283)

This commit is contained in:
Ondřej Hruška
2022-05-26 15:51:29 +02:00
committed by GitHub
parent 0dec80fae7
commit 08a12769bd
2 changed files with 10 additions and 2 deletions
+9 -2
View File
@@ -142,8 +142,15 @@ uint8_t Send_COV_Subscribe(
pdu_len = npdu_encode_pdu(
&Handler_Transmit_Buffer[0], &dest, &my_address, &npdu_data);
/* encode the APDU portion of the packet */
len = cov_subscribe_encode_apdu(&Handler_Transmit_Buffer[pdu_len],
sizeof(Handler_Transmit_Buffer) - pdu_len, invoke_id, cov_data);
if (cov_data->covSubscribeToProperty) {
// subscribe to 1 property
len = cov_subscribe_property_encode_apdu(&Handler_Transmit_Buffer[pdu_len],
sizeof(Handler_Transmit_Buffer) - pdu_len, invoke_id, cov_data);
} else {
// subscribe to object
len = cov_subscribe_encode_apdu(&Handler_Transmit_Buffer[pdu_len],
sizeof(Handler_Transmit_Buffer) - pdu_len, invoke_id, cov_data);
}
pdu_len += len;
/* will it fit in the sender?
note: if there is a bottleneck router in between
+1
View File
@@ -45,6 +45,7 @@ typedef struct BACnet_Subscribe_COV_Data {
bool cancellationRequest; /* true if this is a cancellation request */
bool issueConfirmedNotifications; /* optional */
uint32_t lifetime; /* seconds, optional */
bool covSubscribeToProperty; /* true to use per-property subscription */
BACNET_PROPERTY_REFERENCE monitoredProperty;
bool covIncrementPresent; /* true if present */
float covIncrement; /* optional */