replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / android / android_api / base / src / main / java / org / iotivity / ca / CaLeServerInterface.java
index 281beac..fa71719 100644 (file)
@@ -52,6 +52,9 @@ public class CaLeServerInterface {
     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);
 
@@ -59,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);
@@ -79,6 +84,7 @@ public class CaLeServerInterface {
             super.onConnectionStateChange(device, status, newState);
 
             caLeGattServerConnectionStateChangeCallback(device, status, newState);
+            caLeGattServerNWConnectionStateChangeCallback(device, status, newState);
         }
 
         @Override
@@ -104,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
@@ -134,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() {