@blueid/access-capacitor 0.104.0 → 0.106.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/BlueidAccessCapacitor.podspec +2 -1
- package/dist/esm/BlueCore_pb.d.ts +12 -0
- package/dist/esm/BlueCore_pb.js +11 -0
- package/dist/esm/BlueCore_pb.js.map +1 -1
- package/dist/esm/BlueSDK_pb.d.ts +52 -0
- package/dist/esm/BlueSDK_pb.js +13 -0
- package/dist/esm/BlueSDK_pb.js.map +1 -1
- package/dist/esm/BlueSystem_pb.d.ts +12 -0
- package/dist/esm/BlueSystem_pb.js +3 -0
- package/dist/esm/BlueSystem_pb.js.map +1 -1
- package/dist/plugin.cjs.js +27 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +27 -0
- 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 +9 -4
- package/ios/CBlueIDAccess.xcframework/ios-arm64/libCBlueIDAccess.a +0 -0
- package/ios/CBlueIDAccess.xcframework/ios-arm64_x86_64-simulator/Headers/core/BlueCore.pb.h +9 -4
- 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 +9 -4
- package/ios/CBlueIDAccess.xcframework/macos-arm64_x86_64/libCBlueIDAccess.a +0 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueAPI.swift +7 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueAPIProtocol.swift +20 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueAccess.swift +50 -24
- package/ios/Plugin/BlueIDAccessSDK/BlueCommands.swift +3 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueCore.pb.swift +25 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueDFU/BlueDFUPeripheralService.swift +73 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueDFU/BlueUpdateAccessDeviceFirmwareCommand.swift +252 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueDevices.swift +24 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueError.swift +1 -1
- package/ios/Plugin/BlueIDAccessSDK/BlueFetch.swift +10 -2
- package/ios/Plugin/BlueIDAccessSDK/BlueModal/BlueModal.swift +30 -5
- package/ios/Plugin/BlueIDAccessSDK/BlueModal/{BlueSynchronizeAccessDeviceModalSession.swift → BlueStepProgressModalSession.swift} +4 -4
- package/ios/Plugin/BlueIDAccessSDK/BlueModal/{BlueSynchronizeAccessDeviceModalView.swift → BlueStepProgressModalView.swift} +59 -19
- package/ios/Plugin/BlueIDAccessSDK/BlueSDK.pb.swift +234 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueSystem.pb.swift +51 -0
- package/ios/Plugin/BlueIDAccessSDK/BlueTaskRunner.swift +42 -5
- package/ios/Plugin/BlueIDAccessSDK/BlueZip.swift +30 -0
- package/package.json +1 -1
|
@@ -405,6 +405,123 @@ public struct BlueI18n {
|
|
|
405
405
|
/// Clears the value of `syncDevicePushSystemStatusTaskLabel`. Subsequent reads from it will return its default value.
|
|
406
406
|
public mutating func clearSyncDevicePushSystemStatusTaskLabel() {_uniqueStorage()._syncDevicePushSystemStatusTaskLabel = nil}
|
|
407
407
|
|
|
408
|
+
public var syncDeviceCheckLatestFwlabel: String {
|
|
409
|
+
get {return _storage._syncDeviceCheckLatestFwlabel ?? "Check latest firmware"}
|
|
410
|
+
set {_uniqueStorage()._syncDeviceCheckLatestFwlabel = newValue}
|
|
411
|
+
}
|
|
412
|
+
/// Returns true if `syncDeviceCheckLatestFwlabel` has been explicitly set.
|
|
413
|
+
public var hasSyncDeviceCheckLatestFwlabel: Bool {return _storage._syncDeviceCheckLatestFwlabel != nil}
|
|
414
|
+
/// Clears the value of `syncDeviceCheckLatestFwlabel`. Subsequent reads from it will return its default value.
|
|
415
|
+
public mutating func clearSyncDeviceCheckLatestFwlabel() {_uniqueStorage()._syncDeviceCheckLatestFwlabel = nil}
|
|
416
|
+
|
|
417
|
+
public var dfuInProgressTitle: String {
|
|
418
|
+
get {return _storage._dfuInProgressTitle ?? "Update in Progress"}
|
|
419
|
+
set {_uniqueStorage()._dfuInProgressTitle = newValue}
|
|
420
|
+
}
|
|
421
|
+
/// Returns true if `dfuInProgressTitle` has been explicitly set.
|
|
422
|
+
public var hasDfuInProgressTitle: Bool {return _storage._dfuInProgressTitle != nil}
|
|
423
|
+
/// Clears the value of `dfuInProgressTitle`. Subsequent reads from it will return its default value.
|
|
424
|
+
public mutating func clearDfuInProgressTitle() {_uniqueStorage()._dfuInProgressTitle = nil}
|
|
425
|
+
|
|
426
|
+
public var dfuFailedTitle: String {
|
|
427
|
+
get {return _storage._dfuFailedTitle ?? "Update has failed"}
|
|
428
|
+
set {_uniqueStorage()._dfuFailedTitle = newValue}
|
|
429
|
+
}
|
|
430
|
+
/// Returns true if `dfuFailedTitle` has been explicitly set.
|
|
431
|
+
public var hasDfuFailedTitle: Bool {return _storage._dfuFailedTitle != nil}
|
|
432
|
+
/// Clears the value of `dfuFailedTitle`. Subsequent reads from it will return its default value.
|
|
433
|
+
public mutating func clearDfuFailedTitle() {_uniqueStorage()._dfuFailedTitle = nil}
|
|
434
|
+
|
|
435
|
+
public var dfuCancellingTitle: String {
|
|
436
|
+
get {return _storage._dfuCancellingTitle ?? "Cancelling..."}
|
|
437
|
+
set {_uniqueStorage()._dfuCancellingTitle = newValue}
|
|
438
|
+
}
|
|
439
|
+
/// Returns true if `dfuCancellingTitle` has been explicitly set.
|
|
440
|
+
public var hasDfuCancellingTitle: Bool {return _storage._dfuCancellingTitle != nil}
|
|
441
|
+
/// Clears the value of `dfuCancellingTitle`. Subsequent reads from it will return its default value.
|
|
442
|
+
public mutating func clearDfuCancellingTitle() {_uniqueStorage()._dfuCancellingTitle = nil}
|
|
443
|
+
|
|
444
|
+
public var dfuCompletedTitle: String {
|
|
445
|
+
get {return _storage._dfuCompletedTitle ?? "Update has been completed"}
|
|
446
|
+
set {_uniqueStorage()._dfuCompletedTitle = newValue}
|
|
447
|
+
}
|
|
448
|
+
/// Returns true if `dfuCompletedTitle` has been explicitly set.
|
|
449
|
+
public var hasDfuCompletedTitle: Bool {return _storage._dfuCompletedTitle != nil}
|
|
450
|
+
/// Clears the value of `dfuCompletedTitle`. Subsequent reads from it will return its default value.
|
|
451
|
+
public mutating func clearDfuCompletedTitle() {_uniqueStorage()._dfuCompletedTitle = nil}
|
|
452
|
+
|
|
453
|
+
public var dfuGetAuthenticationTokenTaskLabel: String {
|
|
454
|
+
get {return _storage._dfuGetAuthenticationTokenTaskLabel ?? "Issue authentication token"}
|
|
455
|
+
set {_uniqueStorage()._dfuGetAuthenticationTokenTaskLabel = newValue}
|
|
456
|
+
}
|
|
457
|
+
/// Returns true if `dfuGetAuthenticationTokenTaskLabel` has been explicitly set.
|
|
458
|
+
public var hasDfuGetAuthenticationTokenTaskLabel: Bool {return _storage._dfuGetAuthenticationTokenTaskLabel != nil}
|
|
459
|
+
/// Clears the value of `dfuGetAuthenticationTokenTaskLabel`. Subsequent reads from it will return its default value.
|
|
460
|
+
public mutating func clearDfuGetAuthenticationTokenTaskLabel() {_uniqueStorage()._dfuGetAuthenticationTokenTaskLabel = nil}
|
|
461
|
+
|
|
462
|
+
public var dfuCheckLatestFwlabel: String {
|
|
463
|
+
get {return _storage._dfuCheckLatestFwlabel ?? "Check latest firmware"}
|
|
464
|
+
set {_uniqueStorage()._dfuCheckLatestFwlabel = newValue}
|
|
465
|
+
}
|
|
466
|
+
/// Returns true if `dfuCheckLatestFwlabel` has been explicitly set.
|
|
467
|
+
public var hasDfuCheckLatestFwlabel: Bool {return _storage._dfuCheckLatestFwlabel != nil}
|
|
468
|
+
/// Clears the value of `dfuCheckLatestFwlabel`. Subsequent reads from it will return its default value.
|
|
469
|
+
public mutating func clearDfuCheckLatestFwlabel() {_uniqueStorage()._dfuCheckLatestFwlabel = nil}
|
|
470
|
+
|
|
471
|
+
public var dfuDownloadLatestFwlabel: String {
|
|
472
|
+
get {return _storage._dfuDownloadLatestFwlabel ?? "Download latest firmware"}
|
|
473
|
+
set {_uniqueStorage()._dfuDownloadLatestFwlabel = newValue}
|
|
474
|
+
}
|
|
475
|
+
/// Returns true if `dfuDownloadLatestFwlabel` has been explicitly set.
|
|
476
|
+
public var hasDfuDownloadLatestFwlabel: Bool {return _storage._dfuDownloadLatestFwlabel != nil}
|
|
477
|
+
/// Clears the value of `dfuDownloadLatestFwlabel`. Subsequent reads from it will return its default value.
|
|
478
|
+
public mutating func clearDfuDownloadLatestFwlabel() {_uniqueStorage()._dfuDownloadLatestFwlabel = nil}
|
|
479
|
+
|
|
480
|
+
public var dfuPrepareUpdateLabel: String {
|
|
481
|
+
get {return _storage._dfuPrepareUpdateLabel ?? "Prepare Update"}
|
|
482
|
+
set {_uniqueStorage()._dfuPrepareUpdateLabel = newValue}
|
|
483
|
+
}
|
|
484
|
+
/// Returns true if `dfuPrepareUpdateLabel` has been explicitly set.
|
|
485
|
+
public var hasDfuPrepareUpdateLabel: Bool {return _storage._dfuPrepareUpdateLabel != nil}
|
|
486
|
+
/// Clears the value of `dfuPrepareUpdateLabel`. Subsequent reads from it will return its default value.
|
|
487
|
+
public mutating func clearDfuPrepareUpdateLabel() {_uniqueStorage()._dfuPrepareUpdateLabel = nil}
|
|
488
|
+
|
|
489
|
+
public var dfuStartBootloaderLabel: String {
|
|
490
|
+
get {return _storage._dfuStartBootloaderLabel ?? "Start Bootloader"}
|
|
491
|
+
set {_uniqueStorage()._dfuStartBootloaderLabel = newValue}
|
|
492
|
+
}
|
|
493
|
+
/// Returns true if `dfuStartBootloaderLabel` has been explicitly set.
|
|
494
|
+
public var hasDfuStartBootloaderLabel: Bool {return _storage._dfuStartBootloaderLabel != nil}
|
|
495
|
+
/// Clears the value of `dfuStartBootloaderLabel`. Subsequent reads from it will return its default value.
|
|
496
|
+
public mutating func clearDfuStartBootloaderLabel() {_uniqueStorage()._dfuStartBootloaderLabel = nil}
|
|
497
|
+
|
|
498
|
+
public var dfuInitializationLabel: String {
|
|
499
|
+
get {return _storage._dfuInitializationLabel ?? "DFU initialization"}
|
|
500
|
+
set {_uniqueStorage()._dfuInitializationLabel = newValue}
|
|
501
|
+
}
|
|
502
|
+
/// Returns true if `dfuInitializationLabel` has been explicitly set.
|
|
503
|
+
public var hasDfuInitializationLabel: Bool {return _storage._dfuInitializationLabel != nil}
|
|
504
|
+
/// Clears the value of `dfuInitializationLabel`. Subsequent reads from it will return its default value.
|
|
505
|
+
public mutating func clearDfuInitializationLabel() {_uniqueStorage()._dfuInitializationLabel = nil}
|
|
506
|
+
|
|
507
|
+
public var dfuUpdateFwlabel: String {
|
|
508
|
+
get {return _storage._dfuUpdateFwlabel ?? "Update firmware"}
|
|
509
|
+
set {_uniqueStorage()._dfuUpdateFwlabel = newValue}
|
|
510
|
+
}
|
|
511
|
+
/// Returns true if `dfuUpdateFwlabel` has been explicitly set.
|
|
512
|
+
public var hasDfuUpdateFwlabel: Bool {return _storage._dfuUpdateFwlabel != nil}
|
|
513
|
+
/// Clears the value of `dfuUpdateFwlabel`. Subsequent reads from it will return its default value.
|
|
514
|
+
public mutating func clearDfuUpdateFwlabel() {_uniqueStorage()._dfuUpdateFwlabel = nil}
|
|
515
|
+
|
|
516
|
+
public var dfuWaitForDeviceToRestartTaskLabel: String {
|
|
517
|
+
get {return _storage._dfuWaitForDeviceToRestartTaskLabel ?? "Wait for device to restart"}
|
|
518
|
+
set {_uniqueStorage()._dfuWaitForDeviceToRestartTaskLabel = newValue}
|
|
519
|
+
}
|
|
520
|
+
/// Returns true if `dfuWaitForDeviceToRestartTaskLabel` has been explicitly set.
|
|
521
|
+
public var hasDfuWaitForDeviceToRestartTaskLabel: Bool {return _storage._dfuWaitForDeviceToRestartTaskLabel != nil}
|
|
522
|
+
/// Clears the value of `dfuWaitForDeviceToRestartTaskLabel`. Subsequent reads from it will return its default value.
|
|
523
|
+
public mutating func clearDfuWaitForDeviceToRestartTaskLabel() {_uniqueStorage()._dfuWaitForDeviceToRestartTaskLabel = nil}
|
|
524
|
+
|
|
408
525
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
409
526
|
|
|
410
527
|
public init() {}
|
|
@@ -1023,6 +1140,19 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
1023
1140
|
32: .same(proto: "syncDeviceDeployBlacklistEntriesTaskLabel"),
|
|
1024
1141
|
33: .same(proto: "syncDeviceRetrieveSystemStatusTaskLabel"),
|
|
1025
1142
|
34: .same(proto: "syncDevicePushSystemStatusTaskLabel"),
|
|
1143
|
+
35: .same(proto: "syncDeviceCheckLatestFWLabel"),
|
|
1144
|
+
36: .same(proto: "dfuInProgressTitle"),
|
|
1145
|
+
37: .same(proto: "dfuFailedTitle"),
|
|
1146
|
+
38: .same(proto: "dfuCancellingTitle"),
|
|
1147
|
+
39: .same(proto: "dfuCompletedTitle"),
|
|
1148
|
+
40: .same(proto: "dfuGetAuthenticationTokenTaskLabel"),
|
|
1149
|
+
41: .same(proto: "dfuCheckLatestFWLabel"),
|
|
1150
|
+
42: .same(proto: "dfuDownloadLatestFWLabel"),
|
|
1151
|
+
43: .same(proto: "dfuPrepareUpdateLabel"),
|
|
1152
|
+
44: .same(proto: "dfuStartBootloaderLabel"),
|
|
1153
|
+
45: .same(proto: "dfuInitializationLabel"),
|
|
1154
|
+
46: .same(proto: "dfuUpdateFWLabel"),
|
|
1155
|
+
47: .same(proto: "dfuWaitForDeviceToRestartTaskLabel"),
|
|
1026
1156
|
]
|
|
1027
1157
|
|
|
1028
1158
|
fileprivate class _StorageClass {
|
|
@@ -1060,6 +1190,19 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
1060
1190
|
var _syncDeviceDeployBlacklistEntriesTaskLabel: String? = nil
|
|
1061
1191
|
var _syncDeviceRetrieveSystemStatusTaskLabel: String? = nil
|
|
1062
1192
|
var _syncDevicePushSystemStatusTaskLabel: String? = nil
|
|
1193
|
+
var _syncDeviceCheckLatestFwlabel: String? = nil
|
|
1194
|
+
var _dfuInProgressTitle: String? = nil
|
|
1195
|
+
var _dfuFailedTitle: String? = nil
|
|
1196
|
+
var _dfuCancellingTitle: String? = nil
|
|
1197
|
+
var _dfuCompletedTitle: String? = nil
|
|
1198
|
+
var _dfuGetAuthenticationTokenTaskLabel: String? = nil
|
|
1199
|
+
var _dfuCheckLatestFwlabel: String? = nil
|
|
1200
|
+
var _dfuDownloadLatestFwlabel: String? = nil
|
|
1201
|
+
var _dfuPrepareUpdateLabel: String? = nil
|
|
1202
|
+
var _dfuStartBootloaderLabel: String? = nil
|
|
1203
|
+
var _dfuInitializationLabel: String? = nil
|
|
1204
|
+
var _dfuUpdateFwlabel: String? = nil
|
|
1205
|
+
var _dfuWaitForDeviceToRestartTaskLabel: String? = nil
|
|
1063
1206
|
|
|
1064
1207
|
static let defaultInstance = _StorageClass()
|
|
1065
1208
|
|
|
@@ -1100,6 +1243,19 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
1100
1243
|
_syncDeviceDeployBlacklistEntriesTaskLabel = source._syncDeviceDeployBlacklistEntriesTaskLabel
|
|
1101
1244
|
_syncDeviceRetrieveSystemStatusTaskLabel = source._syncDeviceRetrieveSystemStatusTaskLabel
|
|
1102
1245
|
_syncDevicePushSystemStatusTaskLabel = source._syncDevicePushSystemStatusTaskLabel
|
|
1246
|
+
_syncDeviceCheckLatestFwlabel = source._syncDeviceCheckLatestFwlabel
|
|
1247
|
+
_dfuInProgressTitle = source._dfuInProgressTitle
|
|
1248
|
+
_dfuFailedTitle = source._dfuFailedTitle
|
|
1249
|
+
_dfuCancellingTitle = source._dfuCancellingTitle
|
|
1250
|
+
_dfuCompletedTitle = source._dfuCompletedTitle
|
|
1251
|
+
_dfuGetAuthenticationTokenTaskLabel = source._dfuGetAuthenticationTokenTaskLabel
|
|
1252
|
+
_dfuCheckLatestFwlabel = source._dfuCheckLatestFwlabel
|
|
1253
|
+
_dfuDownloadLatestFwlabel = source._dfuDownloadLatestFwlabel
|
|
1254
|
+
_dfuPrepareUpdateLabel = source._dfuPrepareUpdateLabel
|
|
1255
|
+
_dfuStartBootloaderLabel = source._dfuStartBootloaderLabel
|
|
1256
|
+
_dfuInitializationLabel = source._dfuInitializationLabel
|
|
1257
|
+
_dfuUpdateFwlabel = source._dfuUpdateFwlabel
|
|
1258
|
+
_dfuWaitForDeviceToRestartTaskLabel = source._dfuWaitForDeviceToRestartTaskLabel
|
|
1103
1259
|
}
|
|
1104
1260
|
}
|
|
1105
1261
|
|
|
@@ -1146,6 +1302,19 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
1146
1302
|
if _storage._syncDeviceDeployBlacklistEntriesTaskLabel == nil {return false}
|
|
1147
1303
|
if _storage._syncDeviceRetrieveSystemStatusTaskLabel == nil {return false}
|
|
1148
1304
|
if _storage._syncDevicePushSystemStatusTaskLabel == nil {return false}
|
|
1305
|
+
if _storage._syncDeviceCheckLatestFwlabel == nil {return false}
|
|
1306
|
+
if _storage._dfuInProgressTitle == nil {return false}
|
|
1307
|
+
if _storage._dfuFailedTitle == nil {return false}
|
|
1308
|
+
if _storage._dfuCancellingTitle == nil {return false}
|
|
1309
|
+
if _storage._dfuCompletedTitle == nil {return false}
|
|
1310
|
+
if _storage._dfuGetAuthenticationTokenTaskLabel == nil {return false}
|
|
1311
|
+
if _storage._dfuCheckLatestFwlabel == nil {return false}
|
|
1312
|
+
if _storage._dfuDownloadLatestFwlabel == nil {return false}
|
|
1313
|
+
if _storage._dfuPrepareUpdateLabel == nil {return false}
|
|
1314
|
+
if _storage._dfuStartBootloaderLabel == nil {return false}
|
|
1315
|
+
if _storage._dfuInitializationLabel == nil {return false}
|
|
1316
|
+
if _storage._dfuUpdateFwlabel == nil {return false}
|
|
1317
|
+
if _storage._dfuWaitForDeviceToRestartTaskLabel == nil {return false}
|
|
1149
1318
|
return true
|
|
1150
1319
|
}
|
|
1151
1320
|
}
|
|
@@ -1192,6 +1361,19 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
1192
1361
|
case 32: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceDeployBlacklistEntriesTaskLabel) }()
|
|
1193
1362
|
case 33: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceRetrieveSystemStatusTaskLabel) }()
|
|
1194
1363
|
case 34: try { try decoder.decodeSingularStringField(value: &_storage._syncDevicePushSystemStatusTaskLabel) }()
|
|
1364
|
+
case 35: try { try decoder.decodeSingularStringField(value: &_storage._syncDeviceCheckLatestFwlabel) }()
|
|
1365
|
+
case 36: try { try decoder.decodeSingularStringField(value: &_storage._dfuInProgressTitle) }()
|
|
1366
|
+
case 37: try { try decoder.decodeSingularStringField(value: &_storage._dfuFailedTitle) }()
|
|
1367
|
+
case 38: try { try decoder.decodeSingularStringField(value: &_storage._dfuCancellingTitle) }()
|
|
1368
|
+
case 39: try { try decoder.decodeSingularStringField(value: &_storage._dfuCompletedTitle) }()
|
|
1369
|
+
case 40: try { try decoder.decodeSingularStringField(value: &_storage._dfuGetAuthenticationTokenTaskLabel) }()
|
|
1370
|
+
case 41: try { try decoder.decodeSingularStringField(value: &_storage._dfuCheckLatestFwlabel) }()
|
|
1371
|
+
case 42: try { try decoder.decodeSingularStringField(value: &_storage._dfuDownloadLatestFwlabel) }()
|
|
1372
|
+
case 43: try { try decoder.decodeSingularStringField(value: &_storage._dfuPrepareUpdateLabel) }()
|
|
1373
|
+
case 44: try { try decoder.decodeSingularStringField(value: &_storage._dfuStartBootloaderLabel) }()
|
|
1374
|
+
case 45: try { try decoder.decodeSingularStringField(value: &_storage._dfuInitializationLabel) }()
|
|
1375
|
+
case 46: try { try decoder.decodeSingularStringField(value: &_storage._dfuUpdateFwlabel) }()
|
|
1376
|
+
case 47: try { try decoder.decodeSingularStringField(value: &_storage._dfuWaitForDeviceToRestartTaskLabel) }()
|
|
1195
1377
|
default: break
|
|
1196
1378
|
}
|
|
1197
1379
|
}
|
|
@@ -1306,6 +1488,45 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
1306
1488
|
try { if let v = _storage._syncDevicePushSystemStatusTaskLabel {
|
|
1307
1489
|
try visitor.visitSingularStringField(value: v, fieldNumber: 34)
|
|
1308
1490
|
} }()
|
|
1491
|
+
try { if let v = _storage._syncDeviceCheckLatestFwlabel {
|
|
1492
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 35)
|
|
1493
|
+
} }()
|
|
1494
|
+
try { if let v = _storage._dfuInProgressTitle {
|
|
1495
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 36)
|
|
1496
|
+
} }()
|
|
1497
|
+
try { if let v = _storage._dfuFailedTitle {
|
|
1498
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 37)
|
|
1499
|
+
} }()
|
|
1500
|
+
try { if let v = _storage._dfuCancellingTitle {
|
|
1501
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 38)
|
|
1502
|
+
} }()
|
|
1503
|
+
try { if let v = _storage._dfuCompletedTitle {
|
|
1504
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 39)
|
|
1505
|
+
} }()
|
|
1506
|
+
try { if let v = _storage._dfuGetAuthenticationTokenTaskLabel {
|
|
1507
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 40)
|
|
1508
|
+
} }()
|
|
1509
|
+
try { if let v = _storage._dfuCheckLatestFwlabel {
|
|
1510
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 41)
|
|
1511
|
+
} }()
|
|
1512
|
+
try { if let v = _storage._dfuDownloadLatestFwlabel {
|
|
1513
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 42)
|
|
1514
|
+
} }()
|
|
1515
|
+
try { if let v = _storage._dfuPrepareUpdateLabel {
|
|
1516
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 43)
|
|
1517
|
+
} }()
|
|
1518
|
+
try { if let v = _storage._dfuStartBootloaderLabel {
|
|
1519
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 44)
|
|
1520
|
+
} }()
|
|
1521
|
+
try { if let v = _storage._dfuInitializationLabel {
|
|
1522
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 45)
|
|
1523
|
+
} }()
|
|
1524
|
+
try { if let v = _storage._dfuUpdateFwlabel {
|
|
1525
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 46)
|
|
1526
|
+
} }()
|
|
1527
|
+
try { if let v = _storage._dfuWaitForDeviceToRestartTaskLabel {
|
|
1528
|
+
try visitor.visitSingularStringField(value: v, fieldNumber: 47)
|
|
1529
|
+
} }()
|
|
1309
1530
|
}
|
|
1310
1531
|
try unknownFields.traverse(visitor: &visitor)
|
|
1311
1532
|
}
|
|
@@ -1349,6 +1570,19 @@ extension BlueI18n: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationB
|
|
|
1349
1570
|
if _storage._syncDeviceDeployBlacklistEntriesTaskLabel != rhs_storage._syncDeviceDeployBlacklistEntriesTaskLabel {return false}
|
|
1350
1571
|
if _storage._syncDeviceRetrieveSystemStatusTaskLabel != rhs_storage._syncDeviceRetrieveSystemStatusTaskLabel {return false}
|
|
1351
1572
|
if _storage._syncDevicePushSystemStatusTaskLabel != rhs_storage._syncDevicePushSystemStatusTaskLabel {return false}
|
|
1573
|
+
if _storage._syncDeviceCheckLatestFwlabel != rhs_storage._syncDeviceCheckLatestFwlabel {return false}
|
|
1574
|
+
if _storage._dfuInProgressTitle != rhs_storage._dfuInProgressTitle {return false}
|
|
1575
|
+
if _storage._dfuFailedTitle != rhs_storage._dfuFailedTitle {return false}
|
|
1576
|
+
if _storage._dfuCancellingTitle != rhs_storage._dfuCancellingTitle {return false}
|
|
1577
|
+
if _storage._dfuCompletedTitle != rhs_storage._dfuCompletedTitle {return false}
|
|
1578
|
+
if _storage._dfuGetAuthenticationTokenTaskLabel != rhs_storage._dfuGetAuthenticationTokenTaskLabel {return false}
|
|
1579
|
+
if _storage._dfuCheckLatestFwlabel != rhs_storage._dfuCheckLatestFwlabel {return false}
|
|
1580
|
+
if _storage._dfuDownloadLatestFwlabel != rhs_storage._dfuDownloadLatestFwlabel {return false}
|
|
1581
|
+
if _storage._dfuPrepareUpdateLabel != rhs_storage._dfuPrepareUpdateLabel {return false}
|
|
1582
|
+
if _storage._dfuStartBootloaderLabel != rhs_storage._dfuStartBootloaderLabel {return false}
|
|
1583
|
+
if _storage._dfuInitializationLabel != rhs_storage._dfuInitializationLabel {return false}
|
|
1584
|
+
if _storage._dfuUpdateFwlabel != rhs_storage._dfuUpdateFwlabel {return false}
|
|
1585
|
+
if _storage._dfuWaitForDeviceToRestartTaskLabel != rhs_storage._dfuWaitForDeviceToRestartTaskLabel {return false}
|
|
1352
1586
|
return true
|
|
1353
1587
|
}
|
|
1354
1588
|
if !storagesAreEqual {return false}
|
|
@@ -791,6 +791,33 @@ public struct BlueSystemStatus {
|
|
|
791
791
|
/// Clears the value of `lock`. Subsequent reads from it will return its default value.
|
|
792
792
|
public mutating func clearLock() {_uniqueStorage()._lock = nil}
|
|
793
793
|
|
|
794
|
+
public var applicationVersionTest: UInt32 {
|
|
795
|
+
get {return _storage._applicationVersionTest ?? 0}
|
|
796
|
+
set {_uniqueStorage()._applicationVersionTest = newValue}
|
|
797
|
+
}
|
|
798
|
+
/// Returns true if `applicationVersionTest` has been explicitly set.
|
|
799
|
+
public var hasApplicationVersionTest: Bool {return _storage._applicationVersionTest != nil}
|
|
800
|
+
/// Clears the value of `applicationVersionTest`. Subsequent reads from it will return its default value.
|
|
801
|
+
public mutating func clearApplicationVersionTest() {_uniqueStorage()._applicationVersionTest = nil}
|
|
802
|
+
|
|
803
|
+
public var newFirmwareVersionAvailable: Bool {
|
|
804
|
+
get {return _storage._newFirmwareVersionAvailable ?? false}
|
|
805
|
+
set {_uniqueStorage()._newFirmwareVersionAvailable = newValue}
|
|
806
|
+
}
|
|
807
|
+
/// Returns true if `newFirmwareVersionAvailable` has been explicitly set.
|
|
808
|
+
public var hasNewFirmwareVersionAvailable: Bool {return _storage._newFirmwareVersionAvailable != nil}
|
|
809
|
+
/// Clears the value of `newFirmwareVersionAvailable`. Subsequent reads from it will return its default value.
|
|
810
|
+
public mutating func clearNewFirmwareVersionAvailable() {_uniqueStorage()._newFirmwareVersionAvailable = nil}
|
|
811
|
+
|
|
812
|
+
public var newTestFirmwareVersionAvailable: Bool {
|
|
813
|
+
get {return _storage._newTestFirmwareVersionAvailable ?? false}
|
|
814
|
+
set {_uniqueStorage()._newTestFirmwareVersionAvailable = newValue}
|
|
815
|
+
}
|
|
816
|
+
/// Returns true if `newTestFirmwareVersionAvailable` has been explicitly set.
|
|
817
|
+
public var hasNewTestFirmwareVersionAvailable: Bool {return _storage._newTestFirmwareVersionAvailable != nil}
|
|
818
|
+
/// Clears the value of `newTestFirmwareVersionAvailable`. Subsequent reads from it will return its default value.
|
|
819
|
+
public mutating func clearNewTestFirmwareVersionAvailable() {_uniqueStorage()._newTestFirmwareVersionAvailable = nil}
|
|
820
|
+
|
|
794
821
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
795
822
|
|
|
796
823
|
public init() {}
|
|
@@ -1888,6 +1915,9 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
1888
1915
|
7: .same(proto: "localTime"),
|
|
1889
1916
|
8: .same(proto: "settings"),
|
|
1890
1917
|
9: .same(proto: "lock"),
|
|
1918
|
+
10: .same(proto: "applicationVersionTest"),
|
|
1919
|
+
11: .same(proto: "newFirmwareVersionAvailable"),
|
|
1920
|
+
12: .same(proto: "newTestFirmwareVersionAvailable"),
|
|
1891
1921
|
]
|
|
1892
1922
|
|
|
1893
1923
|
fileprivate class _StorageClass {
|
|
@@ -1900,6 +1930,9 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
1900
1930
|
var _localTime: BlueLocalTimestamp? = nil
|
|
1901
1931
|
var _settings: BlueSystemSettings? = nil
|
|
1902
1932
|
var _lock: BlueLockStatus? = nil
|
|
1933
|
+
var _applicationVersionTest: UInt32? = nil
|
|
1934
|
+
var _newFirmwareVersionAvailable: Bool? = nil
|
|
1935
|
+
var _newTestFirmwareVersionAvailable: Bool? = nil
|
|
1903
1936
|
|
|
1904
1937
|
static let defaultInstance = _StorageClass()
|
|
1905
1938
|
|
|
@@ -1915,6 +1948,9 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
1915
1948
|
_localTime = source._localTime
|
|
1916
1949
|
_settings = source._settings
|
|
1917
1950
|
_lock = source._lock
|
|
1951
|
+
_applicationVersionTest = source._applicationVersionTest
|
|
1952
|
+
_newFirmwareVersionAvailable = source._newFirmwareVersionAvailable
|
|
1953
|
+
_newTestFirmwareVersionAvailable = source._newTestFirmwareVersionAvailable
|
|
1918
1954
|
}
|
|
1919
1955
|
}
|
|
1920
1956
|
|
|
@@ -1959,6 +1995,9 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
1959
1995
|
case 7: try { try decoder.decodeSingularMessageField(value: &_storage._localTime) }()
|
|
1960
1996
|
case 8: try { try decoder.decodeSingularMessageField(value: &_storage._settings) }()
|
|
1961
1997
|
case 9: try { try decoder.decodeSingularMessageField(value: &_storage._lock) }()
|
|
1998
|
+
case 10: try { try decoder.decodeSingularUInt32Field(value: &_storage._applicationVersionTest) }()
|
|
1999
|
+
case 11: try { try decoder.decodeSingularBoolField(value: &_storage._newFirmwareVersionAvailable) }()
|
|
2000
|
+
case 12: try { try decoder.decodeSingularBoolField(value: &_storage._newTestFirmwareVersionAvailable) }()
|
|
1962
2001
|
default: break
|
|
1963
2002
|
}
|
|
1964
2003
|
}
|
|
@@ -1998,6 +2037,15 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
1998
2037
|
try { if let v = _storage._lock {
|
|
1999
2038
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 9)
|
|
2000
2039
|
} }()
|
|
2040
|
+
try { if let v = _storage._applicationVersionTest {
|
|
2041
|
+
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 10)
|
|
2042
|
+
} }()
|
|
2043
|
+
try { if let v = _storage._newFirmwareVersionAvailable {
|
|
2044
|
+
try visitor.visitSingularBoolField(value: v, fieldNumber: 11)
|
|
2045
|
+
} }()
|
|
2046
|
+
try { if let v = _storage._newTestFirmwareVersionAvailable {
|
|
2047
|
+
try visitor.visitSingularBoolField(value: v, fieldNumber: 12)
|
|
2048
|
+
} }()
|
|
2001
2049
|
}
|
|
2002
2050
|
try unknownFields.traverse(visitor: &visitor)
|
|
2003
2051
|
}
|
|
@@ -2016,6 +2064,9 @@ extension BlueSystemStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImpleme
|
|
|
2016
2064
|
if _storage._localTime != rhs_storage._localTime {return false}
|
|
2017
2065
|
if _storage._settings != rhs_storage._settings {return false}
|
|
2018
2066
|
if _storage._lock != rhs_storage._lock {return false}
|
|
2067
|
+
if _storage._applicationVersionTest != rhs_storage._applicationVersionTest {return false}
|
|
2068
|
+
if _storage._newFirmwareVersionAvailable != rhs_storage._newFirmwareVersionAvailable {return false}
|
|
2069
|
+
if _storage._newTestFirmwareVersionAvailable != rhs_storage._newTestFirmwareVersionAvailable {return false}
|
|
2019
2070
|
return true
|
|
2020
2071
|
}
|
|
2021
2072
|
if !storagesAreEqual {return false}
|
|
@@ -26,22 +26,38 @@ enum BlueTaskResult {
|
|
|
26
26
|
|
|
27
27
|
public class BlueTask {
|
|
28
28
|
let id: AnyHashable
|
|
29
|
-
let label: String
|
|
30
29
|
|
|
30
|
+
var label: CurrentValueSubject<String, Never>
|
|
31
31
|
var failable: Bool = false
|
|
32
32
|
var result: Any? = nil
|
|
33
33
|
var error: Error? = nil
|
|
34
34
|
var status: CurrentValueSubject<BlueTaskStatus, Never>
|
|
35
|
+
var progress: CurrentValueSubject<Float, Never>?
|
|
35
36
|
|
|
36
|
-
let handler: (BlueSerialTaskRunner) async throws -> BlueTaskResult
|
|
37
|
+
let handler: (BlueTask, BlueSerialTaskRunner) async throws -> BlueTaskResult
|
|
38
|
+
let cancelHandler: (() -> Void)?
|
|
37
39
|
|
|
38
|
-
init(
|
|
40
|
+
init(
|
|
41
|
+
id: AnyHashable,
|
|
42
|
+
label: String,
|
|
43
|
+
failable: Bool = false,
|
|
44
|
+
status: BlueTaskStatus = .ready,
|
|
45
|
+
error: Error? = nil,
|
|
46
|
+
progress: Float? = nil,
|
|
47
|
+
cancelHandler: (() -> Void)? = nil,
|
|
48
|
+
handler: @escaping (BlueTask, BlueSerialTaskRunner) async throws -> BlueTaskResult
|
|
49
|
+
) {
|
|
39
50
|
self.id = id
|
|
40
|
-
self.label = label
|
|
51
|
+
self.label = CurrentValueSubject(label)
|
|
41
52
|
self.failable = failable
|
|
42
53
|
self.error = error
|
|
43
54
|
self.status = .init(status)
|
|
44
55
|
self.handler = handler
|
|
56
|
+
self.cancelHandler = cancelHandler
|
|
57
|
+
|
|
58
|
+
if let progress = progress {
|
|
59
|
+
self.progress = CurrentValueSubject(progress)
|
|
60
|
+
}
|
|
45
61
|
}
|
|
46
62
|
|
|
47
63
|
var errorDescription: String? {
|
|
@@ -53,6 +69,22 @@ public class BlueTask {
|
|
|
53
69
|
self.status.send(status)
|
|
54
70
|
}
|
|
55
71
|
}
|
|
72
|
+
|
|
73
|
+
func updateProgress(_ progress: Float) {
|
|
74
|
+
blueRunInMainThread {
|
|
75
|
+
self.progress?.send(progress)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
func updateLabel(_ label: String) {
|
|
80
|
+
blueRunInMainThread {
|
|
81
|
+
self.label.send(label)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
func cancel() {
|
|
86
|
+
self.cancelHandler?()
|
|
87
|
+
}
|
|
56
88
|
}
|
|
57
89
|
|
|
58
90
|
public class BlueSerialTaskRunner: BlueTaskRunner {
|
|
@@ -61,6 +93,7 @@ public class BlueSerialTaskRunner: BlueTaskRunner {
|
|
|
61
93
|
private var failed: Bool = false
|
|
62
94
|
private var cancelled: Bool = false
|
|
63
95
|
private var sucessful: Bool = false
|
|
96
|
+
private var currentTask: BlueTask? = nil
|
|
64
97
|
|
|
65
98
|
init(_ tasks: [BlueTask]) {
|
|
66
99
|
self.tasks = tasks
|
|
@@ -77,12 +110,14 @@ public class BlueSerialTaskRunner: BlueTaskRunner {
|
|
|
77
110
|
return
|
|
78
111
|
}
|
|
79
112
|
|
|
113
|
+
self.currentTask = task
|
|
114
|
+
|
|
80
115
|
do {
|
|
81
116
|
blueLogDebug("Started: \(task.id)")
|
|
82
117
|
|
|
83
118
|
task.updateStatus(.started)
|
|
84
119
|
|
|
85
|
-
let taskResult = try await task.handler(self)
|
|
120
|
+
let taskResult = try await task.handler(task, self)
|
|
86
121
|
|
|
87
122
|
let taskStatus: BlueTaskStatus
|
|
88
123
|
|
|
@@ -131,6 +166,8 @@ public class BlueSerialTaskRunner: BlueTaskRunner {
|
|
|
131
166
|
|
|
132
167
|
public func cancel() -> Bool {
|
|
133
168
|
if (!sucessful && !failed) {
|
|
169
|
+
self.currentTask?.cancel()
|
|
170
|
+
|
|
134
171
|
cancelled = true
|
|
135
172
|
|
|
136
173
|
return true
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @class BlueZip
|
|
5
|
+
* A utility class for working with zip files.
|
|
6
|
+
*/
|
|
7
|
+
public class BlueZip {
|
|
8
|
+
/// Extracts contents of a zip file from the provided Data object.
|
|
9
|
+
///
|
|
10
|
+
/// - parameter data: The Data object representing the zip file.
|
|
11
|
+
/// - returns: URL pointing to the location where the contents of the zip file are extracted.
|
|
12
|
+
/// - throws: An error if the extraction process encounters any issues.
|
|
13
|
+
static func extract(data: Data) throws -> URL {
|
|
14
|
+
let tempDirectoryURL = URL(fileURLWithPath: NSTemporaryDirectory())
|
|
15
|
+
let sourceURL = tempDirectoryURL.appendingPathComponent("package.zip")
|
|
16
|
+
let destinationURL = tempDirectoryURL.appendingPathComponent("extracted_package")
|
|
17
|
+
|
|
18
|
+
let fileManager = FileManager.default
|
|
19
|
+
|
|
20
|
+
if fileManager.fileExists(atPath: destinationURL.path) {
|
|
21
|
+
try fileManager.removeItem(at: destinationURL)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
try data.write(to: sourceURL)
|
|
25
|
+
|
|
26
|
+
try fileManager.unzipItem(at: sourceURL, to: destinationURL)
|
|
27
|
+
|
|
28
|
+
return destinationURL
|
|
29
|
+
}
|
|
30
|
+
}
|