Door Control API
API that configures whether the device is set as entrance/exit of the door, how the device will control the door, and the APB settings.
BS2_GetDoor
Retrieves selected doors.
BS2_GetAllDoor
Retrieves all doors.
BS2_GetDoorStatus
Retrieves the status of selected doors.
BS2_GetAllDoorStatus
Retrieves the status of all doors.
BS2_SetDoor
Configures a door. 2 devices connected through TCP/IP cannot be allocated to 1 logical door.
BS2_SetDoorAlarm
Configures the alarm status of the door.
BS2_RemoveDoor
Removes selected doors.
BS2_RemoveAllDoor
Removes all doors.
BS2_ReleaseDoor
Releases the lock/unlock flag of the door status. This initializes the priorities set to the door.
BS2_LockDoor
Configures the priority of when the door gets locked. The lock priority must be higher than the unlock to lock the door.
BS2_UnlockDoor
Configures the priority of when the door gets unlocked. The unlock priority must be higher than the lock to unlock the door.
BS2_TimedLockDoor
+ v2.9.12 Locks the door for a specified time, and when the time elapses (timeout), the door restores to its previous state (normalize).
BS2_TimedUnlockDoor
+ v2.9.12 Unlocks the door for a specified time, and when the time elapses (timeout), the door restores to its previous state (normalize).
Structure
BS2DoorRelay
typedef struct {
uint32_t deviceID;
uint8_t port;
uint8_t reserved[3];
} BS2DoorRelay;
-
deviceIDDevice ID.
-
portRelay port number.
-
reservedReserved space.
BS2DoorSensor
typedef struct {
uint32_t deviceID;
uint8_t port;
uint8_t switchType;
uint8_t apbUseDoorSensor;
uint8_t reserved[1];
} BS2DoorSensor ;
-
deviceIDDevice ID.
-
portInput port number.
-
switchTypeType of the switch.
Value Description 0 Normally open 1 Normally closed -
apbUseDoorSensorDecides whether to use a door sensor for APB.
-
*reserved`
Reserved space.
BS2ExitButton
typedef struct {
uint32_t deviceID;
uint8_t port;
uint8_t switchType;
uint8_t reserved[2];
} BS2ExitButton ;
-
deviceIDDevice ID.
-
portInput port number.
-
switchTypeType of the switch.
Value Description 0 Normally open 1 Normally closed -
reservedReserved space.
BS2DoorStatus
typedef struct {
uint32_t id;
uint8_t opened;
uint8_t unlocked;
uint8_t heldOpened;
uint8_t unlockFlags;
uint8_t lockFlags;
uint8_t alarmFlags;
uint8_t reserved[2];
uint32_t lastOpenTime;
} BS2DoorStatus;
-
idDoor ID.
-
openedDetermines whether the door is opened.
-
unlockedDetermines whether the door is unlocked.
-
heldOpenedDetermines whether the door's status is held open.
-
unlockFlagsThe priority of when the door gets unlocked, which will not operate if the priority is lower than the lock's priority. For example, if the door is locked with the operator priority, all users entry will not be allowed. The unlockFlags and lockFlags cannot have the same priority besides the default priority NONE.
Value Description Priority 0 None Normal 1 Scheduled High 4 Operator Very high 2 Emergency Highest -
lockFlagsThe priority of when the door gets locked, which will not operate if the priority is lower than the unlock's priority.
Value Description Priority 0 None Normal 1 Scheduled High 4 Operator Very high 2 Emergency Highest -
alarmFlagsStatus of the door alarm.
Value Description 0 No alarm 1 Forced open 4 Held open 2 APB violation 8 Lock override 16 Fire alarm -
reservedReserved space.
-
lastOpenTimeThe last time of when the door was open.
BS2Door
typedef struct {
uint32_t doorID;
char name[BS2_MAX_DOOR_NAME_LEN];
uint32_t entryDeviceID;
uint32_t exitDeviceID;
BS2DoorRelay relay;
BS2DoorSensor sensor;
BS2ExitButton button;
uint32_t autoLockTimeout;
uint32_t heldOpenTimeout;
uint8_t instantLock;
uint8_t unlockFlags;
uint8_t lockFlags;
uint8_t unconditionalLock;
BS2Action forcedOpenAlarm[BS2_MAX_FORCED_OPEN_ALARM_ACTION];
BS2Action heldOpenAlarm[BS2_MAX_HELD_OPEN_ALARM_ACTION];
uint32_t dualAuthScheduleID;
uint8_t dualAuthDevice;
uint8_t dualAuthApprovalType;
uint16_t extendedAutoLockTimeout;
uint32_t dualAuthTimeout;
uint8_t numDualAuthApprovalGroups;
uint8_t unused[2];
uint8_t reserved2[1];
uint32_t dualAuthApprovalGroupID[BS2_MAX_DUAL_AUTH_APPROVAL_GROUP];
BS2AntiPassbackZone apbZone;
} BS2Door;
-
doorIDDoor ID. For V1 devices, ID should be defined less than 65535.
-
nameName of the door that will be displayed on the BioStar application. For V1 devices, name can't be defined.
-
entryDeviceIDEntry device ID.
-
exitDeviceIDExit device ID.
-
relayDoor relay.
-
sensorSensor that detects the open/closed status of the door.
-
buttonExit button.
-
autoLockTimeoutTime for the door to lock after it has been opened. The unit is seconds.
-
heldOpenTimeoutTime for the door to be determined as held open. The unit is seconds.
-
instantLockDecides whether to immediately lock the door when the sensor detects the door as closed.
-
unlockFlagsThe priority of when the door gets unlocked, which will not operate if the priority is lower than the lock's priority. For example, if the door is locked with the operator priority, all users entry will not be allowed. The unlockFlags and lockFlags cannot have the same priority besides the default priority NONE.
Value Description Priority 0 None Normal 1 Scheduled High 4 Operator Very high 2 Emergency Highest -
lockFlagsThe priority of when the door gets locked, which will not operate if the priority is lower than the unlock's priority.
Value Description Priority 0 None Normal 1 Scheduled High 4 Operator Very high 2 Emergency Highest -
unconditionalLockFlag that decides whether to lock the door after autoLock timeout.
Value Description 0 Locks the door only when the door is closed after the autoLockTimeout. 1 Locks the door regardless if the door is opened or closed. -
forcedOpenAlarmAlarm that gets triggered when the door is forced open, which can be configured up to 5 alarms.
-
heldOpenAlarmAlarm that gets triggered when the door is held open, which can be configured up to 5 alarms.
-
dualAuthScheduleIDSchedule for the dual authentication. Set the value as 0 for disable, 1 for enable, or set a schedule ID.
-
dualAuthDeviceDecides which device should perform a dual authentication.
Value Description 0 None 1 Only on entry device 2 Only on exit device 3 Both -
dualAuthApprovalTypeDecides whether to distinguish if the user belongs to an access group having authority when accessing the door .
Value Description 0 None 1 Check the last user's authority -
extendedAutoLockTimeout+ v2.9.12 Sets the extended access granted time in seconds. The default value is 10 seconds.
-
dualAuthTimeoutAfter the first user completes authentication, this is the time to wait until the second user attempts authentication. (Unit: seconds)
-
numDualAuthApprovalGroupsTotal number of groups with dual access authorization.
-
unusedReserved space.
-
reserved2Reserved space.
-
dualAuthApprovalGroupIDList of access groups having dual authentication authority, which can be configured up to 16 access groups.
-
apbZoneConfigures Anti Passback on the door. The Anti Passback zone ID and door ID is equivalent. Refer zone_control_apifor further information.