Package io.heraldprox.herald.sensor.ble
Class ConcreteBLETransmitter
- java.lang.Object
-
- io.heraldprox.herald.sensor.ble.ConcreteBLETransmitter
-
- All Implemented Interfaces:
BLETransmitter,BluetoothStateManagerDelegate,Sensor
public class ConcreteBLETransmitter extends java.lang.Object implements BLETransmitter, BluetoothStateManagerDelegate
-
-
Field Summary
-
Fields inherited from interface io.heraldprox.herald.sensor.ble.BLETransmitter
delegates
-
-
Constructor Summary
Constructors Constructor Description ConcreteBLETransmitter(android.content.Context context, BluetoothStateManager bluetoothStateManager, BLETimer timer, PayloadDataSupplier payloadDataSupplier, BLEDatabase database)Transmitter starts automatically when Bluetooth is enabled.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(SensorDelegate delegate)voidbluetoothStateManager(BluetoothState didUpdateState)booleanisSupported()Is transmitter supported.PayloadDatapayloadData()Get current payload.voidstart()voidstop()
-
-
-
Constructor Detail
-
ConcreteBLETransmitter
public ConcreteBLETransmitter(@NonNull android.content.Context context, @NonNull BluetoothStateManager bluetoothStateManager, @NonNull BLETimer timer, @NonNull PayloadDataSupplier payloadDataSupplier, @NonNull BLEDatabase database)Transmitter starts automatically when Bluetooth is enabled.- Parameters:
context- The Herald execution environment ContextbluetoothStateManager- To determine whether Bluetooth is enabledtimer- Used to register a need for periodic events to occurpayloadDataSupplier- Source of the payload to transmitdatabase- BLE Device database to locate nearby device information
-
-
Method Detail
-
add
public void add(@NonNull SensorDelegate delegate)
-
payloadData
@NonNull public PayloadData payloadData()
Description copied from interface:BLETransmitterGet current payload.- Specified by:
payloadDatain interfaceBLETransmitter- Returns:
- The current PayloadData for this device.
-
isSupported
public boolean isSupported()
Description copied from interface:BLETransmitterIs transmitter supported.- Specified by:
isSupportedin interfaceBLETransmitter- Returns:
- True if BLE advertising is supported.
-
bluetoothStateManager
public void bluetoothStateManager(@NonNull BluetoothState didUpdateState)- Specified by:
bluetoothStateManagerin interfaceBluetoothStateManagerDelegate
-
-