You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-12Lines changed: 10 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -26,33 +26,31 @@ Replace `master-SNAPSHOT` with the a release version number or a commit hash to
26
26
27
27
### Overview
28
28
29
-
This library provides all commonly used Bluetooth GATT server functionality through [RxJava][rxjava] powered interfaces. There's a default implementation avaialble for each of those interfaces, so that you don't have to manually deal with all the request and response handling that is usually required when providing Android's `BluetoothGattServerCallback`.
29
+
This library provides all commonly used Bluetooth GATT server functionality through [RxJava][rxjava] powered interfaces. There's a default implementation available for each of those interfaces, so that you don't have to manually deal with all the request and response handling that is usually required when providing Android's `BluetoothGattServerCallback`.
30
30
31
31
It also introduces a few wrappers to make it more convenient to work with the BLE related stuff, for instance:
32
32
33
33
-`RxBleValue` instead of raw `byte[]` arrays with offsets
34
34
-`RxBleServerRequest` and `RxBleServerResponse` instead of the overloaded callback parameters
35
35
- Further extended for characteristic and descriptor reads and writes
36
36
37
-
### Usage
38
-
39
-
#### GATT Server
37
+
### GATT Server
40
38
41
39
The `RxBleServer` interface provides the functionality of Android's `BluetoothGattServer`. It's capable of providing and advertising services as well as connecting and disconnecting clients.
42
40
43
41
To get an instance of the default implementation, use the `ServerBuilder`.
44
42
45
43
You can customize the default implementation by extending `BaseServer`.
46
44
47
-
#####Providing & Advertising
45
+
#### Providing & Advertising
48
46
49
-
To actually open the server and make it visible to remote clients, there are two methods that you should subscribe to: `Completable provideServices()` and `Completable advertise(UUID)`.
47
+
To actually open the server and make it visible to remote clients, there are two methods that you should subscribe to: `provideServices()` and `advertise(UUID)`.
50
48
51
-
You can provide a GATT server without advertising any service UUID. You can also advertise a service UUID that you don't actually provide a GATT server for. While most of the time you might want to do both, that may not always be the case. You could, for instance, stop advertising while a given client is connected. For convenience, there's also a merged version: `Completable provideServicesAndAdvertise(UUID)`.
49
+
You can provide a GATT server without advertising any service UUID. You can also advertise a service UUID that you don't actually provide a GATT server for. While most of the time you might want to do both, that may not always be the case. You could, for instance, stop advertising while a given client is connected. For convenience, there's also a merged version: `provideServicesAndAdvertise(UUID)`.
52
50
53
51
These methods will return a `Completable` that never terminates (unless an error accurs, e.g. when Bluetooth is disabled). You need to manually dispose the `Completable` subscriptions to stop the server (e.g. when your application lifecycle comes to an end).
54
52
55
-
####GATT Services
53
+
### GATT Services
56
54
57
55
The `RxBleService` interface provides the functionality of Android's `BluetoothGattService`. It's basically just a container for one ore more characteristics.
58
56
@@ -68,7 +66,7 @@ RxBleService service = new ServiceBuilder(EXAMPLE_SERVICE_UUID)
68
66
69
67
You can customize the default implementation by extending `BaseService`.
70
68
71
-
####GATT Characteristics
69
+
### GATT Characteristics
72
70
73
71
The `RxBleCharacteristic` interface provides the functionality of Android's `BluetoothGattCharacteristic`. It can hold a value, zero or more descriptors, permissions and properties.
74
72
@@ -88,7 +86,7 @@ RxBleCharacteristic characteristic = new CharacteristicBuilder(EXAMPLE_CHARACTER
88
86
89
87
You can customize the default implementation by extending `BaseCharacteristic`.
90
88
91
-
####GATT Descriptors
89
+
### GATT Descriptors
92
90
93
91
The `RxBleDescriptor` interface provides the functionality of Android's `BluetoothGattDescriptor`. It can hold a value and permissions.
94
92
@@ -109,7 +107,7 @@ RxBleDescriptor descriptor = new CharacteristicUserDescription("Example characte
109
107
110
108
You can customize the default implementation by extending `BaseDescriptor`.
111
109
112
-
####Value Providers
110
+
### Value Providers
113
111
114
112
Both `RxBleCharacteristic` and `RxBleDescriptor` extend the `RxBleSharedValueProvider` as well as the `RxBleClientValueProvider` interface. That means they have methods to get or set values, and to observe value changes (e.g. if set by a write request from a remote client).
Note that the difference between these two is not just a `.filter()` by device, different clients can actually read and write different values on the same `RxBleClientValueProvider`.
129
127
130
-
####Clients
128
+
### Clients
131
129
132
130
The `RxBleClient` interface provides the functionality of Android's `BluetoothDevice`. It represents a remote device that connected to the server. Client instances will be automatically created by the library for your once they start connecting.
0 commit comments