SHARE
TWEET

bleOnSTM

a guest Aug 25th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top