replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / android / android_api / base / src / main / java / org / iotivity / ca / CaLeServerInterface.java
index 0a4bb5c..fa71719 100644 (file)
@@ -62,11 +62,13 @@ public class CaLeServerInterface {
             BluetoothDevice device, byte[] data);
 
     private native static void caLeGattServerCharacteristicWriteRequestCallback(
-            BluetoothDevice device, byte[] data);
+            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);
@@ -108,7 +110,8 @@ public class CaLeServerInterface {
             super.onCharacteristicWriteRequest(device, requestId, characteristic,
                     preparedWrite, responseNeeded, offset, value);
 
-            caLeGattServerCharacteristicWriteRequestCallback(device, value);
+            caLeGattServerCharacteristicWriteRequestCallback(device, value, requestId,
+                                                             offset, value);
         }
 
         @Override
@@ -138,6 +141,13 @@ public class CaLeServerInterface {
 
             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() {