示例#1
0
 @Override
 public void onServicesDiscovered(BluetoothGatt gatt, int status) {
   if (gatt != null && status == BluetoothGatt.GATT_SUCCESS) {
     bluetoothGattService = gatt.getService(bleGattService.getServiceUUID());
     if (bluetoothGattService != null
         && bleGattService.initializeCharacteristics(bluetoothGattService, gatt)) {
       callBack.onConnected();
       return;
     }
   }
   close();
 }
示例#2
0
 @Override
 public void onCharacteristicRead(
     BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
   if (bleGattService.containsCharacteristic(characteristic.getUuid())) {
     callBack.onCharacteristicRead(characteristic.getUuid(), characteristic.getValue());
   }
 }