@Override public void onDescriptorWrite(final BluetoothGatt gatt, final BluetoothGattDescriptor descriptor, final int status) { Log.e(TAG, "OnDescriptor WRITE started: status: " + getStatusName(status)); if (enforceMainThread()) { Handler iHandler = new Handler(Looper.getMainLooper()); iHandler.post(new Runnable() { @Override public void run() { processonDescrptorWrite(gatt, descriptor, status); } }); } else { processonDescrptorWrite(gatt, descriptor, status); } }
@Override public void onDescriptorWrite(final BluetoothGatt gatt, final BluetoothGattDescriptor descriptor, final int status) { Log.e(TAG, "OnDescriptor WRITE started: status: " + getStatusName(status)); if (enforceMainThread()) { Handler iHandler = new Handler(Looper.getMainLooper()); iHandler.post(new Runnable() { @Override public void run() { processonDescrptorWrite(gatt, descriptor, status); } }); } else { processonDescrptorWrite(gatt, descriptor, status); } }
@Override public void onDescriptorWrite(final BluetoothGatt gatt, final BluetoothGattDescriptor descriptor, final int status) { Log.e(TAG, "OnDescriptor WRITE started: status: " + getStatusName(status)); if (enforceMainThread()) { Handler iHandler = new Handler(Looper.getMainLooper()); iHandler.post(new Runnable() { @Override public void run() { processonDescrptorWrite(gatt, descriptor, status); } }); } else { processonDescrptorWrite(gatt, descriptor, status); } }
@Override public void onCharacteristicWrite(final BluetoothGatt gatt, final BluetoothGattCharacteristic characteristic, final int status) { Log.e(TAG, "OnCharacteristic WRITE started: " + getUUIDName(characteristic.getUuid()) + " status: " + getStatusName(status)); //Log.e(TAG, "Write Status " + String.valueOf(status)); //Log.e(TAG, "Characteristic " + String.valueOf(characteristic.getUuid())); if (enforceMainThread()) { Handler iHandler = new Handler(Looper.getMainLooper()); iHandler.post(new Runnable() { @Override public void run() { processOnCharacteristicWrite(gatt, characteristic, status); } }); } else { processOnCharacteristicWrite(gatt, characteristic, status); } }
@Override public void onCharacteristicWrite(final BluetoothGatt gatt, final BluetoothGattCharacteristic characteristic, final int status) { Log.e(TAG, "OnCharacteristic WRITE started: " + getUUIDName(characteristic.getUuid()) + " status: " + getStatusName(status)); //Log.e(TAG, "Write Status " + String.valueOf(status)); //Log.e(TAG, "Characteristic " + String.valueOf(characteristic.getUuid())); if (enforceMainThread()) { Handler iHandler = new Handler(Looper.getMainLooper()); iHandler.post(new Runnable() { @Override public void run() { processOnCharacteristicWrite(gatt, characteristic, status); } }); } else { processOnCharacteristicWrite(gatt, characteristic, status); } }
@Override public void onCharacteristicWrite(final BluetoothGatt gatt, final BluetoothGattCharacteristic characteristic, final int status) { Log.e(TAG, "OnCharacteristic WRITE started: " + getUUIDName(characteristic.getUuid()) + " status: " + getStatusName(status)); //Log.e(TAG, "Write Status " + String.valueOf(status)); //Log.e(TAG, "Characteristic " + String.valueOf(characteristic.getUuid())); if (enforceMainThread()) { Handler iHandler = new Handler(Looper.getMainLooper()); iHandler.post(new Runnable() { @Override public void run() { processOnCharacteristicWrite(gatt, characteristic, status); } }); } else { processOnCharacteristicWrite(gatt, characteristic, status); } }
@SuppressLint("CheckResult") public static boolean doReset(Ob1G5CollectionService parent, RxBleConnection connection) { if (connection == null) return false; parent.msg("Hard Resetting Transmitter"); connection.writeCharacteristic(Control, nn(new ResetTxMessage().byteSequence)) .subscribe(characteristicValue -> { if (d) UserError.Log.d(TAG, "Wrote ResetTxMessage request!!"); parent.msg("Hard Reset Sent"); }, throwable -> { parent.msg("Hard Reset maybe Failed"); UserError.Log.e(TAG, "Failed to write ResetTxMessage: " + throwable); if (throwable instanceof BleGattCharacteristicException) { final int status = ((BleGattCharacteristicException) throwable).getStatus(); UserError.Log.e(TAG, "Got status message: " + BluetoothServices.getStatusName(status)); } }); return true; }
@Override public void onCharacteristicWrite(final BluetoothGatt gatt, final BluetoothGattCharacteristic characteristic, final int status) { try { final String msg = "OnCharacteristic WRITE: " + " status: " + getStatusName(status) + " data: " + JoH.bytesToHex(characteristic.getValue()) + " uuid: " + characteristic.getUuid(); if (status == 0) { Log.d(TAG, msg); } else { UserError.Log.e(TAG, msg); } } catch (Exception e) { UserError.Log.wtf(TAG, "Got exception trying to display data: " + e); } }
@SuppressLint("CheckResult") public static boolean doReset(Ob1G5CollectionService parent, RxBleConnection connection) { if (connection == null) return false; parent.msg("Hard Resetting Transmitter"); connection.writeCharacteristic(Control, nn(new ResetTxMessage().byteSequence)) .subscribe(characteristicValue -> { if (d) UserError.Log.d(TAG, "Wrote ResetTxMessage request!!"); parent.msg("Hard Reset Sent"); }, throwable -> { parent.msg("Hard Reset maybe Failed"); UserError.Log.e(TAG, "Failed to write ResetTxMessage: " + throwable); if (throwable instanceof BleGattCharacteristicException) { final int status = ((BleGattCharacteristicException) throwable).getStatus(); UserError.Log.e(TAG, "Got status message: " + BluetoothServices.getStatusName(status)); } }); return true; }
@SuppressLint("CheckResult") public static boolean doReset(Ob1G5CollectionService parent, RxBleConnection connection) { if (connection == null) return false; parent.msg("Hard Resetting Transmitter"); connection.writeCharacteristic(Control, nn(new ResetTxMessage().byteSequence)) .subscribe(characteristicValue -> { if (d) UserError.Log.d(TAG, "Wrote ResetTxMessage request!!"); parent.msg("Hard Reset Sent"); }, throwable -> { parent.msg("Hard Reset maybe Failed"); UserError.Log.e(TAG, "Failed to write ResetTxMessage: " + throwable); if (throwable instanceof BleGattCharacteristicException) { final int status = ((BleGattCharacteristicException) throwable).getStatus(); UserError.Log.e(TAG, "Got status message: " + BluetoothServices.getStatusName(status)); } }); return true; }
@Override public void onCharacteristicWrite(final BluetoothGatt gatt, final BluetoothGattCharacteristic characteristic, final int status) { try { final String msg = "OnCharacteristic WRITE: " + " status: " + getStatusName(status) + " data: " + JoH.bytesToHex(characteristic.getValue()) + " uuid: " + characteristic.getUuid(); if (status == 0) { Log.d(TAG, msg); } else { UserError.Log.e(TAG, msg); } } catch (Exception e) { UserError.Log.wtf(TAG, "Got exception trying to display data: " + e); } }
@Override public void onCharacteristicWrite(final BluetoothGatt gatt, final BluetoothGattCharacteristic characteristic, final int status) { try { final String msg = "OnCharacteristic WRITE: " + " status: " + getStatusName(status) + " data: " + JoH.bytesToHex(characteristic.getValue()) + " uuid: " + characteristic.getUuid(); if (status == 0) { Log.d(TAG, msg); } else { UserError.Log.e(TAG, msg); } } catch (Exception e) { UserError.Log.wtf(TAG, "Got exception trying to display data: " + e); } }
private synchronized void processOnServicesDiscovered(final BluetoothGatt gatt, final int status) { Log.i(TAG, "onServicesDiscovered On Main Thread? " + isOnMainThread()); Log.e(TAG, "onServicesDiscovered: " + getStatusName(status)); if (status == BluetoothGatt.GATT_SUCCESS) { if (mGatt != null) { Log.w(TAG, "onServicesDiscovered received error status: " + getStatusName(status));
private synchronized void processOnServicesDiscovered(final BluetoothGatt gatt, final int status) { Log.i(TAG, "onServicesDiscovered On Main Thread? " + isOnMainThread()); Log.e(TAG, "onServicesDiscovered: " + getStatusName(status)); if (status == BluetoothGatt.GATT_SUCCESS) { if (mGatt != null) { Log.w(TAG, "onServicesDiscovered received error status: " + getStatusName(status));
private synchronized void processOnServicesDiscovered(final BluetoothGatt gatt, final int status) { Log.i(TAG, "onServicesDiscovered On Main Thread? " + isOnMainThread()); Log.e(TAG, "onServicesDiscovered: " + getStatusName(status)); if (status == BluetoothGatt.GATT_SUCCESS) { if (mGatt != null) { Log.w(TAG, "onServicesDiscovered received error status: " + getStatusName(status));
private void processonDescrptorWrite(final BluetoothGatt gatt, final BluetoothGattDescriptor descriptor, final int status) { Log.i(TAG, "onDescriptorWrite On Main Thread? " + isOnMainThread()); if (status == BluetoothGatt.GATT_SUCCESS) { Log.e(TAG, "Writing to characteristic: " + getUUIDName(descriptor.getCharacteristic().getUuid())); if (mGatt != null) { mGatt.writeCharacteristic(descriptor.getCharacteristic()); } else { Log.e(TAG, "mGatt was null when trying to write UUID descriptor"); } } else { Log.e(TAG, "not writing characteristic due to Unknown error writing descriptor"); } if (status == 133) { encountered133 = true; } Log.e(TAG, "OnDescriptor WRITE finished: status: " + getStatusName(status)); }
private void processonDescrptorWrite(final BluetoothGatt gatt, final BluetoothGattDescriptor descriptor, final int status) { Log.i(TAG, "onDescriptorWrite On Main Thread? " + isOnMainThread()); if (status == BluetoothGatt.GATT_SUCCESS) { Log.e(TAG, "Writing to characteristic: " + getUUIDName(descriptor.getCharacteristic().getUuid())); if (mGatt != null) { mGatt.writeCharacteristic(descriptor.getCharacteristic()); } else { Log.e(TAG, "mGatt was null when trying to write UUID descriptor"); } } else { Log.e(TAG, "not writing characteristic due to Unknown error writing descriptor"); } if (status == 133) { encountered133 = true; } Log.e(TAG, "OnDescriptor WRITE finished: status: " + getStatusName(status)); }
private void processonDescrptorWrite(final BluetoothGatt gatt, final BluetoothGattDescriptor descriptor, final int status) { Log.i(TAG, "onDescriptorWrite On Main Thread? " + isOnMainThread()); if (status == BluetoothGatt.GATT_SUCCESS) { Log.e(TAG, "Writing to characteristic: " + getUUIDName(descriptor.getCharacteristic().getUuid())); if (mGatt != null) { mGatt.writeCharacteristic(descriptor.getCharacteristic()); } else { Log.e(TAG, "mGatt was null when trying to write UUID descriptor"); } } else { Log.e(TAG, "not writing characteristic due to Unknown error writing descriptor"); } if (status == 133) { encountered133 = true; } Log.e(TAG, "OnDescriptor WRITE finished: status: " + getStatusName(status)); }
encountered133 = true; Log.e(TAG, "OnCharacteristic WRITE finished: status: " + getStatusName(status));
encountered133 = true; Log.e(TAG, "OnCharacteristic WRITE finished: status: " + getStatusName(status));