Callback types
Each callback type below is the type of a parameter of at least one BACnetStack_* export. The stack calls your function on the thread that called into the stack.
FPCallbackReceiveMessageForPort
Section titled “FPCallbackReceiveMessageForPort”typedef uint16_t(* FPCallbackReceiveMessageForPort)(uint8_t *message, const uint16_t maxMessageLength, uint8_t *sourceConnectionString, uint8_t *sourceConnectionStringLength, uint8_t *destinationConnectionString, uint8_t *destinationConnectionStringLength, const uint8_t maxConnectionStringLength, uint32_t *networkPortInstance);The CallbackReceiveMessageForPort function essentially services a resource to read bytes.
Example: if supported BACnet IP, the callback function will read the UDP port for bytes and store the results and connection information in the parameters
networkPortInstance names the Network Port object instance the message arrived on - pass BACNET_NETWORK_PORT_DEFAULT (4194303) for a single-port device that never calls AddNetworkPortObject. A build compiled with more than one data-link transport MUST report a real instance; the sentinel is only unambiguous when exactly one transport is compiled in.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
message |
out | The raw bytes received from the resource. |
maxMessageLength |
in | The max number of bytes to receive from the resource. |
sourceConnectionString |
out | The connection string that represents the BACnet device where the message is from. Example: BACnet IP connection string: 0xC0 0xA8 0x01 0x05 0xBA 0xC0 is 192.168.1.5:47808 |
sourceConnectionStringLength |
out | The length of the source connection string. |
destinationConnectionString |
out | The connection string that represents the BACnet device where the message is is going (this could be a broadcast address). Example: BACnet IP connection string: 0xC0 0xA8 0x01 0xFF 0xBA 0xC0 is 192.168.1.255:47808 |
destinationConnectionStringLength |
out | The length of the destination connection string. |
maxConnectionStringLength |
in | The max number of bytes for the connection string. |
networkPortInstance |
out | The Network Port object instance the message was received on, or BACNET_NETWORK_PORT_DEFAULT (4194303) for the default/single port. |
Returns
Section titled “Returns”The number of bytes received
Registered with BACnetStack_RegisterCallbackReceiveMessageForPort().
FPCallbackSendMessageForPort
Section titled “FPCallbackSendMessageForPort”typedef uint16_t(* FPCallbackSendMessageForPort)(const uint8_t *message, const uint16_t messageLength, const uint8_t *connectionString, const uint8_t connectionStringLength, const uint32_t networkPortInstance, bool broadcast);The CallbackSendMessageForPort function hands one outbound frame to the host’s transport.
Example: on BACnet/IP the host sends the frame as one UDP datagram.
networkPortInstance names the Network Port object instance to send on. BACNET_NETWORK_PORT_DEFAULT (4194303) means “the default port for this transport”.
WHERE TO SEND: connectionString and broadcast together
- broadcast true, no connection string (NULL, length 0): the stack has not chosen an address. Send the frame as a local broadcast on this port. On BACnet/IP that is the port’s B/IP broadcast address (the subnet’s directed broadcast address, or 255.255.255.255, with the port’s UDP port). On MS/TP it is MAC 0xFF. The stack sends this for a routed broadcast and for its own network-layer broadcasts (Who-Is-Router-To-Network, I-Am-Router-To-Network) on this port, and on MS/TP for a network-layer reply that must be broadcast.
- broadcast false, with a connection string: send to that address as given, and only to it. The address can itself be a broadcast address. A BBMD forwards to a remote subnet’s directed broadcast address when that subnet’s BDT entry has a subnet mask (one-hop distribution, cl. J.4.3.1), and an MS/TP connection string of 0xFF is the MS/TP broadcast MAC. Every BACnet/SC send, every BVLL management message (Register-Foreign-Device, the BDT and FDT reads and writes, a BVLC-Result), every BBMD forward to a BDT peer or a foreign device, a foreign device’s Distribute-Broadcast-To-Network to its BBMD, and every retry of a confirmed request has this form.
- broadcast true, with a connection string (BACnet/IP only, 6 octets): the frame is a broadcast the host asked for, and the connection string is the address the host passed to its own BACnetStack_Send* call with broadcast true, or the address of a notification recipient whose IP octets are all 0xFF. Sending the frame to the connection string is what was asked for. The stack no longer gives a connection string with a broadcast it chose itself (see the next paragraph); a frame whose connection string is a remote subnet’s directed broadcast address cannot be told from the address alone, and the callback for a Send* call runs before that Send* export returns, so the host can recognise it from that.
- The broadcasts the stack chooses itself reach the callback as broadcast true with NO connection string (NULL, length 0), so a host that sends a broadcast to the port’s B/IP broadcast address handles all of them: a BBMD’s local re-broadcast of a Forwarded-NPDU under two-hop distribution, a BBMD executing a Distribute-Broadcast-To-Network on its own subnet (one-hop or two-hop), a broadcast answer to a request that arrived as a broadcast (an I-Am, an I-Have), an I-Am-Router-To-Network or Network-Number-Is answering a request (broadcast or unicast), and the stack’s own periodic Who-Is for devices it must find. In earlier versions these carried the address of this port, of the requester or of the last device heard from, which a host that sends to the string delivered to that one device and not to the subnet.
- broadcast false, no connection string: BACnet/IP and MS/TP never pass this combination.
On BACnet/SC, broadcast is always false. The connection string names the WebSocket connection to send on (the hub’s URI, or the per-socket string of an accepted connection), and a broadcast is addressed by the destination VMAC inside the frame.
On MS/TP the message is the NPDU, and the frame type the host puts on the wire follows bit 2 of message[1] (the NPCI control octet; cl. 9.7.2): set, the frame is a BACnet Data Expecting Reply (BACnet Extended Data Expecting Reply when the NPDU is over 501 octets); clear, a BACnet Data Not Expecting Reply (or Extended).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
message |
in | The raw bytes to send. |
messageLength |
in | The number of bytes to send. |
connectionString |
in | The address to send to, or NULL when the stack leaves the broadcast address to the host (see above). Example: BACnet/IP connection string 0xC0 0xA8 0x01 0x05 0xBA 0xC0 is 192.168.1.5:47808. |
connectionStringLength |
in | The number of bytes for the connection string: 6 on BACnet/IP, 1 on MS/TP, the URI’s length on BACnet/SC, 0 when connectionString is NULL. |
networkPortInstance |
in | The Network Port object instance to send the message on, or BACNET_NETWORK_PORT_DEFAULT (4194303) for the default/single port. |
broadcast |
in | True when the frame is a broadcast. What the host must do with the connection string then is described above. |
Returns
Section titled “Returns”The number of bytes sent.
Registered with BACnetStack_RegisterCallbackSendMessageForPort().
FPCallbackMSTPReceiveBytes
Section titled “FPCallbackMSTPReceiveBytes”typedef uint16_t(* FPCallbackMSTPReceiveBytes)(const uint32_t networkPortInstance, uint8_t *buffer, const uint16_t maxLength);The CallbackMSTPReceiveBytes hands the stack the octets the RS-485 receiver has already received.
Copy into buffer every octet that is waiting, at most maxLength of them, and return how many. Return 0 when none is waiting. MUST NOT BLOCK. It is called from BACnetStack_LoopMSTP() only.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
networkPortInstance |
in | The MS/TP Network Port object instance this call serves (BACNET_NETWORK_PORT_DEFAULT for the default port). |
buffer |
out | The stack-owned buffer to write the octets into. Valid only during the call. |
maxLength |
in | The size of buffer in octets. |
Returns
Section titled “Returns”The number of octets written into buffer, 0 to maxLength.
Registered with BACnetStack_RegisterCallbackMSTPReceiveBytes().
FPCallbackMSTPSendBytes
Section titled “FPCallbackMSTPSendBytes”typedef bool(* FPCallbackMSTPSendBytes)(const uint32_t networkPortInstance, const uint8_t *buffer, const uint16_t length);The CallbackMSTPSendBytes writes one complete MS/TP frame to the wire.
MUST NOT RETURN UNTIL THE LAST STOP BIT HAS LEFT THE TRANSMITTER (transmit complete, not transmit-buffer empty). The stack turns the RS-485 driver off (CallbackMSTPTransmitEnable(false)) as soon as this returns, so a send that only queues the octets cuts the tail off every frame. If the transceiver echoes what is sent, the echo may come back through CallbackMSTPReceiveBytes; the stack recognises and discards the echo of each frame it sent.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
networkPortInstance |
in | The MS/TP Network Port object instance this call serves. |
buffer |
in | The frame: preamble, header, data and CRCs. Valid only during the call. |
length |
in | The number of octets. |
Returns
Section titled “Returns”true when the frame was sent, false when it was not.
Registered with BACnetStack_RegisterCallbackMSTPSendBytes().
FPCallbackMSTPMicroseconds
Section titled “FPCallbackMSTPMicroseconds”typedef uint32_t(* FPCallbackMSTPMicroseconds)(void);The CallbackMSTPMicroseconds returns one monotonic microsecond clock that wraps at 2^32.
The stack subtracts two readings with unsigned arithmetic, so a wrap is harmless. The clock must keep running while CallbackMSTPSendBytes blocks. A clock that does not advance stops the stack sending anything on the bus.
Returns
Section titled “Returns”The current time in microseconds.
Registered with BACnetStack_RegisterCallbackMSTPMicroseconds().
FPCallbackMSTPTransmitEnable
Section titled “FPCallbackMSTPTransmitEnable”typedef void(* FPCallbackMSTPTransmitEnable)(const uint32_t networkPortInstance, const bool enable);The CallbackMSTPTransmitEnable switches the RS-485 driver.
Optional.
Called with true before a frame is sent and false after CallbackMSTPSendBytes returns. If it is not registered, the host’s CallbackMSTPSendBytes handles the driver itself.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
networkPortInstance |
in | The MS/TP Network Port object instance this call serves. |
enable |
in | true to drive the line, false to release it. |
Registered with BACnetStack_RegisterCallbackMSTPTransmitEnable().
FPCallbackMSTPFrameHeader
Section titled “FPCallbackMSTPFrameHeader”typedef void(* FPCallbackMSTPFrameHeader)(const uint32_t networkPortInstance, const uint8_t *header, const uint8_t length);The CallbackMSTPFrameHeader reports each valid frame header the stack hears, for diagnostics.
Optional.
The header is the eight octets in wire order (X’55’, X’FF’, frame type, destination, source, length high, length low, header CRC), with two quirks: octet 7 is the receiver’s running header CRC (X’55’ for every good header), and for a COBS-encoded frame octets 5 and 6 carry the decoded length. Frames this node sends are not reported.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
networkPortInstance |
in | The MS/TP Network Port object instance this call serves. |
header |
in | The eight header octets. Valid only during the call. |
length |
in | Always 8. |
Registered with BACnetStack_RegisterCallbackMSTPFrameHeader().
FPCallbackGetSystemTime
Section titled “FPCallbackGetSystemTime”typedef CASBACnetTime(* FPCallbackGetSystemTime)();The CallbackGetSystemTime gets the current system time.
Returns
Section titled “Returns”The current time in seconds (unix epoch format).
Registered with BACnetStack_RegisterCallbackGetSystemTime().
FPCallbackSetSystemTime
Section titled “FPCallbackSetSystemTime”typedef bool(* FPCallbackSetSystemTime)(const uint32_t deviceInstance, const uint8_t yearMinus1900, const uint8_t month, const uint8_t day, const uint8_t weekday, const uint8_t hour, const uint8_t minute, const uint8_t second, const uint8_t hundredthSecond);The CallbackSetSystemTime function is a callback for the user to set the system time based on the parameters provided.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The instance of the device to set the system time. |
yearMinus1900 |
in | The year where 0 = 1900. Example: for 2018 use (2018-1900) = 118. |
month |
in | The month where 1 = January. |
day |
in | The day of the month. |
weekday |
in | The day of the week where 1 = Monday and Sunday = 7. |
hour |
in | The hour value. |
minute |
in | The minutes value. |
second |
in | The seconds value. |
hundredthSecond |
in | The hundredth seconds value. |
Returns
Section titled “Returns”True if the time was set successfully, false if failed.
Registered with BACnetStack_RegisterCallbackSetSystemTime().
FPCallbackGetPropertyBitString
Section titled “FPCallbackGetPropertyBitString”typedef bool(* FPCallbackGetPropertyBitString)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, bool *value, uint32_t *valueElementCount, const uint32_t maxElementCount, const bool useArrayIndex, const uint32_t propertyArrayIndex, uint32_t *errorCode);The CallbackGetPropertyBitString function is a callback function that a user implements and registers with the CAS BACnet Stack to return bitstring values from their system or values that the user wishes to use as an override to a BACnet Stack default value.
An example of this would be if a user has information that could represent a status flag bit, the user can respond with that data when the status flag is requested.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
out | A pointer to the boolean array to store the result. |
valueElementCount |
out | A pointer to store the number of results stored in the boolean array. |
maxElementCount |
in | The maximum size of the boolean array. |
useArrayIndex |
in | If the ReadProperty or ReadPropertyMultiple request is asking for a whole array of bitstrings (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if a single bitstring is being requested of an array property. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user provided a value, otherwise false.
Registered with BACnetStack_RegisterCallbackGetPropertyBitString().
FPCallbackGetPropertyBool
Section titled “FPCallbackGetPropertyBool”typedef bool(* FPCallbackGetPropertyBool)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, bool *value, const bool useArrayIndex, const uint32_t propertyArrayIndex, uint32_t *errorCode);The CallbackGetPropertyBool function is a callback function that a user implements and registers with the CAS BACnet Stack to return boolean values from their system or values that the user wishes to use as an override to a BACnet Stack default value.
An example of this would be if a user stores a setting for an object’s out of service property, the user can respond with that data when the out of service is requested.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
out | A pointer to the boolean value to store the result. |
useArrayIndex |
in | If the ReadProperty or ReadPropertyMultiple request is asking for a whole array of booleans (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if a single boolean is being requested of an array property. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user provided a value, otherwise false.
Registered with BACnetStack_RegisterCallbackGetPropertyBool().
FPCallbackGetPropertyCharacterString
Section titled “FPCallbackGetPropertyCharacterString”typedef bool(* FPCallbackGetPropertyCharacterString)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, char *value, uint32_t *valueElementCount, const uint32_t maxElementCount, uint8_t *encodingType, const bool useArrayIndex, const uint32_t propertyArrayIndex, uint32_t *errorCode);The CallbackGetPropertyCharacterString function is a callback function that a user implements and registers with the CAS BACnet Stack to return charstring values from their system or values that the user wishes to use as an override to a BACnet Stack default value.
An example of this would be for the device names and all the object names, the user can respond with that data when the object name property is requested.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
out | A pointer to the char array to store the result. |
valueElementCount |
out | A pointer to store the number of results stored in the char array. |
maxElementCount |
in | The maximum size of the char array. |
encodingType |
out | A pointer to store the encoding type of the character string. Possible values are: - UTF_8 = 00 - IBM_Microsoft_DBCS = 01 - JIS_C_6226 = 02 - ISO_10646_UCS_4 = 03 - ISO_10646_UCS_2 = 04 - ISO_8859_1 = 05 |
useArrayIndex |
in | If the ReadProperty or ReadPropertyMultiple request is asking for a whole array of charstrings (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if a single charstring is being requested of an array property. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user provided a value, otherwise false.
Registered with BACnetStack_RegisterCallbackGetPropertyCharacterString().
FPCallbackGetPropertyDate
Section titled “FPCallbackGetPropertyDate”typedef bool(* FPCallbackGetPropertyDate)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, uint8_t *yearMinus1900, uint8_t *month, uint8_t *day, uint8_t *weekday, const bool useArrayIndex, const uint32_t propertyArrayIndex, uint32_t *errorCode);The CallbackGetPropertyDate function is a callback function that a user implements and registers with the CAS BACnet Stack to return date values from their system or values that the user wishes to use as an override to a BACnet Stack default value.
An example of this would be for the device’s local-date property, the user can respond with that data when the it is requested.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
yearMinus1900 |
out | A pointer to store the year, as the calendar year minus 1900 (2026 is 126). |
month |
out | A pointer to store the month, where 1 = January. |
day |
out | A pointer to store the day of the month. |
weekday |
out | A pointer to store the day of the week, where 1 = Monday, 7 = Sunday. |
useArrayIndex |
in | If the ReadProperty or ReadPropertyMultiple request is asking for a whole array of date values (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if a single date value is being requested of an array property. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user provided a value, otherwise false.
Registered with BACnetStack_RegisterCallbackGetPropertyDate().
FPCallbackGetPropertyDouble
Section titled “FPCallbackGetPropertyDouble”typedef bool(* FPCallbackGetPropertyDouble)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, double *value, const bool useArrayIndex, const uint32_t propertyArrayIndex, uint32_t *errorCode);The CallbackGetPropertyDouble function is a callback function that a user implements and registers with the CAS BACnet Stack to return double values from their system or values that the user wishes to use as an override to a BACnet Stack default value.
An example of this would be if a user stores the present value of a Large Analog Value Object, the user can respond with that data when the present value for that object is requested.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
out | A pointer to the double value to store the result. |
useArrayIndex |
in | If the ReadProperty or ReadPropertyMultiple request is asking for a whole array of doubles (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if a single double is being requested of an array property. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user provided a value, otherwise false.
Registered with BACnetStack_RegisterCallbackGetPropertyDouble().
FPCallbackGetPropertyEnumerated
Section titled “FPCallbackGetPropertyEnumerated”typedef bool(* FPCallbackGetPropertyEnumerated)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, uint32_t *value, const bool useArrayIndex, const uint32_t propertyArrayIndex, uint32_t *errorCode);The CallbackGetPropertyEnumerated function is a callback function that a user implements and registers with the CAS BACnet Stack to return enum values from their system or values that the user wishes to use as an override to a BACnet Stack default value.
An example of this would be if a user stores the present value of a Binary Input Object, the user can respond with that data when the present value for that object is requested.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
out | A pointer to the enum value to store the result. |
useArrayIndex |
in | If the ReadProperty or ReadPropertyMultiple request is asking for a whole array of enums (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if a single enum is being requested of an array property. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user provided a value, otherwise false.
Registered with BACnetStack_RegisterCallbackGetPropertyEnumerated().
FPCallbackGetPropertyOctetString
Section titled “FPCallbackGetPropertyOctetString”typedef bool(* FPCallbackGetPropertyOctetString)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, uint8_t *value, uint32_t *valueElementCount, const uint32_t maxElementCount, const bool useArrayIndex, const uint32_t propertyArrayIndex, uint32_t *errorCode);The CallbackGetPropertyOctetString function is a callback function that a user implements and registers with the CAS BACnet Stack to return octetstring values from their system or values that the user wishes to use as an override to a BACnet Stack default value.
An example of this would be for the properties of a Network Port object, the user can respond with IP Address, Netmask, DNS data when those properties are requested.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
out | A pointer to the uint8_t array to store the result. |
valueElementCount |
out | A pointer to store the number of results stored in the uint8_t array. |
maxElementCount |
in | The maximum size of the uint8_t array. |
useArrayIndex |
in | If the ReadProperty or ReadPropertyMultiple request is asking for a whole array of octetstrings (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if a single octetstring is being requested of an array property. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user provided a value, otherwise false.
Registered with BACnetStack_RegisterCallbackGetPropertyOctetString().
FPCallbackGetPropertySignedInteger
Section titled “FPCallbackGetPropertySignedInteger”typedef bool(* FPCallbackGetPropertySignedInteger)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, int32_t *value, const bool useArrayIndex, const uint32_t propertyArrayIndex, uint32_t *errorCode);The CallbackGetPropertySignedInteger function is a callback function that a user implements and registers with the CAS BACnet Stack to return signed integer values from their system or values that the user wishes to use as an override to a BACnet Stack default value.
An example of this would be if a user stores the present value of a Integer Value Object, the user can respond with that data when the present value for that object is requested.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
out | A pointer to the signed integer value to store the result. |
useArrayIndex |
in | If the ReadProperty or ReadPropertyMultiple request is asking for a whole array of ints (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if a single int is being requested of an array property. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user provided a value, otherwise false.
Registered with BACnetStack_RegisterCallbackGetPropertySignedInteger().
FPCallbackGetPropertyReal
Section titled “FPCallbackGetPropertyReal”typedef bool(* FPCallbackGetPropertyReal)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, float *value, const bool useArrayIndex, const uint32_t propertyArrayIndex, uint32_t *errorCode);The CallbackGetPropertyReal function is a callback function that a user implements and registers with the CAS BACnet Stack to return real values from their system or values that the user wishes to use as an override to a BACnet Stack default value.
An example of this would be if a user stores the present value of a Analog Input Object, the user can respond with that data when the present value for that object is requested.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
out | A pointer to the real (32-bit IEEE-754 float) value to store the result. |
useArrayIndex |
in | If the ReadProperty or ReadPropertyMultiple request is asking for a whole array of reals (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if a single real is being requested of an array property. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user provided a value, otherwise false.
Registered with BACnetStack_RegisterCallbackGetPropertyReal().
FPCallbackGetPropertyTime
Section titled “FPCallbackGetPropertyTime”typedef bool(* FPCallbackGetPropertyTime)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, uint8_t *hour, uint8_t *minute, uint8_t *second, uint8_t *hundredthSecond, const bool useArrayIndex, const uint32_t propertyArrayIndex, uint32_t *errorCode);The CallbackGetPropertyTime function is a callback function that a user implements and registers with the CAS BACnet Stack to return time values from their system or values that the user wishes to use as an override to a BACnet Stack default value.
An example of this would be for the device’s local-time property, the user can respond with that data when the it is requested.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
hour |
out | A pointer to the hour value to store the result. |
minute |
out | A pointer to the minute value to store the result. |
second |
out | A pointer to the second value to store the result. |
hundredthSecond |
out | A pointer to the hundredthSecond value to store the result. |
useArrayIndex |
in | If the ReadProperty or ReadPropertyMultiple request is asking for a whole array of time values (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if a single time value is being requested of an array property. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user provided a value, otherwise false.
Registered with BACnetStack_RegisterCallbackGetPropertyTime().
FPCallbackGetPropertyUnsignedInteger
Section titled “FPCallbackGetPropertyUnsignedInteger”typedef bool(* FPCallbackGetPropertyUnsignedInteger)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, uint32_t *value, const bool useArrayIndex, const uint32_t propertyArrayIndex, uint32_t *errorCode);The CallbackGetPropertyUnsignedInteger function is a callback function that a user implements and registers with the CAS BACnet Stack to return unsigned int values from their system or values that the user wishes to use as an override to a BACnet Stack default value.
An example of this would be if a user stores the present value of a Multi-State Input Object, the user can respond with that data when the present value for that object is requested.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
out | A pointer to the unsigned integer value to store the result. |
useArrayIndex |
in | If the ReadProperty or ReadPropertyMultiple request is asking for a whole array of uints (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if a single uint is being requested of an array property. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. (A host that serves Database_Revision itself also updates it across a restore, in CallbackCompleteRestore: see CASBACnetStack::FPCallbackCompleteRestore.) See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user provided a value, otherwise false.
Registered with BACnetStack_RegisterCallbackGetPropertyUnsignedInteger().
FPCallbackGetPropertyLightingCommand
Section titled “FPCallbackGetPropertyLightingCommand”typedef bool(* FPCallbackGetPropertyLightingCommand)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, uint32_t *operation, bool *useTargetLevel, float *targetLevel, bool *useRampRate, float *rampRate, bool *useStepIncrement, float *stepIncrement, bool *useFadeTime, uint32_t *fadeTime, bool *usePriority, uint32_t *priority, uint32_t *errorCode);The CallbackGetPropertyLightingCommand function is a callback function that a user implements and registers with the CAS BACnet Stack to supply a BACnetLightingCommand-valued property, field by field.
The stack assembles the BACnetLightingCommand SEQUENCE and encodes it - the application never touches BACnet encoding.
The following Objects and properties should be handled by this callback: LightingOutput Lighting_Command
BACnetLightingCommand ::= SEQUENCE (ASHRAE 135 cl. 12.54.6; the production is in cl. 21.6): operation [0] BACnetLightingOperation – mandatory target-level [1] REAL OPTIONAL ramp-rate [2] REAL OPTIONAL step-increment [3] REAL OPTIONAL fade-time [4] Unsigned OPTIONAL priority [5] Unsigned OPTIONAL
Only operation is mandatory. For each optional field, set its use* flag false to omit the field entirely, or true and supply the value. Which fields are meaningful depends on the operation (e.g. fadeTo uses target-level + fade-time; rampTo uses target-level + ramp-rate; stepUp/stepDown use step-increment) - see cl. 12.54.6 Tables 12-66 and 12-67.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
operation |
out | The BACnetLightingOperation. See CASBACnetStack::BACnetLightingOperation for more info. Mandatory. |
useTargetLevel |
out | Set true to include target-level, false to omit it. |
targetLevel |
out | The target level (0.0 .. 100.0), when useTargetLevel is true. |
useRampRate |
out | Set true to include ramp-rate, false to omit it. |
rampRate |
out | The ramp rate (0.1 .. 100.0 percent per second), when useRampRate is true. |
useStepIncrement |
out | Set true to include step-increment, false to omit it. |
stepIncrement |
out | The step increment (0.1 .. 100.0), when useStepIncrement is true. |
useFadeTime |
out | Set true to include fade-time, false to omit it. |
fadeTime |
out | The fade time in milliseconds, when useFadeTime is true. |
usePriority |
out | Set true to include priority, false to omit it. |
priority |
out | The command priority (1 .. 16), when usePriority is true. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the application supplied a value, otherwise false (the stack treats false as “no value”, the same as every other Get callback).
Registered with BACnetStack_RegisterCallbackGetPropertyLightingCommand().
FPCallbackGetPropertyAuthenticationFactorFormat
Section titled “FPCallbackGetPropertyAuthenticationFactorFormat”typedef bool(* FPCallbackGetPropertyAuthenticationFactorFormat)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, uint32_t *formatType, bool *useVendorId, uint32_t *vendorId, bool *useVendorFormat, uint32_t *vendorFormat, const bool useArrayIndex, const uint32_t propertyArrayIndex, uint32_t *errorCode);The CallbackGetPropertyAuthenticationFactorFormat function is a callback function that a user implements and registers with the CAS BACnet Stack to supply a BACnetAuthenticationFactorFormat-valued property, field by field.
The stack assembles the SEQUENCE and encodes it.
The following Objects and properties should be handled by this callback: CredentialDataInput Supported_Formats
BACnetAuthenticationFactorFormat ::= SEQUENCE (ASHRAE 135 cl. 12.36; the production is in cl. 21.6): format-type [0] BACnetAuthenticationFactorType – mandatory vendor-id [1] Unsigned16 OPTIONAL vendor-format [2] Unsigned16 OPTIONAL
vendor-id and vendor-format are only meaningful when format-type is custom; omit them otherwise.
Supported_Formats is a BACnet ARRAY, so this callback follows the same array convention as every other Get callback: the stack calls it once per element with useArrayIndex true and propertyArrayIndex set to the 1-based element index. An arrayIndex of 0 (a length request per cl. 15.5) is answered by the application’s UnsignedInteger callback, NOT this one - exactly as State_Text does.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
formatType |
out | The BACnetAuthenticationFactorType. Mandatory. |
useVendorId |
out | Set true to include vendor-id, false to omit it. |
vendorId |
out | The vendor id, when useVendorId is true. |
useVendorFormat |
out | Set true to include vendor-format, false to omit it. |
vendorFormat |
out | The vendor format, when useVendorFormat is true. |
useArrayIndex |
in | If the request is asking for a single element of the array property. |
propertyArrayIndex |
in | The 1-based array index when useArrayIndex is true. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the application supplied a value, otherwise false (the stack treats false as “no value”, the same as every other Get callback).
Registered with BACnetStack_RegisterCallbackGetPropertyAuthenticationFactorFormat().
FPCallbackGetListOfEnumerations
Section titled “FPCallbackGetListOfEnumerations”typedef bool(* FPCallbackGetListOfEnumerations)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const uint8_t rangeOption, const uint32_t rangeIndexOrSequenceNumber, const bool rangeInPositiveDirection, uint32_t *enumeration, bool *more);The CallbackGetListOfEnumerations function is a callback function that a user implements and registers with the CAS BACnet Stack to return the elements of a property of a list.
The following Objects and properties should be handled by this callback: AccessCredential AuthorizationExemptions ReasonForDisable AccessDoor AlarmValues FaultValues MaskedAlarmValues AccessPoint AccessAlarmEvents AccessTransactionEvents FailedAttemptEvents AccessZone AlarmValues Device VTClassesSupported Escalator FaultSignals LifeSafetyPoint AcceptedModes AlarmValues FaultValues LifeSafetyAlarmValues LifeSafetyZone AcceptedModes AlarmValues FaultValues LifeSafetyAlarmValues Lift FaultSignals Timer AlarmValues
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
rangeOption |
in | Flag to specify how to reference the index of the list of values either by (0) position or (1) sequence number. |
rangeIndexOrSequenceNumber |
in | Depending on the range option flag, this value is either the starting index positionally into the list or the starting sequence number. |
rangeInPositiveDirection |
in | Flag to specify getting the list in counting up (true) or counting down (false). |
enumeration |
out | The value of the enumeration in the list for the requested element. |
more |
out | A flag to show if (true) there are more values to get, or (false) not. |
Returns
Section titled “Returns”True if *enumeration holds the element at the given index (set *more to true to be called again for the next index, or false to end the list); false to fail the whole read with Error PROPERTY / READ_ACCESS_DENIED.
Registered with BACnetStack_RegisterCallbackGetListOfEnumerations().
FPCallbackGetListElevatorGroupLandingCallStatus
Section titled “FPCallbackGetListElevatorGroupLandingCallStatus”typedef bool(* FPCallbackGetListElevatorGroupLandingCallStatus)(const uint32_t deviceInstance, const uint32_t elevatorGroupInstance, const uint32_t propertyIdentifier, const uint8_t rangeOption, const uint32_t rangeIndexOrSequence, uint8_t *floorNumber, uint8_t *commandChoice, uint32_t *bacnetLiftCarDirection, uint8_t *destination, bool *useFloorText, char *floorText, uint32_t *floorTextLength, const uint32_t floorTextMaxLength, bool *more);The CallbackGetListElevatorGroupLandingCallStatus function is a callback function that a user implements and registers with the CAS BACnet Stack to return LandingCallStatuses from their system specifically to fill out an Elevator Group Object’s Landing Calls and Landing Call Control property.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the Elevator Group object being requested. |
elevatorGroupInstance |
in | The BACnet object instance of the Elevator Group object being requested. |
propertyIdentifier |
in | The BACnet property of the Elevator Group object being requested, either LandingCalls or LandingCallControl. |
rangeOption |
in | Flag to specify how to reference the index of the list of values either by (0) position or (1) sequence number. |
rangeIndexOrSequence |
in | Depending on the range option flag, this value is either the starting index positionally into the list or the starting sequence number. |
floorNumber |
out | The floor number of the LandingCallStatus |
commandChoice |
out | Flag to specify if the LandingCallStatus uses either (1) direction or (2) destination. |
bacnetLiftCarDirection |
out | If command choice specifies using direction, this value represents the BACnetLiftCarDirection enumeration value for the LandingCallStatus. See CASBACnetStack::BACnetLiftCarDirection for more info. |
destination |
out | If command choice specifies using destination, this value represents the destination floor number for the LandingCallStatus. |
useFloorText |
out | Flag to show if (true) the LandingCallStatus has floor text, or (false) not. |
floorText |
out | A pointer to the char buffer to store the floor text. |
floorTextLength |
out | The length of the floor text string. |
floorTextMaxLength |
in | The maximum length of the buffer to store the floor text. |
more |
out | A flag to show if there are more values to get (true), or not (false). |
Returns
Section titled “Returns”True if an element was provided, false if list is empty (and rangeIndexOrSequence is 0) or false if element does not exist at that index or sequence number.
Registered with BACnetStack_RegisterCallbackGetListElevatorGroupLandingCallStatus().
FPCallbackGetSequenceLiftAssignedLandingCall
Section titled “FPCallbackGetSequenceLiftAssignedLandingCall”typedef bool(* FPCallbackGetSequenceLiftAssignedLandingCall)(const uint32_t deviceInstance, const uint32_t objectInstance, const uint32_t arrayIndexForDoor, const uint32_t offset, uint8_t *floorNumber, uint32_t *direction, bool *more);The CallbackGetSequenceLiftAssignedLandingCall function is a callback function that a user implements and registers with the CAS BACnet Stack to return landing calls from their system to fill out a Lift Object’s Assigned Landing Calls property.
cl. 12.59.11 (Assigned_Landing_Calls): a BACnetARRAY of BACnetAssignedLandingCalls holding the landing calls the lift currently has and the direction of each. Array element N carries the assigned landing calls for car door N.
Each BACnetAssignedLandingCalls entry pairs a universal floor number with a BACnetLiftCarDirection: UP (3) A passenger wants to go up from that landing. DOWN (4) A passenger wants to go down from that landing. UP_AND_DOWN (5) Two separate passengers at that landing have asked for the two directions.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the Lift object being requested. |
objectInstance |
in | The BACnet object instance of the Lift object being requested. |
arrayIndexForDoor |
in | The array index corresponding to the door for the LIft object being requested. If there is only one door, this parameter will have a value of one. |
offset |
in | The current offset that the stack is requesting. If 0, the stack is requesting the first element. |
floorNumber |
out | The floor number for a landing call which is the universal floor number for the lift. |
direction |
out | The BACnetLiftCarDirection for the landing call. Can only be 3 (UP), 4 (DOWN), or 5 (UP_AND_DOWN). See CASBACnetStack::BACnetLiftCarDirection for more information. |
more |
out | A flag to show if there are more values to get (true), or not (false). |
Returns
Section titled “Returns”True if an element was provided, or false if list is empty.
Registered with BACnetStack_RegisterCallbackGetSequenceLiftAssignedLandingCall().
FPCallbackGetSequenceLiftRegisteredCarCall
Section titled “FPCallbackGetSequenceLiftRegisteredCarCall”typedef bool(* FPCallbackGetSequenceLiftRegisteredCarCall)(const uint32_t deviceInstance, const uint32_t objectInstance, const uint32_t arrayIndexForDoor, const uint32_t offset, uint8_t *floorNumber, bool *more);The CallbackGetSequenceLiftRegisteredCarCall function is a callback function that a user implements and registers with the CAS BACnet Stack to return floor numbers from their system to fill out a Lift Object’s Registered Car Call property.
cl. 12.59.13 (Registered_Car_Call): a BACnetARRAY of BACnetLiftCarCallList. A car call is a passenger’s request for the car to stop at a given floor through a given door; array element N lists the universal floor numbers that have such a call registered for car door N.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the Lift object being requested. |
objectInstance |
in | The BACnet object instance of the Lift object being requested. |
arrayIndexForDoor |
in | The array index corresponding to the door for the LIft object being requested. If there is only one door, this parameter will have a value of one. |
offset |
in | The current offset that the stack is requesting. If 0, the stack is requesting the first element. |
floorNumber |
out | The floor number for the call that is registered to the door of the Lift object. |
more |
out | A flag to show if there are more values to get (true), or not (false). |
Returns
Section titled “Returns”True if an element was provided, or false if list is empty.
Registered with BACnetStack_RegisterCallbackGetSequenceLiftRegisteredCarCall().
FPCallbackGetSequenceLiftLandingDoorStatus
Section titled “FPCallbackGetSequenceLiftLandingDoorStatus”typedef bool(* FPCallbackGetSequenceLiftLandingDoorStatus)(const uint32_t deviceInstance, const uint32_t objectInstance, const uint32_t arrayIndexForDoor, const uint32_t offset, uint8_t *floorNumber, uint32_t *doorStatus, bool *more);The CallbackGetSequenceLiftLandingDoorStatus function is a callback function that a user implements and registers with the CAS BACnet Stack to return landing door statuses from their system to fill out a Lift Object’s Landing Call Status property.
cl. 12.59.33 (Landing_Door_Status): a BACnetARRAY of BACnetLandingDoorStatus giving the state of the landing doors on each floor the lift serves. Array element N lists the landing doors that go with car door N.
Each entry pairs a universal floor number with the door’s present state, one of:
UNKNOWN The state cannot be determined.NONE This car door has no matching landing door on that floor.CLOSING The door is in the middle of shutting.CLOSED Shut all the way, but not locked.OPENING The door is in the middle of opening.OPENED Open all the way.SAFETY_LOCK Shut all the way and locked.LIMITED_OPENED Held partly open, neither fully shut nor fully open.Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the Lift object being requested. |
objectInstance |
in | The BACnet object instance of the Lift object being requested. |
arrayIndexForDoor |
in | The array index corresponding to the door for the LIft object being requested. If there is only one door, this parameter will have a value of one. |
offset |
in | The current offset that the stack is requesting. If 0, the stack is requesting the first element. |
floorNumber |
out | The floor number for a landing call which is the universal floor number for the landing door. |
doorStatus |
out | The BACnetDoorStatus for the landing door. See CASBACnetStack::BACnetDoorStatus for more information. |
more |
out | A flag to show if there are more values to get (true), or not (false). |
Returns
Section titled “Returns”True if an element was provided, or false if list is empty.
Registered with BACnetStack_RegisterCallbackGetSequenceLiftLandingDoorStatus().
FPCallbackSetPropertyBitString
Section titled “FPCallbackSetPropertyBitString”typedef bool(* FPCallbackSetPropertyBitString)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const bool *value, const uint32_t length, const bool useArrayIndex, const uint32_t propertyArrayIndex, const uint8_t priority, uint32_t *errorCode);The CallbackSetPropertyBitString function is a callback function that a user implements and registers with the CAS BACnet Stack to write bitstring values in their system or local storage.
An example of this would be if a user has a Bitstring Value object where the present value is writable, the user would use this callback to store the value in their local storage.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
in | A pointer to the boolean array to write. |
length |
in | The length of the boolean array |
useArrayIndex |
in | If the WriteProperty or WritePropertyMultiple request is writing to a whole array of bitstrings (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if the single bitstring of an array property being written. |
priority |
in | The priority for the write. Only used if the property is commandable, for example: objects with priority arrays. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user successfully stored the value, otherwise false.
Registered with BACnetStack_RegisterCallbackSetPropertyBitString().
FPCallbackSetPropertyBool
Section titled “FPCallbackSetPropertyBool”typedef bool(* FPCallbackSetPropertyBool)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const bool value, const bool useArrayIndex, const uint32_t propertyArrayIndex, const uint8_t priority, uint32_t *errorCode);The CallbackSetPropertyBool function is a callback function that a user implements and registers with the CAS BACnet Stack to write boolean values in their system or local storage.
An example of this would be if a user has an object where the out-of-service property is writable, the user would use this callback to store the value in their local storage.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
in | The boolean value to write. |
useArrayIndex |
in | If the WriteProperty or WritePropertyMultiple request is writing to a whole array of booleans (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if the single boolean of an array property being written. |
priority |
in | The priority for the write. Only used if the property is commandable, for example: objects with priority arrays. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user successfully stored the value, otherwise false.
Registered with BACnetStack_RegisterCallbackSetPropertyBool().
FPCallbackWriteGroupInhibitDelay
Section titled “FPCallbackWriteGroupInhibitDelay”typedef bool(* FPCallbackWriteGroupInhibitDelay)(const uint32_t deviceInstance, const uint32_t channelInstance, const bool inhibitDelay);The CallbackWriteGroupInhibitDelay function is an OPTIONAL callback that a user may implement and register with the CAS BACnet Stack to be notified of the WriteGroup-Request ‘Inhibit Delay’ flag.
When the device is a member of the addressed group (any of its Channel objects lists the group in Control_Groups), the WriteGroup processor calls it once for every Channel object of the device whose Channel_Number can be read, before applying any change-list entry to that Channel - so it is also called for a Channel that the request does not then write.
The stack relays the effective flag (request ‘Inhibit Delay’ present AND TRUE). The Channel objects do not present Execution_Delay or Allow_Group_Delay_Inhibit and the stack applies no delay (#2836 part d), so the flag is informational: a host that delays a member write of its own may use it to skip that delay (ASHRAE 135 cl. 15.11.1.1.4).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance that contains the Channel object. |
channelInstance |
in | The instance of the Channel object the notification is for. |
inhibitDelay |
in | The effective Inhibit Delay flag from the WriteGroup-Request (TRUE only when the optional parameter was present and TRUE). |
Returns
Section titled “Returns”RESERVED - the return value is not read by the WriteGroup processor and does not affect processing. Return true. The bool return type is kept for uniformity with the other callback signatures even though it has no effect here.
Registered with BACnetStack_RegisterCallbackWriteGroupInhibitDelay().
FPCallbackSetPropertyCharacterString
Section titled “FPCallbackSetPropertyCharacterString”typedef bool(* FPCallbackSetPropertyCharacterString)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const char *value, const uint32_t length, const uint8_t encodingType, const bool useArrayIndex, const uint32_t propertyArrayIndex, const uint8_t priority, uint32_t *errorCode);The CallbackSetPropertyCharacterString function is a callback function that a user implements and registers with the CAS BACnet Stack to write character-string values in their system or local storage.
An example of this would be if a user has a CharacterString Value object where the present value is writable, the user would use this callback to store the value in their local storage.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
in | A pointer to the char array to write. |
length |
in | The length of the char array. |
encodingType |
in | The encoding type of the charstring. Possible values are: - UTF_8 = 00 - IBM_Microsoft_DBCS = 01 - JIS_C_6226 = 02 - ISO_10646_UCS_4 = 03 - ISO_10646_UCS_2 = 04 - ISO_8859_1 = 05 |
useArrayIndex |
in | If the WriteProperty or WritePropertyMultiple request is writing to a whole array of charstrings (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if the single charstring of an array property being written. |
priority |
in | The priority for the write. Only used if the property is commandable, for example: objects with priority arrays. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user successfully stored the value, otherwise false.
Registered with BACnetStack_RegisterCallbackSetPropertyCharacterString().
FPCallbackSetPropertyDate
Section titled “FPCallbackSetPropertyDate”typedef bool(* FPCallbackSetPropertyDate)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const uint8_t yearMinus1900, const uint8_t month, const uint8_t day, const uint8_t weekday, const bool useArrayIndex, const uint32_t propertyArrayIndex, const uint8_t priority, uint32_t *errorCode);The CallbackSetPropertyDate function is a callback function that a user implements and registers with the CAS BACnet Stack to write date values in their system or local storage.
An example of this would be if a user has an Date Value Object where the present-value property is writable, the user would use this callback to store the value in their local storage.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
yearMinus1900 |
in | The year value to write where the value represents the year minus 1900. |
month |
in | The month value to write where 1 = January. |
day |
in | The day value to write. |
weekday |
in | The hundredthSecond value to write where 1 = Monday and 7 = Sunday. |
useArrayIndex |
in | If the WriteProperty or WritePropertyMultiple request is writing to a whole array of date values (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if the single date value of an array property being written. |
priority |
in | The priority for the write. Only used if the property is commandable, for example: objects with priority arrays. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user successfully stored the value, otherwise false.
Registered with BACnetStack_RegisterCallbackSetPropertyDate().
FPCallbackSetPropertyDouble
Section titled “FPCallbackSetPropertyDouble”typedef bool(* FPCallbackSetPropertyDouble)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const double value, const bool useArrayIndex, const uint32_t propertyArrayIndex, const uint8_t priority, uint32_t *errorCode);The CallbackSetPropertyDouble function is a callback function that a user implements and registers with the CAS BACnet Stack to write double values in their system or local storage.
An example of this would be if a user has a Large Analog Value Object where the present-value property is writable, the user would use this callback to store the value in their local storage.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
in | The double value to write. |
useArrayIndex |
in | If the WriteProperty or WritePropertyMultiple request is writing to a whole array of doubles (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if the single double of an array property being written. |
priority |
in | The priority for the write. Only used if the property is commandable, for example: objects with priority arrays. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user successfully stored the value, otherwise false.
Registered with BACnetStack_RegisterCallbackSetPropertyDouble().
FPCallbackSetPropertyEnumerated
Section titled “FPCallbackSetPropertyEnumerated”typedef bool(* FPCallbackSetPropertyEnumerated)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const uint32_t value, const bool useArrayIndex, const uint32_t propertyArrayIndex, const uint8_t priority, uint32_t *errorCode);The CallbackSetPropertyEnumerated function is a callback function that a user implements and registers with the CAS BACnet Stack to write enum values in their system or local storage.
An example of this would be if a user has a Binary Value Object where the present-value property is writable, the user would use this callback to store the value in their local storage.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
in | The enum value to write. |
useArrayIndex |
in | If the WriteProperty or WritePropertyMultiple request is writing to a whole array of enums (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if the single enum of an array property being written. |
priority |
in | The priority for the write. Only used if the property is commandable, for example: objects with priority arrays. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user successfully stored the value, otherwise false.
Registered with BACnetStack_RegisterCallbackSetPropertyEnumerated().
FPCallbackSetPropertyNull
Section titled “FPCallbackSetPropertyNull”typedef bool(* FPCallbackSetPropertyNull)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const bool useArrayIndex, const uint32_t propertyArrayIndex, const uint8_t priority, uint32_t *errorCode);The CallbackSetPropertyNull function is a callback function that a user implements and registers with the CAS BACnet Stack to write null values in their system or local storage.
An example of this would be if a user has a Analog Output Object where the present-value property is writable, the user would use this callback to store the value in their local storage.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
useArrayIndex |
in | If the WriteProperty or WritePropertyMultiple request is writing NULL to a whole property (false) or to a single element of an array property (true). |
propertyArrayIndex |
in | The array index if NULL is being written to a single element of an array property. |
priority |
in | The priority for the write. Only used if the property is commandable, for example: objects with priority arrays. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user successfully stored the value, otherwise false.
Registered with BACnetStack_RegisterCallbackSetPropertyNull().
FPCallbackSetPropertyOctetString
Section titled “FPCallbackSetPropertyOctetString”typedef bool(* FPCallbackSetPropertyOctetString)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const uint8_t *value, const uint32_t length, const bool useArrayIndex, const uint32_t propertyArrayIndex, const uint8_t priority, uint32_t *errorCode);The CallbackSetPropertyOctetString function is a callback function that a user implements and registers with the CAS BACnet Stack to write octetstring values in their system or local storage.
The stack also calls it to hand over an MS/TP Network Port’s MAC_Address that a matching You-Are assigned (cl. 16.11.4), when the pending Network Port changes are activated. Return false to refuse it; the MAC then stays pending.
An example of this would be if a user has a OctetString Value object where the present value is writable, the user would use this callback to store the value in their local storage.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
in | A pointer to the uint8_t array to write. |
length |
in | The length of the uint8_t array |
useArrayIndex |
in | If the WriteProperty or WritePropertyMultiple request is writing to a whole array of octetstrings (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if the single octetstring of an array property being written. |
priority |
in | The priority for the write. Only used if the property is commandable, for example: objects with priority arrays. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user successfully stored the value, otherwise false.
Registered with BACnetStack_RegisterCallbackSetPropertyOctetString().
FPCallbackSetPropertySignedInteger
Section titled “FPCallbackSetPropertySignedInteger”typedef bool(* FPCallbackSetPropertySignedInteger)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const int32_t value, const bool useArrayIndex, const uint32_t propertyArrayIndex, const uint8_t priority, uint32_t *errorCode);The CallbackSetPropertySignedInteger function is a callback function that a user implements and registers with the CAS BACnet Stack to write int values in their system or local storage.
An example of this would be if a user has an Integer Value Object where the present-value property is writable, the user would use this callback to store the value in their local storage.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
in | The int value to write. |
useArrayIndex |
in | If the WriteProperty or WritePropertyMultiple request is writing to a whole array of ints (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if the single int of an array property being written. |
priority |
in | The priority for the write. Only used if the property is commandable, for example: objects with priority arrays. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user successfully stored the value, otherwise false.
Registered with BACnetStack_RegisterCallbackSetPropertySignedInteger().
FPCallbackSetPropertyReal
Section titled “FPCallbackSetPropertyReal”typedef bool(* FPCallbackSetPropertyReal)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const float value, const bool useArrayIndex, const uint32_t propertyArrayIndex, const uint8_t priority, uint32_t *errorCode);The CallbackSetPropertyReal function is a callback function that a user implements and registers with the CAS BACnet Stack to write real values in their system or local storage.
An example of this would be if a user has an Analog Value Object where the present-value property is writable, the user would use this callback to store the value in their local storage.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
in | The real value to write. |
useArrayIndex |
in | If the WriteProperty or WritePropertyMultiple request is writing to a whole array of reals (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if the single real of an array property being written. |
priority |
in | The priority for the write. Only used if the property is commandable, for example: objects with priority arrays. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user successfully stored the value, otherwise false.
Registered with BACnetStack_RegisterCallbackSetPropertyReal().
FPCallbackSetPropertyTime
Section titled “FPCallbackSetPropertyTime”typedef bool(* FPCallbackSetPropertyTime)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const uint8_t hour, const uint8_t minute, const uint8_t second, const uint8_t hundredthSecond, const bool useArrayIndex, const uint32_t propertyArrayIndex, const uint8_t priority, uint32_t *errorCode);The CallbackSetPropertyTime function is a callback function that a user implements and registers with the CAS BACnet Stack to write time values in their system or local storage.
An example of this would be if a user has an Time Value Object where the present-value property is writable, the user would use this callback to store the value in their local storage.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
hour |
in | The hour value to write. |
minute |
in | The minute value to write. |
second |
in | The second value to write. |
hundredthSecond |
in | The hundredthSecond value to write. |
useArrayIndex |
in | If the WriteProperty or WritePropertyMultiple request is writing to a whole array of time values (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if the single time value of an array property being written. |
priority |
in | The priority for the write. Only used if the property is commandable, for example: objects with priority arrays. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user successfully stored the value, otherwise false.
Registered with BACnetStack_RegisterCallbackSetPropertyTime().
FPCallbackSetPropertyUnsignedInteger
Section titled “FPCallbackSetPropertyUnsignedInteger”typedef bool(* FPCallbackSetPropertyUnsignedInteger)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const uint32_t value, const bool useArrayIndex, const uint32_t propertyArrayIndex, const uint8_t priority, uint32_t *errorCode);The CallbackSetPropertyUnsignedInteger function is a callback function that a user implements and registers with the CAS BACnet Stack to write real values in their system or local storage.
An example of this would be if a user has an Multi-State Value Object where the present-value property is writable, the user would use this callback to store the value in their local storage.
A call with useArrayIndex true and propertyArrayIndex 0 is a resize request: value is the array’s new length. The stack makes it for the resizable arrays - Channel Control_Groups, Multi-state State_Text, Global Group Group_Members and Group_Member_Names, Command Action_Text, and Structured View Subordinate_List and Subordinate_Annotations - whatever their element datatype, both for a write of an Unsigned to index 0 and, before the elements, for a whole-array write of another length. Control_Groups is on the list only in a build with WriteGroup support. An array whose elements are themselves Unsigned also reaches this callback at index 0, as any element write of it does.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
value |
in | The uint value to write. |
useArrayIndex |
in | If the WriteProperty or WritePropertyMultiple request is writing to a whole array of uints (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if the single uint of an array property being written. |
priority |
in | The priority for the write. Only used if the property is commandable, for example: objects with priority arrays. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user successfully stored the value, otherwise false.
Registered with BACnetStack_RegisterCallbackSetPropertyUnsignedInteger().
FPCallbackGetPropertyObjectIdentifier
Section titled “FPCallbackGetPropertyObjectIdentifier”typedef bool(* FPCallbackGetPropertyObjectIdentifier)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, uint16_t *valueObjectType, uint32_t *valueObjectInstance, const bool useArrayIndex, const uint32_t propertyArrayIndex, uint32_t *errorCode);The CallbackGetPropertyObjectIdentifier function is a callback function that a user implements and registers with the CAS BACnet Stack to supply an ObjectIdentifier-valued property that is stored outside the stack’s own database (e.g. Structured View’s Subordinate_List, cl. 12.29.7).
Mirrors CallbackSetPropertyObjectIdentifier’s shape, minus priority - the Get family carries no priority parameter, matching every other GetProperty* callback in this header. It carries an errorCode out-parameter, mirroring the Set family.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being requested. |
objectType |
in | The BACnet object type of the BACnet object being requested. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being requested. |
propertyIdentifier |
in | The BACnet property of the BACnet object being requested. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
valueObjectType |
out | The object type half of the ObjectIdentifier value. With valueObjectInstance, this is one BACnet Object Identifier carried as two parameters. |
valueObjectInstance |
out | The object instance half of the ObjectIdentifier value. |
useArrayIndex |
in | If the request is asking for a single element of the array property. |
propertyArrayIndex |
in | The 1-based array index when useArrayIndex is true. As with every other array-valued Get callback, an arrayIndex of 0 (a length request, cl. 15.5) is answered by the application’s UnsignedInteger callback, not this one. |
errorCode |
out | A BACnet Error code describing what error occurred if the value was not provided. Preset to CASBACnetStack::BACnetErrorCode::success before the call. When the stack calls this to answer a read of the property itself, a code you set on a false return is sent as the error (CASBACnetStack::BACnetErrorCode::abortOther sends an Abort). Leaving it at success uses the value the stack stores for the property if there is one, otherwise its default - except for LIST properties and the properties the stack will not make up a value for (PresentValue, NumberOfStates, RelinquishDefault, LocalDate, LocalTime and some File, Lift, Escalator and Network Port properties), which are answered with readAccessDenied. When the stack calls this to compute another property (a PriorityArray slot, Database_Revision), errorCode is not used. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the application supplied a value, otherwise false (the stack treats false as “no value”, the same as every other Get callback).
Registered with BACnetStack_RegisterCallbackGetPropertyObjectIdentifier().
FPCallbackSetPropertyObjectIdentifier
Section titled “FPCallbackSetPropertyObjectIdentifier”typedef bool(* FPCallbackSetPropertyObjectIdentifier)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const uint16_t valueObjectType, const uint32_t valueObjectInstance, const bool useArrayIndex, const uint32_t propertyArrayIndex, const uint8_t priority, uint32_t *errorCode);The CallbackSetPropertyObjectIdentifier function is a callback function that a user implements and registers with the CAS BACnet Stack to receive notification from the stack that an ObjectIdentifier property was changed.
An example of this would be if a BACnet Client used a WriteProperty request to change the Object Instance of an object or the device, this callback would be called with the updated value for the user to store.
The stack also calls it when a You-Are request that matches this device assigns it a new Device instance (cl. 16.11.4): once, with the Device object at its old instance (deviceInstance and objectInstance), propertyIdentifier Object_Identifier and the new Device identifier as the value, after the stack’s own checks have accepted the assignment. Return true to let the stack apply the new instance - store it, so the device keeps it across restarts - or false to refuse the assignment; the device then keeps its old instance. If the stack cannot apply an assignment the callback accepted, it calls the callback once more with the Device object at the new instance and the old identifier as the value. With no callback registered, the stack applies the assignment without asking.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being changed. |
objectType |
in | The BACnet object type of the BACnet object being changed. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being changed. |
propertyIdentifier |
in | The BACnet property of the BACnet object being changed. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
valueObjectType |
in | The new object type value to set. With valueObjectInstance, this is one BACnet Object Identifier carried as two parameters. |
valueObjectInstance |
in | The new object instance value to set. |
useArrayIndex |
in | If the WriteProperty or WritePropertyMultiple request is writing to a whole array of objectIdentifiers (false) or a single element of an array property(true). |
propertyArrayIndex |
in | The array index if the single uint of an array property being written. |
priority |
in | The priority for the write. Only used if the property is commandable, for example: objects with priority arrays. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”True if the user successfully stored the value, otherwise false.
Registered with BACnetStack_RegisterCallbackSetPropertyObjectIdentifier().
FPCallbackSetElevatorGroupLandingCallControl
Section titled “FPCallbackSetElevatorGroupLandingCallControl”typedef bool(* FPCallbackSetElevatorGroupLandingCallControl)(const uint32_t deviceInstance, const uint32_t elevatorGroupInstance, const uint8_t floorNumber, const uint8_t commandChoice, const uint32_t bacnetLiftCarDirection, const uint8_t destination, const bool useFloorText, const char *floorText, const uint16_t floorTextLength);The CallbackSetElevatorGroupLandingCallControl function is a callback function that a user implements and registers with the CAS BACnet Stack to write a Landing Call Status to an Elevator Group’s Landing Call Control property.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the Elevator Group object. |
elevatorGroupInstance |
in | The BACnet object instance of the Elevator Group object being requested. |
floorNumber |
in | The floor number of the Landing Call Status to write. |
commandChoice |
in | Determines which option to use. Either (1) for bacnetLiftCarDirection or (2) destination. |
bacnetLiftCarDirection |
in | If commandChoice specifies bacnetLiftCarDirection, this is the direction enumeration to use. See CASBACnetStack::BACnetLiftCarDirection for more information. |
destination |
in | If commandChoice specifies destination, this is the destination floor number to use. |
useFloorText |
in | This is a flag that signals whether a floor text has been provided (true) or not (false). |
floorText |
in | Contains the text for the floor. |
floorTextLength |
in | The length of the floor text. |
Returns
Section titled “Returns”True if the landing call was accepted; false to decline it, in which case the stack stores the value itself if it can and otherwise answers the write with Error PROPERTY / WRITE_ACCESS_DENIED.
Registered with BACnetStack_RegisterCallbackSetElevatorGroupLandingCallControl().
FPCallbackSetPropertyLightingCommand
Section titled “FPCallbackSetPropertyLightingCommand”typedef bool(* FPCallbackSetPropertyLightingCommand)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier, const uint32_t operation, const bool useTargetLevel, const float targetLevel, const bool useRampRate, const float rampRate, const bool useStepIncrement, const float stepIncrement, const bool useFadeTime, const uint32_t fadeTime, const bool usePriority, const uint32_t priority, const uint8_t priorityForWriting, uint32_t *errorCode);The CallbackSetPropertyLightingCommand function is a callback function that a user implements and registers with the CAS BACnet Stack to accept a WriteProperty of a BACnetLightingCommand-valued property.
The stack decodes the BACnetLightingCommand SEQUENCE off the wire and hands the application the individual fields - the application never touches BACnet decoding.
The following Objects and properties should be handled by this callback: LightingOutput Lighting_Command
Lighting_Command is a REQUIRED and WRITABLE property of a Lighting Output (cl. 12.54.6), and writing it is what commands the light - so this callback is the DS-WP-B half of the Lighting Output object. See the matching CASBACnetStack::FPCallbackGetPropertyLightingCommand for the SEQUENCE definition and the per-operation field semantics.
Each optional field arrives with a use* flag: false means the writer omitted that field, in which case the accompanying value is meaningless and must be ignored (the application should apply its own default, per cl. 12.54.6 Table 12-66 - e.g. Default_Fade_Time when fade-time is omitted from a fadeTo).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object and property being written. |
objectType |
in | The BACnet object type of the BACnet object being written. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being written. |
propertyIdentifier |
in | The BACnet property of the BACnet object being written. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
operation |
in | The BACnetLightingOperation. See CASBACnetStack::BACnetLightingOperation for more info. Always present. |
useTargetLevel |
in | True if the writer supplied target-level. |
targetLevel |
in | The target level, only meaningful when useTargetLevel is true. |
useRampRate |
in | True if the writer supplied ramp-rate. |
rampRate |
in | The ramp rate, only meaningful when useRampRate is true. |
useStepIncrement |
in | True if the writer supplied step-increment. |
stepIncrement |
in | The step increment, only meaningful when useStepIncrement is true. |
useFadeTime |
in | True if the writer supplied fade-time. |
fadeTime |
in | The fade time in milliseconds, only meaningful when useFadeTime is true. |
usePriority |
in | True if the writer supplied priority. |
priority |
in | The command priority (1..16), only meaningful when usePriority is true. |
priorityForWriting |
in | The priority of the WriteProperty request itself (1..16), as with every other Set callback. |
errorCode |
out | Set a CASBACnetStack::BACnetErrorCode and return false to reject the write with that BACnet Error-PDU (e.g. valueOutOfRange for a target-level outside 0.0..100.0). |
Returns
Section titled “Returns”True if the application accepted the write, otherwise false (the stack answers with an Error-PDU).
Registered with BACnetStack_RegisterCallbackSetPropertyLightingCommand().
FPCallbackCreateObject
Section titled “FPCallbackCreateObject”typedef bool(* FPCallbackCreateObject)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance);The CallbackCreateObject function is a callback function that a user implements and registers with the CAS BACnet Stack to handle logic or allocate memory to create a BACnet object.
This callback is called when the CAS BACnet Stack receives a CreateObject BACnet message.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_DM_OCD_OBJECT_CREATION_AND_DELETION defined.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that will contain the created object. |
objectType |
in | The BACnet object type of the BACnet object being created. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being created. |
Returns
Section titled “Returns”True if the user-logic was completed, otherwise false.
Registered with BACnetStack_RegisterCallbackCreateObject().
FPCallbackDeleteObject
Section titled “FPCallbackDeleteObject”typedef bool(* FPCallbackDeleteObject)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance);The CallbackDeleteObject function is a callback function that a user implements and registers with the CAS BACnet Stack to handle logic or free up memory when deleting BACnet object.
This callback is called when the CAS BACnet Stack receives a DeleteObject BACnet message.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_DM_OCD_OBJECT_CREATION_AND_DELETION defined.
Note: the stack does not automatically invalidate cross-references to the deleted object held elsewhere (e.g. another object’s BACnetObjectPropertyReference-typed property). If the host application maintains such references, this callback is where that cleanup belongs - the stack itself is not aware of any such references.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance of the device that contains the object to delete. |
objectType |
in | The BACnet object type of the BACnet object being deleted. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object being deleted. |
Returns
Section titled “Returns”True if the user-logic was completed, otherwise false.
Registered with BACnetStack_RegisterCallbackDeleteObject().
FPCallbackLogDebugMessage
Section titled “FPCallbackLogDebugMessage”typedef void(* FPCallbackLogDebugMessage)(const char *message, const uint16_t messageLength, const uint8_t messageType);The CallbackLogDebugMessage function is a callback function that a user implements and registers with the CAS BACnet Stack to get Debug messages that occur within the CAS BACnet stack.
This callback is called when the CAS BACnet Stack logs a debug message.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
message |
out | The debug message. |
messageLength |
out | The length of the debug message. |
messageType |
out | The type of the debug message: 0 for error, 1 for informational, 2 for debug. |
Registered with BACnetStack_RegisterCallbackLogDebugMessage().
FPCallbackReinitializeDevice
Section titled “FPCallbackReinitializeDevice”typedef bool(* FPCallbackReinitializeDevice)(const uint32_t deviceInstance, const uint32_t reinitializedState, const char *password, const uint32_t passwordLength, uint32_t *errorCode);The CallbackReinitializeDevice function is a callback function that a user implements and registers with the CAS BACnet Stack to handle logic to reinitialize a device or activate network port object changes.
This callback is called when the CAS BACnet Stack receives a ReinitializeDevice BACnet message.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_DM_RD_REINITIALIZE_DEVICE defined.
Validate and schedule only: the stack sends the SimpleACK after this callback returns, so a device that restarts inside it never sends the reply, and the client times out and retries. Return, and perform a warm or cold start after the call.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance receiving the ReinitializeDevice request. |
reinitializedState |
in | The state the client wants the device to be in once it has been reinitialized. See CASBACnetStack::BACnetReinitializedStateOfDevice for more info. |
password |
in | The optional password if the device requires password protection. |
passwordLength |
in | The length of the password. |
errorCode |
out | A BACnet Error code describing what error occurred. See CASBACnetStack::BACnetErrorCode for more info. Six codes keep these error classes: PASSWORD_FAILURE (SECURITY), CONFIGURATION_IN_PROGRESS (DEVICE), MISSING_REQUIRED_PARAMETER, COMMUNICATION_DISABLED or OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED (SERVICES), and INVALID_CONFIGURATION_DATA (PROPERTY). ABORT_OTHER answers Abort(other). Any other code from 0 to 65535 that is not an abort- or reject-type code is sent with the stack’s callback error-code mapping’s class. No code, OTHER, or any other value answers SERVICES / SERVICE_REQUEST_DENIED. |
Returns
Section titled “Returns”True to accept the request (the stack replies with a SimpleACK, or with Error PROPERTY / INVALID_CONFIGURATION_DATA if pending Network Port changes then fail to apply); false to refuse it with the error in *errorCode (PASSWORD_FAILURE, CONFIGURATION_IN_PROGRESS, COMMUNICATION_DISABLED, MISSING_REQUIRED_PARAMETER, OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED or INVALID_CONFIGURATION_DATA, which keep the classes above). ABORT_OTHER answers Abort(other); any other code is answered as described for errorCode.
Registered with BACnetStack_RegisterCallbackReinitializeDevice().
FPCallbackDeviceCommunicationControl
Section titled “FPCallbackDeviceCommunicationControl”typedef bool(* FPCallbackDeviceCommunicationControl)(const uint32_t deviceInstance, const uint8_t enableDisable, const char *password, const uint8_t passwordLength, const bool useTimeDuration, const uint16_t timeDuration, uint32_t *errorCode);The CallbackDeviceCommunicationControl function is a callback function that a user implements and registers with the CAS BACnet Stack to handle logic to enable/disable BACnet communication with the device.
This callback is called when the CAS BACnet Stack receives a DeviceCommunicationControl BACnet message.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_DM_DCC_DEVICE_COMMUNICATION_CONTROL
The stack calls it for a request with the deprecated value DISABLE (1) too, so the password is checked first; when it returns true for one, the stack then refuses the request with Error(services, serviceRequestDenied) and changes nothing. A callback that acts on the request itself (rather than only validating it) should ignore DISABLE.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance receiving the DeviceCommunicationControl request. |
enableDisable |
in | The DeviceCommunicationControl option. To enable, disable, or disableInitiation. See CASBACnetStack::BACnetEnableDisable for more info. |
password |
in | The optional password if the device requires password protection. |
passwordLength |
in | The length of the password. It is a uint8_t here (FPCallbackReinitializeDevice uses uint32_t) because a DeviceCommunicationControl password is at most 20 characters (135-2024 clause 16.1.1.1.3) and the stack rejects a longer one before calling. |
useTimeDuration |
in | A flag for whether the DeviceCommunicationControl disable or disableInitiation request has a time duration (true) or is indefinite (false) |
timeDuration |
in | How many minutes the remote device is to refrain from initiating BACnet services (cl. 16.1.1.1.1). |
errorCode |
out | Preset to PASSWORD_FAILURE. On a false return, set OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED or SERVICE_REQUEST_DENIED to send that code with error class SERVICES; any other value, or leaving it unset, sends SECURITY / PASSWORD_FAILURE. See CASBACnetStack::BACnetErrorCode. |
Returns
Section titled “Returns”True to accept the request (the stack applies it and replies with a SimpleACK); false to refuse it. *errorCode may be OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED or SERVICE_REQUEST_DENIED; any other value, or none, is sent as PASSWORD_FAILURE.
Registered with BACnetStack_RegisterCallbackDeviceCommunicationControl().
FPCallbackLifeSafetyOperation
Section titled “FPCallbackLifeSafetyOperation”typedef bool(* FPCallbackLifeSafetyOperation)(const uint32_t deviceInstance, const uint32_t requestingProcessIdentifier, const char *requestingSource, const uint32_t requestingSourceLength, const uint8_t requestOperation, const bool useObjectIdentifier, const uint16_t objectType, const uint32_t objectInstance, uint32_t *errorCode);The CallbackLifeSafetyOperation function is a callback function that a user implements and registers with the CAS BACnet Stack to handle a received LifeSafetyOperation request (ASHRAE 135 clause 13.13).
The user applies the requested operation to the target life-safety object and returns true; on failure it returns false and sets *errorCode (Error Class OBJECT) - e.g. UNKNOWN_OBJECT, OPTIONAL_FUNCTIONALITY_NOT_SUPPORTED, or INVALID_OPERATION_IN_THIS_STATE.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_DM_LSO_LIFE_SAFETY_OPERATION
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance receiving the LifeSafetyOperation request. |
requestingProcessIdentifier |
in | The requesting-process-identifier from the request. |
requestingSource |
in | The requesting-source character string (NULL if empty). |
requestingSourceLength |
in | The length of requestingSource. |
requestOperation |
in | The BACnetLifeSafetyOperation enumeration value. See CASBACnetStack::BACnetLifeSafetyOperation. |
useObjectIdentifier |
in | True if the optional object-identifier was present. |
objectType |
in | The optional target object type (valid only when useObjectIdentifier is true). With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The optional target object instance (valid only when useObjectIdentifier is true). |
errorCode |
out | On failure, set to the BACnetErrorCode to return (Error Class OBJECT). |
Returns
Section titled “Returns”True to accept the operation (the stack applies it and replies with a SimpleACK); false to refuse it with the error in *errorCode (class SERVICES for SERVICE_REQUEST_DENIED, otherwise OBJECT; OTHER if no code is set). Nothing is applied on a refusal.
Registered with BACnetStack_RegisterCallbackLifeSafetyOperation().
FPCallbackAcknowledgeAlarm
Section titled “FPCallbackAcknowledgeAlarm”typedef bool(* FPCallbackAcknowledgeAlarm)(const uint32_t deviceInstance, const uint32_t acknowledgingProcessIdentifier, const uint16_t eventObjectType, const uint32_t eventObjectInstance, const uint16_t eventStateAcknowledged, const uint8_t eventTimeStampYearMinus1900, const uint8_t eventTimeStampMonth, const uint8_t eventTimeStampDay, const uint8_t eventTimeStampWeekday, const uint8_t eventTimeStampHour, const uint8_t eventTimeStampMinute, const uint8_t eventTimeStampSecond, const uint8_t eventTimeStampHundredthSecond, const char *acknowledgmentSource, const uint32_t acknowledgmentSourceLength, const uint8_t acknowledgmentSourceEncoding, const bool timeOfAcknowledgmentIsTime, const bool timeOfAcknowledgmentIsSequenceNumber, const bool timeOfAcknowledgmentIsDateTime, const uint8_t timeOfAcknowledgmentYearMinus1900, const uint8_t timeOfAcknowledgmentMonth, const uint8_t timeOfAcknowledgmentDay, const uint8_t timeOfAcknowledgmentWeekday, const uint8_t timeOfAcknowledgmentHour, const uint8_t timeOfAcknowledgmentMinute, const uint8_t timeOfAcknowledgmentSecond, const uint8_t timeOfAcknowledgmentHundredthSecond, const uint16_t timeOfAcknowledgmentSequenceNumber, uint32_t *errorCode);The CallbackAcknowledgeAlarm function is a callback function that a user implements and registers with the CAS BACnet Stack to authorize alarm acknowledges and to log them.
This callback is called when the CAS BACnet Stack receives an AcknowledgeAlarm BACnet message.
The primary use of this callback is to validate acknowledgment source, to determine if it is authorized to acknowledge alarms. Users can also use this callback to log the acknowledges. It is called only for an acknowledgment that has passed the stack’s own checks (clause 13.5.2): the object exists and generates events, the Time Stamp matches the most recent time of the transition being acknowledged, and the Event State Acknowledged matches its To State. An acknowledgment the stack refuses for one of those reasons is answered without calling it.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_AE_ACKNOWLEDGE_ALARMS defined.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance receiving the AcknowledgeAlarm request. |
acknowledgingProcessIdentifier |
in | The acknowledging process. |
eventObjectType |
in | The type of the object that created the event notification being acknowledged. With eventObjectInstance, this is one BACnet Object Identifier carried as two parameters. |
eventObjectInstance |
in | The instance of the object that created the event notification being acknowledged. |
eventStateAcknowledged |
in | The event state of the event notification being acknowledged. |
eventTimeStampYearMinus1900 |
in | The year of the timestamp of the event notification being acknowledged. |
eventTimeStampMonth |
in | The month of the timestamp of the event notification being acknowledged. |
eventTimeStampDay |
in | The day of the timestamp of the event notification being acknowledged. |
eventTimeStampWeekday |
in | The weekday of the timestamp of the event notification being acknowledged. |
eventTimeStampHour |
in | The hour of the timestamp of the event notification being acknowledged. |
eventTimeStampMinute |
in | The minute of the timestamp of the event notification being acknowledged. |
eventTimeStampSecond |
in | The second of the timestamp of the event notification being acknowledged. |
eventTimeStampHundredthSecond |
in | The hundredth second of the timestamp of the event notification being acknowledged. |
acknowledgmentSource |
in | Who or what is acknowledging the event: the operator’s or process’s identity (cl. 13.5.1.1.5). |
acknowledgmentSourceLength |
in | The length of the acknowledgment source. |
acknowledgmentSourceEncoding |
in | The encoding of the acknowledgment source. |
timeOfAcknowledgmentIsTime |
in | A flag that specifies that the user is acknowledging the event using a Time for the Time of Acknowledgment. Uses the timeOfAcknowledgmentHour, timeOfAcknowledgmentMinute, timeOfAcknowledgmentSecond, timeOfAcknowledgmentHundredthSecond parameters. All others will be ignored. |
timeOfAcknowledgmentIsSequenceNumber |
in | A flag that specifies that the user is acknowledging the event using a SequenceNumber for the Time of Acknowledgment. Uses the timeOfAcknowledgmentSequenceNumber parameter. All others will be ignored. |
timeOfAcknowledgmentIsDateTime |
in | A flag that specifies that the user is acknowledging the event using a Time for the Time of Acknowledgment. Uses the timeOfAcknowledgmentYearMinus1900, timeOfAcknowledgmentMonth, timeOfAcknowledgmentDay, timeOfAcknowledgmentHour, timeOfAcknowledgmentWeekday, timeOfAcknowledgmentMinute, timeOfAcknowledgmentSecond, timeOfAcknowledgmentHundredthSecond parameters. All others will be ignored. |
timeOfAcknowledgmentYearMinus1900 |
in | The year of the Time of Acknowledgment if it is a DateTime. |
timeOfAcknowledgmentMonth |
in | The month of the Time of Acknowledgment if it is a DateTime. |
timeOfAcknowledgmentDay |
in | The day of the Time of Acknowledgment if it is a DateTime. |
timeOfAcknowledgmentWeekday |
in | The weekday of the Time of Acknowledgment if it is a DateTime. |
timeOfAcknowledgmentHour |
in | The hour of the Time of Acknowledgment if it is a DateTime or Time. |
timeOfAcknowledgmentMinute |
in | The minute of the Time of Acknowledgment if it is a DateTime or Time. |
timeOfAcknowledgmentSecond |
in | The second of the Time of Acknowledgment if it is a DateTime or Time. |
timeOfAcknowledgmentHundredthSecond |
in | The hundredthSecond of the Time of Acknowledgment if it is a DateTime or Time. |
timeOfAcknowledgmentSequenceNumber |
in | The sequence number of the Time of Acknowledgment if it is a SequenceNumber. |
errorCode |
out | The error that a user sets in the callback if the AcknowledgeAlarm fails. A bare CASBACnetStack::BACnetErrorCode value; the stack chooses the error class (see the API conventions). Usually will be SERVICE_REQUEST_DENIED (29) |
Returns
Section titled “Returns”True to allow the acknowledgment (the stack then sets the Acked_Transitions bit and replies); false to refuse it with *errorCode, sent with the Error Class the clause 13.5.1.3.1 table pairs with it (OBJECT for UNKNOWN_OBJECT and NO_ALARM_CONFIGURED, SERVICES otherwise), or SERVICES / SERVICE_REQUEST_DENIED if no code is set.
Registered with BACnetStack_RegisterCallbackAcknowledgeAlarm().
FPCallbackEventNotificationReceived
Section titled “FPCallbackEventNotificationReceived”typedef void(* FPCallbackEventNotificationReceived)(const uint32_t deviceInstance, const bool isConfirmed, const uint32_t processIdentifier, const uint32_t initiatingDeviceIdentifier, const uint16_t eventObjectType, const uint32_t eventObjectInstance, const uint8_t timeStampForm, const uint8_t timeStampYearMinus1900, const uint8_t timeStampMonth, const uint8_t timeStampDay, const uint8_t timeStampWeekday, const uint8_t timeStampHour, const uint8_t timeStampMinute, const uint8_t timeStampSecond, const uint8_t timeStampHundredthSecond, const uint16_t timeStampSequenceNumber, const uint32_t notificationClass, const uint8_t priority, const uint16_t eventType, const char *messageText, const uint32_t messageTextLength, const uint8_t messageTextEncoding, const uint8_t notifyType, const bool useAckRequired, const bool ackRequired, const bool useFromState, const uint16_t fromState, const uint16_t toState, const uint16_t eventValuesChoice, const uint8_t *eventValuesEncoded, const uint16_t eventValuesEncodedLength, const uint8_t *connectionString, const uint8_t connectionStringLength, const uint32_t networkPortInstance, const uint16_t sourceNetwork, const uint8_t *sourceAddress, const uint8_t sourceAddressLength);The CallbackEventNotificationReceived function is a callback that fires when a local device receives a ConfirmedEventNotification (confirmed service choice 2) or UnconfirmedEventNotification (unconfirmed service choice 3), for the AE-N-A and AE-VN-A BIBBs (an operator display, B-OD, shows the operator the event object, time stamp and message text).
Registered with BACnetStack_RegisterCallbackEventNotificationReceived(); built with STACK_OPTION_ALARMS_AND_EVENTS.
It fires after the stack has decoded the request, only for a notification whose parameters are all valid (BACnetEventNotificationRequest::AreAllParametersValid) and only when the receiving device exists. A notification that decodes but is not conformant - for example an unconfirmed ackNotification that carries AckRequired, From_State or Event_Values - is not delivered here; a test-tool build delivers it to the separate invalid-notification hook instead. The callback is a notification, not a gate: the confirmed form is still answered with a SimpleACK, and the notification is still offered to the local Event Log and Notification Forwarder objects.
It is called once for each local device the stack hands the notification to, each time with that device’s instance. Every pointer is valid only for the duration of the call.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The instance of the local device that received the notification. |
isConfirmed |
in | True for a ConfirmedEventNotification, false for an UnconfirmedEventNotification. |
processIdentifier |
in | The Process Identifier parameter. |
initiatingDeviceIdentifier |
in | The instance of the device that sent the notification. |
eventObjectType |
in | The object type of the Event Object Identifier. With eventObjectInstance, this is one BACnet Object Identifier carried as two parameters. |
eventObjectInstance |
in | The object instance of the Event Object Identifier. |
timeStampForm |
in | Which BACnetTimeStamp form the Time Stamp carries - the CHOICE tag of 135-2024 cl. 21.6: 0 = time, 1 = sequenceNumber, 2 = dateTime. |
timeStampYearMinus1900 |
in | The year minus 1900 of the date, when timeStampForm is 2; 0 otherwise. |
timeStampMonth |
in | The month of the date, when timeStampForm is 2; 0 otherwise. |
timeStampDay |
in | The day of the month of the date, when timeStampForm is 2; 0 otherwise. |
timeStampWeekday |
in | The day of the week of the date, when timeStampForm is 2; 0 otherwise. |
timeStampHour |
in | The hour of the time, when timeStampForm is 0 or 2; 0 otherwise. |
timeStampMinute |
in | The minute of the time, when timeStampForm is 0 or 2; 0 otherwise. |
timeStampSecond |
in | The second of the time, when timeStampForm is 0 or 2; 0 otherwise. |
timeStampHundredthSecond |
in | The hundredths of a second of the time, when timeStampForm is 0 or 2; 0 otherwise. |
timeStampSequenceNumber |
in | The sequence number, when timeStampForm is 1; 0 otherwise. |
notificationClass |
in | The Notification Class parameter. |
priority |
in | The Priority parameter. |
eventType |
in | The Event Type parameter (BACnetEventType). |
messageText |
in | The Message Text, not NUL-terminated; NULL when the notification omitted it. |
messageTextLength |
in | The length of messageText in bytes; 0 when it was omitted. |
messageTextEncoding |
in | The character set of messageText; 0 when it was omitted. |
notifyType |
in | The Notify Type parameter (BACnetNotifyType: 0 alarm, 1 event, 2 ackNotification). |
useAckRequired |
in | True when the notification carried AckRequired. It is absent from an ackNotification. |
ackRequired |
in | The AckRequired parameter; false when useAckRequired is false. |
useFromState |
in | True when the notification carried From State. It is absent from an ackNotification. |
fromState |
in | The From State parameter (BACnetEventState); 0 when useFromState is false. |
toState |
in | The To State parameter (BACnetEventState). |
eventValuesChoice |
in | The CHOICE tag of the Event Values parameter (BACnetNotificationParameters, 135-2024 cl. 21.6 - for example 5 = out-of-range), so a display can label the alarm without decoding anything; 0xFFFF when the notification carried no Event Values. |
eventValuesEncoded |
in | The Event Values parameter encoded as context tag 12 (opening and closing tags included), re-encoded by the stack from the decoded value, for an application that forwards or logs it. Most displays can ignore it. NULL when the notification carried no Event Values, and also when the stack could not encode them - eventValuesChoice still names the CHOICE then. (The test-tool invalid-notification hook passes the octets captured from the wire instead.) |
eventValuesEncodedLength |
in | The length of eventValuesEncoded in bytes; 0 when it is NULL. |
connectionString |
in | The connection string of the link the notification arrived from. For a notification routed from another network this is the router’s address; see sourceNetwork. |
connectionStringLength |
in | The length of connectionString in bytes. |
networkPortInstance |
in | The Network Port object instance the notification was received on, or BACNET_NETWORK_PORT_DEFAULT. |
sourceNetwork |
in | The network number of the sender when the notification was routed (the NPDU’s SNET); 0 when it came from the local network. |
sourceAddress |
in | The sender’s address on sourceNetwork (the NPDU’s SADR); NULL when sourceNetwork is 0. |
sourceAddressLength |
in | The length of sourceAddress in bytes; 0 when sourceNetwork is 0. |
Registered with BACnetStack_RegisterCallbackEventNotificationReceived().
FPCallbackReadFile
Section titled “FPCallbackReadFile”typedef bool(* FPCallbackReadFile)(const uint32_t deviceInstance, const uint32_t fileInstance, const uint32_t fileStart, const uint32_t requestedCount, uint8_t *fileData, uint32_t *fileDataLength, const uint32_t maxFileDataLength, bool *endOfFile, uint32_t *errorCode);The CallbackReadFile function is a callback function that a user implements and registers with the CAS BACnet Stack to read files.
This callback is called when the CAS BACnet Stack receives an AtomicReadFileRequest BACnet message.
Note: This callback serves File objects whose File_Access_Method is stream access. Record-access File objects are served by CASBACnetStack::FPCallbackReadFileRecord. If no record callback is registered, a record-access File object falls back to this callback, in which case ‘fileStart’ is a record index and the records must be returned in ‘fileData’ packed as [2-byte big-endian record length][record data] repeated; that legacy framing is retained for backwards compatibility only - new applications should register the record callback instead.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_ATOMIC_FILE_IO
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance receiving the AtomicReadFile request. |
fileInstance |
in | The file object to read. |
fileStart |
in | The starting position in the file to read. |
requestedCount |
in | The number of octets to read from the file. |
fileData |
out | Output buffer to store the contents of the file. |
fileDataLength |
out | The number of octets that were read from the file. |
maxFileDataLength |
in | The maximum buffer size of the fileData output buffer. |
endOfFile |
out | A flag to set whether the end of file was reached (true) or not (false) |
errorCode |
out | Parameter to store an error during the callback. On a false return the stack answers Result(-) with this code and its clause-18 error class (e.g. CASBACnetStack::BACnetErrorCode::invalidFileStartPosition and CASBACnetStack::BACnetErrorCode::fileAccessDenied: class SERVICES; CASBACnetStack::BACnetErrorCode::deviceBusy: class DEVICE); an untouched value (success), or other, is answered with SERVICES / FILE_ACCESS_DENIED, and CASBACnetStack::BACnetErrorCode::abortOther with Abort OTHER. |
Returns
Section titled “Returns”True if the data was read (the stack replies with an AtomicReadFile ACK); false on failure, answered with the error *errorCode names (see errorCode).
Registered with BACnetStack_RegisterCallbackReadFile().
FPCallbackWriteFile
Section titled “FPCallbackWriteFile”typedef bool(* FPCallbackWriteFile)(const uint32_t deviceInstance, const uint32_t fileInstance, const int32_t fileStart, const uint8_t *fileData, const uint32_t fileDataLength, int32_t *ackFileStart, uint32_t *errorCode);The CallbackWriteFile function is a callback function that a user implements and registers with the CAS BACnet Stack to write files.
This callback is called when the CAS BACnet Stack receives an AtomicWriteFileRequest BACnet message.
Note: This callback serves File objects whose File_Access_Method is stream access. Record-access File objects are served by CASBACnetStack::FPCallbackWriteFileRecord. If no record callback is registered, a record-access File object falls back to this callback, in which case ‘fileStart’ is a record index and ‘fileData’ holds the records packed as [2-byte big-endian record length][record data] repeated; that legacy framing is retained for backwards compatibility only - new applications should register the record callback instead.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_ATOMIC_FILE_IO
The application owns Modification_Date and Archive. A successful write must update Modification_Date to the current date and time (cl. 12.13.7) and set Archive to FALSE (cl. 12.13.8); the stack does not touch either property. 135.1-2023 9.13.1.x VERIFY both after every successful write.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance receiving the AtomicWriteFile request. |
fileInstance |
in | The file object to write. |
fileStart |
in | The starting position in the file to write. |
fileData |
in | The data to write to the file |
fileDataLength |
in | The number of bytes to write. |
ackFileStart |
out | The actual file position where data was written if the write operation was successful. |
errorCode |
out | Parameter to store an error during the callback. On a false return the stack answers Result(-) with this code and its clause-18 error class (e.g. CASBACnetStack::BACnetErrorCode::invalidFileStartPosition and CASBACnetStack::BACnetErrorCode::fileAccessDenied: class SERVICES; CASBACnetStack::BACnetErrorCode::fileFull: class OBJECT; CASBACnetStack::BACnetErrorCode::deviceBusy: class DEVICE); an untouched value (success), or other, is answered with SERVICES / FILE_ACCESS_DENIED, and CASBACnetStack::BACnetErrorCode::abortOther with Abort OTHER. If the fileStart position is out of range: INVALID_FILE_START_POSITION; if the file is full: FILE_FULL. |
Returns
Section titled “Returns”True if the data was written (the stack replies with an AtomicWriteFile ACK carrying the start position you report); false on failure, answered with the error *errorCode names (see errorCode).
Registered with BACnetStack_RegisterCallbackWriteFile().
FPCallbackReadFileRecord
Section titled “FPCallbackReadFileRecord”typedef bool(* FPCallbackReadFileRecord)(const uint32_t deviceInstance, const uint32_t fileInstance, const int32_t fileStartRecord, const uint32_t requestedRecordCount, uint8_t *recordData, uint32_t *recordDataLengths, uint32_t *returnedRecordCount, const uint32_t maxRecordCount, const uint32_t maxRecordDataLength, bool *endOfFile, uint32_t *errorCode);The CallbackReadFileRecord function is a callback function that a user implements and registers with the CAS BACnet Stack to read record-access files.
This callback is called when the CAS BACnet Stack receives an AtomicReadFileRequest BACnet message naming a File object whose File_Access_Method is record access (ASHRAE 135 cl. 14.1).
Records are returned as one contiguous payload buffer plus a parallel array of per-record lengths: record i occupies ‘recordDataLengths[i]’ octets starting at the sum of the preceding lengths. This keeps the ABI flat C while still conveying record boundaries, which the stream callback’s single flat buffer cannot do.
Per cl. 14.1.5, return fewer records than requested when the file ends first (‘returnedRecordCount’ reports the actual number read) and set ‘endOfFile’ when the last record of the file is included. A ‘fileStartRecord’ outside the file boundaries must be rejected by setting ‘errorCode’ to INVALID_FILE_START_POSITION and returning false.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_ATOMIC_FILE_IO
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance receiving the AtomicReadFile request. |
fileInstance |
in | The file object to read. |
fileStartRecord |
in | The zero-based record number to start reading from. |
requestedRecordCount |
in | The number of records to read from the file. |
recordData |
out | Output buffer holding the record payloads back to back. |
recordDataLengths |
out | Output array receiving the octet length of each returned record. |
returnedRecordCount |
out | How many records the read really returned. |
maxRecordCount |
in | The maximum number of entries the recordDataLengths array can hold. |
maxRecordDataLength |
in | The maximum buffer size of the recordData output buffer. |
endOfFile |
out | A flag to set whether the end of file was reached (true) or not (false) |
errorCode |
out | Parameter to store an error during the callback. On a false return the stack answers Result(-) with this code and its clause-18 error class (e.g. CASBACnetStack::BACnetErrorCode::invalidFileStartPosition and CASBACnetStack::BACnetErrorCode::fileAccessDenied: class SERVICES; CASBACnetStack::BACnetErrorCode::deviceBusy: class DEVICE); an untouched value (success), or other, is answered with SERVICES / FILE_ACCESS_DENIED, and CASBACnetStack::BACnetErrorCode::abortOther with Abort OTHER. If the fileStartRecord is out of range: INVALID_FILE_START_POSITION. |
Returns
Section titled “Returns”True if the records were read (the stack replies with an AtomicReadFile ACK); false on failure, answered with the error *errorCode names (see errorCode).
Registered with BACnetStack_RegisterCallbackReadFileRecord().
FPCallbackWriteFileRecord
Section titled “FPCallbackWriteFileRecord”typedef bool(* FPCallbackWriteFileRecord)(const uint32_t deviceInstance, const uint32_t fileInstance, const int32_t fileStartRecord, const uint32_t recordCount, const uint8_t *recordData, const uint32_t *recordDataLengths, int32_t *ackFileStartRecord, uint32_t *errorCode);The CallbackWriteFileRecord function is a callback function that a user implements and registers with the CAS BACnet Stack to write record-access files.
This callback is called when the CAS BACnet Stack receives an AtomicWriteFileRequest BACnet message naming a File object whose File_Access_Method is record access (ASHRAE 135 cl. 14.2).
Records arrive as one contiguous payload buffer plus a parallel array of per-record lengths, the same framing CASBACnetStack::FPCallbackReadFileRecord uses.
Per cl. 14.2.5, writing at a ‘fileStartRecord’ beyond the current Record_Count extends the file to that size; the contents of any intervening records are a local matter.
A ‘fileStartRecord’ of -1 means append (cl. 14.2.2.3.1): the records are written at the current end of the file. It is NOT an error, and the stack passes it through unchanged - resolving it is the application’s job.
Report the record number at which the write actually began in ‘ackFileStartRecord’ - it is returned to the client in the AtomicWriteFileAck. For an append this must be the resolved position (the Record_Count before the write), never -1.
The stack rejects a ‘fileStartRecord’ below -1 before this callback is reached.
The application owns Modification_Date and Archive. A successful write must update Modification_Date to the current date and time (cl. 12.13.7) and set Archive to FALSE (cl. 12.13.8); the stack does not touch either property. 135.1-2023 9.13.1.1.1 through 9.13.1.1.3 VERIFY both after every record write, so a device that skips this fails those tests even though the write itself succeeded.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_ATOMIC_FILE_IO
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance receiving the AtomicWriteFile request. |
fileInstance |
in | The file object to write. |
fileStartRecord |
in | The zero-based record number to start writing at. |
recordCount |
in | The number of records supplied. |
recordData |
in | The record payloads, back to back. |
recordDataLengths |
in | The octet length of each supplied record. |
ackFileStartRecord |
out | The record number where the write actually began. |
errorCode |
out | Parameter to store an error during the callback. On a false return the stack answers Result(-) with this code and its clause-18 error class (e.g. CASBACnetStack::BACnetErrorCode::invalidFileStartPosition and CASBACnetStack::BACnetErrorCode::fileAccessDenied: class SERVICES; CASBACnetStack::BACnetErrorCode::fileFull: class OBJECT; CASBACnetStack::BACnetErrorCode::deviceBusy: class DEVICE); an untouched value (success), or other, is answered with SERVICES / FILE_ACCESS_DENIED, and CASBACnetStack::BACnetErrorCode::abortOther with Abort OTHER. If the fileStartRecord is out of range: INVALID_FILE_START_POSITION; if the file is full: FILE_FULL. |
Returns
Section titled “Returns”True if the records were written (the stack replies with an AtomicWriteFile ACK carrying the start record you report); false on failure, answered with the error *errorCode names (see errorCode).
Registered with BACnetStack_RegisterCallbackWriteFileRecord().
FPCallbackPrepareBackup
Section titled “FPCallbackPrepareBackup”typedef bool(* FPCallbackPrepareBackup)(const uint32_t deviceInstance);Creates the backup files a BACnet client will then read (ReinitializeDevice startBackup).
Registered with BACnetStack_RegisterCallbackPrepareBackup(), which documents when it is called and the rule that the four backup and restore callbacks and CallbackGetSystemTime must all be registered together.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The device being backed up. |
Returns
Section titled “Returns”True if the backup files are ready; false moves the device into the backupFailure state.
Registered with BACnetStack_RegisterCallbackPrepareBackup().
FPCallbackCompleteBackup
Section titled “FPCallbackCompleteBackup”typedef bool(* FPCallbackCompleteBackup)(const uint32_t deviceInstance);Ends a backup session and cleans up the files it created (ReinitializeDevice endBackup, or the Backup_Failure_Timeout expiring).
Registered with BACnetStack_RegisterCallbackCompleteBackup().
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The device that was backed up. |
Returns
Section titled “Returns”Reserved: only logged. Return true.
Registered with BACnetStack_RegisterCallbackCompleteBackup().
FPCallbackPrepareRestore
Section titled “FPCallbackPrepareRestore”typedef bool(* FPCallbackPrepareRestore)(const uint32_t deviceInstance);Creates the files a BACnet client will write the restore image into (ReinitializeDevice startRestore).
Registered with BACnetStack_RegisterCallbackPrepareRestore().
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The device being restored. |
Returns
Section titled “Returns”True if the restore files are ready; false moves the device into the restoreFailure state. An application that serves Database_Revision itself (through CallbackGetPropertyUInt) notes its current Database_Revision when it returns true here: see FPCallbackCompleteRestore (cl. 19.1.3.4).
Registered with BACnetStack_RegisterCallbackPrepareRestore().
FPCallbackCompleteRestore
Section titled “FPCallbackCompleteRestore”typedef bool(* FPCallbackCompleteRestore)(const uint32_t deviceInstance, const bool wasAborted);Finishes a restore session: applies the uploaded files, or discards them when the session was aborted.
Registered with BACnetStack_RegisterCallbackCompleteRestore(), which explains when wasAborted is true.
Database_Revision (cl. 19.1.3.4): after a successful restore it is one more than it was when the restore began. The stack does this for the value it stores. An application that serves Database_Revision through CallbackGetPropertyUInt - whose value the stack uses in preference - does it here: when it returns true from CallbackPrepareRestore it keeps its current Database_Revision, and when it returns true from this callback with wasAborted false (after a PrepareRestore it accepted) it sets Database_Revision to that kept value plus one. An aborted restore leaves it as it was.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The device that was restored. |
wasAborted |
in | True for a ReinitializeDevice abortRestore and for a restore abandoned because the Backup_Failure_Timeout expired; false only for a normal endRestore. |
Returns
Section titled “Returns”True if the restore was applied, or, when aborted, the previous configuration is in place. False means the application could neither apply the restore nor recover its previous configuration: System_Status then becomes DOWNLOAD_REQUIRED instead of OPERATIONAL. On an endRestore, Last_Restore_Time is recorded only when this returns true.
Registered with BACnetStack_RegisterCallbackCompleteRestore().
FPHookIAm
Section titled “FPHookIAm”typedef void(* FPHookIAm)(const uint32_t deviceIdentifier, const uint32_t maxApduLengthAccepted, const uint8_t segmentationSupported, const uint16_t vendorIdentifier, const uint8_t *connectionString, const uint8_t connectionStringLength, const uint32_t networkPortInstance, const uint16_t sourceNetwork, const uint8_t *sourceAddress, const uint8_t sourceAddressLength);The HookIAm function is a hook that a user implements and registers with the CAS BACnet Stack that gets called when a specific message is received, in this case, an IAm message.
This allows users to process the data from the IAm message.
An IAm is sent by devices in response to a WhoIs message.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceIdentifier |
in | The device identifier of the BACnet device that sent the IAm. |
maxApduLengthAccepted |
in | The max apdu length accepted by the BACnet device that sent the IAm. |
segmentationSupported |
in | The type of segmentation that the device that sent the IAm supports. See CASBACnetStack::BACnetSegmentation for more info. |
vendorIdentifier |
in | The vendor identifier of the BACnet device that sent the IAm. |
connectionString |
in | The connection string of the device that sent the message. |
connectionStringLength |
in | The number of bytes in the connection string. |
networkPortInstance |
in | The Network Port object instance the message was received on, or BACNET_NETWORK_PORT_DEFAULT. |
sourceNetwork |
in | The BACnet network the sender is on. Local network = 0. |
sourceAddress |
in | The Source address (SADR) of the device if the network is non-zero. |
sourceAddressLength |
in | The number of bytes in the source address. |
Registered with BACnetStack_RegisterHookIAm().
FPHookIHave
Section titled “FPHookIHave”typedef void(* FPHookIHave)(const uint32_t deviceIdentifier, const uint16_t objectType, const uint32_t objectInstance, const char *objectName, const uint32_t objectNameLength, const uint8_t objectNameEncoding, const uint8_t *connectionString, const uint8_t connectionStringLength, const uint32_t networkPortInstance, const uint16_t sourceNetwork, const uint8_t *sourceAddress, const uint8_t sourceAddressLength);The HookIHave function is a hook that a user implements and registers with the CAS BACnet Stack that gets called when a specific message is received, in this case, an IHave message.
This allows users to process the data from the IHave message.
An IHave is sent by devices in response to a WhoHas message.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceIdentifier |
in | The device identifier of the BACnet device that sent the IAm. |
objectType |
in | The BACnet object type of the BACnet object returned in the IHave. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance of the BACnet object returned in the IHave. |
objectName |
in | The name of the BACnet object returned in the IHave. |
objectNameLength |
in | The length of the object name. |
objectNameEncoding |
in | The encoding type of the object name. Possible values are: - UTF_8 = 00 - IBM_Microsoft_DBCS = 01 - JIS_C_6226 = 02 - ISO_10646_UCS_4 = 03 - ISO_10646_UCS_2 = 04 - ISO_8859_1 = 05 |
connectionString |
in | The connection string of the device that sent the message. |
connectionStringLength |
in | The number of bytes in the connection string. |
networkPortInstance |
in | The Network Port object instance the message was received on, or BACNET_NETWORK_PORT_DEFAULT. |
sourceNetwork |
in | The BACnet network the sender is on. Local network = 0. |
sourceAddress |
in | The Source address (SADR) of the device if the network is non-zero. |
sourceAddressLength |
in | The number of bytes in the source address. |
Registered with BACnetStack_RegisterHookIHave().
FPHookTextMessage
Section titled “FPHookTextMessage”typedef bool(* FPHookTextMessage)(const uint32_t sourceDeviceIdentifier, const bool useMessageClass, const uint32_t messageClassUnsigned, const char *messageClassString, const uint32_t messageClassStringLength, const uint8_t messagePriority, const char *message, const uint32_t messageLength, const uint8_t *connectionString, const uint8_t connectionStringLength, const uint32_t networkPortInstance, const uint16_t sourceNetwork, const uint8_t *sourceAddress, const uint8_t sourceAddressLength, uint16_t *errorClass, uint16_t *errorCode);The HookTextMessage function is a hook that a user implements and registers with the CAS BACnet Stack that gets called when a specific message is received, in this case, a ConfirmedTextMessage or UnconfirmedTextMessage message.
This allows users to process the data from the ConfirmedTextMessage or UnconfirmedTextMessage message. For ConfirmedTextMessageRequests, user may specify return value of true for Result(+) and false for Result(-) with error code and error class. For UnconfirmedTextMessageRequests, return value and error code/class are ignored. Requires STACK_OPTION_TEXT_MESSAGE and the service enabled with BACnetStack_SetServiceEnabled() (it is not enabled by default; a ConfirmedTextMessageRequest for a service that is not enabled is rejected with UNRECOGNIZED_SERVICE). With the service enabled and no hook registered, a ConfirmedTextMessageRequest is answered with Result(-) Error(SERVICES, SERVICE_REQUEST_DENIED) and an UnconfirmedTextMessageRequest is ignored.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
sourceDeviceIdentifier |
in | The device identifier of the BACnet device that initiated this text message. |
useMessageClass |
in | A flag that tells if a Message Class was provided (true) or not (false). |
messageClassUnsigned |
in | The class of the received text message as an Unsigned Integer. If the Message Class is a Character String, then this will have a value of zero. |
messageClassString |
in | The class of the received text message as a Character String, in the sender’s character set and unconverted (see message). If the Message Class is an Unsigned Integer (useMessageClass true and the unsigned arm), this is an empty string with messageClassStringLength 0, never NULL; use messageClassStringLength, not a NULL test, to tell the arms apart. |
messageClassStringLength |
in | The length of the Message Class, in octets, if it is a Character String. If the Message Class is an Unsigned Integer, then this will have a value of zero. |
messagePriority |
in | The priority for message handling. Possible values are: - Normal = 0 - Urgent = 1 |
message |
in | The text message, as the octets the sender encoded. The stack does not convert them, and does not pass the character set the sender named: a message in ISO 8859-1, UCS-2 or another BACnet character set arrives in that set’s bytes, which may include zero octets. The text is not NUL-terminated; use messageLength. |
messageLength |
in | The length of the text message, in octets. |
connectionString |
in | The connection string of the device that sent the message. |
connectionStringLength |
in | The number of bytes in the connection string. |
networkPortInstance |
in | The Network Port object instance the message was received on, or BACNET_NETWORK_PORT_DEFAULT. |
sourceNetwork |
in | The BACnet network the sender is on. Local network = 0. |
sourceAddress |
in | The Source address (SADR) of the device if the network is non-zero. |
sourceAddressLength |
in | The number of bytes in the source address. |
errorClass |
out | The error class of the error. See CASBACnetStack::BACnetErrorClass for more info. |
errorCode |
out | The error code of the error. See CASBACnetStack::BACnetErrorCode for more info. |
Returns
Section titled “Returns”For a confirmed message, true to acknowledge it, or false to answer with the error in *errorClass and *errorCode (DEVICE / OTHER if neither is set). Ignored for an unconfirmed message.
Registered with BACnetStack_RegisterHookTextMessage().
FPHookError
Section titled “FPHookError”typedef void(* FPHookError)(const uint8_t originalInvokeId, const uint32_t errorChoice, const uint32_t errorClass, const uint32_t errorCode, const uint8_t *connectionString, const uint8_t connectionStringLength, const uint32_t networkPortInstance, const uint16_t sourceNetwork, const uint8_t *sourceAddress, const uint8_t sourceAddressLength, const bool useObjectProperty, const uint16_t objectType, const uint32_t objectInstance, const uint32_t propertyIdentifier);The HookError function is a hook that a user implements and registers with the CAS BACnet Stack that gets called when a specific message is received, in this case, an Error message.
This allows users to process the data from the Error message.
An Error is sent by a device in response to a confirmed service request where an error occurred during the processing of the service.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
originalInvokeId |
in | The invokeId of the confirmed service request that this Error answers (cl. 20.1.7.1). |
errorChoice |
in | The service to which the error is a response. See CASBACnetStack::BACnetConfirmedServiceChoice for more info. |
errorClass |
in | The error class of the error. See CASBACnetStack::BACnetErrorClass for more info. |
errorCode |
in | The error code of the error. See CASBACnetStack::BACnetErrorCode for more info. |
connectionString |
in | The connection string of the device that sent the message. |
connectionStringLength |
in | The number of bytes in the connection string. |
networkPortInstance |
in | The Network Port object instance the message was received on, or BACNET_NETWORK_PORT_DEFAULT. |
sourceNetwork |
in | The BACnet network the sender is on. Local network = 0. |
sourceAddress |
in | The Source address (SADR) of the device if the network is non-zero. |
sourceAddressLength |
in | The number of bytes in the source address. |
useObjectProperty |
in | A flag to notify the user if there is object property information supplied for this error (true) or not (false). |
objectType |
in | The BACnet object type for the BACnet object to which the error is a response. See CASBACnetStack::BACnetObjectType for more info. With objectInstance, this is one BACnet Object Identifier carried as two parameters. |
objectInstance |
in | The BACnet object instance for the BACnet object to which the error is a response. |
propertyIdentifier |
in | The BACnet property identifier to which the error is a response. See CASBACnetStack::BACnetPropertyIdentifier for more info. |
Registered with BACnetStack_RegisterHookError().
FPHookReject
Section titled “FPHookReject”typedef void(* FPHookReject)(const uint8_t originalInvokeId, const uint32_t rejectReason, const uint8_t *connectionString, const uint8_t connectionStringLength, const uint32_t networkPortInstance, const uint16_t sourceNetwork, const uint8_t *sourceAddress, const uint8_t sourceAddressLength);The HookReject function is a hook that a user implements and registers with the CAS BACnet Stack that gets called when a specific message is received, in this case, a Reject message.
This allows users to process the data from the Reject message.
A Reject is sent by a device in response to a confirmed service request where the message was rejected before processing for some reason.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
originalInvokeId |
in | The invokeId of the confirmed service request to which the reject is a response. |
rejectReason |
in | The reason for the reject. See CASBACnetStack::BACnetRejectReason for more info. |
connectionString |
in | The connection string of the device that sent the message. |
connectionStringLength |
in | The number of bytes in the connection string. |
networkPortInstance |
in | The Network Port object instance the message was received on, or BACNET_NETWORK_PORT_DEFAULT. |
sourceNetwork |
in | The BACnet network the sender is on. Local network = 0. |
sourceAddress |
in | The Source address (SADR) of the device if the network is non-zero. |
sourceAddressLength |
in | The number of bytes in the source address. |
Registered with BACnetStack_RegisterHookReject().
FPHookAbort
Section titled “FPHookAbort”typedef void(* FPHookAbort)(const uint8_t originalInvokeId, const bool sentByServer, const uint32_t abortReason, const uint8_t *connectionString, const uint8_t connectionStringLength, const uint32_t networkPortInstance, const uint16_t sourceNetwork, const uint8_t *sourceAddress, const uint8_t sourceAddressLength);The HookAbort function is a hook that a user implements and registers with the CAS BACnet Stack that gets called when a specific message is received, in this case, an Abort message.
This allows users to process the data from the Abort message.
An Abort is sent by a device in response to a confirmed service request where the processing started but was aborted for some reason.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
originalInvokeId |
in | The invokeId of the confirmed service request to which the abort is a response. |
sentByServer |
in | A flag that specifies if the abort was sent by a BACnet Server Device (true) or a BACnet Client Device (false). |
abortReason |
in | The reason for the abort. See CASBACnetStack::BACnetAbortReason for more info. |
connectionString |
in | The connection string of the device that sent the message. |
connectionStringLength |
in | The number of bytes in the connection string. |
networkPortInstance |
in | The Network Port object instance the message was received on, or BACNET_NETWORK_PORT_DEFAULT. |
sourceNetwork |
in | The BACnet network the sender is on. Local network = 0. |
sourceAddress |
in | The Source address (SADR) of the device if the network is non-zero. |
sourceAddressLength |
in | The number of bytes in the source address. |
Registered with BACnetStack_RegisterHookAbort().
FPHookSimpleAck
Section titled “FPHookSimpleAck”typedef void(* FPHookSimpleAck)(const uint8_t originalInvokeId, const uint32_t serverAckChoice, const uint8_t *connectionString, const uint8_t connectionStringLength, const uint32_t networkPortInstance, const uint16_t sourceNetwork, const uint8_t *sourceAddress, const uint8_t sourceAddressLength);The HookSimpleAck function is a hook that a user implements and registers with the CAS BACnet Stack that gets called when a specific message is received, in this case, a SimpleAck message.
This allows users to process the data from the SimpleAck message.
A SimpleAck is sent by a device to acknowledge the handling of a simple service, for example WriteProperty or SubscribeCOV.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
originalInvokeId |
in | The invokeId of the confirmed service request to which the simpleAck is a response. |
serverAckChoice |
in | The service to which the simpleAck is a response. See CASBACnetStack::BACnetConfirmedServiceChoice for more info. |
connectionString |
in | The connection string of the device that sent the message. |
connectionStringLength |
in | The number of bytes in the connection string. |
networkPortInstance |
in | The Network Port object instance the message was received on, or BACNET_NETWORK_PORT_DEFAULT. |
sourceNetwork |
in | The BACnet network the sender is on. Local network = 0. |
sourceAddress |
in | The Source address (SADR) of the device if the network is non-zero. |
sourceAddressLength |
in | The number of bytes in the source address. |
Registered with BACnetStack_RegisterHookSimpleAck().
FPHookTimeout
Section titled “FPHookTimeout”typedef void(* FPHookTimeout)(const uint8_t originalInvokeId, const uint8_t *connectionString, const uint8_t connectionStringLength, const uint32_t networkPortInstance, const uint16_t sourceNetwork, const uint8_t *sourceAddress, const uint8_t sourceAddressLength);The HookTimeout function is a hook that a user implements and registers with the CAS BACnet Stack that gets called when a confirmed service request was sent and has timed out.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
originalInvokeId |
in | The invokeId of the confirmed service request that timed out |
connectionString |
in | The connection string of the device that timed out. |
connectionStringLength |
in | The number of bytes in the connection string. |
networkPortInstance |
in | The Network Port object instance the message was sent on, or BACNET_NETWORK_PORT_DEFAULT. |
sourceNetwork |
in | The network of the device the request was sent to. Local network = 0. |
sourceAddress |
in | The address of that device on that network, if the network is non-zero. |
sourceAddressLength |
in | The number of bytes in sourceAddress. |
Registered with BACnetStack_RegisterHookTimeout().
FPCallbackSCCertificateSignRequest
Section titled “FPCallbackSCCertificateSignRequest”typedef void(* FPCallbackSCCertificateSignRequest)(const uint32_t procedureId, const uint8_t *csr, const uint32_t csrLength);NM-SCCM-A: called when a BACnetStack_SCCertificateReplaceOperational() procedure has read the target’s Certificate Signing Request (135-2024 cl. 19.8.3.2, the step in which the signing CA is asked for a new operational certificate built from the CSR).
The stack never holds the CA key: the host signs the CSR - now or later - and resumes the procedure with BACnetStack_SCCertificateProvideSignedCertificate(procedureId, …). The csr buffer is only valid for the duration of the call.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
procedureId |
in | The procedure that is waiting for the signed certificate. |
csr |
in | The Certificate Signing Request file content read from the target. |
csrLength |
in | The number of bytes in csr. |
Registered with BACnetStack_RegisterCallbackSCCertificateSignRequest().
FPHookSCCertificateProcedure
Section titled “FPHookSCCertificateProcedure”typedef void(* FPHookSCCertificateProcedure)(const uint32_t procedureId, const uint8_t procedure, const uint8_t step, const uint8_t status, const uint32_t errorClass, const uint32_t errorCode);NM-SCCM-A: progress and completion of a cl. 19.8.3 certificate procedure.
Fired after every step and once at the end. While a procedure owns a request, the generic HookSimpleAck / HookError / HookReject / HookAbort / HookTimeout do NOT fire for it - this hook reports each step instead.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
procedureId |
in | The procedure, as returned by the BACnetStack_SCCertificate* start function. |
procedure |
in | BACnetSCCertificateProcedure_AddIssuer (1), _ReplaceOperational (2) or _RemoveIssuer (3). |
step |
in | The BACnetSCCertificateProcedureStep that just completed or failed. |
status |
in | BACnetSCCertificateProcedureStatus: InProgress (0) once per completed step, Succeeded (1) for the final ReinitializeDevice step (in place of its InProgress), Failed (2) when a step failed and the procedure stopped. |
errorClass |
in | When Failed: the BACnet error class from an Error-PDU, or a BACnetSCCertificateProcedureFailure value (65536 and above) for a Reject, Abort, timeout or local failure. |
errorCode |
in | When Failed: the BACnet error code, or the reject / abort reason. 0 otherwise. |
Registered with BACnetStack_RegisterHookSCCertificateProcedure().
FPCallbackNetworkPortCommand
Section titled “FPCallbackNetworkPortCommand”typedef bool(* FPCallbackNetworkPortCommand)(const uint32_t deviceInstance, const uint32_t networkPortInstance, const uint32_t command, uint32_t *errorCode);The host’s part of a WriteProperty of a Network Port’s Command property.
The stack calls it for exactly two commands, after its own checks and before it answers the write:
- DISCARD_CHANGES (1), on every Network Port type. Called BEFORE the stack reverts the port. Return true once the host has reverted the file data it holds for this port (135-2024 cl. 12.56.100 / 12.56.101); the stack then reverts this port’s own pending changes. Return false to refuse: the write fails with errorCode and nothing changes.
- GENERATE_CSR_FILE (9), on a BACnet/SC port whose Changes_Pending is FALSE. Generate a new key pair and write the certificate signing request into the File object bound to Certificate_Signing_Request_File, then return true (Result(+), Command reads IDLE). Return false to refuse with errorCode.
No other command value reaches this callback. It runs synchronously inside the WriteProperty service.
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance that owns the Network Port object. |
networkPortInstance |
in | The Network Port object instance whose Command was written. |
command |
in | The BACnetNetworkPortCommand written: 1 (DISCARD_CHANGES) or 9 (GENERATE_CSR_FILE). |
errorCode |
out | Preset to success (84). On a false return, the BACnet error code to answer with. A bare CASBACnetStack::BACnetErrorCode value; the stack chooses the error class (see the API conventions). |
Returns
Section titled “Returns”True if the command was carried out (the write to Command succeeds); false to refuse it with *errorCode (WRITE_ACCESS_DENIED if no code is set), leaving the port unchanged.
Registered with BACnetStack_RegisterCallbackNetworkPortCommand().
FPCallbackValidateNetworkPortChanges
Section titled “FPCallbackValidateNetworkPortChanges”typedef bool(* FPCallbackValidateNetworkPortChanges)(const uint32_t deviceInstance, const uint32_t networkPortInstance, uint32_t *failedPropertyIdentifier, uint16_t *errorClass, uint16_t *errorCode);The host’s part of a VALIDATE_CHANGES written to a Network Port’s Command property (135-2024 cl. 12.56.16).
The stack first runs its own checks of the port’s pending values; only if they all pass does it call this callback, synchronously inside the WriteProperty service. Validate the values only the host can - on a BACnet/SC port, the operational certificate (cl. 12.56.100: CERTIFICATE_MALFORMED, UNKNOWN_KEY, CERTIFICATE_INVALID, CERTIFICATE_EXPIRED, all class SECURITY) - and change nothing: VALIDATE_CHANGES leaves Changes_Pending as it is.
Return true when the host’s validation passes. Return false with the three out-parameters filled when it fails; the stack records them in the port’s Command_Validation_Result (cl. 12.56.18) and the write still answers Result(+).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance that owns the Network Port object. |
networkPortInstance |
in | The Network Port object instance whose Command was written. |
failedPropertyIdentifier |
out | On a false return, the property that failed validation (the Property field). Preset to 4294967295 (no property): left at that value, the Property field is absent. |
errorClass |
out | On a false return, the BACnet error class (the Error field). Preset to PROPERTY (2). |
errorCode |
out | On a false return, the BACnet error code (the Error field). Paired with errorClass; the stack sends both as given. Preset to INVALID_CONFIGURATION_DATA (46). |
Returns
Section titled “Returns”True if the pending changes are valid; false to record the failure in Command_Validation_Result using *errorClass and *errorCode (PROPERTY / INVALID_CONFIGURATION_DATA if not set) and *failedPropertyIdentifier. The VALIDATE_CHANGES write itself succeeds either way.
Registered with BACnetStack_RegisterCallbackValidateNetworkPortChanges().
FPCallbackInitiateWebsocket
Section titled “FPCallbackInitiateWebsocket”typedef bool(* FPCallbackInitiateWebsocket)(const char *websocketUri, const uint32_t websocketUriLength);The CallbackInitiateWebsocket callback gets called when the CAS BACnet Stack needs to initialize a Websocket connection.
The function passes the websocketUri and length to the implementer that will create the socket connection and handle any security (i.e. TLS) required by the socket connection.
This callback is the application-layer boundary for websocket and TLS ownership. The stack decides when BACnet/SC protocol state requires a websocket connection, but the application is responsible for creating the websocket, binding it to a concrete library, and applying certificate or trust policy.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_DATA_LINK_LAYER_SC
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
websocketUri |
in | The URI of the websocket to connect to. |
websocketUriLength |
in | The length of the websockerUri string. |
Returns
Section titled “Returns”True if the connection will be attempted (its outcome is reported through BACnetStack_SetBACnetSCWebSocketStatus); false if it cannot be, which is a failure to establish the WebSocket (#3364).
Registered with BACnetStack_RegisterCallbackInitiateWebsocket().
FPCallbackDisconnectWebsocket
Section titled “FPCallbackDisconnectWebsocket”typedef void(* FPCallbackDisconnectWebsocket)(const char *websocketUri, const uint32_t websocketUriLength);The FPCallbackDisconnectWebsocket callback gets called when the CAS BACnet Stack needs to disconnect a Websocket connection.
The function passes the websocketUri and length to the implementer that will close and disconnect the socket connection.
This callback keeps websocket teardown in the application layer. The stack owns BACnet/SC connection state, but it does not own the concrete websocket library or transport runtime.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_DATA_LINK_LAYER_SC
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
websocketUri |
in | The URI of the websocket to disconnect. |
websocketUriLength |
in | The length of the websockerUri string. |
Registered with BACnetStack_RegisterCallbackDisconnectWebsocket().
FPCallbackSCStartListening
Section titled “FPCallbackSCStartListening”typedef bool(* FPCallbackSCStartListening)(const char *websocketUri, const uint32_t websocketUriLength);The FPCallbackSCStartListening callback gets called when the CAS BACnet Stack needs to start listening for inbound BACnet/SC websocket connections.
This callback is the application-layer boundary for inbound listener ownership. The stack decides when BACnet/SC hub-function or direct-connect accept mode should be active, but the application is responsible for binding and running the actual listener, including TLS configuration and certificate policy.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_DATA_LINK_LAYER_SC
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
websocketUri |
in | The URI to listen on. |
websocketUriLength |
in | The length of the websocketUri string. |
Returns
Section titled “Returns”True if the user successfully started listening, otherwise false.
Registered with BACnetStack_RegisterCallbackSCStartListening().
FPCallbackSCStopListening
Section titled “FPCallbackSCStopListening”typedef void(* FPCallbackSCStopListening)(const char *websocketUri, const uint32_t websocketUriLength);The FPCallbackSCStopListening callback gets called when the CAS BACnet Stack needs to stop listening for inbound BACnet/SC websocket connections.
This callback keeps listener shutdown in the application layer so the stack remains independent from any specific websocket or TLS implementation.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_DATA_LINK_LAYER_SC
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
websocketUri |
in | The URI to stop listening on. |
websocketUriLength |
in | The length of the websocketUri string. |
Registered with BACnetStack_RegisterCallbackSCStopListening().
FPCallbackBACnetSCStateChange
Section titled “FPCallbackBACnetSCStateChange”typedef void(* FPCallbackBACnetSCStateChange)(const uint32_t deviceInstance, const uint32_t networkPortInstance, const uint8_t stateMachine, const uint8_t previousState, const uint8_t newState, const char *websocketUri, const uint32_t websocketUriLength);The FPCallbackBACnetSCStateChange callback gets called when the CAS BACnet Stack changes an observable BACnet/SC state machine value.
This callback is intended for diagnostics only. The stack invokes it after updating its own internal state.
Note: This callback can only be used if the CAS BACnet Stack has been compiled with STACK_OPTION_DATA_LINK_LAYER_SC
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The BACnet device instance associated with the BACnet/SC Network Port, or 0 when not known. |
networkPortInstance |
in | The BACnet/SC Network Port object instance associated with the transition, or 0 when not known. Once a BACnet/SC Network Port is tracked, only a websocket status reported by the host and the stack’s own direct-connect websocket transitions carry the two instances; see BACnetStack_RegisterCallbackBACnetSCStateChange(). |
stateMachine |
in | The BACnet/SC state machine identifier: 0 = hub connector state, 1 = hub connection status, 2 = initiating peer connection state, 3 = websocket status. |
previousState |
in | The previous state value. |
newState |
in | The new state value. |
websocketUri |
in | The websocket URI associated with the transition, or NULL when not applicable. |
websocketUriLength |
in | The websocket URI length. |
Registered with BACnetStack_RegisterCallbackBACnetSCStateChange().