public abstract class BlePeripheralManagerCallback extends Object
| 构造器 | 说明 |
|---|---|
BlePeripheralManagerCallback() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
connectionStateChangeEvent(BlePeripheralDevice device,
int interval,
int latency,
int timeout,
int status) |
A callback indicating that connection parameters have been updated.
|
void |
executeWriteEvent(BlePeripheralDevice device,
int transId,
boolean execute) |
A callback indicating execution of all pending write operations for this device.
|
void |
mtuUpdateEvent(BlePeripheralDevice device,
int mtu) |
A callback indicating that the remote GATT client has requested to change the MTU for a given connection.
|
void |
notificationSentEvent(BlePeripheralDevice device,
int status) |
A callback indicating that a notification has been sent to a remote device.
|
void |
receiveCharacteristicReadEvent(BlePeripheralDevice device,
int transId,
int offset,
GattCharacteristic characteristic) |
A callback that remote GATT client has requested to read a characteristic.
|
void |
receiveCharacteristicWriteEvent(BlePeripheralDevice device,
int transId,
GattCharacteristic characteristic,
boolean isPrep,
boolean needRsp,
int offset,
byte[] value) |
A callback indicating that the remote GATT client has requested to write a characteristic.
|
void |
receiveDescriptorReadEvent(BlePeripheralDevice device,
int transId,
int offset,
GattDescriptor descriptor) |
A callback indicating that the GATT client has requested to read a descriptor.
|
void |
receiveDescriptorWriteRequestEvent(BlePeripheralDevice device,
int transId,
GattDescriptor descriptor,
boolean isPrep,
boolean needRsp,
int offset,
byte[] value) |
A callback indicating that the GATT client has requested to write a descriptor.
|
void |
serviceAddedEvent(int status,
GattService service) |
A callback indicating whether a local service has been added successfully.
|
public void receiveCharacteristicReadEvent(BlePeripheralDevice device, int transId, int offset, GattCharacteristic characteristic)
device - Indicates the BLE peripheral device has requested the read operation.transId - Indicates the ID of the read.offset - Indicates the offset for a partial read.characteristic - Indicates the characteristic to be read.public void receiveCharacteristicWriteEvent(BlePeripheralDevice device, int transId, GattCharacteristic characteristic, boolean isPrep, boolean needRsp, int offset, byte[] value)
device - Indicates the BLE peripheral device has requested the write operation.transId - Indicates the ID of the write.characteristic - Indicates the characteristic to be write.isPrep - Indicates whether this write operation should be queued for later execution.needRsp - Indicates whether the remote device requires a response.offset - Indicates the offset for a partial write.value - Indicates the client that writed the characteristic.public void connectionStateChangeEvent(BlePeripheralDevice device, int interval, int latency, int timeout, int status)
device - Indicates the BLE peripheral device.interval - Indicates the ID of the write.latency - Indicates the characteristic to be write.timeout - Indicates whether this write operation should be queued for later execution.status - Indicates whether the remote device requires a response.public void receiveDescriptorReadEvent(BlePeripheralDevice device, int transId, int offset, GattDescriptor descriptor)
device - Indicates the BLE peripheral device has requested the read operation.transId - Indicates the ID of the read.offset - Indicates the offset for a partial read.descriptor - Indicates the descriptor to be read.public void receiveDescriptorWriteRequestEvent(BlePeripheralDevice device, int transId, GattDescriptor descriptor, boolean isPrep, boolean needRsp, int offset, byte[] value)
device - Indicates the BLE peripheral device has requested the write operation.transId - Indicates the ID of the write.descriptor - Indicates the descriptor to be write.isPrep - Indicates whether this write operation should be queued for later execution.needRsp - Indicates whether the remote device requires a response.offset - Indicates the offset for a partial write.value - Indicates the GATT client that writed the characteristic.public void executeWriteEvent(BlePeripheralDevice device, int transId, boolean execute)
device - Indicates the BLE peripheral device that will execute all pending write operations.transId - Indicates the ID of the request.execute - Indicates whether the pending write operations will be executed.
Value true means the operations will be executed;
value false means that the operations are cancelled.public void mtuUpdateEvent(BlePeripheralDevice device, int mtu)
device - Indicates the BLE peripheral device that has requested the MTU change.mtu - Indicates the new MTU size.public void notificationSentEvent(BlePeripheralDevice device, int status)
device - Indicates the BLE peripheral device to which the notification is sent.status - Indicates the status of the BLE peripheral device.public void serviceAddedEvent(int status,
GattService service)
status - Indicates whether the service has been added.service - Indicates the service that has been added.