Add new APIs for L2CAP LE CoC functionality 31/299431/1
authorWootak Jung <wootak.jung@samsung.com>
Sun, 10 Apr 2022 23:47:16 +0000 (08:47 +0900)
committerAnuj Jain <anuj01.jain@samsung.com>
Wed, 27 Sep 2023 13:06:15 +0000 (18:36 +0530)
- add new feature:
tizen.org/feature/network.bluetooth.le.coc

To avoid build conflict please merge this patch after merging framework
patch:(Change-Id: Icf4d8a51acc444765a9b61224a3a5d3fd26bfa65)

Change-Id: I193513b0524daeac8e8c538f8226285ccc07a895
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
doc/bluetooth_doc.h
include/bluetooth_private.h
src/bluetooth-common.c

index 9fb2f01d9806d602d4f8b4235bc706d36c287448..30d039c44abad86da9f88910a86fd1c969321871 100644 (file)
  * Please refer Bluetooth Tutorial if you want to get more detailed usages and information of this api.
  */
 
+/**
+ * @defgroup CAPI_NETWORK_BLUETOOTH_L2CAP_SOCKET_MODULE Bluetooth L2CAP Socket
+ * @brief Bluetooth L2CAP Socket API provides functions for managing connections to other devices and exchanging data.
+ * @ingroup CAPI_NETWORK_BLUETOOTH_MODULE
+ *
+ * @section CAPI_NETWORK_BLUETOOTH_L2CAP_SOCKET_MODULE_HEADER Required Header
+ *  \#include <bluetooth.h>
+ *
+ * @section CAPI_NETWORK_BLUETOOTH_L2CAP_SOCKET_MODULE_OVERVIEW Overview
+ * This set of functions is used for exchanging data between two bluetooth
+ * devices, our device can have both roles as server (service provider) and client
+ * (service user).
+ * Depending on the role, there is difference in creating a connection.
+ * After that, processes of exchanging data and disconnection are same.
+ *
+ * To start communication, you should first register for #bt_socket_set_l2cap_channel_connection_state_changed_cb()
+ * and #bt_socket_set_data_received_cb().
+ * Next step depends on the role of your application.\n
+ * If you want to be \b server \b role, application should create socket
+ * (#bt_socket_create_l2cap_channel()), and start listening and accepting incoming connections
+ * (#bt_socket_listen_and_accept_l2cap_channel()).
+ * If you want to connect to specific device and use it's services (\a client \a role),
+ * you have to start connection with #bt_socket_connect_l2cap_channel() and wait for connection.\n
+ * After connection has been established (information is passed to your program with
+ * #bt_socket_l2cap_channel_connection_state_changed_cb() function call), you can exchange data by
+ * calling #bt_socket_send_data_l2cap_channel(). \n
+ * If you receive data from remote device, #bt_socket_data_received_cb() functions will be called.
+ * When you finish exchanging data, you should disconnect connection
+ * with #bt_socket_disconnect_l2cap_channel() and unregister callback functions (with using
+ * #bt_socket_unset_data_received_cb(), #bt_socket_unset_l2cap_channel_connection_state_changed_cb()).
+ *
+ * @section CAPI_NETWORK_BLUETOOTH_L2CAP_SOCKET_MODULE_FEATURE Related Features
+ * This API is related with the following features:\n
+ *  - %http://tizen.org/feature/network.bluetooth.le.coc\n
+ *
+ * It is recommended to design feature related codes in your application for reliability.\n
+ *
+ * You can check if a device supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE,thereby controlling the procedure of your application.\n
+ *
+ * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.\n
+ *
+ * More details on featuring your application can be found from <a href="https://docs.tizen.org/application/tizen-studio/native-tools/manifest-text-editor#feature-element"><b>Feature Element</b>.</a>
+ *
+ * @section CAPI_NETWORK_BLUETOOTH_L2CAP_SOCKET_MODULE_ASYNCHRONOUS_OPERATIONS Asynchronous Operations
+ * <div><table class="doxtable" >
+ *     <tr>
+ *        <th><b>FUNCTION</b></th>
+ *        <th><b>CALLBACK</b></th>
+ *        <th><b>DESCRIPTION</b></th>
+ *     </tr>
+ *     <tr>
+ *        <td>bt_socket_listen_and_accept_l2cap_channel()<br>
+ *            bt_socket_connect_l2cap_channel()</td>
+ *        <td>bt_socket_l2cap_channel_connection_state_changed_cb()</td>
+ *        <td>Used to connect a device. </td>
+ *     </tr>
+ *</table></div>
+ *
+ * @section CAPI_NETWORK_BLUETOOTH_L2CAP_SOCKET_MODULE_CALLBACK_OPERATIONS Callback(Event) Operations
+ * <div><table class="doxtable" >
+ *     <tr>
+ *        <th><b>REGISTER</b></th>
+ *        <th><b>UNREGISTER</b></th>
+ *        <th><b>CALLBACK</b></th>
+ *        <th><b>DESCRIPTION</b></th>
+ *     </tr>
+ *     <tr>
+ *        <td>bt_socket_set_data_received_cb()</td>
+ *        <td>bt_socket_unset_data_received_cb()</td>
+ *        <td>bt_socket_data_received_cb()</td>
+ *        <td>Used to be notified of received data. </td>
+ *     </tr>
+ *     <tr>
+ *        <td>bt_socket_set_l2cap_channel_connection_state_changed_cb()</td>
+ *        <td>bt_socket_unset_l2cap_channel_connection_state_changed_cb()</td>
+ *        <td>bt_socket_l2cap_channel_connection_state_changed_cb()</td>
+ *        <td>Used to be notified when the state of connection changes. </td>
+ *     </tr>
+ *</table></div>
+ *
+ *<BR>
+ * Please refer Bluetooth Tutorial if you want to get more detailed usages and information of this api.
+ */
 
 /**
  * @defgroup CAPI_NETWORK_BLUETOOTH_OPP_MODULE Bluetooth OPP
index 266dd681306e2cd96aa1b5cecc43bc909cd96fb8..0617f8bef6650a1dec6d6c460c81b172bff60866 100644 (file)
@@ -606,6 +606,7 @@ typedef enum {
        BT_FEATURE_COMMON = BT_FEATURE_BASE,
        BT_FEATURE_LE,
        BT_FEATURE_LE_5_0,
+       BT_FEATURE_LE_COC,
        BT_FEATURE_IPSP,
        BT_FEATURE_MESH,
        BT_FEATURE_AUDIO_CALL,
index 2c5c91bc8f238008121c1432eba8a76533ae8c55..d786e12bd3f1354b989b2fdd89e4093ccba8bf93 100644 (file)
@@ -310,6 +310,7 @@ static bt_feature_table_t feature_table[] = {
        {"tizen.org/feature/network.bluetooth", FALSE, FALSE},                  /* BT_FEATURE_COMMON */
        {"tizen.org/feature/network.bluetooth.le", FALSE, FALSE},               /* BT_FEATURE_LE */
        {"tizen.org/feature/network.bluetooth.le.5_0", FALSE, FALSE},           /* BT_FEATURE_LE_5_0 */
+       {"tizen.org/feature/network.bluetooth.le.coc", FALSE, FALSE},           /* BT_FEATURE_LE_COC */
        {"tizen.org/feature/network.bluetooth.le.ipsp", FALSE, FALSE},          /* BT_FEATURE_IPSP */
        {"tizen.org/feature/network.bluetooth.le.mesh", TRUE, TRUE},            /* BT_FEATURE_MESH */
        {"tizen.org/feature/network.bluetooth.audio.call", FALSE, FALSE},       /* BT_FEATURE_AUDIO_CALL */