modified timing issue associated with data transmission.
[platform/upstream/iotivity.git] / resource / csdk / connectivity / src / bt_le_adapter / android / caleclient.h
index da572c9..10066e1 100644 (file)
@@ -45,15 +45,13 @@ static const uint16_t STATE_SEND_NONE = 0;
 static const uint16_t STATE_SEND_SUCCESS = 1;
 static const uint16_t STATE_SEND_FAILED = 2;
 
-static const jint STATE_CONNECTED = 2;
-static const jint STATE_DISCONNECTED = 0;
-
 typedef struct le_state_info
 {
     char address[CA_MACADDR_SIZE];
     jint connectedState;
     uint16_t notificationState;
     uint16_t sendState;
+    jboolean autoConnectFlag;
 } CALEState_t;
 
 /**
@@ -155,9 +153,11 @@ void CALEClientSetCallback(CAPacketReceiveCallback callback);
 /**
  * waiting to get scanned device from BT Platform.
  * if there is no scanned device in the list.
+ * @param[in]   env                   JNI interface pointer.
+ * @param[in]   address               LE address.
  * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
  */
-CAResult_t CALEClientIsThereScannedDevices();
+CAResult_t CALEClientIsThereScannedDevices(JNIEnv *env, const char* address);
 
 /**
  * send data for unicast (implement).
@@ -272,6 +272,22 @@ void CALEClientSetScanFlag(bool flag);
 CAResult_t CALEClientStopScanImpl(JNIEnv *env, jobject callback);
 
 /**
+ * set auto connect flag for connectGatt API.
+ * @param[in]   env                   JNI interface pointer.
+ * @param[in]   jni_address           remote address.
+ * @param[in]   flag                  auto connect flag.
+ */
+CAResult_t CALEClientSetAutoConnectFlag(JNIEnv *env, jstring jni_address, jboolean flag);
+
+/**
+ * get auto connect flag.
+ * @param[in]   env                   JNI interface pointer.
+ * @param[in]   jni_address           remote address.
+ * @return  current auto connect flag;
+ */
+jboolean CALEClientGetAutoConnectFlag(JNIEnv *env, jstring jni_address);
+
+/**
  * connect to gatt server hosted.
  * @param[in]   env                   JNI interface pointer.
  * @param[in]   bluetoothDevice       bluetooth Device object.
@@ -518,6 +534,13 @@ bool CALEClientIsDeviceInList(const char *remoteAddress);
 CAResult_t CALEClientRemoveAllDeviceState();
 
 /**
+ * Reset values of device state for all of devices.
+ * this method has to be invoked when BT adapter is disabled.
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
+ */
+CAResult_t CALEClientResetDeviceStateForAll();
+
+/**
  * remove the device state for a remote device.
  * @param[in]   remoteAddress         remote address.
  * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).