Package io.heraldprox.herald.sensor.ble
Class ConcreteBLEDatabase
- java.lang.Object
-
- io.heraldprox.herald.sensor.ble.ConcreteBLEDatabase
-
- All Implemented Interfaces:
BLEDatabase
,BLEDeviceDelegate
public class ConcreteBLEDatabase extends java.lang.Object implements BLEDatabase, BLEDeviceDelegate
-
-
Constructor Summary
Constructors Constructor Description ConcreteBLEDatabase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(BLEDatabaseDelegate delegate)
Add delegate for handling database eventsvoid
delete(BLEDevice device)
Delete device from database.BLEDevice
device(android.bluetooth.BluetoothDevice bluetoothDevice)
Get or create device for collating information from asynchronous BLE operations.BLEDevice
device(android.bluetooth.le.ScanResult scanResult)
Get or create device for collating information from asynchronous BLE operations.void
device(BLEDevice device, BLEDeviceAttribute didUpdate)
BLEDevice
device(PayloadData payloadData)
Get or create device for collating information from asynchronous BLE operations.BLEDevice
device(TargetIdentifier targetIdentifier)
Get a device from a TargetIdentifier.java.util.List<BLEDevice>
devices()
Get all devices.PayloadSharingData
payloadSharingData(BLEDevice peer)
Get payload sharing data for a peer.
-
-
-
Method Detail
-
add
public void add(@NonNull BLEDatabaseDelegate delegate)
Description copied from interface:BLEDatabase
Add delegate for handling database events- Specified by:
add
in interfaceBLEDatabase
-
device
@Nullable public BLEDevice device(@NonNull TargetIdentifier targetIdentifier)
Description copied from interface:BLEDatabase
Get a device from a TargetIdentifier.- Specified by:
device
in interfaceBLEDatabase
- Returns:
-
device
@NonNull public BLEDevice device(@NonNull android.bluetooth.BluetoothDevice bluetoothDevice)
Description copied from interface:BLEDatabase
Get or create device for collating information from asynchronous BLE operations.- Specified by:
device
in interfaceBLEDatabase
- Returns:
-
device
@NonNull public BLEDevice device(@NonNull android.bluetooth.le.ScanResult scanResult)
Description copied from interface:BLEDatabase
Get or create device for collating information from asynchronous BLE operations.- Specified by:
device
in interfaceBLEDatabase
- Returns:
-
device
@NonNull public BLEDevice device(@NonNull PayloadData payloadData)
Description copied from interface:BLEDatabase
Get or create device for collating information from asynchronous BLE operations.- Specified by:
device
in interfaceBLEDatabase
- Returns:
-
devices
@NonNull public java.util.List<BLEDevice> devices()
Description copied from interface:BLEDatabase
Get all devices.- Specified by:
devices
in interfaceBLEDatabase
- Returns:
-
delete
public void delete(@Nullable BLEDevice device)
Description copied from interface:BLEDatabase
Delete device from database.- Specified by:
delete
in interfaceBLEDatabase
-
payloadSharingData
@NonNull public PayloadSharingData payloadSharingData(@NonNull BLEDevice peer)
Description copied from interface:BLEDatabase
Get payload sharing data for a peer.- Specified by:
payloadSharingData
in interfaceBLEDatabase
- Returns:
-
device
public void device(@NonNull BLEDevice device, @NonNull BLEDeviceAttribute didUpdate)
- Specified by:
device
in interfaceBLEDeviceDelegate
-
-