public boolean deregisterWatcher() { if (watcherRegistered == true) { watcherRegistered = false; return mHelper.deregisterCharacteristicsWatcher(); } return true; }
public ParcelUuid[] getCharacteristicUuids() { ArrayList<ParcelUuid> uuidList = new ArrayList<ParcelUuid>(); if (!discoveryDone) mHelper.waitDiscoveryDone(); if (characteristicPaths == null) return null; int count = characteristicPaths.length; for (int i = 0; i < count; i++) { String value = getCharacteristicProperty(characteristicPaths[i], "UUID"); if (value != null) uuidList.add(ParcelUuid.fromString(value)); Log.d(TAG, "Characteristic UUID: " + value); } ParcelUuid[] uuids = new ParcelUuid[count]; uuidList.toArray(uuids); return uuids; }
public boolean registerWatcher() { if (watcherRegistered == false) { watcherRegistered = mHelper.registerCharacteristicsWatcher(); return watcherRegistered; } else { return true; } }
public String readCharacteristicString(String path) { if (!discoveryDone) mHelper.waitDiscoveryDone(); if (characteristicPaths == null) return null; String value = (String) getCharacteristicProperty(path, "Representation"); return value; }
public byte[] readCharacteristicRaw(String path) { if (!discoveryDone) mHelper.waitDiscoveryDone(); if (characteristicPaths == null) return null; String value = getCharacteristicProperty(path, "Value"); byte[] ret = value.getBytes(); return ret; }
public BluetoothGattService(BluetoothDevice device, ParcelUuid uuid, String path) { mDevice = device; mUuid = uuid; mObjPath = path; mName = getServiceName(); mCharacteristicProperties = new HashMap<String, Map<String, String>>(); mHelper = new CharacteristicHelper(); // Start characteristic discovery right away mHelper.doDiscovery(); }
public ParcelUuid getCharacteristicUuid(String path) { ParcelUuid uuid = null; if (!discoveryDone) mHelper.waitDiscoveryDone(); String value = getCharacteristicProperty(path, "UUID"); if (value != null) { uuid = ParcelUuid.fromString(value); Log.d(TAG, "Characteristic UUID: " + value); } return uuid; }
public String[] getCharacteristics() { if (!discoveryDone) mHelper.waitDiscoveryDone(); return characteristicPaths; }
public String getCharacteristicDescription(String path) { if (!discoveryDone) mHelper.waitDiscoveryDone(); return getCharacteristicProperty(path, "Description"); }