public final class AndroidBluetoothManager extends java.lang.Object implements IBluetoothManager
IBluetoothManager
, and wraps BluetoothManager
and BluetoothAdapter
. This class is used by default
by the library, and the only time it should NOT be used, is when unit testing.IBluetoothManager.DefaultFactory, IBluetoothManager.Factory
DEFAULT_FACTORY, DEFAULT_INSTANCE
Constructor and Description |
---|
AndroidBluetoothManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
cancelDiscovery() |
boolean |
disable() |
boolean |
enable() |
java.lang.String |
getAddress() |
int |
getBleState() |
java.util.Set<P_DeviceHolder> |
getBondedDevices() |
int |
getConnectionState(IBluetoothDevice device,
int profile) |
java.lang.String |
getName() |
android.bluetooth.BluetoothAdapter |
getNativeAdaptor() |
android.bluetooth.BluetoothManager |
getNativeManager() |
android.bluetooth.BluetoothDevice |
getRemoteDevice(java.lang.String macAddress) |
int |
getState() |
boolean |
isBluetooth5HighSpeedSupported() |
boolean |
isBluetooth5LongRangeSupported() |
boolean |
isBluetoothEnabled() |
boolean |
isLocationEnabledForScanning_byOsServices() |
boolean |
isLocationEnabledForScanning_byRuntimePermissions() |
boolean |
isLocationEnabledForScanning() |
boolean |
isManagerNull() |
boolean |
isMultipleAdvertisementSupported() |
P_ServerHolder |
openGattServer(android.content.Context context,
IServerListener listeners) |
void |
resetManager(android.content.Context context) |
void |
setIBleManager(IBleManager mgr)
This gets called when the
IBleManager calls it's initConfigDependentMembers method. |
boolean |
setName(java.lang.String name) |
void |
startAdvertising(android.bluetooth.le.AdvertiseSettings settings,
android.bluetooth.le.AdvertiseData adData,
L_Util.AdvertisingCallback callback) |
boolean |
startDiscovery() |
boolean |
startLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback callback) |
void |
startLScan(int scanMode,
Interval delay,
L_Util.ScanCallback callback) |
void |
startMScan(int scanMode,
Interval delay,
L_Util.ScanCallback callback) |
boolean |
startPendingIntentScan(int scanMode,
Interval delay,
android.app.PendingIntent pendingIntent) |
void |
stopAdvertising() |
void |
stopLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback callback) |
void |
stopPendingIntentScan(android.app.PendingIntent pendingIntent) |
public final void setIBleManager(IBleManager mgr)
IBluetoothManager
IBleManager
calls it's initConfigDependentMembers method. This is called
upon first instantiation of the manager class, and whenever BleManager.setConfig(BleManagerConfig)
is
called.setIBleManager
in interface IBluetoothManager
public final int getConnectionState(IBluetoothDevice device, int profile)
getConnectionState
in interface IBluetoothManager
public final boolean startDiscovery()
startDiscovery
in interface IBluetoothManager
public final boolean isManagerNull()
isManagerNull
in interface IBluetoothManager
public final void resetManager(android.content.Context context)
resetManager
in interface IBluetoothManager
public final boolean disable()
disable
in interface IBluetoothManager
public final boolean enable()
enable
in interface IBluetoothManager
public final boolean isMultipleAdvertisementSupported()
isMultipleAdvertisementSupported
in interface IBluetoothManager
public final boolean isBluetooth5LongRangeSupported()
isBluetooth5LongRangeSupported
in interface IBluetoothManager
public final boolean isBluetooth5HighSpeedSupported()
isBluetooth5HighSpeedSupported
in interface IBluetoothManager
public final int getState()
getState
in interface IBluetoothManager
public final int getBleState()
getBleState
in interface IBluetoothManager
public final java.lang.String getAddress()
getAddress
in interface IBluetoothManager
public java.lang.String getName()
getName
in interface IBluetoothManager
public boolean setName(java.lang.String name)
setName
in interface IBluetoothManager
public final P_ServerHolder openGattServer(android.content.Context context, IServerListener listeners)
openGattServer
in interface IBluetoothManager
public final void startAdvertising(android.bluetooth.le.AdvertiseSettings settings, android.bluetooth.le.AdvertiseData adData, L_Util.AdvertisingCallback callback)
startAdvertising
in interface IBluetoothManager
public final void stopAdvertising()
stopAdvertising
in interface IBluetoothManager
public final java.util.Set<P_DeviceHolder> getBondedDevices()
getBondedDevices
in interface IBluetoothManager
public final boolean cancelDiscovery()
cancelDiscovery
in interface IBluetoothManager
public final android.bluetooth.BluetoothDevice getRemoteDevice(java.lang.String macAddress)
getRemoteDevice
in interface IBluetoothManager
public final android.bluetooth.BluetoothAdapter getNativeAdaptor()
getNativeAdaptor
in interface IBluetoothManager
public final android.bluetooth.BluetoothManager getNativeManager()
getNativeManager
in interface IBluetoothManager
public final boolean isLocationEnabledForScanning_byOsServices()
isLocationEnabledForScanning_byOsServices
in interface IBluetoothManager
public final boolean isLocationEnabledForScanning_byRuntimePermissions()
isLocationEnabledForScanning_byRuntimePermissions
in interface IBluetoothManager
public final boolean isLocationEnabledForScanning()
isLocationEnabledForScanning
in interface IBluetoothManager
public final boolean isBluetoothEnabled()
isBluetoothEnabled
in interface IBluetoothManager
public final void startLScan(int scanMode, Interval delay, L_Util.ScanCallback callback)
startLScan
in interface IBluetoothManager
public final void startMScan(int scanMode, Interval delay, L_Util.ScanCallback callback)
startMScan
in interface IBluetoothManager
public final boolean startLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback callback)
startLeScan
in interface IBluetoothManager
public boolean startPendingIntentScan(int scanMode, Interval delay, android.app.PendingIntent pendingIntent)
startPendingIntentScan
in interface IBluetoothManager
public final void stopLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback callback)
stopLeScan
in interface IBluetoothManager
public void stopPendingIntentScan(android.app.PendingIntent pendingIntent)
stopPendingIntentScan
in interface IBluetoothManager