From 6e470ebde6bf232103ce14841cfe05dc1bc2c2e4 Mon Sep 17 00:00:00 2001 From: Ivan Baranov Date: Mon, 24 Apr 2017 15:04:26 +0300 Subject: [PATCH] Update README.md --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index dd31888..96b8876 100644 --- a/README.md +++ b/README.md @@ -320,6 +320,28 @@ bluetoothConnection.send("Hello"); // String bluetoothConnection.send("There".getBytes()); // Array of bytes ``` +#### Observe ACL actions +```java +rxBluetooth.observeAclEvent() // + .observeOn(AndroidSchedulers.mainThread()) + .subscribeOn(Schedulers.computation()) + .subscribe(new Action1() { + @Override public void call(AclEvent aclEvent) { + switch (aclEvent.getAction()) { + case BluetoothDevice.ACTION_ACL_CONNECTED: + //... + break; + case BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED: + //... + break; + case BluetoothDevice.ACTION_ACL_DISCONNECTED: + //... + break; + } + } + }); +``` + Download -------- ```groovy