Add option to subscribe to single property COV (#283)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user