@blueid/access-proto 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/BlueLock.proto ADDED
@@ -0,0 +1,35 @@
1
+ syntax = "proto2";
2
+
3
+ import "BlueCore.proto";
4
+
5
+ import "nanopb.proto";
6
+
7
+ enum BlueLockState {
8
+ UnknownLockState = 1;
9
+ Locked = 2;
10
+ Unlocked = 3;
11
+ Jammed = 4;
12
+ }
13
+
14
+ message BlueLockConfig {
15
+ // Schedules for when the lock opens automatically
16
+ repeated BlueLocalTimeSchedule openSchedules = 1 [ (nanopb).max_count = 4 ];
17
+
18
+ // If set to true then the lock opens by schedule only after it was first
19
+ // opened by an authenticated user and is within any of the open schedules
20
+ required bool openScheduleByUser = 2 [ default = false ];
21
+
22
+ // Days of year (1-366) the open schedule is ignored (ie vacation days)
23
+ repeated uint32 closedDays = 20 [ (nanopb).max_count = 18 ];
24
+
25
+ // Default time in seconds to keep the lock open
26
+ required uint32 defaultOpenTimeSec = 21 [ default = 5 ];
27
+
28
+ // Extended time in seconds to keep the lock open
29
+ required uint32 extendedOpenTimeSec = 22 [ default = 3600 ];
30
+ }
31
+
32
+ message BlueLockStatus {
33
+ required BlueLockState state = 1;
34
+ required uint32 openings = 2;
35
+ }
package/BlueSDK.proto ADDED
@@ -0,0 +1,56 @@
1
+ syntax = "proto2";
2
+
3
+ // import "nanopb.proto";
4
+
5
+ import "BlueCore.proto";
6
+
7
+ ///////////////////////////////////////////////////////////////////////
8
+ // I18n
9
+ ///////////////////////////////////////////////////////////////////////
10
+
11
+ message BlueI18n {
12
+ required string nfcWaitMessage = 1 [ default = "Waiting for transponder" ];
13
+ required string nfcOssSuccessReadConfigurationMessage = 2
14
+ [ default = "Configuration read successfully" ];
15
+ required string nfcOssSuccessUpdateConfigurationMessage = 3
16
+ [ default = "Configuration successfully updated" ];
17
+ required string nfcOssSuccessClearEventsMessage = 4
18
+ [ default = "Events successfully cleared" ];
19
+ required string nfcOssSuccessIsProvisionedMessage = 5
20
+ [ default = "Is already provisioned" ];
21
+ required string nfcOssSuccessProvisionMessage = 6
22
+ [ default = "Successfully provisioned" ];
23
+ required string nfcOssSuccessUnprovisionMessage = 7
24
+ [ default = "Successfully unprovisioned" ];
25
+ required string nfcOssSuccessFormatMessage = 8
26
+ [ default = "Transponder was successfully formatted" ];
27
+ }
28
+
29
+ ///////////////////////////////////////////////////////////////////////
30
+ // Device
31
+ ///////////////////////////////////////////////////////////////////////
32
+
33
+ enum BlueDeviceType {
34
+ BluetoothDevice = 1;
35
+ UWBDevice = 2;
36
+ }
37
+
38
+ message BlueDeviceDetailsBluetooth {
39
+ required int32 rssi = 1;
40
+ required int32 txPower = 2;
41
+ required bool isIBeacon = 3;
42
+ }
43
+
44
+ message BlueDeviceDetailsUWB { required bool notUsed = 1; }
45
+
46
+ message BlueDeviceInfo {
47
+ required BlueDeviceType deviceType = 1;
48
+ required string deviceId = 2;
49
+ required float distanceMeters = 3;
50
+ optional BlueBleManufacturerInfo manufacturerInfo = 4;
51
+
52
+ oneof details {
53
+ BlueDeviceDetailsBluetooth bluetooth = 5;
54
+ BlueDeviceDetailsUWB uwb = 6;
55
+ }
56
+ }
@@ -0,0 +1,278 @@
1
+ syntax = "proto2";
2
+
3
+ import "BlueCore.proto";
4
+ import "BlueLock.proto";
5
+
6
+ import "nanopb.proto";
7
+
8
+ ///////////////////////////////////////////////////////////////////////
9
+ // System types
10
+ ///////////////////////////////////////////////////////////////////////
11
+
12
+ message BlueTimeOffsetPeriod {
13
+ // UTC-epoch when this shift occurs
14
+ required uint32 epoch = 1;
15
+ // The time offset in minutes, negative or positive
16
+ required int32 offset = 2;
17
+ }
18
+
19
+ message BlueBaseConfig {
20
+ // The time offsets that get shifted automatically
21
+ repeated BlueTimeOffsetPeriod timeOffsetPeriods = 1
22
+ [ (nanopb).max_count = 12 ];
23
+
24
+ // If enabled this will check the system-status every 24-hours and
25
+ // react accordingly ie like when battery is running low opening the lock
26
+ // and logging accordingly etc
27
+ required bool autoCheckSystemStatus = 2 [ default = false ];
28
+ }
29
+
30
+ message BlueBleConfig {
31
+ // Whether ble is enabled or not
32
+ required bool isAdvertising = 1 [ default = true ];
33
+
34
+ // Optional schedule on when ble advertising is enabled, if none
35
+ // set then ble is always on when enabled
36
+ repeated BlueLocalTimeSchedule advertisingSchedules = 2
37
+ [ (nanopb).max_count = 8 ];
38
+
39
+ // Index of advertising schedules (starting at zero) where it should
40
+ // use the max power level available for broader reach
41
+ repeated uint32 maxPowerAdvertisingSchedulesIndices = 3
42
+ [ (nanopb).max_count = 4 ];
43
+
44
+ // The desired advertising interval in ms
45
+ required uint32 advertisingIntervalMs = 4 [ default = 500 ];
46
+
47
+ // The maximal connection timeout per connection in milliseconds
48
+ required uint32 maxConnectionTimeoutMs = 5 [ default = 3000 ];
49
+
50
+ // The actual tx power level used for bluetooth from (0 - lowest) to 7
51
+ // (highest)
52
+ required uint32 txPowerLevel = 6 [ default = 3 ];
53
+
54
+ // The advertised tx power level at 1 meter in decibel (-XX - +XX)
55
+ required int32 advertisedTxPower1Meter = 7 [ default = -77 ];
56
+
57
+ // If set then advertises as IBeacon otherwise uses regular advertising
58
+ required bool isIBeaconAdvertisement = 8;
59
+ }
60
+
61
+ enum BlueOnlineMode {
62
+ // Offline mode
63
+ OfflineMode = 0;
64
+ // Wifi is manually re-connected whenever required
65
+ ManualWifi = 1;
66
+ // Wifi is always connected and re-connects automatically
67
+ AlwaysOnWifi = 2;
68
+ // A LAN connection is available that shall be used
69
+ UseLan = 3;
70
+ }
71
+
72
+ message BlueOnlineConfig {
73
+ // The online mode
74
+ required BlueOnlineMode mode = 1 [ default = OfflineMode ];
75
+
76
+ // Schedules when it should go online for updating. Only takes effect if
77
+ // online mode is set to manual wifi. The end time is not used.
78
+ repeated BlueLocalTimeSchedule connectSchedules = 2
79
+ [ (nanopb).max_count = 4 ];
80
+
81
+ // The SSID of the wifi network
82
+ required string wifiSSID = 3 [ (nanopb).max_length = 32 ];
83
+
84
+ // The wifi password
85
+ required string wifiPassword = 4 [ (nanopb).max_length = 32 ];
86
+
87
+ // Default timeout for online connections
88
+ required uint32 timeoutSec = 5 [ default = 30 ];
89
+ }
90
+
91
+ message BlueAccessConfig {
92
+ // The device's unique access id
93
+ required uint32 id = 1 [ default = 1 ];
94
+
95
+ // The site id bound to this device
96
+ required uint32 siteId = 2 [ default = 1 ];
97
+
98
+ // The access groups this device is part of
99
+ repeated uint32 groupIds = 3 [ (nanopb).max_count = 16 ];
100
+ }
101
+
102
+ message BlueOssConfig {
103
+ //
104
+ // -- Oss SecureId --
105
+ //
106
+
107
+ // The mifare aes-key for reading the oss secure id application, default is
108
+ // the oss sid demo key
109
+ required bytes sidMifareAesKey = 1 [
110
+ (nanopb).max_size = 16,
111
+ (nanopb).fixed_length = true,
112
+ default = "\xFF\xEE\xDD\xCC\xBB\xAA\x99\x88\x77\x66\x55\x44\x33\x22\x11\x00"
113
+ ];
114
+
115
+ // The mifare application id for the oss secure id application, default is the
116
+ // oss sid default aid. A value of 0 disables Oss Sid Mifare support.
117
+ required uint32 sidMifareAid = 2 [ default = 16076801 ];
118
+
119
+ //
120
+ // -- Oss Offline --
121
+ //
122
+
123
+ // If set the system will try to connect online to refresh the presented oss
124
+ // offline card if required as well as it will try to get and put the latest
125
+ // blacklist on the card
126
+ required bool soUpdater = 3 [ default = false ];
127
+
128
+ // If set the system will try to connect online if there are any events on a
129
+ // presented card and transfer all events online
130
+ required bool soPushEvents = 4 [ default = false ];
131
+
132
+ // If set the system will transfer pending events to an offline card
133
+ required bool soWritePendingEvents = 5 [ default = true ];
134
+
135
+ // If set the system will update from the blacklist of an offline card
136
+ required bool soUpdateFromBlacklist = 6 [ default = true ];
137
+
138
+ // The mifare aes-key for reading/writing the oss offline application, default
139
+ // is the oss so demo key
140
+ required bytes soMifareAesKey = 7 [
141
+ (nanopb).max_size = 16,
142
+ (nanopb).fixed_length = true,
143
+ default = "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
144
+ ];
145
+
146
+ // The mifare application id for the oss offline application, default is the
147
+ // oss so default aid. A value of 0 disables Oss So Mifare support.
148
+ required uint32 soMifareAid = 8 [ default = 16076800 ];
149
+ }
150
+
151
+ message BlueSystemConfig {
152
+ required uint32 version = 1;
153
+ // -- Base
154
+ required BlueBaseConfig base = 2;
155
+ required BlueBleConfig ble = 3;
156
+ required BlueOnlineConfig online = 4;
157
+ required BlueAccessConfig access = 5;
158
+ required BlueOssConfig oss = 6;
159
+ // -- Custom
160
+ optional BlueLockConfig lock = 7;
161
+ }
162
+
163
+ message BlueSystemTimeUnix { required uint32 epoch = 1; }
164
+
165
+ message BlueSystemUpdate {
166
+ optional BlueSystemConfig config = 1;
167
+ optional BlueSystemTimeUnix timeUnix = 2;
168
+ }
169
+
170
+ message BlueSystemSettings {
171
+ required uint32 blacklistMaxEntriesCount = 1 [ default = 0 ];
172
+ required uint32 blacklistEntriesCount = 2 [ default = 0 ];
173
+
174
+ required uint32 eventLogMaxEntriesCount = 3 [ default = 0 ];
175
+ required uint32 eventLogEntriesCount = 4 [ default = 0 ];
176
+ required uint32 eventLogSequenceId = 5 [ default = 0 ];
177
+ required uint32 eventLogIndex = 6 [ default = 0 ];
178
+
179
+ required uint32 systemLogMaxEntriesCount = 7 [ default = 0 ];
180
+ required uint32 systemLogEntriesCount = 8 [ default = 0 ];
181
+ required uint32 systemLogSequenceId = 9 [ default = 0 ];
182
+ required uint32 systemLogIndex = 10 [ default = 0 ];
183
+
184
+ required bool timeWasSet = 11;
185
+
186
+ required bool isBatteryLow = 12;
187
+ }
188
+
189
+ message BlueSystemProvisioning {
190
+ required BlueHardwareType hardwareType = 1 [ default = TestHardware ];
191
+ // Unique id generated by blueid which identitifies this device (default set
192
+ // from BlueSharedDemoKeys)
193
+ required string deviceId = 2 [ (nanopb).max_length = 8 ];
194
+ // Serial-number which is vendor specific stored as hex
195
+ required string serialNumber = 3
196
+ [ (nanopb).max_length = 20, default = "00000000000000000000" ];
197
+ // Private key used for signing to proof authenticity of this device (default
198
+ // set from BlueSharedDemoKeys)
199
+ required bytes terminalPrivateKey = 4 [ (nanopb).max_size = 160 ];
200
+ // Public key used for verifying signatures being valid on this device
201
+ // (default set from BlueSharedDemoKeys)
202
+ required bytes signaturePublicKey = 5 [ (nanopb).max_size = 100 ];
203
+ }
204
+
205
+ message BlueSystemStatus {
206
+ required uint32 configVersion = 1;
207
+ required string deviceId = 2 [ (nanopb).max_length = 8 ];
208
+ required string serialNumber = 3 [ (nanopb).max_length = 20 ];
209
+ required BlueHardwareType hardwareType = 4;
210
+ required BlueBatteryLevel batteryLevel = 5;
211
+ required uint32 applicationVersion = 6;
212
+ required BlueLocalTimestamp localTime = 7;
213
+ required BlueSystemSettings settings = 8;
214
+ required uint32 blacklistEntriesCount = 9;
215
+ required uint32 eventLogEntriesCount = 10;
216
+ required uint32 eventLogSequenceId = 11;
217
+ required uint32 systemLogEntriesCount = 12;
218
+ required uint32 systemLogSequenceId = 13;
219
+
220
+ // -- Custom
221
+ optional BlueLockStatus lock = 14;
222
+ }
223
+
224
+ ///////////////////////////////////////////////////////////////////////
225
+ // System Log
226
+ ///////////////////////////////////////////////////////////////////////
227
+
228
+ message BlueSystemLogQuery {
229
+ required uint32 maxCount = 1;
230
+
231
+ oneof start {
232
+ uint32 sequenceId = 2;
233
+ bool fromHead = 3; // false = starts from tail
234
+ }
235
+ }
236
+
237
+ message BlueSystemLogEntry {
238
+ required uint32 sequenceId = 1;
239
+
240
+ required BlueLocalTimestamp time = 2;
241
+
242
+ required uint32 severity = 3;
243
+
244
+ required uint32 line = 4;
245
+
246
+ required string file = 5 [ (nanopb).max_length = 20 ];
247
+
248
+ required string message = 6 [ (nanopb).max_length = 94 ];
249
+ }
250
+
251
+ message BlueSystemLogResult {
252
+ repeated BlueSystemLogEntry entries = 1 [ (nanopb).max_count = 10 ];
253
+ }
254
+
255
+ ///////////////////////////////////////////////////////////////////////
256
+ // Event Log
257
+ ///////////////////////////////////////////////////////////////////////
258
+
259
+ message BlueEventLogQuery {
260
+ required uint32 maxCount = 1;
261
+
262
+ oneof start {
263
+ uint32 sequenceId = 2;
264
+ bool fromHead = 3; // false = starts from tail
265
+ }
266
+ }
267
+
268
+ message BlueEventLogResult {
269
+ repeated BlueEvent events = 1 [ (nanopb).max_count = 50 ];
270
+ }
271
+
272
+ ///////////////////////////////////////////////////////////////////////
273
+ // Blacklist
274
+ ///////////////////////////////////////////////////////////////////////
275
+
276
+ message BlueBlacklistEntries {
277
+ repeated BlueBlacklistEntry entries = 1 [ (nanopb).max_count = 75 ];
278
+ }