BACnetStack_RegisterHookError
void BACnetStack_RegisterHookError( 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));Registers a hook the stack calls when an error is reported for a confirmed request this client sent.
Fires from inside BACnetStack_Tick().
TWO different situations reach this one hook, told apart by useObjectProperty:
- A BACnet Error PDU. useObjectProperty is ALWAYS false and the object type, object instance and property identifier are ALWAYS 0, whatever the service was - do not read them.
- A per-property access error inside a ReadPropertyMultiple ComplexAck. useObjectProperty is true and the three fields identify the property that failed. This fires ONCE PER FAILED PROPERTY, so one invoke-id can produce many calls, and the surrounding ACK may still have succeeded for the other properties.
The stack has already removed the request from its pending-request table before calling the hook, so no timeout will follow for that invoke-id. The hook returns void.
See also: CASBACnetStack::FPHookError
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
FPHookError |
in | The function pointer for the HookError function. See CASBACnetStack::FPHookError for more info. |
Callback type
Section titled “Callback type”Topic: Client response hooks. Declared in CASBACnetStackDLL.h.