X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fconnectivity%2Fsrc%2Fbt_le_adapter%2Fandroid%2Fcaleutils.h;h=fef040f5c1bf5549d5d6ee9db86e120da4a6ce92;hb=7f00f942c39b7bc27c7eeecf213a239c3fe4173c;hp=371e748eebeb30b455e28cb967dfc639a4cc30f0;hpb=6c39110cd89220de04c7adfc7aaede1aceb2ca0f;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/connectivity/src/bt_le_adapter/android/caleutils.h b/resource/csdk/connectivity/src/bt_le_adapter/android/caleutils.h index 371e748..fef040f 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/android/caleutils.h +++ b/resource/csdk/connectivity/src/bt_le_adapter/android/caleutils.h @@ -36,6 +36,11 @@ extern "C" { #endif +#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_CHARACTERISTIC_REQUEST_UUID[] = CA_GATT_REQUEST_CHRC_UUID; @@ -47,18 +52,33 @@ 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;"; static const char METHODID_BT_REMOTE_DEVICE[] = "(Ljava/lang/String;)Landroid/bluetooth/BluetoothDevice;"; +static const jint GATT_PROFILE = 7; static const jint GATT_SUCCESS = 0; static const jint BOND_BONDED = 12; static const jint BOND_BONDING = 11; static const jint BOND_NONE = 10; +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. @@ -76,6 +96,14 @@ 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 address from a local device. * @param[in] env JNI interface pointer. * @return local address. @@ -142,6 +170,23 @@ jstring CALEGetAddressFromBTDevice(JNIEnv *env, jobject bluetoothDevice); * @return remote address. */ jint CALEGetConstantsValue(JNIEnv *env, const char* classType, const char* name); + +/** + * get bluetooth device object from bluetooth adapter. + * @param[in] env JNI interface pointer. + * @param[in] address bluetooth address. + * @return bluetooth device object. + */ +jobject CALEGetRemoteDevice(JNIEnv *env, jstring address); + +/** + * get address from gatt profile object. + * @param[in] env JNI interface pointer. + * @param[in] gatt gatt profile object. + * @return LE address. + */ +jstring CALEGetAddressFromGatt(JNIEnv *env, jobject gatt); + #ifdef __cplusplus } /* extern "C" */ #endif