private native static void caLeGattServerConnectionStateChangeCallback(
BluetoothDevice device, int status, int newState);
+ private native static void caLeGattServerNWConnectionStateChangeCallback(
+ BluetoothDevice device, int status, int newState);
+
private native static void caLeGattServerServiceAddedCallback(int status,
BluetoothGattService service);
private native static void caLeGattServerCharacteristicReadRequestCallback(
- BluetoothDevice device,
- int requestId, int offset, BluetoothGattCharacteristic characteristic, byte[] data);
+ BluetoothDevice device, byte[] data);
private native static void caLeGattServerCharacteristicWriteRequestCallback(
- BluetoothDevice device, int requestId,
- BluetoothGattCharacteristic characteristic, byte[] data, boolean preparedWrite,
- boolean responseNeeded, int offset, byte[] value);
-
- private native static void caLeGattServerDescriptorReadRequestCallback(
- BluetoothDevice device, int requestId, int offset, BluetoothGattDescriptor descriptor);
-
- public native static void caLeGattServerDescriptorWriteRequestCallback(
- BluetoothDevice device, int requestId, BluetoothGattDescriptor descriptor,
- boolean preparedWrite, boolean responseNeeded, int offset, byte[] value);
-
- private native static void caLeGattServerExecuteWriteCallback(BluetoothDevice device,
- int requestId, boolean execute);
+ BluetoothDevice device, byte[] data, int id, int offset, byte[] value);
private native static void caLeGattServerNotificationSentCallback(BluetoothDevice device,
int status);
+ private native static void caLeGattServerMtuChangedCallback(BluetoothDevice gatt, int mtu);
+
// AdvertiseCallback
private native static void caLeAdvertiseStartSuccessCallback(
AdvertiseSettings settingsInEffect);
super.onConnectionStateChange(device, status, newState);
caLeGattServerConnectionStateChangeCallback(device, status, newState);
+ caLeGattServerNWConnectionStateChangeCallback(device, status, newState);
}
@Override
BluetoothGattCharacteristic characteristic) {
super.onCharacteristicReadRequest(device, requestId, offset, characteristic);
- caLeGattServerCharacteristicReadRequestCallback(device, requestId, offset,
- characteristic,
- characteristic.getValue());
+ caLeGattServerCharacteristicReadRequestCallback(device, characteristic.getValue());
}
@Override
super.onCharacteristicWriteRequest(device, requestId, characteristic,
preparedWrite, responseNeeded, offset, value);
- caLeGattServerCharacteristicWriteRequestCallback(device, requestId, characteristic,
- value, preparedWrite, responseNeeded,
+ caLeGattServerCharacteristicWriteRequestCallback(device, value, requestId,
offset, value);
}
BluetoothDevice device,
int requestId, int offset, BluetoothGattDescriptor descriptor) {
super.onDescriptorReadRequest(device, requestId, offset, descriptor);
-
- caLeGattServerDescriptorReadRequestCallback(device, requestId, offset, descriptor);
}
@Override
byte[] value) {
super.onDescriptorWriteRequest(device, requestId, descriptor, preparedWrite,
responseNeeded, offset, value);
-
- caLeGattServerDescriptorWriteRequestCallback(device, requestId, descriptor,
- preparedWrite, responseNeeded, offset,
- value);
}
@Override
public void onExecuteWrite(BluetoothDevice device, int requestId, boolean execute) {
super.onExecuteWrite(device, requestId, execute);
-
- caLeGattServerExecuteWriteCallback(device, requestId, execute);
}
@Override
caLeGattServerNotificationSentCallback(device, status);
}
+
+ @Override
+ public void onMtuChanged(BluetoothDevice device, int mtu) {
+ super.onMtuChanged(device, mtu);
+
+ caLeGattServerMtuChangedCallback(device, mtu);
+ }
};
private static final AdvertiseCallback mAdvertiseCallback = new AdvertiseCallback() {