@blueid/access-capacitor 1.9.0 → 1.18.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/android/build.gradle +3 -5
- package/android/repo/net/blueid/access/5.0/access-5.0-sources.jar +0 -0
- package/android/repo/net/blueid/access/5.0/access-5.0-sources.jar.md5 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0-sources.jar.sha1 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0-sources.jar.sha256 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0-sources.jar.sha512 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0.aar +0 -0
- package/android/repo/net/blueid/access/5.0/access-5.0.aar.md5 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0.aar.sha1 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0.aar.sha256 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0.aar.sha512 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0.module +29 -15
- package/android/repo/net/blueid/access/5.0/access-5.0.module.md5 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0.module.sha1 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0.module.sha256 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0.module.sha512 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0.pom +12 -0
- package/android/repo/net/blueid/access/5.0/access-5.0.pom.md5 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0.pom.sha1 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0.pom.sha256 +1 -1
- package/android/repo/net/blueid/access/5.0/access-5.0.pom.sha512 +1 -1
- package/android/repo/net/blueid/access/maven-metadata.xml +1 -1
- package/android/repo/net/blueid/access/maven-metadata.xml.md5 +1 -1
- package/android/repo/net/blueid/access/maven-metadata.xml.sha1 +1 -1
- package/android/repo/net/blueid/access/maven-metadata.xml.sha256 +1 -1
- package/android/repo/net/blueid/access/maven-metadata.xml.sha512 +1 -1
- package/android/src/main/java/com/blueid/access/plugins/capacitor/BlueIDAccess.java +1 -43
- package/android/src/main/java/com/blueid/access/plugins/capacitor/BlueIDAccessPlugin.java +1 -87
- package/dist/esm/BlueSystem_pb.d.ts +41 -0
- package/dist/esm/BlueSystem_pb.js +32 -0
- package/dist/esm/BlueSystem_pb.js.map +1 -1
- package/dist/esm/interop.js +0 -3
- package/dist/esm/interop.js.map +1 -1
- package/dist/plugin.cjs.js +34 -3
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +34 -3
- package/dist/plugin.js.map +1 -1
- package/ios/CBlueIDAccess.xcframework/Info.plist +6 -6
- package/ios/CBlueIDAccess.xcframework/ios-arm64/Headers/core/BlueCore.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.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.h +1 -1
- package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/libCBlueIDAccess.a +0 -0
- package/ios/Plugin/BlueIDAccessPlugin.swift +1 -1
- package/ios/Plugin/BlueIDAccessSDK/BlueAPI.swift +7 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueAPIProtocol.swift +22 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueCore.pb.swift +9 -1
- package/ios/Plugin/BlueIDAccessSDK/BlueDevices.swift +11 -25
- package/ios/Plugin/BlueIDAccessSDK/BlueDevicesList.swift +89 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueSDK.pb.swift +18 -2
- package/ios/Plugin/BlueIDAccessSDK/BlueSPTransponder.swift +1 -3
- package/ios/Plugin/BlueIDAccessSDK/BlueSystem.pb.swift +185 -3
- package/ios/Plugin/BlueIDAccessSDK/BlueSystem.swift +43 -17
- package/package.json +2 -4
- package/android/settings.gradle +0 -4
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<key>HeadersPath</key>
|
|
11
11
|
<string>Headers</string>
|
|
12
12
|
<key>LibraryIdentifier</key>
|
|
13
|
-
<string>
|
|
13
|
+
<string>macos-arm64_x86_64</string>
|
|
14
14
|
<key>LibraryPath</key>
|
|
15
15
|
<string>libCBlueIDAccess.a</string>
|
|
16
16
|
<key>SupportedArchitectures</key>
|
|
@@ -19,9 +19,7 @@
|
|
|
19
19
|
<string>x86_64</string>
|
|
20
20
|
</array>
|
|
21
21
|
<key>SupportedPlatform</key>
|
|
22
|
-
<string>
|
|
23
|
-
<key>SupportedPlatformVariant</key>
|
|
24
|
-
<string>simulator</string>
|
|
22
|
+
<string>macos</string>
|
|
25
23
|
</dict>
|
|
26
24
|
<dict>
|
|
27
25
|
<key>BinaryPath</key>
|
|
@@ -45,7 +43,7 @@
|
|
|
45
43
|
<key>HeadersPath</key>
|
|
46
44
|
<string>Headers</string>
|
|
47
45
|
<key>LibraryIdentifier</key>
|
|
48
|
-
<string>
|
|
46
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
49
47
|
<key>LibraryPath</key>
|
|
50
48
|
<string>libCBlueIDAccess.a</string>
|
|
51
49
|
<key>SupportedArchitectures</key>
|
|
@@ -54,7 +52,9 @@
|
|
|
54
52
|
<string>x86_64</string>
|
|
55
53
|
</array>
|
|
56
54
|
<key>SupportedPlatform</key>
|
|
57
|
-
<string>
|
|
55
|
+
<string>ios</string>
|
|
56
|
+
<key>SupportedPlatformVariant</key>
|
|
57
|
+
<string>simulator</string>
|
|
58
58
|
</dict>
|
|
59
59
|
</array>
|
|
60
60
|
<key>CFBundlePackageType</key>
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
// Return with void in case of error
|
|
40
40
|
#define BLUE_ERROR_CHECK_ERROR_VOID(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, true, return)
|
|
41
|
-
#define
|
|
41
|
+
#define BLUE_ERROR_CHECK_DEBUG_VOID(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, false, return)
|
|
42
42
|
|
|
43
43
|
// Just log errors without returning
|
|
44
44
|
#define BLUE_ERROR_LOG_ERROR(EXPRESSION, DEBUG_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, DEBUG_MESSAGE, true, (void)0)
|
|
Binary file
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
// Return with void in case of error
|
|
40
40
|
#define BLUE_ERROR_CHECK_ERROR_VOID(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, true, return)
|
|
41
|
-
#define
|
|
41
|
+
#define BLUE_ERROR_CHECK_DEBUG_VOID(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, false, return)
|
|
42
42
|
|
|
43
43
|
// Just log errors without returning
|
|
44
44
|
#define BLUE_ERROR_LOG_ERROR(EXPRESSION, DEBUG_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, DEBUG_MESSAGE, true, (void)0)
|
|
Binary file
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
// Return with void in case of error
|
|
40
40
|
#define BLUE_ERROR_CHECK_ERROR_VOID(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, true, return)
|
|
41
|
-
#define
|
|
41
|
+
#define BLUE_ERROR_CHECK_DEBUG_VOID(EXPRESSION, ERROR_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, ERROR_MESSAGE, false, return)
|
|
42
42
|
|
|
43
43
|
// Just log errors without returning
|
|
44
44
|
#define BLUE_ERROR_LOG_ERROR(EXPRESSION, DEBUG_MESSAGE) BLUE_ERROR_CHECK_EXT(EXPRESSION, DEBUG_MESSAGE, true, (void)0)
|
|
Binary file
|
|
@@ -107,6 +107,13 @@ class BlueAPI: BlueAPIProtocol {
|
|
|
107
107
|
)
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
func getDevice(deviceID: String, with tokenAuthentication: BlueTokenAuthentication) async throws -> BlueFetchResponse<BlueGetDeviceResult> {
|
|
111
|
+
return try await post(
|
|
112
|
+
endpoint: .AccessGetDevice,
|
|
113
|
+
request: BlueGetDeviceRequest(deviceId: deviceID, tokenAuthentication: tokenAuthentication)
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
|
|
110
117
|
private func post<T>(endpoint: BlueAPIEndpoints, request: Encodable) async throws -> BlueFetchResponse<T> {
|
|
111
118
|
guard #available(macOS 12.0, *) else {
|
|
112
119
|
throw BlueError(.sdkUnsupportedPlatform)
|
|
@@ -22,6 +22,7 @@ public enum BlueAPIEndpoints: String {
|
|
|
22
22
|
case AccessSynchronizeOfflineAccess = "/access/synchronizeOfflineAccess"
|
|
23
23
|
case AccessClaimCredential = "/access/cc"
|
|
24
24
|
case AccessGetLatestFirmware = "/access/getLatestFirmware"
|
|
25
|
+
case AccessGetDevice = "/access/device"
|
|
25
26
|
|
|
26
27
|
var url: URL {
|
|
27
28
|
guard let url = URL(string: baseURL) else {
|
|
@@ -258,6 +259,26 @@ internal struct BlueGetLatestFirmwareResult: Decodable {
|
|
|
258
259
|
let test: BlueLatestFirmwareInfo?
|
|
259
260
|
}
|
|
260
261
|
|
|
262
|
+
/// [POST] /access/device request
|
|
263
|
+
internal struct BlueGetDeviceRequest: Encodable {
|
|
264
|
+
var deviceId: String
|
|
265
|
+
var tokenAuthentication: BlueTokenAuthentication
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
internal struct BlueDeviceHardware: Decodable {
|
|
269
|
+
let name: String
|
|
270
|
+
let vendor: String
|
|
271
|
+
let vendorName: String
|
|
272
|
+
let version: Int
|
|
273
|
+
let type: Int
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/// [POST] /access/device response
|
|
277
|
+
internal struct BlueGetDeviceResult: Decodable {
|
|
278
|
+
let configId: String
|
|
279
|
+
let hardware: BlueDeviceHardware
|
|
280
|
+
}
|
|
281
|
+
|
|
261
282
|
protocol BlueAPIProtocol {
|
|
262
283
|
func getAccessToken(credentialId: String) async throws -> BlueFetchResponse<BlueAccessToken>
|
|
263
284
|
func synchronizeMobileAccess(with tokenAuthentication: BlueTokenAuthentication, forceRefresh: Bool?) async throws -> BlueFetchResponse<BlueMobileAccessSynchronizationResult>
|
|
@@ -273,4 +294,5 @@ protocol BlueAPIProtocol {
|
|
|
273
294
|
func claimAccessCredential(activationToken: String) async throws -> BlueFetchResponse<BlueClaimAccessCredentialResult>
|
|
274
295
|
func getAccessCredentials(with tokenAuthentication: BlueTokenAuthentication) async throws -> BlueFetchResponse<BlueGetAccessCredentialsResult>
|
|
275
296
|
func getLatestFirmware(deviceID: String, with tokenAuthentication: BlueTokenAuthentication) async throws -> BlueFetchResponse<BlueGetLatestFirmwareResult>
|
|
297
|
+
func getDevice(deviceID: String, with tokenAuthentication: BlueTokenAuthentication) async throws -> BlueFetchResponse<BlueGetDeviceResult>
|
|
276
298
|
}
|
|
@@ -6406,7 +6406,15 @@ extension BlueOssSoConfiguration: SwiftProtobuf.Message, SwiftProtobuf._MessageI
|
|
|
6406
6406
|
var _blacklist: BlueOssSoFileBlacklist? = nil
|
|
6407
6407
|
var _customerExtensions: BlueOssSoFileCustomerExtensions? = nil
|
|
6408
6408
|
|
|
6409
|
-
|
|
6409
|
+
#if swift(>=5.10)
|
|
6410
|
+
// This property is used as the initial default value for new instances of the type.
|
|
6411
|
+
// The type itself is protecting the reference to its storage via CoW semantics.
|
|
6412
|
+
// This will force a copy to be made of this reference when the first mutation occurs;
|
|
6413
|
+
// hence, it is safe to mark this as `nonisolated(unsafe)`.
|
|
6414
|
+
static nonisolated(unsafe) let defaultInstance = _StorageClass()
|
|
6415
|
+
#else
|
|
6416
|
+
static let defaultInstance = _StorageClass()
|
|
6417
|
+
#endif
|
|
6410
6418
|
|
|
6411
6419
|
private init() {}
|
|
6412
6420
|
|
|
@@ -2,10 +2,11 @@ import Foundation
|
|
|
2
2
|
|
|
3
3
|
internal var maxDeviceAgeSeconds = 10.0
|
|
4
4
|
|
|
5
|
-
private var blueDevices: [BlueDevice] = []
|
|
6
5
|
private var bluePurgeDevicesTimer: Timer? = nil
|
|
7
6
|
private var blueDeviceScannersCount = 0
|
|
8
7
|
|
|
8
|
+
private let blueDevicesList = BlueDevicesList()
|
|
9
|
+
|
|
9
10
|
internal func blueSetMaxDeviceAgeSeconds(_ newMaxDeviceAgeSeconds: Double) {
|
|
10
11
|
maxDeviceAgeSeconds = max(newMaxDeviceAgeSeconds, 1)
|
|
11
12
|
}
|
|
@@ -35,18 +36,11 @@ internal func waitForDeviceAvailability(_ deviceID: String, timeout: Int = 10, m
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
internal func blueGetDevice(_ deviceID: String) -> BlueDevice? {
|
|
38
|
-
|
|
39
|
-
if (device.info.deviceID == deviceID) {
|
|
40
|
-
return device
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return nil
|
|
39
|
+
return blueDevicesList.get(deviceID)
|
|
45
40
|
}
|
|
46
41
|
|
|
47
42
|
internal func blueAddDevice(_ device: BlueDevice) {
|
|
48
|
-
if
|
|
49
|
-
blueDevices.append(device)
|
|
43
|
+
if blueDevicesList.add(device) {
|
|
50
44
|
blueNotifyAddeddDevice(device)
|
|
51
45
|
}
|
|
52
46
|
}
|
|
@@ -54,32 +48,24 @@ internal func blueAddDevice(_ device: BlueDevice) {
|
|
|
54
48
|
internal func bluePurgeOldDevices() {
|
|
55
49
|
let now = Date()
|
|
56
50
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
for device in blueDevices {
|
|
51
|
+
blueDevicesList.remove() { device in
|
|
60
52
|
let shouldPurge = now.timeIntervalSince(device.lastSeenAt) >= maxDeviceAgeSeconds && !isActiveDevice(device)
|
|
61
53
|
if (shouldPurge) {
|
|
62
54
|
blueNotifyRemovedDevice(device)
|
|
63
|
-
} else {
|
|
64
|
-
newDevices.append(device)
|
|
65
55
|
}
|
|
56
|
+
|
|
57
|
+
return shouldPurge
|
|
66
58
|
}
|
|
67
|
-
|
|
68
|
-
blueDevices = newDevices
|
|
69
59
|
}
|
|
70
60
|
|
|
71
61
|
internal func bluePurgeDevicesByType(_ deviceType: BlueDeviceType) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (device.info.deviceType == deviceType) {
|
|
62
|
+
blueDevicesList.remove() { device in
|
|
63
|
+
let shouldPurge = device.info.deviceType == deviceType
|
|
64
|
+
if (shouldPurge) {
|
|
76
65
|
blueNotifyRemovedDevice(device)
|
|
77
|
-
} else {
|
|
78
|
-
newDevices.append(device)
|
|
79
66
|
}
|
|
67
|
+
return shouldPurge
|
|
80
68
|
}
|
|
81
|
-
|
|
82
|
-
blueDevices = newDevices
|
|
83
69
|
}
|
|
84
70
|
|
|
85
71
|
internal func blueAddDeviceScanner() {
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @class BlueDevicesList
|
|
5
|
+
* A thread-safe list to manage BlueDevices.
|
|
6
|
+
* This class provides thread-safe operations for adding, retrieving, and removing BlueDevices.
|
|
7
|
+
* It internally uses a DispatchQueue with concurrent attributes to synchronize access to the list.
|
|
8
|
+
*/
|
|
9
|
+
internal class BlueDevicesList {
|
|
10
|
+
private let queue = DispatchQueue(label: "blueid.BlueDevicesList", attributes: .concurrent)
|
|
11
|
+
|
|
12
|
+
private var devices: [BlueDevice] = []
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Adds a BlueDevice to the list.
|
|
16
|
+
*
|
|
17
|
+
* - Parameters:
|
|
18
|
+
* - device: The BlueDevice to add.
|
|
19
|
+
*
|
|
20
|
+
* - Returns: `true` if the device was successfully added, `false` if a device with the same device ID already exists in the list.
|
|
21
|
+
*/
|
|
22
|
+
func add(_ device: BlueDevice) -> Bool {
|
|
23
|
+
var added = false
|
|
24
|
+
|
|
25
|
+
queue.sync(flags: .barrier) {
|
|
26
|
+
if (self.getById(device.info.deviceID) == nil) {
|
|
27
|
+
self.devices.append(device)
|
|
28
|
+
added = true
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return added
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Retrieves a BlueDevice from the list based on its device ID.
|
|
37
|
+
*
|
|
38
|
+
* - Parameters:
|
|
39
|
+
* - deviceID: The ID of the BlueDevice to retrieve.
|
|
40
|
+
*
|
|
41
|
+
* - Returns: The BlueDevice with the specified device ID, or `nil` if no device with that ID exists in the list.
|
|
42
|
+
*/
|
|
43
|
+
func get(_ deviceID: String) -> BlueDevice? {
|
|
44
|
+
var device: BlueDevice?
|
|
45
|
+
queue.sync() {
|
|
46
|
+
device = self.getById(deviceID)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return device
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Removes BlueDevices from the list based on a filter closure.
|
|
54
|
+
*
|
|
55
|
+
* - Parameters:
|
|
56
|
+
* - where: A closure that returns `true` for devices to be removed, `false` otherwise.
|
|
57
|
+
*/
|
|
58
|
+
func remove(where shouldBeRemoved: @escaping (BlueDevice) -> Bool) {
|
|
59
|
+
queue.async(flags: .barrier) {
|
|
60
|
+
var newDevices: [BlueDevice] = []
|
|
61
|
+
|
|
62
|
+
for device in self.devices {
|
|
63
|
+
if (!shouldBeRemoved(device)) {
|
|
64
|
+
newDevices.append(device)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
self.devices.removeAll()
|
|
69
|
+
self.devices.append(contentsOf: newDevices)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Returns the number of devices currently stored in the `BlueDevicesList`.
|
|
75
|
+
*
|
|
76
|
+
* - Returns: An integer representing the count of devices in the list.
|
|
77
|
+
*/
|
|
78
|
+
func count() -> Int {
|
|
79
|
+
var count = 0
|
|
80
|
+
queue.sync() {
|
|
81
|
+
count = self.devices.count
|
|
82
|
+
}
|
|
83
|
+
return count
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private func getById(_ deviceID: String) -> BlueDevice? {
|
|
87
|
+
return self.devices.first { $0.info.deviceID == deviceID }
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -1204,7 +1204,15 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
1204
1204
|
var _dfuUpdateFwlabel: String? = nil
|
|
1205
1205
|
var _dfuWaitForDeviceToRestartTaskLabel: String? = nil
|
|
1206
1206
|
|
|
1207
|
-
|
|
1207
|
+
#if swift(>=5.10)
|
|
1208
|
+
// This property is used as the initial default value for new instances of the type.
|
|
1209
|
+
// The type itself is protecting the reference to its storage via CoW semantics.
|
|
1210
|
+
// This will force a copy to be made of this reference when the first mutation occurs;
|
|
1211
|
+
// hence, it is safe to mark this as `nonisolated(unsafe)`.
|
|
1212
|
+
static nonisolated(unsafe) let defaultInstance = _StorageClass()
|
|
1213
|
+
#else
|
|
1214
|
+
static let defaultInstance = _StorageClass()
|
|
1215
|
+
#endif
|
|
1208
1216
|
|
|
1209
1217
|
private init() {}
|
|
1210
1218
|
|
|
@@ -1824,7 +1832,15 @@ extension BlueAccessCredential: SwiftProtobuf.Message, SwiftProtobuf._MessageImp
|
|
|
1824
1832
|
var _organisation: String? = nil
|
|
1825
1833
|
var _organisationName: String? = nil
|
|
1826
1834
|
|
|
1827
|
-
|
|
1835
|
+
#if swift(>=5.10)
|
|
1836
|
+
// This property is used as the initial default value for new instances of the type.
|
|
1837
|
+
// The type itself is protecting the reference to its storage via CoW semantics.
|
|
1838
|
+
// This will force a copy to be made of this reference when the first mutation occurs;
|
|
1839
|
+
// hence, it is safe to mark this as `nonisolated(unsafe)`.
|
|
1840
|
+
static nonisolated(unsafe) let defaultInstance = _StorageClass()
|
|
1841
|
+
#else
|
|
1842
|
+
static let defaultInstance = _StorageClass()
|
|
1843
|
+
#endif
|
|
1828
1844
|
|
|
1829
1845
|
private init() {}
|
|
1830
1846
|
|
|
@@ -61,10 +61,8 @@ internal final class BlueSPTransponder {
|
|
|
61
61
|
|
|
62
62
|
do {
|
|
63
63
|
_ = try blueClibErrorCheck(blueSPTransponder_Release())
|
|
64
|
-
} catch let error as BlueError {
|
|
65
|
-
fatalError(error.errorDescription!)
|
|
66
64
|
} catch {
|
|
67
|
-
|
|
65
|
+
blueLogError(error.localizedDescription)
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
68
|
|
|
@@ -704,6 +704,67 @@ public struct BlueSystemProvisioning {
|
|
|
704
704
|
fileprivate var _signaturePublicKey: Data? = nil
|
|
705
705
|
}
|
|
706
706
|
|
|
707
|
+
public struct BlueHardwareInfo {
|
|
708
|
+
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
709
|
+
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
710
|
+
// methods supported on all messages.
|
|
711
|
+
|
|
712
|
+
public var name: String {
|
|
713
|
+
get {return _name ?? String()}
|
|
714
|
+
set {_name = newValue}
|
|
715
|
+
}
|
|
716
|
+
/// Returns true if `name` has been explicitly set.
|
|
717
|
+
public var hasName: Bool {return self._name != nil}
|
|
718
|
+
/// Clears the value of `name`. Subsequent reads from it will return its default value.
|
|
719
|
+
public mutating func clearName() {self._name = nil}
|
|
720
|
+
|
|
721
|
+
public var vendor: String {
|
|
722
|
+
get {return _vendor ?? String()}
|
|
723
|
+
set {_vendor = newValue}
|
|
724
|
+
}
|
|
725
|
+
/// Returns true if `vendor` has been explicitly set.
|
|
726
|
+
public var hasVendor: Bool {return self._vendor != nil}
|
|
727
|
+
/// Clears the value of `vendor`. Subsequent reads from it will return its default value.
|
|
728
|
+
public mutating func clearVendor() {self._vendor = nil}
|
|
729
|
+
|
|
730
|
+
public var vendorName: String {
|
|
731
|
+
get {return _vendorName ?? String()}
|
|
732
|
+
set {_vendorName = newValue}
|
|
733
|
+
}
|
|
734
|
+
/// Returns true if `vendorName` has been explicitly set.
|
|
735
|
+
public var hasVendorName: Bool {return self._vendorName != nil}
|
|
736
|
+
/// Clears the value of `vendorName`. Subsequent reads from it will return its default value.
|
|
737
|
+
public mutating func clearVendorName() {self._vendorName = nil}
|
|
738
|
+
|
|
739
|
+
public var version: UInt32 {
|
|
740
|
+
get {return _version ?? 0}
|
|
741
|
+
set {_version = newValue}
|
|
742
|
+
}
|
|
743
|
+
/// Returns true if `version` has been explicitly set.
|
|
744
|
+
public var hasVersion: Bool {return self._version != nil}
|
|
745
|
+
/// Clears the value of `version`. Subsequent reads from it will return its default value.
|
|
746
|
+
public mutating func clearVersion() {self._version = nil}
|
|
747
|
+
|
|
748
|
+
public var type: BlueHardwareType {
|
|
749
|
+
get {return _type ?? .unknownHardware}
|
|
750
|
+
set {_type = newValue}
|
|
751
|
+
}
|
|
752
|
+
/// Returns true if `type` has been explicitly set.
|
|
753
|
+
public var hasType: Bool {return self._type != nil}
|
|
754
|
+
/// Clears the value of `type`. Subsequent reads from it will return its default value.
|
|
755
|
+
public mutating func clearType() {self._type = nil}
|
|
756
|
+
|
|
757
|
+
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
758
|
+
|
|
759
|
+
public init() {}
|
|
760
|
+
|
|
761
|
+
fileprivate var _name: String? = nil
|
|
762
|
+
fileprivate var _vendor: String? = nil
|
|
763
|
+
fileprivate var _vendorName: String? = nil
|
|
764
|
+
fileprivate var _version: UInt32? = nil
|
|
765
|
+
fileprivate var _type: BlueHardwareType? = nil
|
|
766
|
+
}
|
|
767
|
+
|
|
707
768
|
public struct BlueSystemStatus {
|
|
708
769
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
709
770
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
@@ -818,6 +879,24 @@ public struct BlueSystemStatus {
|
|
|
818
879
|
/// Clears the value of `newTestFirmwareVersionAvailable`. Subsequent reads from it will return its default value.
|
|
819
880
|
public mutating func clearNewTestFirmwareVersionAvailable() {_uniqueStorage()._newTestFirmwareVersionAvailable = nil}
|
|
820
881
|
|
|
882
|
+
public var newConfigurationAvailable: Bool {
|
|
883
|
+
get {return _storage._newConfigurationAvailable ?? false}
|
|
884
|
+
set {_uniqueStorage()._newConfigurationAvailable = newValue}
|
|
885
|
+
}
|
|
886
|
+
/// Returns true if `newConfigurationAvailable` has been explicitly set.
|
|
887
|
+
public var hasNewConfigurationAvailable: Bool {return _storage._newConfigurationAvailable != nil}
|
|
888
|
+
/// Clears the value of `newConfigurationAvailable`. Subsequent reads from it will return its default value.
|
|
889
|
+
public mutating func clearNewConfigurationAvailable() {_uniqueStorage()._newConfigurationAvailable = nil}
|
|
890
|
+
|
|
891
|
+
public var hardwareInfo: BlueHardwareInfo {
|
|
892
|
+
get {return _storage._hardwareInfo ?? BlueHardwareInfo()}
|
|
893
|
+
set {_uniqueStorage()._hardwareInfo = newValue}
|
|
894
|
+
}
|
|
895
|
+
/// Returns true if `hardwareInfo` has been explicitly set.
|
|
896
|
+
public var hasHardwareInfo: Bool {return _storage._hardwareInfo != nil}
|
|
897
|
+
/// Clears the value of `hardwareInfo`. Subsequent reads from it will return its default value.
|
|
898
|
+
public mutating func clearHardwareInfo() {_uniqueStorage()._hardwareInfo = nil}
|
|
899
|
+
|
|
821
900
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
822
901
|
|
|
823
902
|
public init() {}
|
|
@@ -1074,6 +1153,7 @@ extension BlueSystemTimeUnix: @unchecked Sendable {}
|
|
|
1074
1153
|
extension BlueSystemUpdate: @unchecked Sendable {}
|
|
1075
1154
|
extension BlueSystemSettings: @unchecked Sendable {}
|
|
1076
1155
|
extension BlueSystemProvisioning: @unchecked Sendable {}
|
|
1156
|
+
extension BlueHardwareInfo: @unchecked Sendable {}
|
|
1077
1157
|
extension BlueSystemStatus: @unchecked Sendable {}
|
|
1078
1158
|
extension BlueSystemLogQuery: @unchecked Sendable {}
|
|
1079
1159
|
extension BlueSystemLogQuery.OneOf_Start: @unchecked Sendable {}
|
|
@@ -1514,7 +1594,15 @@ extension BlueSystemConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
1514
1594
|
var _oss: BlueOssConfig? = nil
|
|
1515
1595
|
var _lock: BlueLockConfig? = nil
|
|
1516
1596
|
|
|
1517
|
-
|
|
1597
|
+
#if swift(>=5.10)
|
|
1598
|
+
// This property is used as the initial default value for new instances of the type.
|
|
1599
|
+
// The type itself is protecting the reference to its storage via CoW semantics.
|
|
1600
|
+
// This will force a copy to be made of this reference when the first mutation occurs;
|
|
1601
|
+
// hence, it is safe to mark this as `nonisolated(unsafe)`.
|
|
1602
|
+
static nonisolated(unsafe) let defaultInstance = _StorageClass()
|
|
1603
|
+
#else
|
|
1604
|
+
static let defaultInstance = _StorageClass()
|
|
1605
|
+
#endif
|
|
1518
1606
|
|
|
1519
1607
|
private init() {}
|
|
1520
1608
|
|
|
@@ -1903,6 +1991,75 @@ extension BlueSystemProvisioning: SwiftProtobuf.Message, SwiftProtobuf._MessageI
|
|
|
1903
1991
|
}
|
|
1904
1992
|
}
|
|
1905
1993
|
|
|
1994
|
+
extension BlueHardwareInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
1995
|
+
public static let protoMessageName: String = "BlueHardwareInfo"
|
|
1996
|
+
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
1997
|
+
1: .same(proto: "name"),
|
|
1998
|
+
2: .same(proto: "vendor"),
|
|
1999
|
+
3: .same(proto: "vendorName"),
|
|
2000
|
+
4: .same(proto: "version"),
|
|
2001
|
+
5: .same(proto: "type"),
|
|
2002
|
+
]
|
|
2003
|
+
|
|
2004
|
+
public var isInitialized: Bool {
|
|
2005
|
+
if self._name == nil {return false}
|
|
2006
|
+
if self._vendor == nil {return false}
|
|
2007
|
+
if self._vendorName == nil {return false}
|
|
2008
|
+
if self._version == nil {return false}
|
|
2009
|
+
if self._type == nil {return false}
|
|
2010
|
+
return true
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
2014
|
+
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
2015
|
+
// The use of inline closures is to circumvent an issue where the compiler
|
|
2016
|
+
// allocates stack space for every case branch when no optimizations are
|
|
2017
|
+
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
2018
|
+
switch fieldNumber {
|
|
2019
|
+
case 1: try { try decoder.decodeSingularStringField(value: &self._name) }()
|
|
2020
|
+
case 2: try { try decoder.decodeSingularStringField(value: &self._vendor) }()
|
|
2021
|
+
case 3: try { try decoder.decodeSingularStringField(value: &self._vendorName) }()
|
|
2022
|
+
case 4: try { try decoder.decodeSingularUInt32Field(value: &self._version) }()
|
|
2023
|
+
case 5: try { try decoder.decodeSingularEnumField(value: &self._type) }()
|
|
2024
|
+
default: break
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
2030
|
+
// The use of inline closures is to circumvent an issue where the compiler
|
|
2031
|
+
// allocates stack space for every if/case branch local when no optimizations
|
|
2032
|
+
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
|
2033
|
+
// https://github.com/apple/swift-protobuf/issues/1182
|
|
2034
|
+
try { if let v = self._name {
|
|
2035
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 1)
|
|
2036
|
+
} }()
|
|
2037
|
+
try { if let v = self._vendor {
|
|
2038
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 2)
|
|
2039
|
+
} }()
|
|
2040
|
+
try { if let v = self._vendorName {
|
|
2041
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 3)
|
|
2042
|
+
} }()
|
|
2043
|
+
try { if let v = self._version {
|
|
2044
|
+
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 4)
|
|
2045
|
+
} }()
|
|
2046
|
+
try { if let v = self._type {
|
|
2047
|
+
try visitor.visitSingularEnumField(value: v, fieldNumber: 5)
|
|
2048
|
+
} }()
|
|
2049
|
+
try unknownFields.traverse(visitor: &visitor)
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
public static func ==(lhs: BlueHardwareInfo, rhs: BlueHardwareInfo) -> Bool {
|
|
2053
|
+
if lhs._name != rhs._name {return false}
|
|
2054
|
+
if lhs._vendor != rhs._vendor {return false}
|
|
2055
|
+
if lhs._vendorName != rhs._vendorName {return false}
|
|
2056
|
+
if lhs._version != rhs._version {return false}
|
|
2057
|
+
if lhs._type != rhs._type {return false}
|
|
2058
|
+
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
2059
|
+
return true
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
|
|
1906
2063
|
extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
1907
2064
|
public static let protoMessageName: String = "BlueSystemStatus"
|
|
1908
2065
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
@@ -1918,6 +2075,8 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
1918
2075
|
10: .same(proto: "applicationVersionTest"),
|
|
1919
2076
|
11: .same(proto: "newFirmwareVersionAvailable"),
|
|
1920
2077
|
12: .same(proto: "newTestFirmwareVersionAvailable"),
|
|
2078
|
+
13: .same(proto: "newConfigurationAvailable"),
|
|
2079
|
+
14: .same(proto: "hardwareInfo"),
|
|
1921
2080
|
]
|
|
1922
2081
|
|
|
1923
2082
|
fileprivate class _StorageClass {
|
|
@@ -1933,8 +2092,18 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
1933
2092
|
var _applicationVersionTest: UInt32? = nil
|
|
1934
2093
|
var _newFirmwareVersionAvailable: Bool? = nil
|
|
1935
2094
|
var _newTestFirmwareVersionAvailable: Bool? = nil
|
|
1936
|
-
|
|
1937
|
-
|
|
2095
|
+
var _newConfigurationAvailable: Bool? = nil
|
|
2096
|
+
var _hardwareInfo: BlueHardwareInfo? = nil
|
|
2097
|
+
|
|
2098
|
+
#if swift(>=5.10)
|
|
2099
|
+
// This property is used as the initial default value for new instances of the type.
|
|
2100
|
+
// The type itself is protecting the reference to its storage via CoW semantics.
|
|
2101
|
+
// This will force a copy to be made of this reference when the first mutation occurs;
|
|
2102
|
+
// hence, it is safe to mark this as `nonisolated(unsafe)`.
|
|
2103
|
+
static nonisolated(unsafe) let defaultInstance = _StorageClass()
|
|
2104
|
+
#else
|
|
2105
|
+
static let defaultInstance = _StorageClass()
|
|
2106
|
+
#endif
|
|
1938
2107
|
|
|
1939
2108
|
private init() {}
|
|
1940
2109
|
|
|
@@ -1951,6 +2120,8 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
1951
2120
|
_applicationVersionTest = source._applicationVersionTest
|
|
1952
2121
|
_newFirmwareVersionAvailable = source._newFirmwareVersionAvailable
|
|
1953
2122
|
_newTestFirmwareVersionAvailable = source._newTestFirmwareVersionAvailable
|
|
2123
|
+
_newConfigurationAvailable = source._newConfigurationAvailable
|
|
2124
|
+
_hardwareInfo = source._hardwareInfo
|
|
1954
2125
|
}
|
|
1955
2126
|
}
|
|
1956
2127
|
|
|
@@ -1974,6 +2145,7 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
1974
2145
|
if let v = _storage._localTime, !v.isInitialized {return false}
|
|
1975
2146
|
if let v = _storage._settings, !v.isInitialized {return false}
|
|
1976
2147
|
if let v = _storage._lock, !v.isInitialized {return false}
|
|
2148
|
+
if let v = _storage._hardwareInfo, !v.isInitialized {return false}
|
|
1977
2149
|
return true
|
|
1978
2150
|
}
|
|
1979
2151
|
}
|
|
@@ -1998,6 +2170,8 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
1998
2170
|
case 10: try { try decoder.decodeSingularUInt32Field(value: &_storage._applicationVersionTest) }()
|
|
1999
2171
|
case 11: try { try decoder.decodeSingularBoolField(value: &_storage._newFirmwareVersionAvailable) }()
|
|
2000
2172
|
case 12: try { try decoder.decodeSingularBoolField(value: &_storage._newTestFirmwareVersionAvailable) }()
|
|
2173
|
+
case 13: try { try decoder.decodeSingularBoolField(value: &_storage._newConfigurationAvailable) }()
|
|
2174
|
+
case 14: try { try decoder.decodeSingularMessageField(value: &_storage._hardwareInfo) }()
|
|
2001
2175
|
default: break
|
|
2002
2176
|
}
|
|
2003
2177
|
}
|
|
@@ -2046,6 +2220,12 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
2046
2220
|
try { if let v = _storage._newTestFirmwareVersionAvailable {
|
|
2047
2221
|
try visitor.visitSingularBoolField(value: v, fieldNumber: 12)
|
|
2048
2222
|
} }()
|
|
2223
|
+
try { if let v = _storage._newConfigurationAvailable {
|
|
2224
|
+
try visitor.visitSingularBoolField(value: v, fieldNumber: 13)
|
|
2225
|
+
} }()
|
|
2226
|
+
try { if let v = _storage._hardwareInfo {
|
|
2227
|
+
try visitor.visitSingularMessageField(value: v, fieldNumber: 14)
|
|
2228
|
+
} }()
|
|
2049
2229
|
}
|
|
2050
2230
|
try unknownFields.traverse(visitor: &visitor)
|
|
2051
2231
|
}
|
|
@@ -2067,6 +2247,8 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
2067
2247
|
if _storage._applicationVersionTest != rhs_storage._applicationVersionTest {return false}
|
|
2068
2248
|
if _storage._newFirmwareVersionAvailable != rhs_storage._newFirmwareVersionAvailable {return false}
|
|
2069
2249
|
if _storage._newTestFirmwareVersionAvailable != rhs_storage._newTestFirmwareVersionAvailable {return false}
|
|
2250
|
+
if _storage._newConfigurationAvailable != rhs_storage._newConfigurationAvailable {return false}
|
|
2251
|
+
if _storage._hardwareInfo != rhs_storage._hardwareInfo {return false}
|
|
2070
2252
|
return true
|
|
2071
2253
|
}
|
|
2072
2254
|
if !storagesAreEqual {return false}
|