Add MTU related APIs into internal header 46/88846/2
authorDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 21 Sep 2016 02:21:29 +0000 (11:21 +0900)
committerPyun DoHyun <dh79.pyun@samsung.com>
Wed, 21 Sep 2016 05:30:23 +0000 (22:30 -0700)
Change-Id: I87575dfaaaf8568a131e2a021150ccf8a2798d87
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
include/bluetooth_private.h
include/mobile/bluetooth_internal.h
include/mobile/bluetooth_type_internal.h
include/tv/bluetooth_internal.h
include/tv/bluetooth_type_internal.h
include/wearable/bluetooth_internal.h
include/wearable/bluetooth_type_internal.h
test/bt_unit_test.c
test/bt_unit_test.h

index 5fe151595e262c53ea5e54b654131b14d3bf6d9e..01e5c8fdf33f1f81e668b27a96b76a9bc3c13ba1 100644 (file)
@@ -419,32 +419,6 @@ typedef struct {
        bt_gatt_client_request_completed_cb cb;
 } bt_gatt_client_cb_data_s;
 
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
- * @brief Attribute protocol MTU change information structure.
- * @since_tizen 3.0
- *
- * @see bt_device_att_mtu_changed_cb()
- */
-typedef struct {
-       char *remote_address;   /**< The address of remote device */
-       unsigned int mtu;               /** < MTU value */
-       unsigned int status;    /** < request status*/
-} bt_device_att_mtu_info_s;
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
- * @brief  Called when the connection state is changed.
- * @since_tizen 2.3.1
- *
- * @param[in] connected The connection status: (@c true = connected, @c false = disconnected)
- * @param[in] conn_info The connection information
- * @param[in] user_data The user data passed from the callback registration function
- * @see bt_device_set_connection_state_changed_cb()
- * @see bt_device_unset_connection_state_changed_cb()
- */
-typedef void (*bt_device_att_mtu_changed_cb)(int result, bt_device_att_mtu_info_s *mtu_info, void *user_data);
-
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
  * @brief  Called when RSSI monitoring is enabled.
index 23f3a40bdd555b0676571963addee6028d8ee8ca..6b2d4b47c38bde7a8457bbefa0c28ee3a4f36b30 100644 (file)
@@ -1104,6 +1104,82 @@ int bt_device_set_profile_restricted(const char *device_address, bt_restricted_p
  */
 int bt_device_get_profile_restricted(const char *device_address, bt_restricted_profile_t profile, int *restricted);
 
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief Request to change ATT MTU value
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/bluetooth.admin
+ *
+ * @param[in] remote_address The address of the remote Bluetooth device
+ * @param[in] mtu New MTU value to be changed
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_NOT_ENABLED  Not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED   Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ */
+int bt_device_request_att_mtu(const char *remote_address, unsigned int mtu);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief Gets the ATT MTU value set for a connection
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/bluetooth.admin
+ *
+ * @param[in] remote_address The address of the remote Bluetooth device
+ * @param[ot] mtu MTU value set for a connection
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_NOT_ENABLED  Not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED     Not supported
+ */
+int bt_device_get_att_mtu(const char *remote_address, unsigned int *mtu);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief  Registers a callback function to be invoked when the ATT MTU is changed.
+ * @since_tizen 3.0
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ * @post bt_device_connection_state_changed_cb() will be invoked.
+ * @see bt_initialize()
+ * @see bt_device_unset_att_mtu_changed_cb()
+ */
+int bt_device_set_att_mtu_changed_cb(bt_device_att_mtu_changed_cb callback, void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief      Unregisters the callback function to be invoked when the ATT MTU is changed.
+ * @since_tizen 3.0
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ * @see bt_initialize()
+ * @see bt_device_set_att_mtu_changed_cb()
+ */
+int bt_device_unset_att_mtu_changed_cb(void);
+
 /**
  * @internal
  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
index 643dbffd0b76b5538ad0f5dbb3b72da55b5a3c95..82602627543f4ff0917ef5bf4b0b8fa118be3f80 100644 (file)
@@ -409,6 +409,31 @@ typedef enum {
 typedef void (*bt_device_trusted_profiles_cb)
        (int result, char *remote_address, int trusted_profile, bool supported, bool trusted, void *user_data);
 
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief Attribute protocol MTU change information structure.
+ * @since_tizen 3.0
+ *
+ * @see bt_device_att_mtu_changed_cb()
+ */
+typedef struct {
+       char *remote_address;   /**< The address of remote device */
+       unsigned int mtu;               /** < MTU value */
+       unsigned int status;            /** < request status*/
+} bt_device_att_mtu_info_s;
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief  Called when the connection state is changed.
+ * @since_tizen 3.0
+ *
+ * @param[in] connected The connection status: (@c true = connected, @c false = disconnected)
+ * @param[in] conn_info The connection information
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see bt_device_set_connection_state_changed_cb()
+ * @see bt_device_unset_connection_state_changed_cb()
+ */
+typedef void (*bt_device_att_mtu_changed_cb)(int result, bt_device_att_mtu_info_s *mtu_info, void *user_data);
 
 /**
  * @internal
index 23f3a40bdd555b0676571963addee6028d8ee8ca..6b2d4b47c38bde7a8457bbefa0c28ee3a4f36b30 100644 (file)
@@ -1104,6 +1104,82 @@ int bt_device_set_profile_restricted(const char *device_address, bt_restricted_p
  */
 int bt_device_get_profile_restricted(const char *device_address, bt_restricted_profile_t profile, int *restricted);
 
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief Request to change ATT MTU value
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/bluetooth.admin
+ *
+ * @param[in] remote_address The address of the remote Bluetooth device
+ * @param[in] mtu New MTU value to be changed
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_NOT_ENABLED  Not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED   Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ */
+int bt_device_request_att_mtu(const char *remote_address, unsigned int mtu);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief Gets the ATT MTU value set for a connection
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/bluetooth.admin
+ *
+ * @param[in] remote_address The address of the remote Bluetooth device
+ * @param[ot] mtu MTU value set for a connection
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_NOT_ENABLED  Not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED     Not supported
+ */
+int bt_device_get_att_mtu(const char *remote_address, unsigned int *mtu);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief  Registers a callback function to be invoked when the ATT MTU is changed.
+ * @since_tizen 3.0
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ * @post bt_device_connection_state_changed_cb() will be invoked.
+ * @see bt_initialize()
+ * @see bt_device_unset_att_mtu_changed_cb()
+ */
+int bt_device_set_att_mtu_changed_cb(bt_device_att_mtu_changed_cb callback, void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief      Unregisters the callback function to be invoked when the ATT MTU is changed.
+ * @since_tizen 3.0
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ * @see bt_initialize()
+ * @see bt_device_set_att_mtu_changed_cb()
+ */
+int bt_device_unset_att_mtu_changed_cb(void);
+
 /**
  * @internal
  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
index 643dbffd0b76b5538ad0f5dbb3b72da55b5a3c95..82602627543f4ff0917ef5bf4b0b8fa118be3f80 100644 (file)
@@ -409,6 +409,31 @@ typedef enum {
 typedef void (*bt_device_trusted_profiles_cb)
        (int result, char *remote_address, int trusted_profile, bool supported, bool trusted, void *user_data);
 
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief Attribute protocol MTU change information structure.
+ * @since_tizen 3.0
+ *
+ * @see bt_device_att_mtu_changed_cb()
+ */
+typedef struct {
+       char *remote_address;   /**< The address of remote device */
+       unsigned int mtu;               /** < MTU value */
+       unsigned int status;            /** < request status*/
+} bt_device_att_mtu_info_s;
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief  Called when the connection state is changed.
+ * @since_tizen 3.0
+ *
+ * @param[in] connected The connection status: (@c true = connected, @c false = disconnected)
+ * @param[in] conn_info The connection information
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see bt_device_set_connection_state_changed_cb()
+ * @see bt_device_unset_connection_state_changed_cb()
+ */
+typedef void (*bt_device_att_mtu_changed_cb)(int result, bt_device_att_mtu_info_s *mtu_info, void *user_data);
 
 /**
  * @internal
index 5c47f13193fc7c42447a46ef2f755aa6265daf6b..5d7b6482ed0b3aadd967fb727f83439516ccda5e 100644 (file)
@@ -1074,6 +1074,82 @@ int bt_device_set_profile_restricted(const char *device_address, bt_restricted_p
  */
 int bt_device_get_profile_restricted(const char *device_address, bt_restricted_profile_t profile, int *restricted);
 
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief Request to change ATT MTU value
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/bluetooth.admin
+ *
+ * @param[in] remote_address The address of the remote Bluetooth device
+ * @param[in] mtu New MTU value to be changed
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_NOT_ENABLED  Not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED   Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ */
+int bt_device_request_att_mtu(const char *remote_address, unsigned int mtu);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief Gets the ATT MTU value set for a connection
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/bluetooth.admin
+ *
+ * @param[in] remote_address The address of the remote Bluetooth device
+ * @param[ot] mtu MTU value set for a connection
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_NOT_ENABLED  Not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED     Not supported
+ */
+int bt_device_get_att_mtu(const char *remote_address, unsigned int *mtu);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief  Registers a callback function to be invoked when the ATT MTU is changed.
+ * @since_tizen 3.0
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ * @post bt_device_connection_state_changed_cb() will be invoked.
+ * @see bt_initialize()
+ * @see bt_device_unset_att_mtu_changed_cb()
+ */
+int bt_device_set_att_mtu_changed_cb(bt_device_att_mtu_changed_cb callback, void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief      Unregisters the callback function to be invoked when the ATT MTU is changed.
+ * @since_tizen 3.0
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE  Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED  Not initialized
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ * @see bt_initialize()
+ * @see bt_device_set_att_mtu_changed_cb()
+ */
+int bt_device_unset_att_mtu_changed_cb(void);
+
 /**
  * @internal
  * @ingroup CAPI_NETWORK_BLUETOOTH_SOCKET_MODULE
index 441a9ef0cc62f0f2596fafab03d04303c8304c68..9dce714e6cab33200d98de86d1e6f16fb9b07172 100644 (file)
@@ -426,6 +426,32 @@ typedef enum {
 typedef void (*bt_device_trusted_profiles_cb)
        (int result, char *remote_address, int trusted_profile, bool supported, bool trusted, void *user_data);
 
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief Attribute protocol MTU change information structure.
+ * @since_tizen 3.0
+ *
+ * @see bt_device_att_mtu_changed_cb()
+ */
+typedef struct {
+       char *remote_address;   /**< The address of remote device */
+       unsigned int mtu;               /** < MTU value */
+       unsigned int status;            /** < request status*/
+} bt_device_att_mtu_info_s;
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
+ * @brief  Called when the connection state is changed.
+ * @since_tizen 3.0
+ *
+ * @param[in] connected The connection status: (@c true = connected, @c false = disconnected)
+ * @param[in] conn_info The connection information
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see bt_device_set_connection_state_changed_cb()
+ * @see bt_device_unset_connection_state_changed_cb()
+ */
+typedef void (*bt_device_att_mtu_changed_cb)(int result, bt_device_att_mtu_info_s *mtu_info, void *user_data);
+
 /**
  * @internal
  * @brief IPSP Init state changed callback
index c57d86d267a35ce65102cfd51ef11c8165318395..f921f6f031eeab6e538fcfbfdc94471bc81214dd 100644 (file)
@@ -370,6 +370,14 @@ tc_table_t tc_device[] = {
                , BT_UNIT_TEST_FUNCTION_DEVICE_CREATE_BOND_BY_TYPE},
        {"bt_device_destroy_bond"
                , BT_UNIT_TEST_FUNCTION_DEVICE_DESTROY_BOND},
+       {"bt_device_request_att_mtu"
+               , BT_UNIT_TEST_FUNCTION_DEVICE_REQUEST_ATT_MTU},
+       {"bt_device_set_att_mtu_changed_cb"
+               , BT_UNIT_TEST_FUNCTION_DEVICE_SET_REQUEST_ATT_MTU_CHANGED_CB},
+       {"bt_device_unset_att_mtu_changed_cb"
+               , BT_UNIT_TEST_FUNCTION_DEVICE_UNSET_REQUEST_ATT_MTU_CHANGED_CB},
+       {"bt_device_get_att_mtu"
+                               , BT_UNIT_TEST_FUNCTION_DEVICE_GET_ATT_MTU},
        {"bt_device_le_set_data_length"
                , BT_UNIT_TEST_FUNCTION_LE_DEVICE_SET_DATA_LENGTH},
        {"bt_device_le_data_length_changed_cb"
@@ -1876,6 +1884,23 @@ void __bt_device_connection_state_changed_cb(bool connected,
        TC_PRT("disconnection reason [%d]", conn_info->disconn_reason);
 }
 
+void __bt_device_att_mtu_changed_cb(int result, bt_device_att_mtu_info_s *mtu_info, void *user_data)
+{
+       TC_PRT("__bt_device_att_mtu_changed_cb");
+
+       if (result != BT_ERROR_NONE) {
+               TC_PRT("Callback: Request ATT MTU failed.");
+               TC_PRT("result: %s", __bt_get_error_message(result));
+       }
+
+       if (mtu_info) {
+               TC_PRT("status [%d]", mtu_info->status);
+               TC_PRT("address [%s]", mtu_info->remote_address);
+               TC_PRT("MTU [%d]", mtu_info->mtu);
+       }
+}
+
+
 bool __bt_device_connected_profile(bt_profile_e profile, void *user_data)
 {
        TC_PRT("__bt_device_connected_profile [%d]", profile);
@@ -3189,6 +3214,35 @@ int test_set_params(int test_id, char *param)
                        break;
                }
 
+               case BT_UNIT_TEST_FUNCTION_DEVICE_REQUEST_ATT_MTU: {
+                       if (param_index == 0) {
+                               g_test_param.param_count = 1;
+                               g_test_param.params = g_malloc0(sizeof(char*) * g_test_param.param_count);
+                               param_type = "int(1, 2, 10, ...., 512)";
+                       }
+
+                       if (param_index > 0) {
+                               g_test_param.params[param_index - 1] = g_malloc0(strlen(param) + 1);
+                               strcpy(g_test_param.params[param_index - 1], param);
+                       }
+
+                       if (param_index == g_test_param.param_count) {
+                               need_to_set_params = false;
+#ifdef ARCH64
+                               test_input_callback((void *)(uintptr_t)test_id);
+#else
+                               test_input_callback((void *)test_id);
+#endif
+                               param_index = 0;
+                               return 0;
+                       }
+
+                       TC_PRT("Input param(%d) : %s", param_index + 1, param_type);
+                       param_index++;
+
+                       break;
+               }
+
                default:
                        TC_PRT("There is no param to set\n");
                        need_to_set_params = false;
@@ -5319,7 +5373,35 @@ int test_input_callback(void *data)
 
                        break;
                }
+               case BT_UNIT_TEST_FUNCTION_DEVICE_REQUEST_ATT_MTU: {
+                       unsigned int mtu = 512; /* MAX MTU Value */
+
+                       if (g_test_param.param_count > 0) {
+                               mtu = atoi(g_test_param.params[0]);
+
+                               __bt_free_test_param(&g_test_param);
+                       }
 
+                       ret = bt_device_request_att_mtu(remote_addr, mtu);
+                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
+                       break;
+               }
+               case BT_UNIT_TEST_FUNCTION_DEVICE_GET_ATT_MTU: {
+                       unsigned int mtu = 0;
+                       ret = bt_device_get_att_mtu(remote_addr, &mtu);
+                       TC_PRT("returns %s, MTU %d\n", __bt_get_error_message(ret), mtu);
+                       break;
+               }
+               case BT_UNIT_TEST_FUNCTION_DEVICE_SET_REQUEST_ATT_MTU_CHANGED_CB: {
+                       ret = bt_device_set_att_mtu_changed_cb(__bt_device_att_mtu_changed_cb, NULL);
+                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
+                       break;
+               }
+               case BT_UNIT_TEST_FUNCTION_DEVICE_UNSET_REQUEST_ATT_MTU_CHANGED_CB: {
+                       ret = bt_device_unset_att_mtu_changed_cb();
+                       TC_PRT("returns %s\n", __bt_get_error_message(ret));
+                       break;
+               }
                case BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS:
                        need_to_set_params = true;
                        TC_PRT("Select the function again");
index 328a2609284aa44da2524fb0c67733a9cc7fb6f8..13162f12bdcc04e0eb16937eebf1bab82c6bbd80 100644 (file)
@@ -152,6 +152,10 @@ typedef enum {
        BT_UNIT_TEST_FUNCTION_DEVICE_DISABLE_RSSI_MONITOR,
        BT_UNIT_TEST_FUNCTION_DEVICE_GET_RSSI_STRENGTH,
        BT_UNIT_TEST_FUNCTION_DEVICE_GET_CONNECTION_STATE,
+       BT_UNIT_TEST_FUNCTION_DEVICE_REQUEST_ATT_MTU,
+       BT_UNIT_TEST_FUNCTION_DEVICE_SET_REQUEST_ATT_MTU_CHANGED_CB,
+       BT_UNIT_TEST_FUNCTION_DEVICE_UNSET_REQUEST_ATT_MTU_CHANGED_CB,
+       BT_UNIT_TEST_FUNCTION_DEVICE_GET_ATT_MTU,
        BT_UNIT_TEST_FUNCTION_SOCKET_CREATE_RFCOMM = 1,
        BT_UNIT_TEST_FUNCTION_SOCKET_DESTROY_RFCOMM,
        BT_UNIT_TEST_FUNCTION_SOCKET_LISTEN_AND_ACCEPT_RFCOMM,