Implement ScanFilter (#17)

* Implement ScanFilter

* Add windows implementation

* Fix Linux and cleanups

* Update Readme, Changelog and Version

* Minor fixes from AI comments

* Fix windows crash and update pigeon

* Fix UUID parsing

* Apply suggestions from code review

Co-authored-by: Foti Dim <foti@navideck.com>

---------

Co-authored-by: Foti Dim <foti@navideck.com>
This commit is contained in:
Rohit Sangwan
2024-03-05 22:37:14 +05:30
committed by GitHub
parent 7e47be374b
commit 1f7ba287ef
28 changed files with 546 additions and 118 deletions
+14
View File
@@ -141,6 +141,20 @@ public extension CBPeripheral {
}
}
extension String {
var validFullUUID: String {
let uuidLength = self.count
if uuidLength == 4 || uuidLength == 8 {
let baseUuid = "00000000-0000-1000-8000-00805F9B34FB"
let start = baseUuid.startIndex
let range = baseUuid.index(start, offsetBy: 4-uuidLength)..<baseUuid.index(start, offsetBy: 4)
return baseUuid.replacingCharacters(in: range, with: self)
} else {
return self
}
}
}
// Future classes
class CharacteristicReadFuture {
let deviceId: String