private void setConnectionParameters() { // Make sure connection interval is long enough for OAD byte[] value = { Conversion.loUint16(OAD_CONN_INTERVAL), Conversion.hiUint16(OAD_CONN_INTERVAL), Conversion.loUint16(OAD_CONN_INTERVAL), Conversion.hiUint16(OAD_CONN_INTERVAL), 0, 0, Conversion.loUint16(OAD_SUPERVISION_TIMEOUT), Conversion.hiUint16(OAD_SUPERVISION_TIMEOUT) }; mCharConnReq.setValue(value); boolean ok = mLeService.writeCharacteristic(mCharConnReq); if (ok) ok = mLeService.waitIdle(GATT_WRITE_TIMEOUT); }
private boolean enableNotification(BluetoothGattCharacteristic c, boolean enable) { boolean ok = mLeService.setCharacteristicNotification(c, enable); if (ok) ok = mLeService.waitIdle(GATT_WRITE_TIMEOUT); return ok; }
private boolean writeCharacteristic(BluetoothGattCharacteristic c, byte v) { boolean ok = mLeService.writeCharacteristic(c, v); if (ok) ok = mLeService.waitIdle(GATT_WRITE_TIMEOUT); return ok; }