public abstract class BluetoothPeripheralCallback
extends java.lang.Object
Constructor and Description |
---|
BluetoothPeripheralCallback() |
Modifier and Type | Method and Description |
---|---|
void |
onBondingFailed(@NotNull BluetoothPeripheral peripheral)
Callback invoked when the bonding process has failed
|
void |
onBondingStarted(@NotNull BluetoothPeripheral peripheral)
Callback invoked when the bonding process is started
|
void |
onBondingSucceeded(@NotNull BluetoothPeripheral peripheral)
Callback invoked when the bonding process has succeeded
|
void |
onBondLost(@NotNull BluetoothPeripheral peripheral)
Callback invoked when a bond has been lost and the peripheral is not bonded anymore.
|
void |
onCharacteristicUpdate(@NotNull BluetoothPeripheral peripheral,
@NotNull byte[] value,
@NotNull android.bluetooth.BluetoothGattCharacteristic characteristic,
@NotNull GattStatus status)
Callback invoked as the result of a characteristic read operation or notification/indication
|
void |
onCharacteristicWrite(@NotNull BluetoothPeripheral peripheral,
@NotNull byte[] value,
@NotNull android.bluetooth.BluetoothGattCharacteristic characteristic,
@NotNull GattStatus status)
Callback invoked as the result of a characteristic write operation.
|
void |
onConnectionUpdated(@NotNull BluetoothPeripheral peripheral,
int interval,
int latency,
int timeout,
@NotNull GattStatus status)
Callback invoked when the connection parameters are updated.
|
void |
onDescriptorRead(@NotNull BluetoothPeripheral peripheral,
@NotNull byte[] value,
@NotNull android.bluetooth.BluetoothGattDescriptor descriptor,
@NotNull GattStatus status)
Callback invoked as the result of a descriptor read operation
|
void |
onDescriptorWrite(@NotNull BluetoothPeripheral peripheral,
@NotNull byte[] value,
@NotNull android.bluetooth.BluetoothGattDescriptor descriptor,
@NotNull GattStatus status)
Callback invoked as the result of a descriptor write operation.
|
void |
onMtuChanged(@NotNull BluetoothPeripheral peripheral,
int mtu,
@NotNull GattStatus status)
Callback invoked as the result of a MTU request operation
|
void |
onNotificationStateUpdate(@NotNull BluetoothPeripheral peripheral,
@NotNull android.bluetooth.BluetoothGattCharacteristic characteristic,
@NotNull GattStatus status)
Callback invoked when the notification state of a characteristic has changed.
|
void |
onPhyUpdate(@NotNull BluetoothPeripheral peripheral,
@NotNull PhyType txPhy,
@NotNull PhyType rxPhy,
@NotNull GattStatus status)
Callback invoke as result of readPhy or setPhy operation
|
void |
onReadRemoteRssi(@NotNull BluetoothPeripheral peripheral,
int rssi,
@NotNull GattStatus status)
Callback invoked as the result of a read RSSI operation
|
void |
onServicesDiscovered(@NotNull BluetoothPeripheral peripheral)
Callback invoked when the list of remote services, characteristics and descriptors
for the remote peripheral has been discovered.
|
public void onServicesDiscovered(@NotNull @NotNull BluetoothPeripheral peripheral)
public void onNotificationStateUpdate(@NotNull @NotNull BluetoothPeripheral peripheral, @NotNull @NotNull android.bluetooth.BluetoothGattCharacteristic characteristic, @NotNull @NotNull GattStatus status)
Use BluetoothPeripheral.isNotifying(android.bluetooth.BluetoothGattCharacteristic)
to get the current notification state of the characteristic
peripheral
- the peripheralcharacteristic
- the characteristic for which the notification state changedstatus
- GATT status codepublic void onCharacteristicUpdate(@NotNull @NotNull BluetoothPeripheral peripheral, @NotNull @NotNull byte[] value, @NotNull @NotNull android.bluetooth.BluetoothGattCharacteristic characteristic, @NotNull @NotNull GattStatus status)
peripheral
- the peripheralvalue
- the new value receivedcharacteristic
- the characteristic for which the new value was receivedstatus
- GATT status codepublic void onCharacteristicWrite(@NotNull @NotNull BluetoothPeripheral peripheral, @NotNull @NotNull byte[] value, @NotNull @NotNull android.bluetooth.BluetoothGattCharacteristic characteristic, @NotNull @NotNull GattStatus status)
peripheral
- the peripheralvalue
- the value that was writtencharacteristic
- the characteristic written tostatus
- GATT status codepublic void onDescriptorRead(@NotNull @NotNull BluetoothPeripheral peripheral, @NotNull @NotNull byte[] value, @NotNull @NotNull android.bluetooth.BluetoothGattDescriptor descriptor, @NotNull @NotNull GattStatus status)
peripheral
- the peripheralvalue
- the read valuedescriptor
- the descriptor that was readstatus
- GATT status codepublic void onDescriptorWrite(@NotNull @NotNull BluetoothPeripheral peripheral, @NotNull @NotNull byte[] value, @NotNull @NotNull android.bluetooth.BluetoothGattDescriptor descriptor, @NotNull @NotNull GattStatus status)
onNotificationStateUpdate(BluetoothPeripheral, BluetoothGattCharacteristic, GattStatus)
will be calledperipheral
- the peripheralvalue
- the value that was writtendescriptor
- the descriptor written tostatus
- the GATT status codepublic void onBondingStarted(@NotNull @NotNull BluetoothPeripheral peripheral)
peripheral
- the peripheralpublic void onBondingSucceeded(@NotNull @NotNull BluetoothPeripheral peripheral)
peripheral
- the peripheralpublic void onBondingFailed(@NotNull @NotNull BluetoothPeripheral peripheral)
peripheral
- the peripheralpublic void onBondLost(@NotNull @NotNull BluetoothPeripheral peripheral)
peripheral
- the peripheralpublic void onReadRemoteRssi(@NotNull @NotNull BluetoothPeripheral peripheral, int rssi, @NotNull @NotNull GattStatus status)
peripheral
- the peripheralrssi
- the RSSI valuestatus
- GATT status codepublic void onMtuChanged(@NotNull @NotNull BluetoothPeripheral peripheral, int mtu, @NotNull @NotNull GattStatus status)
peripheral
- the peripheralmtu
- the new MTUstatus
- GATT status codepublic void onPhyUpdate(@NotNull @NotNull BluetoothPeripheral peripheral, @NotNull @NotNull PhyType txPhy, @NotNull @NotNull PhyType rxPhy, @NotNull @NotNull GattStatus status)
peripheral
- the peripheraltxPhy
- the transmitter PHY in use.rxPhy
- the receiver PHY in usestatus
- GATT status codepublic void onConnectionUpdated(@NotNull @NotNull BluetoothPeripheral peripheral, int interval, int latency, int timeout, @NotNull @NotNull GattStatus status)
peripheral
- the peripheralinterval
- Connection interval used on this connection, 1.25ms unit.
Valid range is from 6 (7.5ms) to 3200 (4000ms).latency
- Slave latency for the connection in number of connection events.
Valid range is from 0 to 499.timeout
- Supervision timeout for this connection, in 10ms unit.
Valid range is from 10 (0.1s) to 3200 (32s).status
- GATT status code