@blueid/access-capacitor 0.98.0 → 0.100.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/dist/esm/BlueCore_pb.d.ts +28 -7
- package/dist/esm/BlueCore_pb.js +25 -3
- package/dist/esm/BlueCore_pb.js.map +1 -1
- package/dist/plugin.cjs.js +26 -3
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +26 -3
- package/dist/plugin.js.map +1 -1
- package/ios/CBlueIDAccess.xcframework/Info.plist +5 -5
- package/ios/CBlueIDAccess.xcframework/ios-arm64/Headers/core/BlueCore.pb.h +29 -15
- package/ios/CBlueIDAccess.xcframework/ios-arm64/Headers/core/oss/BlueOss.h +1 -1
- package/ios/CBlueIDAccess.xcframework/ios-arm64/libCBlueIDAccess.a +0 -0
- package/ios/CBlueIDAccess.xcframework/ios-arm64_x86_64-simulator/Headers/core/BlueCore.pb.h +29 -15
- package/ios/CBlueIDAccess.xcframework/ios-arm64_x86_64-simulator/Headers/core/oss/BlueOss.h +1 -1
- package/ios/CBlueIDAccess.xcframework/ios-arm64_x86_64-simulator/libCBlueIDAccess.a +0 -0
- package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/Headers/core/BlueCore.pb.h +29 -15
- package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/Headers/core/oss/BlueOss.h +1 -1
- package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/libCBlueIDAccess.a +0 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueAccess.swift +28 -10
- package/ios/Plugin/BlueIDAccessSDK/BlueAccessSync.swift +2 -2
- package/ios/Plugin/BlueIDAccessSDK/BlueAccessSyncScheduler.swift +25 -7
- package/ios/Plugin/BlueIDAccessSDK/BlueCore.pb.swift +72 -10
- package/ios/Plugin/BlueIDAccessSDK/BlueDemoData.swift +9 -2
- package/ios/Plugin/BlueIDAccessSDK/BlueOssSo.swift +1 -1
- package/ios/Plugin/BlueIDAccessSDK/BlueTerminal.swift +11 -1
- package/ios/Plugin/BlueIDAccessSDK/Extensions.swift +14 -0
- package/package.json +1 -1
|
@@ -10,18 +10,15 @@
|
|
|
10
10
|
<key>HeadersPath</key>
|
|
11
11
|
<string>Headers</string>
|
|
12
12
|
<key>LibraryIdentifier</key>
|
|
13
|
-
<string>ios-
|
|
13
|
+
<string>ios-arm64</string>
|
|
14
14
|
<key>LibraryPath</key>
|
|
15
15
|
<string>libCBlueIDAccess.a</string>
|
|
16
16
|
<key>SupportedArchitectures</key>
|
|
17
17
|
<array>
|
|
18
18
|
<string>arm64</string>
|
|
19
|
-
<string>x86_64</string>
|
|
20
19
|
</array>
|
|
21
20
|
<key>SupportedPlatform</key>
|
|
22
21
|
<string>ios</string>
|
|
23
|
-
<key>SupportedPlatformVariant</key>
|
|
24
|
-
<string>simulator</string>
|
|
25
22
|
</dict>
|
|
26
23
|
<dict>
|
|
27
24
|
<key>BinaryPath</key>
|
|
@@ -46,15 +43,18 @@
|
|
|
46
43
|
<key>HeadersPath</key>
|
|
47
44
|
<string>Headers</string>
|
|
48
45
|
<key>LibraryIdentifier</key>
|
|
49
|
-
<string>ios-
|
|
46
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
50
47
|
<key>LibraryPath</key>
|
|
51
48
|
<string>libCBlueIDAccess.a</string>
|
|
52
49
|
<key>SupportedArchitectures</key>
|
|
53
50
|
<array>
|
|
54
51
|
<string>arm64</string>
|
|
52
|
+
<string>x86_64</string>
|
|
55
53
|
</array>
|
|
56
54
|
<key>SupportedPlatform</key>
|
|
57
55
|
<string>ios</string>
|
|
56
|
+
<key>SupportedPlatformVariant</key>
|
|
57
|
+
<string>simulator</string>
|
|
58
58
|
</dict>
|
|
59
59
|
</array>
|
|
60
60
|
<key>CFBundlePackageType</key>
|
|
@@ -139,10 +139,12 @@ typedef enum BlueCredentialType {
|
|
|
139
139
|
BlueCredentialType_Regular = 1,
|
|
140
140
|
/* Maintenance can open and update all locks within the site */
|
|
141
141
|
BlueCredentialType_Maintenance = 2,
|
|
142
|
-
/* Master can open all locks within the given site
|
|
142
|
+
/* Master can open all locks within the given site */
|
|
143
143
|
BlueCredentialType_Master = 3,
|
|
144
144
|
/* Nfc writer allows to write any credential within this site on cards & fobs */
|
|
145
|
-
BlueCredentialType_NfcWriter = 4
|
|
145
|
+
BlueCredentialType_NfcWriter = 4,
|
|
146
|
+
/* Emergency can open all locks within given site, requires no refresh and has no validity */
|
|
147
|
+
BlueCredentialType_Emergency = 5
|
|
146
148
|
} pb_packed BlueCredentialType_t;
|
|
147
149
|
|
|
148
150
|
typedef enum BlueAccessType {
|
|
@@ -251,6 +253,10 @@ typedef enum BlueOssSoCredentialTypeOssCredential {
|
|
|
251
253
|
BlueOssSoCredentialTypeOssCredential_InterventionMedia = 1
|
|
252
254
|
} pb_packed BlueOssSoCredentialTypeOssCredential_t;
|
|
253
255
|
|
|
256
|
+
typedef enum BlueOssSoDoorGroupId {
|
|
257
|
+
BlueOssSoDoorGroupId_MasterGroupId = 0
|
|
258
|
+
} pb_packed BlueOssSoDoorGroupId_t;
|
|
259
|
+
|
|
254
260
|
typedef enum BlueOssSoDoorInfoAccessBy {
|
|
255
261
|
BlueOssSoDoorInfoAccessBy_DoorGroupId = 0,
|
|
256
262
|
BlueOssSoDoorInfoAccessBy_DoorId = 1
|
|
@@ -377,10 +383,12 @@ typedef struct BlueSPResult {
|
|
|
377
383
|
typedef struct BlueOssAccessResult {
|
|
378
384
|
/* If access is granted or not */
|
|
379
385
|
bool accessGranted;
|
|
380
|
-
/* The final access type */
|
|
386
|
+
/* The final access type that was used if access was granted */
|
|
381
387
|
BlueAccessType_t accessType;
|
|
382
|
-
/*
|
|
383
|
-
|
|
388
|
+
/* Additional access info if was granted, depends on device
|
|
389
|
+
For locks for example this would contain the BlueLockState */
|
|
390
|
+
uint8_t accessInfo;
|
|
391
|
+
/* Defines when the used schedule actually ends if any if access was granted */
|
|
384
392
|
BlueLocalTimestamp_t scheduleEndTime;
|
|
385
393
|
/* If access denied this marks if it was denied due a schedule missmatch */
|
|
386
394
|
bool scheduleMissmatch;
|
|
@@ -734,8 +742,8 @@ extern "C" {
|
|
|
734
742
|
#define _BLUEWEEKDAY_ARRAYSIZE ((BlueWeekday_t)(BlueWeekday_Sunday+1))
|
|
735
743
|
|
|
736
744
|
#define _BLUECREDENTIALTYPE_MIN BlueCredentialType_Regular
|
|
737
|
-
#define _BLUECREDENTIALTYPE_MAX
|
|
738
|
-
#define _BLUECREDENTIALTYPE_ARRAYSIZE ((BlueCredentialType_t)(
|
|
745
|
+
#define _BLUECREDENTIALTYPE_MAX BlueCredentialType_Emergency
|
|
746
|
+
#define _BLUECREDENTIALTYPE_ARRAYSIZE ((BlueCredentialType_t)(BlueCredentialType_Emergency+1))
|
|
739
747
|
|
|
740
748
|
#define _BLUEACCESSTYPE_MIN BlueAccessType_DefaultTime
|
|
741
749
|
#define _BLUEACCESSTYPE_MAX BlueAccessType_NoAccessBlacklisted
|
|
@@ -773,6 +781,10 @@ extern "C" {
|
|
|
773
781
|
#define _BLUEOSSSOCREDENTIALTYPEOSSCREDENTIAL_MAX BlueOssSoCredentialTypeOssCredential_InterventionMedia
|
|
774
782
|
#define _BLUEOSSSOCREDENTIALTYPEOSSCREDENTIAL_ARRAYSIZE ((BlueOssSoCredentialTypeOssCredential_t)(BlueOssSoCredentialTypeOssCredential_InterventionMedia+1))
|
|
775
783
|
|
|
784
|
+
#define _BLUEOSSSODOORGROUPID_MIN BlueOssSoDoorGroupId_MasterGroupId
|
|
785
|
+
#define _BLUEOSSSODOORGROUPID_MAX BlueOssSoDoorGroupId_MasterGroupId
|
|
786
|
+
#define _BLUEOSSSODOORGROUPID_ARRAYSIZE ((BlueOssSoDoorGroupId_t)(BlueOssSoDoorGroupId_MasterGroupId+1))
|
|
787
|
+
|
|
776
788
|
#define _BLUEOSSSODOORINFOACCESSBY_MIN BlueOssSoDoorInfoAccessBy_DoorGroupId
|
|
777
789
|
#define _BLUEOSSSODOORINFOACCESSBY_MAX BlueOssSoDoorInfoAccessBy_DoorId
|
|
778
790
|
#define _BLUEOSSSODOORINFOACCESSBY_ARRAYSIZE ((BlueOssSoDoorInfoAccessBy_t)(BlueOssSoDoorInfoAccessBy_DoorId+1))
|
|
@@ -864,7 +876,7 @@ extern "C" {
|
|
|
864
876
|
#define BLUESPTOKENCOMMAND_INIT_DEFAULT {BLUECREDENTIALID_INIT_DEFAULT, BLUELOCALTIMESTAMP_INIT_DEFAULT, BLUELOCALTIMESTAMP_INIT_DEFAULT, "", {0, {0}}}
|
|
865
877
|
#define BLUESPTOKEN_INIT_DEFAULT {{0, {0}}, 0, {BLUESPTOKENCOMMAND_INIT_DEFAULT}}
|
|
866
878
|
#define BLUESPRESULT_INIT_DEFAULT {{0, {0}}}
|
|
867
|
-
#define BLUEOSSACCESSRESULT_INIT_DEFAULT {0, _BLUEACCESSTYPE_MIN, BLUELOCALTIMESTAMP_INIT_DEFAULT, 0}
|
|
879
|
+
#define BLUEOSSACCESSRESULT_INIT_DEFAULT {0, _BLUEACCESSTYPE_MIN, 0, BLUELOCALTIMESTAMP_INIT_DEFAULT, 0}
|
|
868
880
|
#define BLUEOSSACCESSEVENTSRESULT_INIT_DEFAULT {BLUEOSSACCESSRESULT_INIT_DEFAULT, 0, {BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT}}
|
|
869
881
|
#define BLUEOSSSIDVERSION_INIT_DEFAULT {false, 1u, false, 0u}
|
|
870
882
|
#define BLUEOSSSIDCREDENTIALTYPEOSS_INIT_DEFAULT {false, 0}
|
|
@@ -920,7 +932,7 @@ extern "C" {
|
|
|
920
932
|
#define BLUESPTOKENCOMMAND_INIT_ZERO {BLUECREDENTIALID_INIT_ZERO, BLUELOCALTIMESTAMP_INIT_ZERO, BLUELOCALTIMESTAMP_INIT_ZERO, "", {0, {0}}}
|
|
921
933
|
#define BLUESPTOKEN_INIT_ZERO {{0, {0}}, 0, {BLUESPTOKENCOMMAND_INIT_ZERO}}
|
|
922
934
|
#define BLUESPRESULT_INIT_ZERO {{0, {0}}}
|
|
923
|
-
#define BLUEOSSACCESSRESULT_INIT_ZERO {0, _BLUEACCESSTYPE_MIN, BLUELOCALTIMESTAMP_INIT_ZERO, 0}
|
|
935
|
+
#define BLUEOSSACCESSRESULT_INIT_ZERO {0, _BLUEACCESSTYPE_MIN, 0, BLUELOCALTIMESTAMP_INIT_ZERO, 0}
|
|
924
936
|
#define BLUEOSSACCESSEVENTSRESULT_INIT_ZERO {BLUEOSSACCESSRESULT_INIT_ZERO, 0, {BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO}}
|
|
925
937
|
#define BLUEOSSSIDVERSION_INIT_ZERO {false, 0, false, 0}
|
|
926
938
|
#define BLUEOSSSIDCREDENTIALTYPEOSS_INIT_ZERO {false, 0}
|
|
@@ -1013,8 +1025,9 @@ extern "C" {
|
|
|
1013
1025
|
#define BLUESPRESULT_DATA_TAG 1
|
|
1014
1026
|
#define BLUEOSSACCESSRESULT_ACCESSGRANTED_TAG 1
|
|
1015
1027
|
#define BLUEOSSACCESSRESULT_ACCESSTYPE_TAG 2
|
|
1016
|
-
#define
|
|
1017
|
-
#define
|
|
1028
|
+
#define BLUEOSSACCESSRESULT_ACCESSINFO_TAG 3
|
|
1029
|
+
#define BLUEOSSACCESSRESULT_SCHEDULEENDTIME_TAG 4
|
|
1030
|
+
#define BLUEOSSACCESSRESULT_SCHEDULEMISSMATCH_TAG 5
|
|
1018
1031
|
#define BLUEOSSACCESSEVENTSRESULT_ACCESSRESULT_TAG 1
|
|
1019
1032
|
#define BLUEOSSACCESSEVENTSRESULT_EVENTS_TAG 2
|
|
1020
1033
|
#define BLUEOSSSIDVERSION_VERSIONMAJOR_TAG 1
|
|
@@ -1278,8 +1291,9 @@ X(a, STATIC, REQUIRED, BYTES, data, 1)
|
|
|
1278
1291
|
#define BLUEOSSACCESSRESULT_FIELDLIST(X, a) \
|
|
1279
1292
|
X(a, STATIC, REQUIRED, BOOL, accessGranted, 1) \
|
|
1280
1293
|
X(a, STATIC, REQUIRED, UENUM, accessType, 2) \
|
|
1281
|
-
X(a, STATIC, REQUIRED,
|
|
1282
|
-
X(a, STATIC, REQUIRED,
|
|
1294
|
+
X(a, STATIC, REQUIRED, UINT32, accessInfo, 3) \
|
|
1295
|
+
X(a, STATIC, REQUIRED, MESSAGE, scheduleEndTime, 4) \
|
|
1296
|
+
X(a, STATIC, REQUIRED, BOOL, scheduleMissmatch, 5)
|
|
1283
1297
|
#define BLUEOSSACCESSRESULT_CALLBACK NULL
|
|
1284
1298
|
#define BLUEOSSACCESSRESULT_DEFAULT (const pb_byte_t*)"\x10\x01\x00"
|
|
1285
1299
|
#define BlueOssAccessResult_t_scheduleEndTime_MSGTYPE BlueLocalTimestamp_t
|
|
@@ -1733,8 +1747,8 @@ extern const pb_msgdesc_t _BlueTestEncodeDecode_t_msg;
|
|
|
1733
1747
|
#define BLUELOCALTIMEPERIOD_SIZE 12
|
|
1734
1748
|
#define BLUELOCALTIMESCHEDULE_SIZE 36
|
|
1735
1749
|
#define BLUELOCALTIMESTAMP_SIZE 19
|
|
1736
|
-
#define BLUEOSSACCESSEVENTSRESULT_SIZE
|
|
1737
|
-
#define BLUEOSSACCESSRESULT_SIZE
|
|
1750
|
+
#define BLUEOSSACCESSEVENTSRESULT_SIZE 1088
|
|
1751
|
+
#define BLUEOSSACCESSRESULT_SIZE 30
|
|
1738
1752
|
#define BLUEOSSSIDCONFIGURATION_SIZE 47
|
|
1739
1753
|
#define BLUEOSSSIDCREDENTIALTYPEOSS_SIZE 2
|
|
1740
1754
|
#define BLUEOSSSIDCREDENTIALTYPEPROPRIETARY_SIZE 9
|
|
@@ -27,7 +27,7 @@ typedef enum BlueOssPrepareMode
|
|
|
27
27
|
}, \
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
typedef BlueReturnCode_t (*BlueOssGrantAccessFunc_t)(void *pContext, BlueAccessType_t accessType, const BlueLocalTimestamp_t *const pScheduleEndTime);
|
|
30
|
+
typedef BlueReturnCode_t (*BlueOssGrantAccessFunc_t)(void *pContext, BlueAccessType_t accessType, const BlueLocalTimestamp_t *const pScheduleEndTime, uint8_t *const pAccessInfo);
|
|
31
31
|
typedef BlueReturnCode_t (*BlueOssDenyAccessFunc_t)(void *pContext, BlueAccessType_t accessType);
|
|
32
32
|
|
|
33
33
|
#ifdef __cplusplus
|
|
Binary file
|
|
@@ -139,10 +139,12 @@ typedef enum BlueCredentialType {
|
|
|
139
139
|
BlueCredentialType_Regular = 1,
|
|
140
140
|
/* Maintenance can open and update all locks within the site */
|
|
141
141
|
BlueCredentialType_Maintenance = 2,
|
|
142
|
-
/* Master can open all locks within the given site
|
|
142
|
+
/* Master can open all locks within the given site */
|
|
143
143
|
BlueCredentialType_Master = 3,
|
|
144
144
|
/* Nfc writer allows to write any credential within this site on cards & fobs */
|
|
145
|
-
BlueCredentialType_NfcWriter = 4
|
|
145
|
+
BlueCredentialType_NfcWriter = 4,
|
|
146
|
+
/* Emergency can open all locks within given site, requires no refresh and has no validity */
|
|
147
|
+
BlueCredentialType_Emergency = 5
|
|
146
148
|
} pb_packed BlueCredentialType_t;
|
|
147
149
|
|
|
148
150
|
typedef enum BlueAccessType {
|
|
@@ -251,6 +253,10 @@ typedef enum BlueOssSoCredentialTypeOssCredential {
|
|
|
251
253
|
BlueOssSoCredentialTypeOssCredential_InterventionMedia = 1
|
|
252
254
|
} pb_packed BlueOssSoCredentialTypeOssCredential_t;
|
|
253
255
|
|
|
256
|
+
typedef enum BlueOssSoDoorGroupId {
|
|
257
|
+
BlueOssSoDoorGroupId_MasterGroupId = 0
|
|
258
|
+
} pb_packed BlueOssSoDoorGroupId_t;
|
|
259
|
+
|
|
254
260
|
typedef enum BlueOssSoDoorInfoAccessBy {
|
|
255
261
|
BlueOssSoDoorInfoAccessBy_DoorGroupId = 0,
|
|
256
262
|
BlueOssSoDoorInfoAccessBy_DoorId = 1
|
|
@@ -377,10 +383,12 @@ typedef struct BlueSPResult {
|
|
|
377
383
|
typedef struct BlueOssAccessResult {
|
|
378
384
|
/* If access is granted or not */
|
|
379
385
|
bool accessGranted;
|
|
380
|
-
/* The final access type */
|
|
386
|
+
/* The final access type that was used if access was granted */
|
|
381
387
|
BlueAccessType_t accessType;
|
|
382
|
-
/*
|
|
383
|
-
|
|
388
|
+
/* Additional access info if was granted, depends on device
|
|
389
|
+
For locks for example this would contain the BlueLockState */
|
|
390
|
+
uint8_t accessInfo;
|
|
391
|
+
/* Defines when the used schedule actually ends if any if access was granted */
|
|
384
392
|
BlueLocalTimestamp_t scheduleEndTime;
|
|
385
393
|
/* If access denied this marks if it was denied due a schedule missmatch */
|
|
386
394
|
bool scheduleMissmatch;
|
|
@@ -734,8 +742,8 @@ extern "C" {
|
|
|
734
742
|
#define _BLUEWEEKDAY_ARRAYSIZE ((BlueWeekday_t)(BlueWeekday_Sunday+1))
|
|
735
743
|
|
|
736
744
|
#define _BLUECREDENTIALTYPE_MIN BlueCredentialType_Regular
|
|
737
|
-
#define _BLUECREDENTIALTYPE_MAX
|
|
738
|
-
#define _BLUECREDENTIALTYPE_ARRAYSIZE ((BlueCredentialType_t)(
|
|
745
|
+
#define _BLUECREDENTIALTYPE_MAX BlueCredentialType_Emergency
|
|
746
|
+
#define _BLUECREDENTIALTYPE_ARRAYSIZE ((BlueCredentialType_t)(BlueCredentialType_Emergency+1))
|
|
739
747
|
|
|
740
748
|
#define _BLUEACCESSTYPE_MIN BlueAccessType_DefaultTime
|
|
741
749
|
#define _BLUEACCESSTYPE_MAX BlueAccessType_NoAccessBlacklisted
|
|
@@ -773,6 +781,10 @@ extern "C" {
|
|
|
773
781
|
#define _BLUEOSSSOCREDENTIALTYPEOSSCREDENTIAL_MAX BlueOssSoCredentialTypeOssCredential_InterventionMedia
|
|
774
782
|
#define _BLUEOSSSOCREDENTIALTYPEOSSCREDENTIAL_ARRAYSIZE ((BlueOssSoCredentialTypeOssCredential_t)(BlueOssSoCredentialTypeOssCredential_InterventionMedia+1))
|
|
775
783
|
|
|
784
|
+
#define _BLUEOSSSODOORGROUPID_MIN BlueOssSoDoorGroupId_MasterGroupId
|
|
785
|
+
#define _BLUEOSSSODOORGROUPID_MAX BlueOssSoDoorGroupId_MasterGroupId
|
|
786
|
+
#define _BLUEOSSSODOORGROUPID_ARRAYSIZE ((BlueOssSoDoorGroupId_t)(BlueOssSoDoorGroupId_MasterGroupId+1))
|
|
787
|
+
|
|
776
788
|
#define _BLUEOSSSODOORINFOACCESSBY_MIN BlueOssSoDoorInfoAccessBy_DoorGroupId
|
|
777
789
|
#define _BLUEOSSSODOORINFOACCESSBY_MAX BlueOssSoDoorInfoAccessBy_DoorId
|
|
778
790
|
#define _BLUEOSSSODOORINFOACCESSBY_ARRAYSIZE ((BlueOssSoDoorInfoAccessBy_t)(BlueOssSoDoorInfoAccessBy_DoorId+1))
|
|
@@ -864,7 +876,7 @@ extern "C" {
|
|
|
864
876
|
#define BLUESPTOKENCOMMAND_INIT_DEFAULT {BLUECREDENTIALID_INIT_DEFAULT, BLUELOCALTIMESTAMP_INIT_DEFAULT, BLUELOCALTIMESTAMP_INIT_DEFAULT, "", {0, {0}}}
|
|
865
877
|
#define BLUESPTOKEN_INIT_DEFAULT {{0, {0}}, 0, {BLUESPTOKENCOMMAND_INIT_DEFAULT}}
|
|
866
878
|
#define BLUESPRESULT_INIT_DEFAULT {{0, {0}}}
|
|
867
|
-
#define BLUEOSSACCESSRESULT_INIT_DEFAULT {0, _BLUEACCESSTYPE_MIN, BLUELOCALTIMESTAMP_INIT_DEFAULT, 0}
|
|
879
|
+
#define BLUEOSSACCESSRESULT_INIT_DEFAULT {0, _BLUEACCESSTYPE_MIN, 0, BLUELOCALTIMESTAMP_INIT_DEFAULT, 0}
|
|
868
880
|
#define BLUEOSSACCESSEVENTSRESULT_INIT_DEFAULT {BLUEOSSACCESSRESULT_INIT_DEFAULT, 0, {BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT}}
|
|
869
881
|
#define BLUEOSSSIDVERSION_INIT_DEFAULT {false, 1u, false, 0u}
|
|
870
882
|
#define BLUEOSSSIDCREDENTIALTYPEOSS_INIT_DEFAULT {false, 0}
|
|
@@ -920,7 +932,7 @@ extern "C" {
|
|
|
920
932
|
#define BLUESPTOKENCOMMAND_INIT_ZERO {BLUECREDENTIALID_INIT_ZERO, BLUELOCALTIMESTAMP_INIT_ZERO, BLUELOCALTIMESTAMP_INIT_ZERO, "", {0, {0}}}
|
|
921
933
|
#define BLUESPTOKEN_INIT_ZERO {{0, {0}}, 0, {BLUESPTOKENCOMMAND_INIT_ZERO}}
|
|
922
934
|
#define BLUESPRESULT_INIT_ZERO {{0, {0}}}
|
|
923
|
-
#define BLUEOSSACCESSRESULT_INIT_ZERO {0, _BLUEACCESSTYPE_MIN, BLUELOCALTIMESTAMP_INIT_ZERO, 0}
|
|
935
|
+
#define BLUEOSSACCESSRESULT_INIT_ZERO {0, _BLUEACCESSTYPE_MIN, 0, BLUELOCALTIMESTAMP_INIT_ZERO, 0}
|
|
924
936
|
#define BLUEOSSACCESSEVENTSRESULT_INIT_ZERO {BLUEOSSACCESSRESULT_INIT_ZERO, 0, {BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO}}
|
|
925
937
|
#define BLUEOSSSIDVERSION_INIT_ZERO {false, 0, false, 0}
|
|
926
938
|
#define BLUEOSSSIDCREDENTIALTYPEOSS_INIT_ZERO {false, 0}
|
|
@@ -1013,8 +1025,9 @@ extern "C" {
|
|
|
1013
1025
|
#define BLUESPRESULT_DATA_TAG 1
|
|
1014
1026
|
#define BLUEOSSACCESSRESULT_ACCESSGRANTED_TAG 1
|
|
1015
1027
|
#define BLUEOSSACCESSRESULT_ACCESSTYPE_TAG 2
|
|
1016
|
-
#define
|
|
1017
|
-
#define
|
|
1028
|
+
#define BLUEOSSACCESSRESULT_ACCESSINFO_TAG 3
|
|
1029
|
+
#define BLUEOSSACCESSRESULT_SCHEDULEENDTIME_TAG 4
|
|
1030
|
+
#define BLUEOSSACCESSRESULT_SCHEDULEMISSMATCH_TAG 5
|
|
1018
1031
|
#define BLUEOSSACCESSEVENTSRESULT_ACCESSRESULT_TAG 1
|
|
1019
1032
|
#define BLUEOSSACCESSEVENTSRESULT_EVENTS_TAG 2
|
|
1020
1033
|
#define BLUEOSSSIDVERSION_VERSIONMAJOR_TAG 1
|
|
@@ -1278,8 +1291,9 @@ X(a, STATIC, REQUIRED, BYTES, data, 1)
|
|
|
1278
1291
|
#define BLUEOSSACCESSRESULT_FIELDLIST(X, a) \
|
|
1279
1292
|
X(a, STATIC, REQUIRED, BOOL, accessGranted, 1) \
|
|
1280
1293
|
X(a, STATIC, REQUIRED, UENUM, accessType, 2) \
|
|
1281
|
-
X(a, STATIC, REQUIRED,
|
|
1282
|
-
X(a, STATIC, REQUIRED,
|
|
1294
|
+
X(a, STATIC, REQUIRED, UINT32, accessInfo, 3) \
|
|
1295
|
+
X(a, STATIC, REQUIRED, MESSAGE, scheduleEndTime, 4) \
|
|
1296
|
+
X(a, STATIC, REQUIRED, BOOL, scheduleMissmatch, 5)
|
|
1283
1297
|
#define BLUEOSSACCESSRESULT_CALLBACK NULL
|
|
1284
1298
|
#define BLUEOSSACCESSRESULT_DEFAULT (const pb_byte_t*)"\x10\x01\x00"
|
|
1285
1299
|
#define BlueOssAccessResult_t_scheduleEndTime_MSGTYPE BlueLocalTimestamp_t
|
|
@@ -1733,8 +1747,8 @@ extern const pb_msgdesc_t _BlueTestEncodeDecode_t_msg;
|
|
|
1733
1747
|
#define BLUELOCALTIMEPERIOD_SIZE 12
|
|
1734
1748
|
#define BLUELOCALTIMESCHEDULE_SIZE 36
|
|
1735
1749
|
#define BLUELOCALTIMESTAMP_SIZE 19
|
|
1736
|
-
#define BLUEOSSACCESSEVENTSRESULT_SIZE
|
|
1737
|
-
#define BLUEOSSACCESSRESULT_SIZE
|
|
1750
|
+
#define BLUEOSSACCESSEVENTSRESULT_SIZE 1088
|
|
1751
|
+
#define BLUEOSSACCESSRESULT_SIZE 30
|
|
1738
1752
|
#define BLUEOSSSIDCONFIGURATION_SIZE 47
|
|
1739
1753
|
#define BLUEOSSSIDCREDENTIALTYPEOSS_SIZE 2
|
|
1740
1754
|
#define BLUEOSSSIDCREDENTIALTYPEPROPRIETARY_SIZE 9
|
|
@@ -27,7 +27,7 @@ typedef enum BlueOssPrepareMode
|
|
|
27
27
|
}, \
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
typedef BlueReturnCode_t (*BlueOssGrantAccessFunc_t)(void *pContext, BlueAccessType_t accessType, const BlueLocalTimestamp_t *const pScheduleEndTime);
|
|
30
|
+
typedef BlueReturnCode_t (*BlueOssGrantAccessFunc_t)(void *pContext, BlueAccessType_t accessType, const BlueLocalTimestamp_t *const pScheduleEndTime, uint8_t *const pAccessInfo);
|
|
31
31
|
typedef BlueReturnCode_t (*BlueOssDenyAccessFunc_t)(void *pContext, BlueAccessType_t accessType);
|
|
32
32
|
|
|
33
33
|
#ifdef __cplusplus
|
|
Binary file
|
|
@@ -139,10 +139,12 @@ typedef enum BlueCredentialType {
|
|
|
139
139
|
BlueCredentialType_Regular = 1,
|
|
140
140
|
/* Maintenance can open and update all locks within the site */
|
|
141
141
|
BlueCredentialType_Maintenance = 2,
|
|
142
|
-
/* Master can open all locks within the given site
|
|
142
|
+
/* Master can open all locks within the given site */
|
|
143
143
|
BlueCredentialType_Master = 3,
|
|
144
144
|
/* Nfc writer allows to write any credential within this site on cards & fobs */
|
|
145
|
-
BlueCredentialType_NfcWriter = 4
|
|
145
|
+
BlueCredentialType_NfcWriter = 4,
|
|
146
|
+
/* Emergency can open all locks within given site, requires no refresh and has no validity */
|
|
147
|
+
BlueCredentialType_Emergency = 5
|
|
146
148
|
} pb_packed BlueCredentialType_t;
|
|
147
149
|
|
|
148
150
|
typedef enum BlueAccessType {
|
|
@@ -251,6 +253,10 @@ typedef enum BlueOssSoCredentialTypeOssCredential {
|
|
|
251
253
|
BlueOssSoCredentialTypeOssCredential_InterventionMedia = 1
|
|
252
254
|
} pb_packed BlueOssSoCredentialTypeOssCredential_t;
|
|
253
255
|
|
|
256
|
+
typedef enum BlueOssSoDoorGroupId {
|
|
257
|
+
BlueOssSoDoorGroupId_MasterGroupId = 0
|
|
258
|
+
} pb_packed BlueOssSoDoorGroupId_t;
|
|
259
|
+
|
|
254
260
|
typedef enum BlueOssSoDoorInfoAccessBy {
|
|
255
261
|
BlueOssSoDoorInfoAccessBy_DoorGroupId = 0,
|
|
256
262
|
BlueOssSoDoorInfoAccessBy_DoorId = 1
|
|
@@ -377,10 +383,12 @@ typedef struct BlueSPResult {
|
|
|
377
383
|
typedef struct BlueOssAccessResult {
|
|
378
384
|
/* If access is granted or not */
|
|
379
385
|
bool accessGranted;
|
|
380
|
-
/* The final access type */
|
|
386
|
+
/* The final access type that was used if access was granted */
|
|
381
387
|
BlueAccessType_t accessType;
|
|
382
|
-
/*
|
|
383
|
-
|
|
388
|
+
/* Additional access info if was granted, depends on device
|
|
389
|
+
For locks for example this would contain the BlueLockState */
|
|
390
|
+
uint8_t accessInfo;
|
|
391
|
+
/* Defines when the used schedule actually ends if any if access was granted */
|
|
384
392
|
BlueLocalTimestamp_t scheduleEndTime;
|
|
385
393
|
/* If access denied this marks if it was denied due a schedule missmatch */
|
|
386
394
|
bool scheduleMissmatch;
|
|
@@ -734,8 +742,8 @@ extern "C" {
|
|
|
734
742
|
#define _BLUEWEEKDAY_ARRAYSIZE ((BlueWeekday_t)(BlueWeekday_Sunday+1))
|
|
735
743
|
|
|
736
744
|
#define _BLUECREDENTIALTYPE_MIN BlueCredentialType_Regular
|
|
737
|
-
#define _BLUECREDENTIALTYPE_MAX
|
|
738
|
-
#define _BLUECREDENTIALTYPE_ARRAYSIZE ((BlueCredentialType_t)(
|
|
745
|
+
#define _BLUECREDENTIALTYPE_MAX BlueCredentialType_Emergency
|
|
746
|
+
#define _BLUECREDENTIALTYPE_ARRAYSIZE ((BlueCredentialType_t)(BlueCredentialType_Emergency+1))
|
|
739
747
|
|
|
740
748
|
#define _BLUEACCESSTYPE_MIN BlueAccessType_DefaultTime
|
|
741
749
|
#define _BLUEACCESSTYPE_MAX BlueAccessType_NoAccessBlacklisted
|
|
@@ -773,6 +781,10 @@ extern "C" {
|
|
|
773
781
|
#define _BLUEOSSSOCREDENTIALTYPEOSSCREDENTIAL_MAX BlueOssSoCredentialTypeOssCredential_InterventionMedia
|
|
774
782
|
#define _BLUEOSSSOCREDENTIALTYPEOSSCREDENTIAL_ARRAYSIZE ((BlueOssSoCredentialTypeOssCredential_t)(BlueOssSoCredentialTypeOssCredential_InterventionMedia+1))
|
|
775
783
|
|
|
784
|
+
#define _BLUEOSSSODOORGROUPID_MIN BlueOssSoDoorGroupId_MasterGroupId
|
|
785
|
+
#define _BLUEOSSSODOORGROUPID_MAX BlueOssSoDoorGroupId_MasterGroupId
|
|
786
|
+
#define _BLUEOSSSODOORGROUPID_ARRAYSIZE ((BlueOssSoDoorGroupId_t)(BlueOssSoDoorGroupId_MasterGroupId+1))
|
|
787
|
+
|
|
776
788
|
#define _BLUEOSSSODOORINFOACCESSBY_MIN BlueOssSoDoorInfoAccessBy_DoorGroupId
|
|
777
789
|
#define _BLUEOSSSODOORINFOACCESSBY_MAX BlueOssSoDoorInfoAccessBy_DoorId
|
|
778
790
|
#define _BLUEOSSSODOORINFOACCESSBY_ARRAYSIZE ((BlueOssSoDoorInfoAccessBy_t)(BlueOssSoDoorInfoAccessBy_DoorId+1))
|
|
@@ -864,7 +876,7 @@ extern "C" {
|
|
|
864
876
|
#define BLUESPTOKENCOMMAND_INIT_DEFAULT {BLUECREDENTIALID_INIT_DEFAULT, BLUELOCALTIMESTAMP_INIT_DEFAULT, BLUELOCALTIMESTAMP_INIT_DEFAULT, "", {0, {0}}}
|
|
865
877
|
#define BLUESPTOKEN_INIT_DEFAULT {{0, {0}}, 0, {BLUESPTOKENCOMMAND_INIT_DEFAULT}}
|
|
866
878
|
#define BLUESPRESULT_INIT_DEFAULT {{0, {0}}}
|
|
867
|
-
#define BLUEOSSACCESSRESULT_INIT_DEFAULT {0, _BLUEACCESSTYPE_MIN, BLUELOCALTIMESTAMP_INIT_DEFAULT, 0}
|
|
879
|
+
#define BLUEOSSACCESSRESULT_INIT_DEFAULT {0, _BLUEACCESSTYPE_MIN, 0, BLUELOCALTIMESTAMP_INIT_DEFAULT, 0}
|
|
868
880
|
#define BLUEOSSACCESSEVENTSRESULT_INIT_DEFAULT {BLUEOSSACCESSRESULT_INIT_DEFAULT, 0, {BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT, BLUEEVENT_INIT_DEFAULT}}
|
|
869
881
|
#define BLUEOSSSIDVERSION_INIT_DEFAULT {false, 1u, false, 0u}
|
|
870
882
|
#define BLUEOSSSIDCREDENTIALTYPEOSS_INIT_DEFAULT {false, 0}
|
|
@@ -920,7 +932,7 @@ extern "C" {
|
|
|
920
932
|
#define BLUESPTOKENCOMMAND_INIT_ZERO {BLUECREDENTIALID_INIT_ZERO, BLUELOCALTIMESTAMP_INIT_ZERO, BLUELOCALTIMESTAMP_INIT_ZERO, "", {0, {0}}}
|
|
921
933
|
#define BLUESPTOKEN_INIT_ZERO {{0, {0}}, 0, {BLUESPTOKENCOMMAND_INIT_ZERO}}
|
|
922
934
|
#define BLUESPRESULT_INIT_ZERO {{0, {0}}}
|
|
923
|
-
#define BLUEOSSACCESSRESULT_INIT_ZERO {0, _BLUEACCESSTYPE_MIN, BLUELOCALTIMESTAMP_INIT_ZERO, 0}
|
|
935
|
+
#define BLUEOSSACCESSRESULT_INIT_ZERO {0, _BLUEACCESSTYPE_MIN, 0, BLUELOCALTIMESTAMP_INIT_ZERO, 0}
|
|
924
936
|
#define BLUEOSSACCESSEVENTSRESULT_INIT_ZERO {BLUEOSSACCESSRESULT_INIT_ZERO, 0, {BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO, BLUEEVENT_INIT_ZERO}}
|
|
925
937
|
#define BLUEOSSSIDVERSION_INIT_ZERO {false, 0, false, 0}
|
|
926
938
|
#define BLUEOSSSIDCREDENTIALTYPEOSS_INIT_ZERO {false, 0}
|
|
@@ -1013,8 +1025,9 @@ extern "C" {
|
|
|
1013
1025
|
#define BLUESPRESULT_DATA_TAG 1
|
|
1014
1026
|
#define BLUEOSSACCESSRESULT_ACCESSGRANTED_TAG 1
|
|
1015
1027
|
#define BLUEOSSACCESSRESULT_ACCESSTYPE_TAG 2
|
|
1016
|
-
#define
|
|
1017
|
-
#define
|
|
1028
|
+
#define BLUEOSSACCESSRESULT_ACCESSINFO_TAG 3
|
|
1029
|
+
#define BLUEOSSACCESSRESULT_SCHEDULEENDTIME_TAG 4
|
|
1030
|
+
#define BLUEOSSACCESSRESULT_SCHEDULEMISSMATCH_TAG 5
|
|
1018
1031
|
#define BLUEOSSACCESSEVENTSRESULT_ACCESSRESULT_TAG 1
|
|
1019
1032
|
#define BLUEOSSACCESSEVENTSRESULT_EVENTS_TAG 2
|
|
1020
1033
|
#define BLUEOSSSIDVERSION_VERSIONMAJOR_TAG 1
|
|
@@ -1278,8 +1291,9 @@ X(a, STATIC, REQUIRED, BYTES, data, 1)
|
|
|
1278
1291
|
#define BLUEOSSACCESSRESULT_FIELDLIST(X, a) \
|
|
1279
1292
|
X(a, STATIC, REQUIRED, BOOL, accessGranted, 1) \
|
|
1280
1293
|
X(a, STATIC, REQUIRED, UENUM, accessType, 2) \
|
|
1281
|
-
X(a, STATIC, REQUIRED,
|
|
1282
|
-
X(a, STATIC, REQUIRED,
|
|
1294
|
+
X(a, STATIC, REQUIRED, UINT32, accessInfo, 3) \
|
|
1295
|
+
X(a, STATIC, REQUIRED, MESSAGE, scheduleEndTime, 4) \
|
|
1296
|
+
X(a, STATIC, REQUIRED, BOOL, scheduleMissmatch, 5)
|
|
1283
1297
|
#define BLUEOSSACCESSRESULT_CALLBACK NULL
|
|
1284
1298
|
#define BLUEOSSACCESSRESULT_DEFAULT (const pb_byte_t*)"\x10\x01\x00"
|
|
1285
1299
|
#define BlueOssAccessResult_t_scheduleEndTime_MSGTYPE BlueLocalTimestamp_t
|
|
@@ -1733,8 +1747,8 @@ extern const pb_msgdesc_t _BlueTestEncodeDecode_t_msg;
|
|
|
1733
1747
|
#define BLUELOCALTIMEPERIOD_SIZE 12
|
|
1734
1748
|
#define BLUELOCALTIMESCHEDULE_SIZE 36
|
|
1735
1749
|
#define BLUELOCALTIMESTAMP_SIZE 19
|
|
1736
|
-
#define BLUEOSSACCESSEVENTSRESULT_SIZE
|
|
1737
|
-
#define BLUEOSSACCESSRESULT_SIZE
|
|
1750
|
+
#define BLUEOSSACCESSEVENTSRESULT_SIZE 1088
|
|
1751
|
+
#define BLUEOSSACCESSRESULT_SIZE 30
|
|
1738
1752
|
#define BLUEOSSSIDCONFIGURATION_SIZE 47
|
|
1739
1753
|
#define BLUEOSSSIDCREDENTIALTYPEOSS_SIZE 2
|
|
1740
1754
|
#define BLUEOSSSIDCREDENTIALTYPEPROPRIETARY_SIZE 9
|
|
@@ -27,7 +27,7 @@ typedef enum BlueOssPrepareMode
|
|
|
27
27
|
}, \
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
typedef BlueReturnCode_t (*BlueOssGrantAccessFunc_t)(void *pContext, BlueAccessType_t accessType, const BlueLocalTimestamp_t *const pScheduleEndTime);
|
|
30
|
+
typedef BlueReturnCode_t (*BlueOssGrantAccessFunc_t)(void *pContext, BlueAccessType_t accessType, const BlueLocalTimestamp_t *const pScheduleEndTime, uint8_t *const pAccessInfo);
|
|
31
31
|
typedef BlueReturnCode_t (*BlueOssDenyAccessFunc_t)(void *pContext, BlueAccessType_t accessType);
|
|
32
32
|
|
|
33
33
|
#ifdef __cplusplus
|
|
Binary file
|
|
@@ -40,22 +40,22 @@ public class BlueClaimAccessCredentialCommand: BlueSdkAsyncCommand {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
public struct BlueGetAccessCredentialsCommand:
|
|
44
|
-
|
|
43
|
+
public struct BlueGetAccessCredentialsCommand: BlueCommand {
|
|
44
|
+
func run(arg0: Any?, arg1: Any?, arg2: Any?) throws -> Any? {
|
|
45
45
|
var credentialType: BlueCredentialType?
|
|
46
46
|
|
|
47
47
|
if let rawValue = try blueCastArg(Int.self, arg0) {
|
|
48
48
|
credentialType = BlueCredentialType(rawValue: rawValue)
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
return try
|
|
51
|
+
return try run(
|
|
52
52
|
credentialType: credentialType,
|
|
53
53
|
for: blueCastArg(String.self, arg1),
|
|
54
54
|
includePrivateKey: false
|
|
55
55
|
)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
public func
|
|
58
|
+
public func run(credentialType: BlueCredentialType? = nil, for deviceID: String? = nil, includePrivateKey: Bool? = false) throws -> BlueAccessCredentialList {
|
|
59
59
|
let filterByCredentialType = { (_ credential: BlueAccessCredential) -> Bool in
|
|
60
60
|
guard let credentialType = credentialType else {
|
|
61
61
|
return true
|
|
@@ -321,11 +321,19 @@ public class BlueSynchronizeAccessDeviceCommand: BlueSdkAsyncCommand {
|
|
|
321
321
|
|
|
322
322
|
private func waitUntilDeviceHasBeenRestarted(_ deviceID: String) async throws {
|
|
323
323
|
do {
|
|
324
|
-
|
|
324
|
+
var attempts = 0
|
|
325
325
|
|
|
326
|
-
|
|
327
|
-
|
|
326
|
+
while attempts <= 2 {
|
|
327
|
+
try? await Task.sleep(nanoseconds: UInt64(blueSecondsToNanoseconds(10)))
|
|
328
|
+
|
|
329
|
+
if blueGetDevice(deviceID) != nil {
|
|
330
|
+
return
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
attempts += 1
|
|
328
334
|
}
|
|
335
|
+
|
|
336
|
+
throw BlueError(.sdkDeviceNotFound)
|
|
329
337
|
} catch {
|
|
330
338
|
throw BlueError(.sdkWaitDeviceToRestartFailed, cause: error)
|
|
331
339
|
}
|
|
@@ -534,13 +542,23 @@ public struct BlueListAccessDevicesCommand: BlueAsyncCommand {
|
|
|
534
542
|
credentialType = BlueCredentialType(rawValue: credentialTypeRawValue)
|
|
535
543
|
}
|
|
536
544
|
|
|
537
|
-
return try await runAsync(
|
|
545
|
+
return try await runAsync(
|
|
546
|
+
credentialType: credentialType,
|
|
547
|
+
suppressCredentialValidityStart: blueCastArg(Bool.self, arg1)
|
|
548
|
+
)
|
|
538
549
|
}
|
|
539
550
|
|
|
540
|
-
public func runAsync(credentialType: BlueCredentialType? = nil) async throws -> BlueAccessDeviceList {
|
|
541
|
-
let credentialList = try
|
|
551
|
+
public func runAsync(credentialType: BlueCredentialType? = nil, suppressCredentialValidityStart: Bool? = false) async throws -> BlueAccessDeviceList {
|
|
552
|
+
let credentialList = try BlueGetAccessCredentialsCommand().run(credentialType: credentialType)
|
|
542
553
|
|
|
543
554
|
let devices = credentialList.credentials.compactMap { credential in
|
|
555
|
+
|
|
556
|
+
if (suppressCredentialValidityStart != true) {
|
|
557
|
+
if (!credential.checkValidityStart()) {
|
|
558
|
+
return [BlueAccessDevice]()
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
544
562
|
let deviceList = try? BlueGetAccessDevicesCommand().run(credentialID: credential.credentialID.id)
|
|
545
563
|
|
|
546
564
|
return deviceList?.devices
|
|
@@ -199,7 +199,7 @@ public class BlueSynchronizeAccessCredentialsCommand: BlueSdkAsyncCommand {
|
|
|
199
199
|
throw BlueError(.sdkUnsupportedPlatform)
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
let credentials = try
|
|
202
|
+
let credentials = try BlueGetAccessCredentialsCommand().run().credentials
|
|
203
203
|
|
|
204
204
|
if (credentials.isEmpty) {
|
|
205
205
|
return BlueSynchronizeAccessCredentials()
|
|
@@ -251,7 +251,7 @@ public class BlueSynchronizeAccessCredentialsCommand: BlueSdkAsyncCommand {
|
|
|
251
251
|
/// Purges orphaned tokens.
|
|
252
252
|
private func purgeTokens() async {
|
|
253
253
|
do {
|
|
254
|
-
let credentialIds = try
|
|
254
|
+
let credentialIds = try BlueGetAccessCredentialsCommand().run().credentials.compactMap { $0.credentialID.id }
|
|
255
255
|
|
|
256
256
|
try blueGetSpTokenEntryIds().forEach{ entryID in
|
|
257
257
|
do {
|
|
@@ -14,11 +14,6 @@ private class ForegroundScheduler {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
func schedule(_ now: Bool? = false) {
|
|
17
|
-
guard #available(macOS 10.15, *) else {
|
|
18
|
-
blueLogWarn("Unsupported platform")
|
|
19
|
-
return
|
|
20
|
-
}
|
|
21
|
-
|
|
22
17
|
suspend()
|
|
23
18
|
|
|
24
19
|
if now == true {
|
|
@@ -26,7 +21,7 @@ private class ForegroundScheduler {
|
|
|
26
21
|
} else {
|
|
27
22
|
blueRunInMainThread {
|
|
28
23
|
self.timer = Timer.scheduledTimer(
|
|
29
|
-
timeInterval: self.scheduler!.
|
|
24
|
+
timeInterval: self.scheduler!.calculateNextInterval(),
|
|
30
25
|
target: self,
|
|
31
26
|
selector: #selector(self.handleTask),
|
|
32
27
|
userInfo: nil,
|
|
@@ -36,7 +31,6 @@ private class ForegroundScheduler {
|
|
|
36
31
|
}
|
|
37
32
|
}
|
|
38
33
|
|
|
39
|
-
@available(macOS 10.15, *)
|
|
40
34
|
@objc private func handleTask() {
|
|
41
35
|
DispatchQueue.global(qos: .background).async {
|
|
42
36
|
Task {
|
|
@@ -142,4 +136,28 @@ internal class BlueAccessSyncScheduler: BlueEventListener {
|
|
|
142
136
|
|
|
143
137
|
_ = try await command.runAsync()
|
|
144
138
|
}
|
|
139
|
+
|
|
140
|
+
func calculateNextInterval(_ now: Date? = nil) -> TimeInterval {
|
|
141
|
+
var interval: TimeInterval = self.timeInterval
|
|
142
|
+
|
|
143
|
+
if let credentials = try? blueCommands.getAccessCredentials.run().credentials {
|
|
144
|
+
if (!credentials.isEmpty) {
|
|
145
|
+
credentials.forEach { credential in
|
|
146
|
+
if (!credential.checkValidityStart()) {
|
|
147
|
+
if let validFrom = credential.validFrom.toDate() {
|
|
148
|
+
let now = now ?? Date()
|
|
149
|
+
|
|
150
|
+
if validFrom > now {
|
|
151
|
+
let differenceInSeconds = validFrom.timeIntervalSince(now)
|
|
152
|
+
|
|
153
|
+
interval = min(differenceInSeconds, interval)
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return interval
|
|
162
|
+
}
|
|
145
163
|
}
|