Example usage for android.bluetooth BluetoothGattCharacteristic getProperties

List of usage examples for android.bluetooth BluetoothGattCharacteristic getProperties

Introduction

In this page you can find the example usage for android.bluetooth BluetoothGattCharacteristic getProperties.

Prototype

public int getProperties() 

Source Link

Document

Returns the properties of this characteristic.

Usage

From source file:com.cypress.cysmart.BLEServiceFragments.BatteryInformationService.java

/**
 * Stopping Broadcast receiver to broadcast notify characteristics
 *
 * @param gattCharacteristic/*from w w w . ja v a2 s . com*/
 */
void stopBroadcastDataNotify(BluetoothGattCharacteristic gattCharacteristic) {
    Logger.i("Notify stopped");
    final int charaProp = gattCharacteristic.getProperties();
    if ((charaProp | BluetoothGattCharacteristic.PROPERTY_NOTIFY) > 0) {
        if (mNotifyCharacteristic != null) {
            BluetoothLeService.setCharacteristicNotification(mNotifyCharacteristic, false);
        }

    }

}

From source file:com.cypress.cysmart.BLEServiceFragments.SensorHubService.java

/**
 * Stopping Broadcast receiver to broadcast notify characteristics
 *
 * @param gattCharacteristic//from  w w w. j a  va2  s . c om
 */
private static void stopBroadcastDataNotify(BluetoothGattCharacteristic gattCharacteristic) {
    final int charaProp = gattCharacteristic.getProperties();

    if ((charaProp | BluetoothGattCharacteristic.PROPERTY_NOTIFY) > 0) {
        if (gattCharacteristic != null) {
            BluetoothLeService.setCharacteristicNotification(gattCharacteristic, false);

        }

    }

}

From source file:com.cypress.cysmart.BLEServiceFragments.SensorHubService.java

/**
 * Stopping Broadcast receiver to broadcast indicate characteristics
 *
 * @param gattCharacteristic// ww w.j a va2s  . c  o m
 */
private static void stopBroadcastDataIndicate(BluetoothGattCharacteristic gattCharacteristic) {
    final int charaProp = gattCharacteristic.getProperties();

    if ((charaProp | BluetoothGattCharacteristic.PROPERTY_INDICATE) > 0) {
        if (gattCharacteristic != null) {
            BluetoothLeService.setCharacteristicNotification(gattCharacteristic, false);

        }

    }

}

From source file:com.cypress.cysmart.BLEServiceFragments.CapsenseService.java

/**
 * Preparing Broadcast receiver to broadcast notify characteristics
 *
 * @param gattCharacteristic/*w  ww .  java  2  s  . c  o m*/
 */
void prepareBroadcastDataNotify(BluetoothGattCharacteristic gattCharacteristic) {
    final BluetoothGattCharacteristic characteristic = gattCharacteristic;
    final int charaProp = characteristic.getProperties();

    if ((charaProp | BluetoothGattCharacteristic.PROPERTY_NOTIFY) > 0) {
        BluetoothLeService.setCharacteristicNotification(characteristic, true);
    }

}

From source file:com.cypress.cysmart.BLEServiceFragments.HealthTemperatureService.java

/**
 * Preparing Broadcast receiver to broadcast read characteristics
 *
 * @param gattCharacteristic//from  w w w  .  jav  a 2s  .c om
 */

void prepareBroadcastDataRead(BluetoothGattCharacteristic gattCharacteristic) {
    final int charaProp = gattCharacteristic.getProperties();
    if ((charaProp | BluetoothGattCharacteristic.PROPERTY_READ) > 0) {
        mReadCharacteristic = gattCharacteristic;
        BluetoothLeService.readCharacteristic(gattCharacteristic);
    }
}

From source file:com.cypress.cysmart.BLEServiceFragments.HealthTemperatureService.java

/**
 * Preparing Broadcast receiver to broadcast notify characteristics
 *
 * @param gattCharacteristic//from  w  ww .ja v a2 s  .  c  o m
 */
void prepareBroadcastDataIndicate(BluetoothGattCharacteristic gattCharacteristic) {
    final int charaProp = gattCharacteristic.getProperties();

    if ((charaProp | BluetoothGattCharacteristic.PROPERTY_INDICATE) > 0) {
        mNotifyCharacteristic = gattCharacteristic;
        BluetoothLeService.setCharacteristicIndication(gattCharacteristic, true);
    }

}

From source file:com.cypress.cysmart.BLEServiceFragments.HealthTemperatureService.java

/**
 * Stopping Broadcast receiver to broadcast notify characteristics
 *
 * @param gattCharacteristic/* www .  jav a  2 s .c o m*/
 */
void stopBroadcastDataIndiacte(BluetoothGattCharacteristic gattCharacteristic) {
    final int charaProp = gattCharacteristic.getProperties();

    if ((charaProp | BluetoothGattCharacteristic.PROPERTY_INDICATE) > 0) {
        if (mNotifyCharacteristic != null) {
            BluetoothLeService.setCharacteristicIndication(mNotifyCharacteristic, false);
            mNotifyCharacteristic = null;
        }

    }
}

From source file:com.cypress.cysmart.BLEServiceFragments.HeartRateService.java

/**
 * Preparing Broadcast receiver to broadcast notify characteristics
 *
 * @param gattCharacteristic/*  w  w  w  .j av  a  2 s. c  o m*/
 */
void prepareBroadcastDataNotify(BluetoothGattCharacteristic gattCharacteristic) {
    final int charaProp = gattCharacteristic.getProperties();
    if ((charaProp | BluetoothGattCharacteristic.PROPERTY_NOTIFY) > 0) {
        mNotifyCharacteristic = gattCharacteristic;
        BluetoothLeService.setCharacteristicNotification(gattCharacteristic, true);
    }
}

From source file:com.cypress.cysmart.BLEServiceFragments.HeartRateService.java

/**
 * Preparing Broadcast receiver to broadcast read characteristics
 *
 * @param gattCharacteristic/*w  w w.ja  va2 s.  co  m*/
 */
void prepareBroadcastDataRead(BluetoothGattCharacteristic gattCharacteristic) {
    final int charaProp = gattCharacteristic.getProperties();
    if ((charaProp | BluetoothGattCharacteristic.PROPERTY_READ) > 0) {

        mReadCharacteristic = gattCharacteristic;
        BluetoothLeService.readCharacteristic(gattCharacteristic);
    }
}

From source file:com.cypress.cysmart.GATTDBFragments.GattDescriptorDetails.java

/**
 * Preparing Broadcast receiver to broadcast notify characteristics
 *
 * @param gattCharacteristic/*from ww w .  jav a2 s  .c o m*/
 */
void prepareBroadcastDataNotify(BluetoothGattCharacteristic gattCharacteristic) {
    Logger.i("Notify called");
    final BluetoothGattCharacteristic characteristic = gattCharacteristic;
    final int charaProp = characteristic.getProperties();
    if ((charaProp | BluetoothGattCharacteristic.PROPERTY_NOTIFY) > 0) {
        BluetoothLeService.setCharacteristicNotification(characteristic, true);

    }

}