BACnetStack_RegisterCallbackDeleteObject
void BACnetStack_RegisterCallbackDeleteObject( bool (*FPCallbackDeleteObject)(const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance));Registers the callback the stack calls to let the host release an object’s own resources.
It fires for a DeleteObject request AND as the rollback when a CreateObject request fails after the object was already created - so it can arrive for an object your CallbackCreateObject only just accepted.
THE RETURN MEANS DIFFERENT THINGS AT THE TWO SITES. On the DeleteObject service, false declines the request: the stack answers Error(object, objectDeletionNotPermitted) and the object is NOT deleted. On the CreateObject rollback path the return is only logged and the stack erases the object regardless, so a rollback you cannot complete leaves host-side resources orphaned with no further notice. There is no error-code out-parameter.
The stack has already rejected unknown objects (Error(object, unknownObject)) and non-deletable ones (Error(object, objectDeletionNotPermitted)) before calling you.
Registering has no effect if object creation was not compiled (STACK_OPTION_DM_OCD_OBJECT_CREATION_AND_DELETION): the pointer is discarded and set to NULL.
See also: CASBACnetStack::FPCallbackDeleteObject
BACnet reference: ANSI/ASHRAE 135-2024 clause 15.4 (DeleteObject Service).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
FPCallbackDeleteObject |
in | The function pointer for the CallbackDeleteObject function. See CASBACnetStack::FPCallbackDeleteObject for more info. |
Callback type
Section titled “Callback type”Topic: Service callbacks. Declared in CASBACnetStackDLL.h.