Skip to content
Version 6.1.0
Contact Us

BACnetStack_RegisterCallbackDeviceCommunicationControl

void BACnetStack_RegisterCallbackDeviceCommunicationControl(
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));

Registers the callback the stack calls to validate a DeviceCommunicationControl request before applying it.

IF YOU DO NOT REGISTER IT, EVERY REQUEST IS REFUSED. With this callback absent the stack answers every DeviceCommunicationControl with Error(security, passwordFailure) instead of applying it unauthenticated. The stack performs no password check of its own: register this callback to accept requests, and check the password in it.

errorCode is preset to passwordFailure. On a false return the stack sends Error(services, optionalFunctionalityNotSupported) or Error(services, serviceRequestDenied) when you set one of those two codes, and Error(security, passwordFailure) for any other value, or when you leave it unset.

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.

See also: CASBACnetStack::FPCallbackDeviceCommunicationControl

BACnet reference: ANSI/ASHRAE 135-2024 clause 16.1 (DeviceCommunicationControl Service).

Parameter Direction Description
FPCallbackDeviceCommunicationControl in The function pointer for the CallbackDeviceCommunicationControl function. See CASBACnetStack::FPCallbackDeviceCommunicationControl for more info.

FPCallbackDeviceCommunicationControl

Topic: Service callbacks. Declared in CASBACnetStackDLL.h.