Package network.datahop.blediscovery
Class GattServerCallback
- java.lang.Object
-
- android.bluetooth.BluetoothGattServerCallback
-
- network.datahop.blediscovery.GattServerCallback
-
public class GattServerCallback extends android.bluetooth.BluetoothGattServerCallback
GattServerCallback extends BluetoothGattServerCallback and overwrites all functions required to accept GATT connections and read/write characteristics.
-
-
Constructor Summary
Constructors Constructor Description GattServerCallback(android.content.Context context, java.lang.String parcelUuid, java.util.HashMap<java.util.UUID,byte[]> advertisingInfo, DiscoveryListener listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
notifyCharacteristic(byte[] value, java.util.UUID uuid)
void
onCharacteristicReadRequest(android.bluetooth.BluetoothDevice device, int requestId, int offset, android.bluetooth.BluetoothGattCharacteristic characteristic)
void
onCharacteristicWriteRequest(android.bluetooth.BluetoothDevice device, int requestId, android.bluetooth.BluetoothGattCharacteristic characteristic, boolean preparedWrite, boolean responseNeeded, int offset, byte[] value)
void
onConnectionStateChange(android.bluetooth.BluetoothDevice device, int status, int newState)
void
onDescriptorReadRequest(android.bluetooth.BluetoothDevice device, int requestId, int offset, android.bluetooth.BluetoothGattDescriptor descriptor)
void
onDescriptorWriteRequest(android.bluetooth.BluetoothDevice device, int requestId, android.bluetooth.BluetoothGattDescriptor descriptor, boolean preparedWrite, boolean responseNeeded, int offset, byte[] value)
void
onNotificationSent(android.bluetooth.BluetoothDevice device, int status)
void
setServer(android.bluetooth.BluetoothGattServer gattServer)
void
stop()
-
-
-
Constructor Detail
-
GattServerCallback
public GattServerCallback(android.content.Context context, java.lang.String parcelUuid, java.util.HashMap<java.util.UUID,byte[]> advertisingInfo, DiscoveryListener listener)
-
-
Method Detail
-
stop
public void stop()
-
setServer
public void setServer(android.bluetooth.BluetoothGattServer gattServer)
-
onConnectionStateChange
public void onConnectionStateChange(android.bluetooth.BluetoothDevice device, int status, int newState)
- Overrides:
onConnectionStateChange
in classandroid.bluetooth.BluetoothGattServerCallback
-
onCharacteristicReadRequest
public void onCharacteristicReadRequest(android.bluetooth.BluetoothDevice device, int requestId, int offset, android.bluetooth.BluetoothGattCharacteristic characteristic)
- Overrides:
onCharacteristicReadRequest
in classandroid.bluetooth.BluetoothGattServerCallback
-
onCharacteristicWriteRequest
public void onCharacteristicWriteRequest(android.bluetooth.BluetoothDevice device, int requestId, android.bluetooth.BluetoothGattCharacteristic characteristic, boolean preparedWrite, boolean responseNeeded, int offset, byte[] value)
- Overrides:
onCharacteristicWriteRequest
in classandroid.bluetooth.BluetoothGattServerCallback
-
onDescriptorReadRequest
public void onDescriptorReadRequest(android.bluetooth.BluetoothDevice device, int requestId, int offset, android.bluetooth.BluetoothGattDescriptor descriptor)
- Overrides:
onDescriptorReadRequest
in classandroid.bluetooth.BluetoothGattServerCallback
-
onDescriptorWriteRequest
public void onDescriptorWriteRequest(android.bluetooth.BluetoothDevice device, int requestId, android.bluetooth.BluetoothGattDescriptor descriptor, boolean preparedWrite, boolean responseNeeded, int offset, byte[] value)
- Overrides:
onDescriptorWriteRequest
in classandroid.bluetooth.BluetoothGattServerCallback
-
onNotificationSent
public void onNotificationSent(android.bluetooth.BluetoothDevice device, int status)
- Overrides:
onNotificationSent
in classandroid.bluetooth.BluetoothGattServerCallback
-
notifyCharacteristic
public void notifyCharacteristic(byte[] value, java.util.UUID uuid)
-
-