public static class RxBleClientMock.DeviceBuilder
extends java.lang.Object
| Constructor and Description |
|---|
DeviceBuilder()
Build a new
RxBleDevice. |
| Modifier and Type | Method and Description |
|---|---|
RxBleClientMock.DeviceBuilder |
addService(java.util.UUID uuid,
java.util.List<android.bluetooth.BluetoothGattCharacteristic> characteristics)
Add a
BluetoothGattService to the device. |
RxBleClientMock.DeviceBuilder |
bluetoothDevice(android.bluetooth.BluetoothDevice bluetoothDevice)
Sets a bluetooth device.
|
RxBleDevice |
build()
Create the
RxBleDeviceMock instance using the configured values. |
RxBleClientMock.DeviceBuilder |
deviceMacAddress(java.lang.String deviceMacAddress)
Set a device mac address.
|
RxBleClientMock.DeviceBuilder |
deviceName(java.lang.String deviceName)
Set a device name.
|
RxBleClientMock.DeviceBuilder |
notificationSource(java.util.UUID characteristicUUID,
<any> sourceObservable)
Set an
Observable that will be used to fire characteristic change notifications. |
RxBleClientMock.DeviceBuilder |
rssi(int rssi)
Set a rssi that will be reported.
|
RxBleClientMock.DeviceBuilder |
scanRecord(byte[] scanRecord)
Set a BLE scan record.
|
public DeviceBuilder()
RxBleDevice.
Calling scanRecord, rssi and deviceMacAddress
is required before calling build(). All other methods
are optional.
public RxBleClientMock.DeviceBuilder addService(java.util.UUID uuid, java.util.List<android.bluetooth.BluetoothGattCharacteristic> characteristics)
BluetoothGattService to the device. Calling this method is not required.uuid - service UUIDcharacteristics - characteristics that the service should report. Use RxBleClientMock.CharacteristicsBuilder to create them.public RxBleDevice build()
RxBleDeviceMock instance using the configured values.public RxBleClientMock.DeviceBuilder deviceMacAddress(java.lang.String deviceMacAddress)
public RxBleClientMock.DeviceBuilder deviceName(java.lang.String deviceName)
public RxBleClientMock.DeviceBuilder bluetoothDevice(android.bluetooth.BluetoothDevice bluetoothDevice)
public RxBleClientMock.DeviceBuilder notificationSource(java.util.UUID characteristicUUID, <any> sourceObservable)
Observable that will be used to fire characteristic change notifications. It will be subscribed to after
a call to com.polidea.rxandroidble2.RxBleConnection#setupNotification(UUID). Calling this method is not required.characteristicUUID - UUID of the characteristic that will be observed for notificationssourceObservable - Observable that will be subscribed to in order to receive characteristic change notificationspublic RxBleClientMock.DeviceBuilder rssi(int rssi)
public RxBleClientMock.DeviceBuilder scanRecord(byte[] scanRecord)