public abstract class BlePeripheralCallback extends Object
This class can be inherited to implement callback operations on peripheral devices.
| 构造器 | 说明 |
|---|---|
BlePeripheralCallback() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
characteristicChangedEvent(GattCharacteristic characteristic) |
A callback used to send notifications of characteristic changes.
|
void |
characteristicReadEvent(GattCharacteristic characteristic,
int ret) |
A callback used to obtain the result of reading a characteristic.
|
void |
characteristicWriteEvent(GattCharacteristic characteristic,
int ret) |
A callback used to obtain the result of writing a characteristic.
|
void |
connectionStateChangeEvent(int connectionState) |
A callback used to send notifications of connection status changes.
|
void |
descriptorReadEvent(GattDescriptor descriptor,
int ret) |
A callback used to obtain the result of reading a descriptor.
|
void |
descriptorWriteEvent(GattDescriptor descriptor,
int ret) |
A callback used to obtain the result of writing a descriptor.
|
void |
mtuUpdateEvent(int mtu,
int ret) |
A callback used to obtain the result of reading a BLE MTU size.
|
void |
readRemoteRssiEvent(int rssi,
int ret) |
A callback used to obtain the result of reading a rssi.
|
void |
servicesDiscoveredEvent(int status) |
A callback used to send notifications of service discovery on a peripheral device.
|
public void servicesDiscoveredEvent(int status)
This method is the callback of BlePeripheralDevice#discoverServices().
status - Indicates the operation status. BlePeripheralDevice#OPERATION_SUCC indicates
that the operation succeeds.public void connectionStateChangeEvent(int connectionState)
This method is the callback of BlePeripheralDevice#connect(boolean, BlePeripheralCallback).
connectionState - Indicates the connection status after the change,
which can be ProfileBase.STATE_DISCONNECTED or
ProfileBase.STATE_CONNECTED.public void characteristicReadEvent(GattCharacteristic characteristic, int ret)
This method is the callback of BlePeripheralDevice#readCharacteristic(GattCharacteristic).
characteristic - Indicates the characteristic to read.ret - Indicates the operation status. BlePeripheralDevice#OPERATION_SUCC indicates
that the operation succeeds.public void characteristicWriteEvent(GattCharacteristic characteristic, int ret)
This method is the callback of BlePeripheralDevice#writeCharacteristic(GattCharacteristic).
characteristic - Indicates the characteristic to write.ret - Indicates the operation status. BlePeripheralDevice#OPERATION_SUCC indicates
that the operation succeeds.public void characteristicChangedEvent(GattCharacteristic characteristic)
This method is the callback of
BlePeripheralDevice#setNotifyCharacteristic(GattCharacteristic, boolean).
characteristic - Indicates the characteristic after the change.public void descriptorReadEvent(GattDescriptor descriptor, int ret)
This method is the callback of BlePeripheralDevice#readDescriptor(GattDescriptor).
descriptor - Indicates the descriptor to read.ret - Indicates the operation status. BlePeripheralDevice#OPERATION_SUCC indicates
that the operation succeeds.public void descriptorWriteEvent(GattDescriptor descriptor, int ret)
This method is the callback of BlePeripheralDevice#writeDescriptor(GattDescriptor).
descriptor - Indicates the descriptor to write.ret - Indicates the operation status. BlePeripheralDevice#OPERATION_SUCC indicates
that the operation succeeds.public void readRemoteRssiEvent(int rssi,
int ret)
This method is the callback of BlePeripheralDevice#readRemoteRssiValue().
rssi - Indicates the rssi to read.ret - Indicates the operation status. BlePeripheralDevice#OPERATION_SUCC indicates
that the operation succeeds.public void mtuUpdateEvent(int mtu,
int ret)
This method is the callback of BlePeripheralDevice#requestBleMtuSize(int).
mtu - Indicates the MTU to read.ret - Indicates the operation status. BlePeripheralDevice#OPERATION_SUCC indicates
that the operation succeeds.