-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathevents.tbh
100 lines (82 loc) · 2.16 KB
/
events.tbh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
enum EN_EVENT_SOURCE
EN_ES_UNKNOWN,
EN_ES_READER,
EN_ES_INPUT,
EN_ES_RELAY,
EN_ES_STATE,
EN_ES_ACL,
EN_ES_AGG,
EN_ES_DEVICE,
EN_ES_STATE_STOR,
EN_ES_DOOR,
EN_ES_TURNSTYLE,
EN_ES_APB
end enum
enum EN_EVENT_EVENT
EN_EE_UNKNOWN,
EN_EE_OPEN,
EN_EE_CLOSE,
EN_EE_FUNCTION,
EN_EE_PIN_REQUEST,
EN_EE_PIN_UNREQUEST,
EN_EE_CARD_READED,
EN_EE_SET
EN_EE_UNSET,
EN_EE_DENY,
EN_EE_GRANTED,
EN_EE_POWERON,
EN_EE_RESTORED_STATE,
EN_EE_DOOR_OPEN,
EN_EE_DOOR_CLOSE,
EN_EE_TURNSTYLE_TURNIN,
EN_EE_TURNSTYLE_TURNOUT
EN_EE_APBREQUEST
end enum
enum EN_EVENT_APB_CMD
EN_EE_REQUEST = 0,
EN_EE_CHANGEAREA = 1
end enum
enum EN_EVENT_STATUS
EN_ET_EMPTY = 0,
EN_ET_ACTIVE,
EN_ET_SENDED
end enum
#define EVENTS_ACE_SENDED_COUNT 5
#define EVENTS_ACE_TIMEOUT 100
#define EVENTS_ACE_COUNT 200
type EVENT_ACE_TYPE
status as EN_EVENT_STATUS
id as dword
time as string(17)
source as EN_EVENT_SOURCE
evnt as EN_EVENT_EVENT
addition as string(12)
extra as string(16)
end type
#define EVENTS_CR_SENDED_COUNT 5
#define EVENTS_CR_TIMEOUT 100
#define EVENTS_CR_COUNT 200
type EVENT_CR_TYPE
status as EN_EVENT_STATUS
id as dword
time as string(17)
direction as byte
card as string(16)
end type
type EVENT_SENDED
index as integer
timeout as word
id_agg as long
end type
#define EVENT_TYPE_STANDART 0
#define EVENT_TYPE_DIRECT 1
#define EVENT_TYPE_DYNAMIC 2
#define EVENTS_PROCEDURE_TYPE EVENT_TYPE_DYNAMIC' 0 - Standart (table store before sending to AGG), 1 - Direct (AGG direct), 2 - Dynamic (table store for no AGG connection and direct to AGG for AGG connection establish)
declare events_enable(12) as boolean
declare sub event_init()
declare sub event_add(source as EN_EVENT_SOURCE, evnt as EN_EVENT_EVENT, addition as string(12), extra as string(16))
declare sub event_time(card_id as string(16), direction as EN_TA_DIRECTION_TYPE)
declare sub event_apb(cmd as EN_EVENT_APB_CMD, card as string(16), reader as byte, date as string(17))
declare sub event_timer()
declare sub event_confirm_agg(id as long)
declare function event_sr_to_ta(direction as EN_SR_DIRECTION_TYPE) as EN_TA_DIRECTION_TYPE