BleDevice
and BleManager
and most of the internal guts for SweetBlue, the easiest way to do BLE on Android.See: Description
Interface | Description |
---|---|
AddServiceListener |
Provide an implementation of this callback to
BleServer.setListener_ServiceAdd(AddServiceListener) . |
AdvertisingListener |
Provide an implementation to
BleServer.setListener_Advertising(AdvertisingListener) , and
BleManager.setListener_Advertising(AdvertisingListener) to receive a callback
when using BleServer.startAdvertising(BleScanRecord) . |
AssertListener |
Mostly only for SweetBlue library developers.
|
BleDeviceConfig.AuthTransactionFactory<T extends BleTransaction.Auth> | |
BleDeviceConfig.InitTransactionFactory<T extends BleTransaction.Init> | |
BleNodeConfig.HistoricalDataFactory |
Provide an instance to
BleNodeConfig.historicalDataFactory to return custom subclasses
of HistoricalData if you would like. |
BleNodeConfig.HistoricalDataLogFilter |
Provide an instance of this class to
BleNodeConfig.historicalDataLogFilter to control
how/if historical data from BLE operations is logged. |
BleWriteTransaction.FailListener |
Interface for handling failures when writing.
|
BleWriteTransaction.WriteQueueListener |
Interface for listening between each write made in the queue.
|
BondFilter |
As of now there are two main default uses for this class...
|
BondListener |
Pass an instance of this listener to
BleDevice.setListener_Bond(BondListener) or BleDevice.bond(BondListener) . |
BondRetryFilter |
Interface used to tell SweetBlue how to behave when a bond attempt fails.
|
DescriptorFilter |
Interface used when the Bluetooth device you're trying to connect to has multiple
BluetoothGattCharacteristic s with the same UUID , in the same
BluetoothGattService . |
DeviceConnectListener |
Convenience listener to know if a connect call was successful or not.
|
DeviceReconnectFilter | |
DeviceStateListener |
Provide an implementation to
BleDevice.setListener_State(DeviceStateListener) and/or
BleManager.setListener_DeviceState(DeviceStateListener) to receive state change events. |
DiscoveryListener |
Provide an implementation to
BleManager.setListener_Discovery(DiscoveryListener) to receive
callbacks when a device is newly discovered, rediscovered, or undiscovered after calling various BleManager.startScan()
or BleManager.startPeriodicScan(Interval, Interval) methods. |
ExchangeListener |
Tagging interface, not to be implemented directly as this is just the base interface to statically tie together
IncomingListener and OutgoingListener with common enums/structures. |
HistoricalDataLoadListener |
A callback that is used by various overloads of
BleDevice.loadHistoricalData() that accept instances hereof. |
HistoricalDataQueryListener |
A callback that is used by
BleNode.select() to listen for when a database query is done processing. |
IncomingListener |
Provide an instance through
BleServer.setListener_Incoming(IncomingListener) . |
ManagerStateListener |
Provide an implementation to
BleManager.setListener_State(ManagerStateListener) to receive callbacks
when the BleManager undergoes a BleManagerState change. |
MtuTestCallback |
Callback used to test out an MTU size adjustment.
|
NotificationListener |
Convenience interface for listening for Notifications/Indications only.
|
OutgoingListener |
Provide an instance to various static methods of
IncomingListener.Please such as
IncomingListener.Please.respondWithSuccess(OutgoingListener) , or BleServer.setListener_Outgoing(OutgoingListener) ,
or BleManager.setListener_Outgoing(OutgoingListener) . |
P_Bridge_User.TransactionHolder | |
P_ITransaction | |
ReadWriteListener |
Provide an implementation of this callback to various methods like
BleDevice.read(UUID, ReadWriteListener) ,
BleDevice.write(UUID, byte[], ReadWriteListener) , BleDevice.startPoll(UUID, Interval, ReadWriteListener) ,
BleDevice.readRssi(ReadWriteListener) , etc. |
ReconnectFilter<T extends ReconnectFilter.ConnectFailEvent> |
An optional interface you can implement on
BleNodeConfig.reconnectFilter to control reconnection behavior. |
ResetListener |
Provide an implementation to
BleManager.reset(ResetListener)
to be notified when a reset operation is complete. |
ScanFilter |
An optional whitelisting mechanism for scanning.
|
ServerConnectListener | |
ServerReconnectFilter | |
ServerStateListener |
Provide an implementation to
BleServer.setListener_State(ServerStateListener) and/or
BleManager.setListener_ServerState(ServerStateListener) to receive state change events. |
SweetLogger | |
TaskTimeoutRequestFilter |
Provides a way to control timeout behavior for various
BleTask instances. |
UhOhListener |
Provide an implementation to
BleManager.setListener_UhOh(UhOhListener)
to receive a callback when an UhOhListener.UhOh occurs. |
UpdateCallback |
A callback where you handle the update time step.
|
Class | Description |
---|---|
AddServiceListener.ServiceAddEvent |
Event struct passed to
AddServiceListener.onEvent(ServiceAddEvent) to give you information about the success
of a service addition or the reason(s) for its failure. |
AdvertisingListener.AdvertisingEvent |
Sub class representing the Advertising Event
|
AssertListener.AssertEvent |
Struct passed to
AssertListener.onEvent(AssertListener.AssertEvent) . |
BleAdvertisingSettings |
Class used specify Ble Advertising settings.
|
BleCharacteristic |
Wrapper class which holds an instance of
BluetoothGattCharacteristic . |
BleDescriptor |
Wrapper class which holds an instance of
BluetoothGattDescriptor . |
BleDescriptorOp<T extends BleDescriptorOp> | |
BleDescriptorRead | |
BleDescriptorRead.Builder |
Builder class to build out a list (or array) of
BleDescriptorRead instances. |
BleDescriptorWrite | |
BleDescriptorWrite.Builder |
Builder class to build out a list (or array) of
BleDescriptorWrite instances. |
BleDevice |
This is the one other class you will use the most besides
BleManager . |
BleDeviceConfig |
Provides a number of options to (optionally) pass to
BleDevice.setConfig(BleDeviceConfig) . |
BleDeviceConfig_UnitTest |
Convenience config class which sets
BleDeviceConfig.gattFactory , and BleDeviceConfig.bluetoothDeviceFactory to the default unit testing equivalents. |
BleDeviceConfig.DefaultBondFilter |
Default implementation of
BondFilter that unbonds for certain phone models upon discovery and disconnects. |
BleDeviceIterator |
Implementation of
Iterator for BleDevice instances, returned from BleManager.getDevices() and its overloads. |
BleManager |
The entry point to the library.
|
BleManagerConfig |
Provides a number of options to pass to the
BleManager.get(Context, BleManagerConfig)
singleton getter or BleManager.setConfig(BleManagerConfig) . |
BleManagerConfig_UnitTest |
Convenience config class which sets
BleManagerConfig.bluetoothManagerImplementation , BleDeviceConfig.gattFactory , BleDeviceConfig.bluetoothDeviceFactory , BleManagerConfig.serverFactory ,
and BleManagerConfig.logger to the default unit testing equivalents. |
BleManagerConfig.DeviceNameComparator |
Default sorter class for sorting the list of devices in
BleManager . |
BleNode | |
BleNodeConfig |
Provides a number of options to (optionally) pass to
BleServer.setConfig(BleNodeConfig) . |
BleNodeConfig.DefaultHistoricalDataLogFilter |
Default implementation of
BleNodeConfig.HistoricalDataLogFilter set on BleNodeConfig.historicalDataLogFilter
that logs the most recent data reading to memory only, flushing the previous one. |
BleNodeConfig.DefaultTaskTimeoutRequestFilter |
Default implementation of
TaskTimeoutRequestFilter that simply sets the timeout
for all BleTask instances to BleNodeConfig.DefaultTaskTimeoutRequestFilter.DEFAULT_TASK_TIMEOUT seconds. |
BleNodeConfig.HistoricalDataLogFilter.HistoricalDataLogEvent |
Event passed to
BleNodeConfig.HistoricalDataLogFilter.onEvent(HistoricalDataLogEvent) that provides
information you can use to determine whether or not BleNodeConfig.HistoricalDataLogFilter.HistoricalDataLogEvent.data() should be logged. |
BleNodeConfig.HistoricalDataLogFilter.Please |
Special value returned from
BleNodeConfig.HistoricalDataLogFilter.onEvent(HistoricalDataLogEvent)
that determines if/how BleNodeConfig.HistoricalDataLogFilter.HistoricalDataLogEvent.data() will get logged. |
BleNotify | |
BleNotify.Builder |
Builder class to build out a list (or array) of
BleNotify instances. |
BleOp<T extends BleOp> |
Base class for basic BLE operations (read, write, notify).
|
BleRead |
Builder-type class used when performing reads on BLE devices.
|
BleRead.Builder |
Builder class to build out a list (or array) of
BleRead instances. |
BleServer |
Get an instance from
BleManager.getServer() . |
BleService |
Wrapper class which holds an instance of
BluetoothGattService . |
BleStatuses |
A collection of various BLE status codes that for whatever reason are not exposed through Android's
public BLE layer - this can be because they are
public but use the @hide annotation,
or they are not public in the first place, or they can only be found by Googling
for native C/C++ library code. |
BleTransaction |
Abstract base class for transactions passed to various methods of
BleDevice . |
BleTransaction.Auth |
Tagging subclass to force type-discrepancy for various
BleDevice.connect() overloads. |
BleTransaction.Init |
Tagging subclass to force type-discrepancy for various
BleDevice.connect() overloads. |
BleTransaction.Ota |
Tagging subclass to force type-correctness for
BleDevice.performOta(BleTransaction.Ota) . |
BleWrite |
Builder-type class for sending a write over BLE.
|
BleWrite.Builder |
Builder class to build out a list (or array) of
BleWrite instances. |
BleWriteTransaction | |
BleWriteTransaction.FailListener.Please |
Class used to dictate what should happen if a write fail happens.
|
BleWriteTransaction.WriteQueueListener.Please |
Class used to tell this
BleWriteTransaction to either proceed to the next write,
or cancel this transaction. |
BondFilter.CharacteristicEvent |
Struct passed to
BondFilter.onEvent(CharacteristicEvent) . |
BondFilter.ConnectionBugEvent | |
BondFilter.ConnectionBugEvent.Please | |
BondFilter.Please |
Return value for the various interface methods of
BondFilter . |
BondFilter.StateChangeEvent |
Just a dummy subclass of
DeviceStateListener.StateEvent so that this gets auto-imported for implementations of BondFilter . |
BondListener.BondEvent |
Struct passed to
BondListener.onEvent(BondEvent) to provide more information about a BleDevice.bond() attempt. |
BondRetryFilter.DefaultBondRetryFilter |
The default
BondRetryFilter that SweetBlue uses. |
BondRetryFilter.Please |
Please class to tell the library if it should retry bonding to the device again or not.
|
BondRetryFilter.RetryEvent |
Event class which holds an instance of the device that a bond has failed on, and the failure code.
|
ConnectFailBluetoothGatt |
Implementation of
UnitTestBluetoothGatt which will fail connection attempts. |
DescriptorFilter.DescriptorEvent |
Event class which is an argument in the
DescriptorFilter.onEvent(DescriptorEvent) method of the
DescriptorFilter interface. |
DescriptorFilter.Please |
Class used to dictate if the current
BluetoothGattCharacteristic is the correct one to operate on
by looking at it's BluetoothGattDescriptor value. |
DeviceConnectListener.ConnectEvent | |
DeviceReconnectFilter.ConnectFailEvent |
Structure passed to
ReconnectFilter.onConnectFailed(ReconnectFilter.ConnectFailEvent) to provide more info about how/why the connection failed. |
DeviceStateListener.StateEvent |
Subclass that adds the device field.
|
DiscoveryListener.DiscoveryEvent |
Struct passed to
DiscoveryListener.onEvent(DiscoveryEvent) . |
ExchangeListener.ExchangeEvent |
Like
ExchangeListener , this class should not be used directly as this is just a base class to statically tie together
IncomingListener.IncomingEvent and OutgoingListener.OutgoingEvent with a common API. |
HistoricalDataLoadListener.HistoricalDataLoadEvent |
Event struct passed to
GenericListener_Void.onEvent(Event) that provides
further information about the status of a historical data load to memory using BleDevice.loadHistoricalData()
(or overloads). |
HistoricalDataQueryListener.HistoricalDataQueryEvent |
Event struct passed to
GenericListener_Void.onEvent(Event) that provides
further information about the status of a historical data load to memory using BleDevice.loadHistoricalData()
(or overloads). |
IncomingListener.IncomingEvent |
Struct passed to
IncomingListener.onEvent(IncomingEvent) } that provides details about the client and what it wants from us, the server. |
IncomingListener.Please |
Struct returned from
IncomingListener.onEvent(IncomingEvent) . |
LogOptions |
Class used to specify the logging options in SweetBlue.
|
ManagerStateListener.StateEvent |
Subclass that adds the manager field.
|
MtuTestCallback.MtuTestEvent |
Class passed in to
MtuTestCallback.onTestRequest(MtuTestEvent) when an MTU has been successfully negotiated to see if SweetBlue should now test it to make
sure it works as it's supposed to. |
MtuTestCallback.Please |
Please class used to tell SweetBlue if it should test the new MTU size, and if so, which service uuid, and char uuid to use, and the data to write (the data
should be the size of the MTU size requested to properly test).
|
MtuTestCallback.TestResult |
Enumeration reporting the result of an MTU test.
|
NotificationListener.NotificationEvent |
Provides a bunch of information about a notification.
|
OutgoingListener.OutgoingEvent |
Struct passed to
OutgoingListener.onEvent(OutgoingEvent)
that provides details of what was sent to the client and if it succeeded. |
P_Bridge |
Bridge class used by
SweetBlueSchedulers to setup the scheduler. |
P_Bridge_User | |
ReadWriteFailBluetoothGatt |
Basic sub-class of
UnitTestBluetoothGatt which will fail all reads/writes. |
ReadWriteListener.ReadWriteEvent |
Provides a bunch of information about a completed read or write.
|
ReconnectFilter.ConnectFailEvent |
Abstract base class for structures passed to
ReconnectFilter.onConnectFailed(ConnectFailEvent)
and ReconnectFilter.onConnectFailed(ConnectFailEvent) to provide more info about how/why a connection failed. |
ReconnectFilter.ConnectFailPlease | |
ReconnectFilter.ConnectionLostEvent |
Struct passed to
ReconnectFilter.onConnectionLost(ConnectionLostEvent) to aid in making a decision. |
ReconnectFilter.ConnectionLostPlease |
Return value for
ReconnectFilter.onConnectionLost(ConnectionLostEvent) . |
ReconnectFilter.DefaultNullReconnectFilter | |
ResetListener.ResetEvent |
Struct passed to
ResetListener.onEvent(ResetListener.ResetEvent) . |
ScanFilter.Please |
Small struct passed back from
ScanFilter.onEvent(ScanEvent) . |
ScanFilter.ScanEvent |
Instances of this class are passed to
ScanFilter.onEvent(ScanEvent) to aid in making a decision. |
ScanOptions |
Class used to feed options for scanning via
BleManager.startScan(ScanOptions) . |
ServerConnectListener.ConnectEvent | |
ServerReconnectFilter.ConnectFailEvent |
Structure passed to
ReconnectFilter.onConnectFailed(ReconnectFilter.ConnectFailEvent) to provide more info about how/why the connection failed. |
ServerStateListener.StateEvent |
Subclass that adds the
ServerStateListener.StateEvent.server() , ServerStateListener.StateEvent.macAddress() , and ServerStateListener.StateEvent.gattStatus() fields. |
SweetUnitTest<A extends android.app.Activity> |
Convenience base class for running unit tests involving SweetBlue.
|
TaskTimeoutRequestFilter.Please |
Use static constructor methods to create instances to return from
TaskTimeoutRequestFilter.onEvent(TaskTimeoutRequestEvent) . |
TaskTimeoutRequestFilter.TaskTimeoutRequestEvent |
Event passed to
TaskTimeoutRequestFilter.onEvent(TaskTimeoutRequestEvent) that provides
information about the BleTask that will soon be executed. |
UhOhListener.UhOhEvent |
Struct passed to
UhOhListener.onEvent(UhOhListener.UhOhEvent) . |
UnitTestBluetoothDevice |
Base class used to mock a bluetooth device (at the android layer).
|
UnitTestBluetoothGatt |
Base class used to mock a bluetooth gatt instance (at the android layer).
|
UnitTestBluetoothManager |
Base class used to mock the bluetooth manager instance (at the android layer).
|
UnitTestBluetoothServer |
Base class used to mock a bluetooth server (at the android layer).
|
UnitTestLogger |
Implementation of
SweetLogger which just prints logs to the console via System.out.println(). |
Util_Native |
Utility class for simulating Bluetooth operations (read/writes, notifications, etc).
|
Enum | Description |
---|---|
AddServiceListener.Status |
Enumeration of the different ways that service addition can fail (and one way for it to succeed),
provided through
OutgoingListener.OutgoingEvent.status() . |
AdvertisingListener.Status |
Enumeration describing the m_status of calling
BleServer.startAdvertising(BleScanRecord) . |
BleAdvertisingSettings.BleAdvertisingMode |
Type-safe parallel of static final int members of
AdvertiseSettings . |
BleAdvertisingSettings.BleTransmissionPower |
Type-safe parallel of static final int members of
AdvertiseSettings . |
BleCharacteristicPermission |
This enum enforces compile-time constraints over various public static int PERMISSION_ members
of
BluetoothGattCharacteristic . |
BleCharacteristicProperty |
This enum enforces compile-time constraints over various public static int PROPERTY_ members
of
BluetoothGattCharacteristic . |
BleConnectionPriority |
This enum enforces compile-time constraints over various public static int CONNECTION_PRIORITY_* members
of
BluetoothGatt and is passed to BleDevice.setConnectionPriority(BleConnectionPriority, ReadWriteListener)
and returned from BleDevice.getConnectionPriority() . |
BleDescriptorPermission |
This enum enforces compile-time constraints over various public static int PERMISSION_ members
of
BluetoothGattDescriptor . |
BleDeviceConfig.RefreshOption |
Enumeration used with
BleDeviceConfig.useGattRefresh . |
BleDeviceOrigin |
Enumeration signifying how a
BleDevice instance was created. |
BleDeviceState |
An enumeration of the various states that a
BleDevice can be in. |
BleManagerState |
An enumeration of the various states that a
BleManager can be in. |
BleNodeConfig.HistoricalDataLogFilter.Source |
Signifies where the data came from, usually from a BLE read or notification.
|
BleScanApi |
Type-safe parallel of various static final int members of
ScanSettings and a way to
force pre-Lollipop scanning mode. |
BleScanPower |
Type-safe parallel of various static final int members of
ScanSettings for setting the scanning power
when using the Lollipop scanning API. |
BleServerState |
An enumeration of the various states that a
BleServer can be in on a per-client (mac address) basis. |
BleTask |
Under the hood, SweetBlue uses a priority task queue to serialize all interaction with the native BLE stack.
|
BleTransaction.Atomicity | |
BleTransaction.EndReason |
Values are passed to
BleTransaction.onEnd(EndReason) . |
BondFilter.CharacteristicEventType |
An enumeration of the type of characteristic operation for a
BondFilter.CharacteristicEvent . |
BondListener.BondEvent.Type | |
BondListener.Status |
Used on
BondListener.BondEvent.status() to roughly enumerate success or failure. |
BondRetryFilter.Status | |
ConnectFailBluetoothGatt.FailurePoint |
Enumeration used to dictate where in the connection process the failure should happen.
|
ConnectFailBluetoothGatt.FailureType |
Enumeration used to dictate what type of failure should be reported.
|
DeviceReconnectFilter.Status |
The reason for the connection failure.
|
DeviceReconnectFilter.Timing |
For
DeviceReconnectFilter.Status.NATIVE_CONNECTION_FAILED , DeviceReconnectFilter.Status.DISCOVERING_SERVICES_FAILED , and
DeviceReconnectFilter.Status.BONDING_FAILED , gives further timing information on when the failure took place. |
DiscoveryListener.LifeCycle |
Enumerates changes in the "discovered" state of a device.
|
ExchangeListener.Target |
The type of GATT object, provided by
ExchangeListener.ExchangeEvent.target() . |
ExchangeListener.Type |
The type of exchange being executed, read, write, or notify.
|
HistoricalDataLoadListener.Status |
Enumerates the status codes for operations kicked off from
BleDevice.loadHistoricalData() (or overloads). |
HistoricalDataQueryListener.Status |
Enumerates the status codes for operations kicked off from
BleNode.select() . |
LogOptions.LogLevel |
Enumeration for setting the log level of SweetBlue's logger.
|
MtuTestCallback.TestResult.Result | |
NotificationListener.Status |
A value returned to
GenericListener_Void.onEvent(Event)
by way of NotificationListener.NotificationEvent.status() that indicates success of the
operation or the reason for its failure. |
NotificationListener.Type |
The type of operation for a
ReadWriteListener.ReadWriteEvent - read, write, poll, etc. |
OutgoingListener.Status |
Enumeration of the various success and error statuses possible for an outgoing message.
|
P_ITransaction.Type | |
ReadWriteFailBluetoothGatt.FailType |
Enumeration used to specify the type of failure.
|
ReadWriteListener.Status |
A value returned to
GenericListener_Void.onEvent(Event)
by way of ReadWriteListener.ReadWriteEvent.status() that indicates success of the
operation or the reason for its failure. |
ReadWriteListener.Target |
The type of GATT "object", provided by
ReadWriteListener.ReadWriteEvent.target() . |
ReadWriteListener.Type |
The type of operation for a
ReadWriteListener.ReadWriteEvent - read, write, poll, etc. |
ReconnectFilter.AutoConnectUsage |
Describes usage of the
autoConnect parameter for either BluetoothDevice.connectGatt(Context, boolean, android.bluetooth.BluetoothGattCallback)
or BluetoothGattServer.connect(BluetoothDevice, boolean) . |
ReconnectFilter.Type |
An enum provided through
ReconnectFilter.ConnectionLostEvent.type() that describes what reconnect stage we're at. |
ResetListener.Progress |
Enumeration of the progress of the reset.
|
ScanFilter.ApplyMode |
An enumeration of the various ways that the (up to) two
ScanFilter held in the scan
filter manager will be applied when scanning |
ServerReconnectFilter.Status |
The reason for the connection failure.
|
TimeTrackerSetting | |
UhOhListener.Remedy |
The suggested remedy for each
UhOhListener.UhOh . |
UhOhListener.UhOh |
An UhOh is a warning about an exceptional (in the bad sense) and unfixable problem with the underlying stack that
the app can warn its user about.
|
BleDevice
and BleManager
and most of the internal guts for SweetBlue, the easiest way to do BLE on Android.