help_vars.Add(EnumVariable('BLE_CUSTOM_ADV', 'Build with CUSTOM Advertisement', 'False', allowed_values=('True', 'False')))
help_vars.Add(EnumVariable('BLE_DIVISION', 'BLE Build with division code', 'OFF', allowed_values=('OFF', 'MCD', 'VD')))
help_vars.Add(EnumVariable('BLE_TIZEN_30', 'Build with tizen 3.0 BLE api', 'False', allowed_values=('True', 'False')))
+help_vars.Add(EnumVariable('TIZEN_4', 'Build with tizen 4.0 api', 'False', allowed_values=('True', 'False')))
help_vars.Add(PathVariable('TIZENRT_OS_DIR', 'Absolute Path to TizenRT OS directory', None, PathVariable.PathAccept))
help_vars.Add(EnumVariable('PLATFORM_TLS', 'Use platform tls instead of local mbedtls', '0', allowed_values=('0', '1')))
help_vars.Add(EnumVariable('OIC_SUPPORT_TIZEN_TRACE', 'Tizen Trace(T-trace) api availability', 'False', allowed_values=('True', 'False')))
#include <string.h>
#include <bluetooth.h>
-#include <bluetooth_internal.h>
-
#include "caedrinterface.h"
#include "octhread.h"
#include "caedrendpoint.h"
#include <bluetooth.h>
#include <bluetooth_type.h>
-#include <bluetooth_type_internal.h>
-#include <bluetooth_internal.h>
-
#include "cacommon.h"
#include "caadapterutils.h"
#include "caleutil.h"
#include <netinet/in.h>
#include <bluetooth.h>
-#include <bluetooth_internal.h>
#include <bluetooth_type.h>
#include "octhread.h"
#include <netinet/in.h>
#include <bluetooth.h>
-#include <bluetooth_internal.h>
#include <bluetooth_type.h>
#include "octhread.h"
#include <bluetooth.h>
#include <bluetooth_type.h>
-#include <bluetooth_internal.h>
#ifdef BLE_MCD
#include <bluetooth_product.h>
#endif
#include "oic_string.h"
#include "oic_malloc.h"
#include "caleutil.h"
+#ifndef TIZEN_4
+#include <bluetooth_internal.h>
+#endif
/**
* Logging tag for module name
OIC_LOG(DEBUG, TAG, "IN");
VERIFY_NON_NULL_RET(address, TAG, "address is null", CA_DEFAULT_BLE_MTU_SIZE);
- unsigned int mtu;
- int ret = bt_device_get_att_mtu(address, &mtu);
+ unsigned int mtu = CA_DEFAULT_BLE_MTU_SIZE;
+ int ret = 0;
+
+#ifdef TIZEN_4
+ bt_gatt_client_h client = NULL;
+ ret = bt_gatt_client_create(address, &client);
+ if (0 != ret)
+ {
+ OIC_LOG_V(ERROR, TAG,
+ "bt_gatt_client_create failed with return [%s]", CALEGetErrorMsg(ret));
+ return CA_DEFAULT_BLE_MTU_SIZE;
+ }
+
+ ret = bt_gatt_client_get_att_mtu(client, &mtu);
+ if (0 != ret)
+ {
+ OIC_LOG_V(ERROR, TAG,
+ "bt_gatt_client_get_att_mtu failed with return [%s]", CALEGetErrorMsg(ret));
+ return CA_DEFAULT_BLE_MTU_SIZE;
+ }
+
+ ret = bt_gatt_client_destroy(client);
+ if (0 != ret)
+ {
+ OIC_LOG_V(ERROR, TAG,
+ "bt_gatt_client_destroy failed with return [%s]", CALEGetErrorMsg(ret));
+ return CA_DEFAULT_BLE_MTU_SIZE;
+ }
+#else
+ ret = bt_device_get_att_mtu(address, &mtu);
if (0 != ret)
{
OIC_LOG_V(ERROR, TAG,
"bt_device_get_att_mtu failed with return [%s]", CALEGetErrorMsg(ret));
return CA_DEFAULT_BLE_MTU_SIZE;
}
+#endif // TIZEN_4
+
OIC_LOG_V(INFO, TAG, "mtu size(including header) from bt_device_get_att_mtu is %d", mtu);
OIC_LOG(DEBUG, TAG, "OUT");
return mtu - CA_BLE_MTU_HEADER_SIZE;
#include "oic_malloc.h"
#include "caleutil.h"
#include "caadapterutils.h"
+#include <glib.h>
+#ifndef TIZEN_4
+#include <bluetooth_internal.h>
+#endif
/**
* Logging tag for module name
OIC_LOG(DEBUG, TAG, "IN");
VERIFY_NON_NULL_RET(address, TAG, "address is null", CA_DEFAULT_BLE_MTU_SIZE);
- unsigned int mtu;
- int ret = bt_device_get_att_mtu(address, &mtu);
+ unsigned int mtu = CA_DEFAULT_BLE_MTU_SIZE;
+ int ret = 0;
+
+#ifdef TIZEN_4
+ bt_gatt_client_h client = NULL;
+ ret = bt_gatt_client_create(address, &client);
+ if (0 != ret)
+ {
+ OIC_LOG_V(ERROR, TAG,
+ "bt_gatt_client_create failed with return [%s]", CALEGetErrorMsg(ret));
+ return CA_DEFAULT_BLE_MTU_SIZE;
+ }
+
+ ret = bt_gatt_client_get_att_mtu(client, &mtu);
+ if (0 != ret)
+ {
+ OIC_LOG_V(ERROR, TAG,
+ "bt_gatt_client_get_att_mtu failed with return [%s]", CALEGetErrorMsg(ret));
+ return CA_DEFAULT_BLE_MTU_SIZE;
+ }
+
+ ret = bt_gatt_client_destroy(client);
+ if (0 != ret)
+ {
+ OIC_LOG_V(ERROR, TAG,
+ "bt_gatt_client_destroy failed with return [%s]", CALEGetErrorMsg(ret));
+ return CA_DEFAULT_BLE_MTU_SIZE;
+ }
+#else
+ ret = bt_device_get_att_mtu(address, &mtu);
if (0 != ret)
{
OIC_LOG_V(ERROR, TAG,
"bt_device_get_att_mtu failed with return [%s]", CALEGetErrorMsg(ret));
return CA_DEFAULT_BLE_MTU_SIZE;
}
+#endif // TIZEN_4
+
OIC_LOG_V(INFO, TAG, "mtu size(including header) from bt_device_get_att_mtu is %d", mtu);
OIC_LOG(DEBUG, TAG, "OUT");
return mtu - CA_BLE_MTU_HEADER_SIZE;
#include <bluetooth.h>
#include <bluetooth_type.h>
-#include <bluetooth_internal.h>
-
#include "camanagerleinterface.h"
#include "cacommon.h"
#include "camessagehandler.h"