Advertisement
Guest User

bleOnSTM

a guest
Aug 25th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.47 KB | None | 0 0
  1. func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {
  2.         let stringValue = String(bytes: characteristic.value!, encoding: .utf8)
  3.         print("update \(stringValue) errot \(error?.localizedDescription)")
  4.         let on = "\u{01}\u{01}"
  5.         let of = "\u{00}\u{00}"
  6.         if let data = of.data(using: .utf8) {
  7.             stm?.writeValue(data, for: characteristic, type: .withoutResponse)
  8.         }
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement