Skip to content
Version 6.1.0
Contact Us

BACnetStack_AddCalendarDateRangeEntry

bool BACnetStack_AddCalendarDateRangeEntry(
const uint32_t deviceInstance,
const uint32_t calendarObjectInstance,
const uint16_t startYear,
const uint8_t startMonth,
const uint8_t startDay,
const uint16_t endYear,
const uint8_t endMonth,
const uint8_t endDay);

Appends a BACnetDateRange entry to a stack-held Calendar’s Date_List.

The range is inclusive at both ends. Per 135-2024 cl. 12.1.7 each endpoint is either a specific date or unspecified: an unspecified start matches every date until the end date (the end date included), an unspecified end every date from the start date on, and two unspecified endpoints match every date. An endpoint is unspecified when its year is 0 AND its month and day are 255; any other endpoint must be a real calendar date (patterns are not allowed in a range). The stack fills in each specific endpoint’s weekday.

BACnet reference: ANSI/ASHRAE 135-2024 clause 12.9 (Calendar Object Type).

Parameter Direction Description
deviceInstance in The device instance that owns the Calendar object.
calendarObjectInstance in The stack-held Calendar (BACnetStack_AddCalendarObject()).
startYear in Full year 1900..2154, or 0 (with startMonth and startDay 255) for unspecified.
startMonth in 1..12, or 255 for an unspecified start.
startDay in 1..31 (valid for the month), or 255 for an unspecified start.
endYear in Full year 1900..2154, or 0 (with endMonth and endDay 255) for unspecified.
endMonth in 1..12, or 255 for an unspecified end.
endDay in 1..31 (valid for the month), or 255 for an unspecified end.

True on success; false if the device does not exist, the Calendar is not stack-held, an endpoint is neither unspecified nor a valid date, or Calendar support was not compiled.

Topic: Schedules, calendars, trend logs and other object configuration. Declared in CASBACnetStackDLL.h.