~~NOTOC~~
[[zone_control_api]] > [[BS2_SetGlobalAPBViolationByDoorOpenHandler]]
----
===== BS2_SetGlobalAPBViolationByDoorOpenHandler =====
[+ 2.7.0] Registers callback function for global determination when an APB violation alarm occurs.\\
Generally, Global APB API [[BS2_SetCheckGlobalAPBViolationHandler]] determines access with the user authentication only. \\
On the other hand, Global APB By Door Open has two steps; i) User authentication ii) Actual access based on the door sensor. \\
First, [[zone_control_api#OnCheckGlobalAPBViolationByDoorOpen]] is called after a user authentication. \\
Second, [[zone_control_api#OnUpdateGlobalAPBViolationByDoorOpen]] is called after checking the door sensor to figure out if the user actually accessed the door. \\
The final status is updated through [[zone_control_api#OnUpdateGlobalAPBViolationByDoorOpen]]
\\
==== Declaration ====
#include "BS_API.h"
int BS2_SetGlobalAPBViolationByDoorOpenHandler(void* context, OnCheckGlobalAPBViolationByDoorOpen ptrCheck, OnUpdateGlobalAPBViolationByDoorOpen ptrUpdate);
[[zone_control_api#OnCheckGlobalAPBViolationByDoorOpen|See OnCheckGlobalAPBViolationByDoorOpen Callback Function]] \\
[[zone_control_api#OnUpdateGlobalAPBViolationByDoorOpen|See OnUpdateGlobalAPBViolationByDoorOpen Callback Function]]
==== Parameter ====
* [In] ''//context//'' : Context
* [In] ''//ptrCheck//'' : Callback function called for global determination when Anti Passback alarm occurs
* [In] ''//ptrUpdate//'' : Callback function called for updating status of the authenticated user.
**NOTE**\\
To use Global Anti Passback service, set [[configuration api#BS2AuthConfig|BS2AuthConfig]] useGlobalAPB = true, \\
and [[door_control_api#BS2DoorSensor|BS2DoorSensor]] apbUseDoorSensor = true.
==== Return Value ====
If successfully done, ''BS_SDK_SUCCESS'' will be returned. \\
If there is an error, the corresponding error code will be returned.
==== See Also ====
[[BS2_CheckGlobalAPBViolationByDoorOpen]]