Codota Logo
ReadRequest
Code IndexAdd Codota to your IDE (free)

How to use
ReadRequest
in
no.nordicsemi.android.ble

Best Java code snippets using no.nordicsemi.android.ble.ReadRequest (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: NordicSemiconductor/Android-nRF-Toolbox

public void readBatteryLevelCharacteristic() {
  if (isConnected()) {
    readCharacteristic(mBatteryLevelCharacteristic)
        .with(mBatteryLevelDataCallback)
        .fail((device, status) -> log(Log.WARN,"Battery Level characteristic not found"))
        .enqueue();
  }
}
origin: NordicSemiconductor/Android-BLE-Library

/**
 * Creates new Read Battery Level request. The first found Battery Level characteristic value
 * from the first found Battery Service. If any of them is not found, or the characteristic
 * does not have the READ property this operation will not execute.
 *
 * @return The new request.
 * @deprecated Use {@link #newReadRequest(BluetoothGattCharacteristic)} with
 * BatteryLevelDataCallback from Android BLE Common Library instead.
 */
@NonNull
@Deprecated
public static ReadRequest newReadBatteryLevelRequest() {
  return new ReadRequest(Type.READ_BATTERY_LEVEL);
}
origin: NordicSemiconductor/Android-BLE-Library

/**
 * Reads the battery level from the device.
 *
 * @deprecated Use {@link #readCharacteristic(BluetoothGattCharacteristic)} instead.
 */
@SuppressWarnings("ConstantConditions")
@Deprecated
protected void readBatteryLevel() {
  Request.newReadBatteryLevelRequest().setManager(this)
      .with((device, data) -> {
        if (data.size() == 1) {
          final int batteryLevel = data.getIntValue(Data.FORMAT_UINT8, 0);
          log(Log.INFO, "Battery Level received: " + batteryLevel + "%");
          mBatteryValue = batteryLevel;
          final BleManagerGattCallback callback = mGattCallback;
          if (callback != null) {
            callback.onBatteryValueReceived(mBluetoothGatt, batteryLevel);
          }
          mCallbacks.onBatteryValueReceived(device, batteryLevel);
        }
      })
      .enqueue();
}
origin: NordicSemiconductor/Android-BLE-Library

    .merge((output, lastPacket, index) -> {
      assertTrue(data.length <= MTU - 3);
    })
    .with((device, data) -> {
    .done(device -> done = true);
    readRequest.notifyValueChanged(null, chunk);
readRequest.notifySuccess(null);
assertTrue(done);
origin: NordicSemiconductor/Android-nRF-Toolbox

  @Override
  protected void onDeviceReady() {
    super.onDeviceReady();
    // Initialization is now ready.
    // The service or activity has been notified with TemplateManagerCallbacks#onDeviceReady().
    // TODO Do some extra logic here, of remove onDeviceReady().
    // Device is ready, let's read something here. Usually there is nothing else to be done
    // here, as all had been done during initialization.
    readCharacteristic(mOptionalCharacteristic)
        .with((device, data) -> {
          // Characteristic value has been read
          // Let's do some magic with it.
          if (data.size() > 0) {
            final Integer value = data.getIntValue(Data.FORMAT_UINT8, 0);
            log(LogContract.Log.Level.APPLICATION, "Value '" + value + "' has been read!");
          } else {
            log(Log.WARN, "Value is empty!");
          }
        })
        .enqueue();
  }
};
origin: NordicSemiconductor/Android-BLE-Library

  throws RequestFailedException, InvalidDataException, DeviceDisconnectedException,
  BluetoothDisabledException, InvalidRequestException {
final E response = await(responseClass);
if (!response.isValid()) {
  throw new InvalidDataException(response);
origin: NordicSemiconductor/Android-BLE-Library

  throws RequestFailedException, InvalidDataException, DeviceDisconnectedException,
  BluetoothDisabledException, InvalidRequestException {
await(response);
if (!response.isValid()) {
  throw new InvalidDataException(response);
origin: NordicSemiconductor/Android-nRF-Toolbox

super.initialize();
readCharacteristic(mBodySensorLocationCharacteristic)
    .with(new BodySensorLocationDataCallback() {
      @Override
      public void onDataReceived(@NonNull final BluetoothDevice device, @NonNull final Data data) {
    .fail((device, status) -> log(Log.WARN, "Body Sensor Location characteristic not found"))
    .enqueue();
setNotificationCallback(mHeartRateCharacteristic)
    .with(new HeartRateMeasurementDataCallback() {
origin: NordicSemiconductor/Android-BLE-Library

/**
 * Creates new Read Descriptor request. The request will not be executed if given descriptor
 * is null. After the operation is complete a proper callback will be invoked.
 *
 * @param descriptor descriptor to be read.
 * @return The new request.
 * @deprecated Access to this method will change to package-only.
 * Use {@link BleManager#readDescriptor(BluetoothGattDescriptor)} instead.
 */
@Deprecated
@NonNull
public static ReadRequest newReadRequest(@Nullable final BluetoothGattDescriptor descriptor) {
  return new ReadRequest(Type.READ_DESCRIPTOR, descriptor);
}
origin: NordicSemiconductor/Android-nRF-Toolbox

.with(new CGMFeatureDataCallback() {
  @Override
  public void onContinuousGlucoseMonitorFeaturesReceived(@NonNull final BluetoothDevice device, @NonNull final CGMFeatures features,
.fail((device, status) -> log(Log.WARN, "Could not read CGM Feature characteristic"))
.enqueue();
.with(new CGMStatusDataCallback() {
  @Override
  public void onContinuousGlucoseMonitorStatusChanged(@NonNull final BluetoothDevice device, @NonNull final CGMStatus status, final int timeOffset, final boolean secured) {
.fail((device, status) -> log(Log.WARN, "Could not read CGM Status characteristic"))
.enqueue();
origin: NordicSemiconductor/Android-BLE-Library

/**
 * Creates new Read Characteristic request. The request will not be executed if given
 * characteristic is null or does not have READ property.
 * After the operation is complete a proper callback will be invoked.
 *
 * @param characteristic characteristic to be read.
 * @return The new request.
 * @deprecated Access to this method will change to package-only.
 * Use {@link BleManager#readCharacteristic(BluetoothGattCharacteristic)} instead.
 */
@Deprecated
@NonNull
public static ReadRequest newReadRequest(
    @Nullable final BluetoothGattCharacteristic characteristic) {
  return new ReadRequest(Type.READ, characteristic);
}
no.nordicsemi.android.bleReadRequest

Most used methods

  • with
  • enqueue
  • <init>
  • await
  • done
  • fail
  • merge
    Adds a merger that will be used to merge multiple packets into a single Data. The merger may modify
  • notifySuccess
  • notifyValueChanged
  • setManager

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now