List of usage examples for android.bluetooth BluetoothGattCharacteristic PROPERTY_READ
int PROPERTY_READ
To view the source code for android.bluetooth BluetoothGattCharacteristic PROPERTY_READ.
Click Source Link
From source file:org.bcsphere.bluetooth.tools.Tools.java
public static JSONArray decodeProperty(int property) { JSONArray properties = new JSONArray(); String strProperty = null;/* www . ja v a 2s .c o m*/ if ((strProperty = lookup(property, BluetoothGattCharacteristic.PROPERTY_BROADCAST)) != null) { properties.put(strProperty); } if ((strProperty = lookup(property, BluetoothGattCharacteristic.PROPERTY_READ)) != null) { properties.put(strProperty); } if ((strProperty = lookup(property, BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE)) != null) { properties.put(strProperty); } if ((strProperty = lookup(property, BluetoothGattCharacteristic.PROPERTY_WRITE)) != null) { properties.put(strProperty); } if ((strProperty = lookup(property, BluetoothGattCharacteristic.PROPERTY_NOTIFY)) != null) { properties.put(strProperty); } if ((strProperty = lookup(property, BluetoothGattCharacteristic.PROPERTY_INDICATE)) != null) { properties.put(strProperty); } if ((strProperty = lookup(property, BluetoothGattCharacteristic.PROPERTY_SIGNED_WRITE)) != null) { properties.put(strProperty); } if ((strProperty = lookup(property, BluetoothGattCharacteristic.PROPERTY_EXTENDED_PROPS)) != null) { properties.put(strProperty); } return properties; }
From source file:edu.umich.eecs.lab11.camera.CameraFragment.java
private void initServer() { BluetoothGattService service = new BluetoothGattService(DeviceProfile.SERVICE_UUID, BluetoothGattService.SERVICE_TYPE_PRIMARY); BluetoothGattCharacteristic offsetCharacteristic = new BluetoothGattCharacteristic( DeviceProfile.CHARACTERISTIC_UUID, //Read+write permissions BluetoothGattCharacteristic.PROPERTY_READ | BluetoothGattCharacteristic.PROPERTY_WRITE, BluetoothGattCharacteristic.PERMISSION_READ | BluetoothGattCharacteristic.PERMISSION_WRITE); service.addCharacteristic(offsetCharacteristic); mGattServer.addService(service);//from w w w. j a v a 2 s . c om }
From source file:com.cypress.cysmart.BLEServiceFragments.SensorHubService.java
/** * Preparing Broadcast receiver to broadcast read characteristics * * @param gattCharacteristic// w ww . ja v a 2 s . c o m */ void prepareBroadcastDataRead(BluetoothGattCharacteristic gattCharacteristic) { final int charaProp = gattCharacteristic.getProperties(); if ((charaProp | BluetoothGattCharacteristic.PROPERTY_READ) > 0) { BluetoothLeService.readCharacteristic(gattCharacteristic); } }