ilabs-flir 2.2.4 → 2.2.5
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.
|
@@ -49,7 +49,11 @@ import ThermalSDK
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/// Main FLIR Manager - Singleton that manages all FLIR camera operations
|
|
52
|
+
#if FLIR_ENABLED
|
|
53
|
+
@objc public class FlirManager: NSObject, FLIRDiscoveryEventDelegate, FLIRDataReceivedDelegate, FLIRStreamDelegate {
|
|
54
|
+
#else
|
|
52
55
|
@objc public class FlirManager: NSObject {
|
|
56
|
+
#endif
|
|
53
57
|
@objc public static let shared = FlirManager()
|
|
54
58
|
|
|
55
59
|
// MARK: - Properties
|
|
@@ -371,7 +375,12 @@ import ThermalSDK
|
|
|
371
375
|
|
|
372
376
|
if discovery == nil {
|
|
373
377
|
discovery = FLIRDiscovery()
|
|
374
|
-
discovery
|
|
378
|
+
// Assign delegate only if we conform to the required discovery delegate protocol
|
|
379
|
+
if let dd = self as? FLIRDiscoveryEventDelegate {
|
|
380
|
+
discovery?.delegate = dd
|
|
381
|
+
} else {
|
|
382
|
+
FlirLogger.log(.discovery, "Warning: FlirManager does not conform to FLIRDiscoveryEventDelegate at runtime; delegate not assigned")
|
|
383
|
+
}
|
|
375
384
|
FlirLogger.log(.discovery, "Created FLIRDiscovery instance")
|
|
376
385
|
}
|
|
377
386
|
|
|
@@ -458,12 +467,10 @@ import ThermalSDK
|
|
|
458
467
|
#if FLIR_ENABLED
|
|
459
468
|
discoveryTimeoutWorkItem?.cancel()
|
|
460
469
|
discoveryTimeoutWorkItem = nil
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
@objc public func connectToDevice(_ deviceId: String) {
|
|
466
|
-
FlirLogger.logConnectionAttempt(deviceId: deviceId)
|
|
470
|
+
discovery?.stop()
|
|
471
|
+
isScanning = false
|
|
472
|
+
FlirLogger.log(.discovery, "Discovery stopped")
|
|
473
|
+
#endif
|
|
467
474
|
|
|
468
475
|
#if FLIR_ENABLED
|
|
469
476
|
// Find the identity for this device
|
|
@@ -974,8 +981,10 @@ extension FlirManager: FLIRDiscoveryEventDelegate {
|
|
|
974
981
|
discovery?.stop()
|
|
975
982
|
isScanning = false
|
|
976
983
|
DispatchQueue.main.async { [weak self] in
|
|
977
|
-
self
|
|
978
|
-
|
|
984
|
+
guard let self = self else { return }
|
|
985
|
+
// Re-emit device list (could be empty) so JS/UI can recover
|
|
986
|
+
self.delegate?.onDevicesFound(self.discoveredDevices)
|
|
987
|
+
self.delegate?.onError("Discovery error: \(error)")
|
|
979
988
|
}
|
|
980
989
|
}
|
|
981
990
|
|