SHARE
TWEET

Untitled

a guest Oct 21st, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. readData.setOnClickListener {
  2.             Log.d("Archer","readData")
  3.                 if (mBle.connetedDevices.size > 0) {
  4.                     Log.d("Archer","connetedDevices´╝Ü${mBle.connetedDevices[0].bleName}")
  5.                    var result = mBle.read(mBle.connetedDevices[0],object :BleReadCallback<BleDevice>(){
  6.                         override fun onReadSuccess(characteristic: BluetoothGattCharacteristic?) {
  7.                             super.onReadSuccess(characteristic)
  8.                             var data = characteristic?.value
  9.                             Log.d("Archer","onReadSuccess: ${Arrays.toString(data)}")
  10.                         }
  11.                     })
  12.  
  13.                     if(!result){
  14.                         Log.d("Archer","read data fail!")
  15.                     }
  16.                 }
  17.         }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top