Imported Upstream version 1.1.0
[platform/upstream/iotivity.git] / android / android_api / base / src / main / java / org / iotivity / ca / CaLeServerInterface.java
index 18ac49f..0a4bb5c 100644 (file)
@@ -52,27 +52,17 @@ 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);
 
     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);
 
     private native static void caLeGattServerNotificationSentCallback(BluetoothDevice device,
                                                                      int status);
@@ -92,6 +82,7 @@ public class CaLeServerInterface {
             super.onConnectionStateChange(device, status, newState);
 
             caLeGattServerConnectionStateChangeCallback(device, status, newState);
+            caLeGattServerNWConnectionStateChangeCallback(device, status, newState);
         }
 
         @Override
@@ -107,9 +98,7 @@ public class CaLeServerInterface {
                 BluetoothGattCharacteristic characteristic) {
             super.onCharacteristicReadRequest(device, requestId, offset, characteristic);
 
-            caLeGattServerCharacteristicReadRequestCallback(device, requestId, offset,
-                                                            characteristic,
-                                                            characteristic.getValue());
+            caLeGattServerCharacteristicReadRequestCallback(device, characteristic.getValue());
         }
 
         @Override
@@ -119,9 +108,7 @@ public class CaLeServerInterface {
             super.onCharacteristicWriteRequest(device, requestId, characteristic,
                     preparedWrite, responseNeeded, offset, value);
 
-            caLeGattServerCharacteristicWriteRequestCallback(device, requestId, characteristic,
-                                                             value, preparedWrite, responseNeeded,
-                                                             offset, value);
+            caLeGattServerCharacteristicWriteRequestCallback(device, value);
         }
 
         @Override
@@ -129,8 +116,6 @@ public class CaLeServerInterface {
                 BluetoothDevice device,
                 int requestId, int offset, BluetoothGattDescriptor descriptor) {
             super.onDescriptorReadRequest(device, requestId, offset, descriptor);
-
-            caLeGattServerDescriptorReadRequestCallback(device, requestId, offset, descriptor);
         }
 
         @Override
@@ -140,17 +125,11 @@ public class CaLeServerInterface {
                 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