Closed Lufthummel closed 3 years ago
It's a Result, so the usual {code} switch result { case .success(let data): break // The data was read and is returned as an NSData instance case .failure(let error): break // An error happened while attempting to read the data } {code} will apply here as well.
Not tested
I try to get the actual value of a notification. Example code:
self.peripherals[selected].setNotifyValue(toEnabled: true, forCharacWithUUID: cuuid, ofServiceWithUUID: suuid) { (result) in
The given documentation is not working .. { (isnotifying, error) in ... so that needs to be changed I guess.
So far this works fine but value contains only true
Output:
2018-03-10 15:51:23.873 [Debug] [ViewController.swift:88] notifierTest > Notyfying SUCCESS 2018-03-10 15:51:23.873 [Debug] [ViewController.swift:89] notifierTest > Notyfying value Optional(true) 2018-03-10 15:51:23.873 [Debug] [ViewController.swift:90] notifierTest > Notyfying description SUCCESS 2018-03-10 15:51:23.874 [Debug] [ViewController.swift:91] notifierTest > Notyfying debug description SUCCESS: true
I was expecting the actual values of the changed characteristic (eg.data values).
Maybe I do something wrong, any help appreciated here.