Use GATT server's get mtu size API instead of GATT client API
[platform/upstream/iotivity.git] / resource / csdk / connectivity / src / bt_le_adapter / tizen / caleserver_vd.c
index bcfe6d4..bcd5d0d 100644 (file)
@@ -1047,6 +1047,15 @@ uint16_t CALEServerGetMtuSize(const char* address)
     unsigned int mtu = CA_DEFAULT_BLE_MTU_SIZE;
     int ret = 0;
 
+#ifdef BLE_TIZEN_55
+    ret = bt_gatt_server_get_device_mtu(address, &mtu);
+    if (0 != ret)
+    {
+        OIC_LOG_V(ERROR, TAG,
+                  "bt_gatt_server_get_device_mtu failed with return [%s]", CALEGetErrorMsg(ret));
+        return CA_DEFAULT_BLE_MTU_SIZE;
+    }
+#else
 #ifdef BLE_TIZEN_40
     bt_gatt_client_h client = NULL;
     ret = bt_gatt_client_create(address, &client);
@@ -1081,6 +1090,7 @@ uint16_t CALEServerGetMtuSize(const char* address)
         return CA_DEFAULT_BLE_MTU_SIZE;
     }
 #endif // BLE_TIZEN_40
+#endif // BLE_TIZEN_55
 
     OIC_LOG_V(INFO, TAG, "mtu size(including header) from bt_device_get_att_mtu is %d", mtu);
     OIC_LOG(DEBUG, TAG, "OUT");