private native long connectionRfOpenClientConnectionImpl(long address, int channel, boolean authenticate, boolean encrypt, int timeout) throws IOException;
public long connectionRfOpenClientConnection(BluetoothConnectionParams params) throws IOException {
if (params.encrypt) {
throw new BluetoothConnectionException(BluetoothConnectionException.SECURITY_BLOCK, "encrypt mode not supported");
public native void l2CloseClientConnection(long handle) throws IOException;
private native long l2ServerOpenImpl(byte[] uuidValue, boolean authenticate, boolean encrypt, String name, int receiveMTU, int transmitMTU, int assignPsm)
throws IOException;
public native int l2ServerPSM(long handle) throws IOException;
public long l2ServerOpen(BluetoothConnectionNotifierParams params, int receiveMTU, int transmitMTU, ServiceRecordImpl serviceRecord) throws IOException {
verifyDeviceReady();
validateMTU(receiveMTU, transmitMTU);
if (params.encrypt) {
throw new BluetoothConnectionException(BluetoothConnectionException.SECURITY_BLOCK, "encrypt mode not supported");