Add new L2CAP socket API to get the maximum buffer size 40/306740/1
authorWootak Jung <wootak.jung@samsung.com>
Tue, 27 Feb 2024 04:51:09 +0000 (13:51 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Tue, 27 Feb 2024 04:51:26 +0000 (13:51 +0900)
Change-Id: Id530fded18e3803f5a26064ca5233ed45da9f4e5
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
bt-api/bt-l2cap-le-client.c
include/bluetooth-api.h

index 65925db..639d0cb 100644 (file)
@@ -543,3 +543,13 @@ BT_EXPORT_API int bluetooth_l2cap_le_write(int fd, const char *buf, int length)
 
        return result;
 }
+
+BT_EXPORT_API int bluetooth_l2cap_le_get_max_buffer_size(int *size)
+{
+       BT_CHECK_ENABLED_LE(return);
+       BT_CHECK_PARAMETER(size, return);
+
+       *size = BT_L2CAP_LE_BUFFER_LEN;
+
+       return BLUETOOTH_ERROR_NONE;
+}
index 30a313c..1ecd95c 100644 (file)
@@ -8588,6 +8588,23 @@ int bluetooth_l2cap_le_server_is_connected(
  */
 int bluetooth_l2cap_le_get_psm(int id, int *psm);
 
+/**
+ * @fn gboolean bluetooth_l2cap_le_get_max_buffer_size(int *size)
+ * @brief gives the maximum size of buffer.
+ *
+ * This function is a synchronous call.
+ *
+ * @return  BLUETOOTH_ERROR_NONE  - Success \n
+ *              BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n
+ *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
+ *
+ * @param[out]  int *size
+ *
+ * @exception   None
+ *
+ * @remark       None
+ */
+int bluetooth_l2cap_le_get_max_buffer_size(int *size);
 
 /**
  * @}