+
+bool CALEServerIsConnected(const char* address)
+{
+ //@Todo
+ return true;
+}
+
+uint16_t CALEServerGetMtuSize(const char* address)
+{
+ OIC_LOG(DEBUG, TAG, "IN");
+ VERIFY_NON_NULL_RET(address, TAG, "address is null",
+ CA_SUPPORTED_BLE_MTU_SIZE - CA_BLE_MTU_HEADER_SIZE);
+
+ unsigned int mtu = CA_DEFAULT_BLE_MTU_SIZE;
+ int ret = 0;
+
+ 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;
+ }
+
+ OIC_LOG_V(INFO, TAG, "mtu size(including header) from bt_device_get_att_mtu is %d", mtu);
+ return mtu - CA_BLE_MTU_HEADER_SIZE;
+}