One of the properties we need to publish is a BACNET_DATE_TIME value.
There seems to be some support for it in src/datetime.c but I don't see routines for encoding or decoding these.
Using the example BACnet server (in the demo directory) would it be as simple as ...
int DateTime_Value_Read_Property(BACNET_READ_PROPERTY_DATA * rpdata) {
...
BACNET_DATE_TIME bdatetime;
switch (rpdata->object_property) {
...
case PROP_PRESENT_VALUE:
// get the local date & time as a BACNET_DATE_TIME value
get_datetime(&bdatetime);
// encode it as a date followed by a time
apdu_len = encode_application_date(&apdu[0], &bdatetime.date);
apdu_len += encode_application_time(&apdu[apdu_len], &bdatetime.time);
break;
Thanks,
Jeremy Begg
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
One of the properties we need to publish is a BACNET_DATE_TIME value.
There seems to be some support for it in src/datetime.c but I don't see routines for encoding or decoding these.
Using the example BACnet server (in the demo directory) would it be as simple as ...
Thanks,
Jeremy Begg
Yes, it is as simple as that. There is already a helper in src/datetime.c file: