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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user