Implementation of Filtered Scan for BLE android client
[platform/upstream/iotivity.git] / resource / csdk / connectivity / src / bt_le_adapter / android / caleutils.h
index 478b264..1a5013a 100644 (file)
@@ -39,9 +39,13 @@ extern "C"
 #define CA_LE_AUTO_CONNECT_FLAG    1
 #define CA_LE_CONNECTION_STATE     2
 #define CA_LE_SEND_STATE           3
+#define CA_LE_DESCRIPTOR_FOUND     4
 
 /* Service UUID */
 static const char OIC_GATT_SERVICE_UUID[] = CA_GATT_SERVICE_UUID;
+static const char OIC_GATT_CUSTOM_UUID[] = CA_GATT_CUSTOM_UUID;
+static const char OIC_GATT_CUSTOM_UUID2[] = CA_GATT_CUSTOM_UUID2;
+static const char OIC_GATT_CUSTOM_UUID3[] = CA_GATT_CUSTOM_UUID3;
 static const char OIC_GATT_CHARACTERISTIC_REQUEST_UUID[] = CA_GATT_REQUEST_CHRC_UUID;
 static const char OIC_GATT_CHARACTERISTIC_RESPONSE_UUID[] = CA_GATT_RESPONSE_CHRC_UUID;
 static const char OIC_GATT_CHARACTERISTIC_CONFIG_UUID[] = "00002902-0000-1000-8000-00805f9b34fb";
@@ -51,7 +55,8 @@ static const char CLASSPATH_BT_GATT[] = "android/bluetooth/BluetoothGatt";
 static const char CLASSPATH_BT_ADAPTER[] = "android/bluetooth/BluetoothAdapter";
 static const char CLASSPATH_BT_DEVICE[] = "android/bluetooth/BluetoothDevice";
 static const char CLASSPATH_BT_UUID[] = "java/util/UUID";
-
+static const char CLASSPATH_LE_SCANNER[] = "android/bluetooth/le/BluetoothLeScanner";
+static const char CLASSPATH_LE_SCANSETTINGS[] = "android/bluetooth/le/ScanSettings";
 
 static const char METHODID_OBJECTNONPARAM[] = "()Landroid/bluetooth/BluetoothAdapter;";
 static const char METHODID_BT_DEVICE[] = "()Landroid/bluetooth/BluetoothDevice;";
@@ -68,6 +73,15 @@ static const uint16_t STATE_CONNECTED = 3;
 static const uint16_t STATE_SERVICE_CONNECTED = 2;
 static const uint16_t STATE_DISCONNECTED = 1;
 
+static const uint16_t GATT_ERROR = 133;
+
+static const uint16_t STATE_SEND_NONE = 1;
+static const uint16_t STATE_SEND_SUCCESS = 2;
+static const uint16_t STATE_SEND_FAIL = 3;
+static const uint16_t STATE_SENDING = 4;
+static const uint16_t STATE_SEND_PREPARING = 5;
+static const uint16_t STATE_SEND_MTU_NEGO_SUCCESS = 6;
+
 /**
  * get uuid(jni object) from uuid(character).
  * @param[in]   env              JNI interface pointer.
@@ -85,6 +99,22 @@ jobject CALEGetUuidFromString(JNIEnv *env, const char* uuid);
 jobject CALEGetParcelUuid(JNIEnv *env, jobject uuid);
 
 /**
+ * get parcel uuid object from uuid string value.
+ * @param[in]   env              JNI interface pointer.
+ * @param[in]   uuid             uuid (const char*).
+ * @return  parcel uuid object.
+ */
+jobject CALEGetParcelUuidFromString(JNIEnv *env, const char* uuid);
+
+/**
+ * get manufactererData jbyteArray from uuid string value.
+ * @param[in]   env              JNI interface pointer.
+ * @param[in]   uuid             uuid (const char*).
+ * @return  manufactererData jbyteArray.
+ */
+jbyteArray CALEGetManufacturerData(JNIEnv *env, const char* uuid);
+
+/**
  * get address from a local device.
  * @param[in]   env              JNI interface pointer.
  * @return  local address.