Skip to content
Version 6.1.0
Contact Us

BACnetStack_AddScheduleWeeklyTimeValue

bool BACnetStack_AddScheduleWeeklyTimeValue(
const uint32_t deviceInstance,
const uint32_t scheduleObjectInstance,
const uint8_t dayOffset,
const uint8_t hour,
const uint8_t minute,
const uint8_t second,
const uint8_t hundredthSecond,
const uint8_t valueDatatype,
const uint32_t valueAsUnsigned,
const float valueAsReal);

Appends one (day, time, value) entry to the Weekly_Schedule (135-2024 cl. 12.24.7).

The (time, value) pair is one BACnetTimeValue, appended to that day’s BACnetDailySchedule (cl. 21).

BACnet reference: ANSI/ASHRAE 135-2024 clause 12.24 (Schedule Object Type).

Parameter Direction Description
deviceInstance in The device instance that owns this Schedule object.
scheduleObjectInstance in The Schedule object to modify.
dayOffset in Day of week, 0..6 = Monday..Sunday (the BACnetDailySchedule array order, NOT the C tm_wday Sunday-first order).
hour in Hour of the transition, 0..23.
minute in Minute of the transition, 0..59.
second in Second of the transition, 0..59.
hundredthSecond in Hundredths of a second, 0..99.
valueDatatype in The application datatype of the scheduled value: 0 = Null (no value / relinquish), 1 = Boolean, 2 = UnsignedInteger, 3 = SignedInteger, 4 = Real, 9 = Enumerated. See CASBACnetStack::BACnetStackDatatypes. Use 9 = Enumerated for a Binary Value or Binary Output target - BACnetBinaryPV is an ENUMERATED, and scheduling it as 2 = UnsignedInteger produces a Schedule whose value datatype does not match its references (135-2024 cl. 12.24.13 makes that a CONFIGURATION_ERROR). Any other datatype, including 5 = Double, is rejected and the call returns false; Double is excluded deliberately because the FFI payload below is a 32-bit float. CharacterString, OctetString, BitString, Date, Time and ObjectIdentifier are spec-legal for a Schedule but are not reachable through this triple.
valueAsUnsigned in The value when valueDatatype is Boolean (0 = false, non-zero = true), UnsignedInteger, SignedInteger (reinterpreted as int32_t, so pass a negative value by cast) or Enumerated; ignored otherwise.
valueAsReal in The value when valueDatatype is Real; ignored otherwise.

True on success; false if the device or Schedule object does not exist, or Schedule support was not compiled.

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