Comments (2)
Has COV been enabled in your device for the particular object instance you are trying to SubscribeCOV? COV for an object results in the server sending COVnotification service with the Present_Value and Status_Flags property values from a specific object instance a) upon subscription and b) any time present-value or status-flags change.
To enable COV for an object in the BACnet stack library in v0.8.x for a particular product:
- add extra files to your build: cov.c, h_cov.c, h_ccov.c, and there might be others (but the linker will warn if the functions are
missing).
- reference demo/object/bi.c - three functions are used by device.c module to a) detect when Present_Value or Status_Flags values change, and b) encode the present-value and status-flags property values to send in the COVnotification.
bool Binary_Input_Change_Of_Value(
uint32_t object_instance);
void Binary_Input_Change_Of_Value_Clear(
uint32_t object_instance);
bool Binary_Input_Encode_Value_List(
uint32_t object_instance,
BACNET_PROPERTY_VALUE * value_list);
If there are other object types that your device needs to support for COV, reference the master branch of the 1.x BACnet stack for object examples - they should be similar - and the encoding for binary has been refactored into bacnet/cov.c module. See cov_data_value_list_link()
, cov_value_list_encode_real()
, cov_value_list_encode_enumerated()
, and cov_value_list_encode_unsigned()
.
These unique object functions - for each object that supports COV - are added to the device.c module in the Object_Table.
For Analog objects, additional requirement of the COV Increment property value which is normally non-volatile.
float Analog_Input_COV_Increment(
uint32_t instance);
void Analog_Input_COV_Increment_Set(
uint32_t instance,
float value);
Add the COV Increment property to the optional list:
static const int Analog_Input_Properties_Optional[] = {
PROP_COV_INCREMENT, -1 };
Add COV Increment property to Analog_Input_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
function:
case PROP_COV_INCREMENT:
apdu_len = encode_application_real(
&apdu[0], Analog_Input_COV_Increment(rpdata->object_instance));
break;
Add COV Increment property to Analog_Input_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
function:
case PROP_COV_INCREMENT:
status = write_property_type_valid(
wp_data, &value, BACNET_APPLICATION_TAG_REAL);
if (status) {
status =
Analog_Input_COV_Increment_Write(wp_data->object_instance,
value.type.Real, wp_data->priority,
&wp_data->error_class, &wp_data->error_code);
}
break;
- reference demo/server/main.c for example APDU handler setup and tasks. Add an APDU handler to support COV subscription. This handles subscriptions to the object instances.
apdu_set_confirmed_handler(SERVICE_CONFIRMED_SUBSCRIBE_COV, handler_cov_subscribe);
-
reference demo/handler/h_cov.c - contains handler_cov_task() that is called in main loop manages the sending of the COV notification when objects indicate that their present-value or status-flags have changed.
-
reference demo/handler/h_cov.c - contains handler_cov_timer_seconds() that is called every second to manage the subscription timeouts.
-
The maximum number COV subscriptions are configured by these defines (in h_cov.c module):
#define MAX_COV_SUBCRIPTIONS 128
#define MAX_COV_ADDRESSES 16
- The h_ccov.c file also needs at least one TSM (transaction state machine) buffer, defined in the Makefile or project precompiler defines as
MAX_TSM_TRANSACTIONS=1
or some other value larger than 0.
from bacnet-stack.
thanks for answer Steve
from bacnet-stack.
Related Issues (20)
- solved
- Is there any relevant description document about objects and properties? HOT 1
- solved
- How can we define static address for objects HOT 4
- How to subscribe to multiple cov objects in the same device? HOT 5
- How to reinitialize a bacnet stack on windows HOT 4
- Bacnet testing with BTS HOT 8
- tcdrain blocks the thread HOT 2
- Compiling with BBMD_ENABLED=0 and BBMD_CLIENT_ENABLED=1 doesn't work HOT 1
- Doesn't compile on Windows with Code::Blocks without modifying CMakeLists.txt by hand HOT 3
- Client Present Value and Properties HOT 1
- Help: Multiple serial ports for the router-mstp or router app HOT 1
- Win32 port problem HOT 2
- BACnet MSTP Slave mode doesn't seem to work HOT 1
- Read ExceptionSchedule HOT 4
- After enabling the macro definition of BACNET_SVC_SERVER, an error occurred. HOT 2
- Slow response when reading and writing attributes HOT 2
- Calendar and BACnetCalendarEntry HOT 1
- Accumulator object SCALE property decoding HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bacnet-stack.