Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {
- let stringValue = String(bytes: characteristic.value!, encoding: .utf8)
- print("update \(stringValue) errot \(error?.localizedDescription)")
- let on = "\u{01}\u{01}"
- let of = "\u{00}\u{00}"
- if let data = of.data(using: .utf8) {
- stm?.writeValue(data, for: characteristic, type: .withoutResponse)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement