Fix the IPSP APIs' name and move those in the internal.h 06/83606/2
authorTaejin Woo <tt.woo@samsung.com>
Fri, 12 Aug 2016 02:18:43 +0000 (11:18 +0900)
committerTaejin Woo <tt.woo@samsung.com>
Fri, 12 Aug 2016 03:51:53 +0000 (12:51 +0900)
Change-Id: Ifd7d4d3cf13a8d300df6843dbc57efbd0047b492
Signed-off-by: Taejin Woo <tt.woo@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
src/bluetooth-common.c
src/bluetooth-ipsp.c
test/bt_unit_test.c

index c10e23f80453f2866ec8a306688899ecdc8c7502..b0686b12dd551050f309732c9e8abe4c7e3c2fad 100644 (file)
@@ -534,70 +534,6 @@ const GSList *_bt_gatt_get_server_list(void);
 
 int _bt_gatt_client_update_all(bt_gatt_client_h client);
 
-/**
- * @internal
- * @brief IPSP Init state changed callback
- */
-typedef void (*bt_le_ipsp_init_state_changed_cb)
-               (int result, bool ipsp_initialized, void *user_data);
-
-/**
- * @internal
- * @brief Initialize Bluetooth LE IPSP service and set the callback
- */
-int bt_le_ipsp_initialize(bt_le_ipsp_init_state_changed_cb callback, void *user_data);
-
-/**
- * @internal
- * @brief De-Initialize Bluetooth LE IPSP service and unset the callback
- */
-int bt_le_ipsp_deinitialize(void);
-
-/**
- * @internal
- * @brief Connect to a IPSP service over LE to remote device.
- */
-int bt_le_ipsp_connect(const char *address);
-
-/**
- * @internal
- * @brief Disconnect to a IPSP service over LE to remote device.
- */
-int bt_le_ipsp_disconnect(const char *address);
-
-/**
-* @internal
-* @brief Check whether IPSP service is initialized
-*/
-int bt_le_ipsp_is_initialized(void);
-
-/**
- * @internal
- * @brief IPSP Connection state changed callback
- */
-typedef void (*bt_le_ipsp_connection_state_changed_cb)
-               (int result, bool connected, const char *remote_address, const char *iface_name, void *user_data);
-/**
- * @internal
- * @brief Set IPSP connection state event change callback.
- */
-int bt_le_ipsp_set_connection_state_changed_cb(bt_le_ipsp_connection_state_changed_cb callback,
-                                               void *user_data);
-
-/**
- * @internal
- * @brief Unset IPSP connection state event change callback.
- */
-int bt_le_ipsp_unset_connection_state_changed_cb(void);
-
-/**
- * @internal
- * @brief IPSP Connection Interface Info callback
- */
-typedef void (*bt_le_ipsp_interface_info_cb)
-               (int result, const char *remote_address, const char *if_name,
-               void *user_data);
-
 /**
  * @ingroup CAPI_NETWORK_BLUETOOTH_LE_MODULE
  * @brief Reads the maximum data length of LE packets supported by the controller.
index 2fd346b53b4133bf0a497c97c7d61ec2d9cc1543..66e7d3187e98d3fa1e8006595283b21a01eca100 100644 (file)
@@ -3017,6 +3017,49 @@ int bt_dpm_set_data_transfer_state(bt_dpm_status_e value);
  */
 int bt_dpm_get_data_transfer_state(bt_dpm_status_e *value);
 
+/**
+ * @internal
+ * @brief Initialize Bluetooth IPSP service and set the callback
+ */
+int bt_ipsp_initialize(bt_ipsp_init_state_changed_cb callback, void *user_data);
+
+/**
+ * @internal
+ * @brief De-Initialize Bluetooth IPSP service and unset the callback
+ */
+int bt_ipsp_deinitialize(void);
+
+/**
+ * @internal
+ * @brief Connect to a IPSP service over LE to remote device.
+ */
+int bt_ipsp_connect(const char *address);
+
+/**
+ * @internal
+ * @brief Disconnect to a IPSP service over LE to remote device.
+ */
+int bt_ipsp_disconnect(const char *address);
+
+/**
+* @internal
+* @brief Check whether IPSP service is initialized
+*/
+int bt_ipsp_is_initialized(void);
+
+/**
+ * @internal
+ * @brief Set IPSP connection state event change callback.
+ */
+int bt_ipsp_set_connection_state_changed_cb(bt_ipsp_connection_state_changed_cb callback,
+                                               void *user_data);
+
+/**
+ * @internal
+ * @brief Unset IPSP connection state event change callback.
+ */
+int bt_ipsp_unset_connection_state_changed_cb(void);
+
 /**
  * @}
  */
index 0b1547f61d49fb78d1626c3802f7653e807e6ff0..1a09f63eaa886e38fb899c972bbd7b6563d99be8 100644 (file)
@@ -361,7 +361,25 @@ typedef void (*bt_hid_device_connection_state_changed_cb) (int result,
  * @see bt_hid_device_set_data_received_cb()
  */
 typedef void (*bt_hid_device_data_received_cb)(const bt_hid_device_received_data_s *data, void *user_data);
-/* HID device related type */
+
+/**
+ * @internal
+ * @ingroup
+ * @brief IPSP Init state changed callback
+ * @since_tizen 3.0
+ */
+typedef void (*bt_ipsp_init_state_changed_cb)
+               (int result, bool ipsp_initialized, void *user_data);
+
+/**
+ * @internal
+ * @ingroup
+ * @since_tizen 3.0
+
+ * @brief IPSP Connection state changed callback
+ */
+typedef void (*bt_ipsp_connection_state_changed_cb)
+               (int result, bool connected, const char *remote_address, const char *iface_name, void *user_data);
 
 
 /**
index ce3ba68ab411f4c75e10303fbd988009a007a069..24243e0a30ab81cf54d8c9d878a785065d68cf91 100644 (file)
@@ -3018,6 +3018,49 @@ int bt_dpm_set_data_transfer_state(bt_dpm_status_e value);
  */
 int bt_dpm_get_data_transfer_state(bt_dpm_status_e *value);
 
+/**
+ * @internal
+ * @brief Initialize Bluetooth IPSP service and set the callback
+ */
+int bt_ipsp_initialize(bt_ipsp_init_state_changed_cb callback, void *user_data);
+
+/**
+ * @internal
+ * @brief De-Initialize Bluetooth IPSP service and unset the callback
+ */
+int bt_ipsp_deinitialize(void);
+
+/**
+ * @internal
+ * @brief Connect to a IPSP service over LE to remote device.
+ */
+int bt_ipsp_connect(const char *address);
+
+/**
+ * @internal
+ * @brief Disconnect to a IPSP service over LE to remote device.
+ */
+int bt_ipsp_disconnect(const char *address);
+
+/**
+* @internal
+* @brief Check whether IPSP service is initialized
+*/
+int bt_ipsp_is_initialized(void);
+
+/**
+ * @internal
+ * @brief Set IPSP connection state event change callback.
+ */
+int bt_ipsp_set_connection_state_changed_cb(bt_ipsp_connection_state_changed_cb callback,
+                                               void *user_data);
+
+/**
+ * @internal
+ * @brief Unset IPSP connection state event change callback.
+ */
+int bt_ipsp_unset_connection_state_changed_cb(void);
+
 /**
  * @}
  */
index 8dfda7f25eba111c17d0d30deb03242f955c752b..f9386eb060ac425cabdd8bbc08f895cfe3933524 100644 (file)
@@ -361,8 +361,20 @@ typedef void (*bt_hid_device_connection_state_changed_cb) (int result,
  * @see bt_hid_device_set_data_received_cb()
  */
 typedef void (*bt_hid_device_data_received_cb)(const bt_hid_device_received_data_s *data, void *user_data);
-/* HID device related type */
 
+/**
+ * @internal
+ * @brief IPSP Init state changed callback
+ */
+typedef void (*bt_ipsp_init_state_changed_cb)
+               (int result, bool ipsp_initialized, void *user_data);
+
+/**
+ * @internal
+ * @brief IPSP Connection state changed callback
+ */
+typedef void (*bt_ipsp_connection_state_changed_cb)
+               (int result, bool connected, const char *remote_address, const char *iface_name, void *user_data);
 
 /**
  * @}
index 72d23a3c8d984d9fad22b404e9d6fd349758f32c..a3f90dc1ac60b81100e9a355cddd6745acb58e65 100644 (file)
@@ -3165,6 +3165,49 @@ int bt_dpm_set_data_transfer_state(bt_dpm_status_e value);
  */
 int bt_dpm_get_data_transfer_state(bt_dpm_status_e *value);
 
+/**
+ * @internal
+ * @brief Initialize Bluetooth IPSP service and set the callback
+ */
+int bt_ipsp_initialize(bt_ipsp_init_state_changed_cb callback, void *user_data);
+
+/**
+ * @internal
+ * @brief De-Initialize Bluetooth IPSP service and unset the callback
+ */
+int bt_ipsp_deinitialize(void);
+
+/**
+ * @internal
+ * @brief Connect to a IPSP service over LE to remote device.
+ */
+int bt_ipsp_connect(const char *address);
+
+/**
+ * @internal
+ * @brief Disconnect to a IPSP service over LE to remote device.
+ */
+int bt_ipsp_disconnect(const char *address);
+
+/**
+* @internal
+* @brief Check whether IPSP service is initialized
+*/
+int bt_ipsp_is_initialized(void);
+
+/**
+ * @internal
+ * @brief Set IPSP connection state event change callback.
+ */
+int bt_ipsp_set_connection_state_changed_cb(bt_ipsp_connection_state_changed_cb callback,
+                                               void *user_data);
+
+/**
+ * @internal
+ * @brief Unset IPSP connection state event change callback.
+ */
+int bt_ipsp_unset_connection_state_changed_cb(void);
+
 /**
  * @}
  */
index a596b0bb71319d00c3e263429f560bc96cbb7e63..ac4fe1acacccd40fb1d90878f49f64a2630c89e3 100644 (file)
@@ -379,6 +379,20 @@ typedef struct {
        char **uuids;
 } bt_dpm_uuids_list_s;
 
+/**
+ * @internal
+ * @brief IPSP Init state changed callback
+ */
+typedef void (*bt_ipsp_init_state_changed_cb)
+               (int result, bool ipsp_initialized, void *user_data);
+
+/**
+ * @internal
+ * @brief IPSP Connection state changed callback
+ */
+typedef void (*bt_ipsp_connection_state_changed_cb)
+               (int result, bool connected, const char *remote_address, const char *iface_name, void *user_data);
+
 /**
  * @}
  */
index 591cf5898ad92a8fdac397434d1df3a2b33fbdc9..6aee504a6c856cb4ba3816d84093c83178d56888 100644 (file)
@@ -1825,7 +1825,7 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                BT_INFO("BLUETOOTH_EVENT_IPSP_CONNECTED");
                bt_ipsp_iface_info = (bt_ipsp_connection_info_t *)(param->param_data);
                _bt_convert_address_to_string(&device_addr, &bt_ipsp_iface_info->btaddr);
-               ((bt_le_ipsp_connection_state_changed_cb)bt_event_slot_container[event_index].callback)
+               ((bt_ipsp_connection_state_changed_cb)bt_event_slot_container[event_index].callback)
                (_bt_get_error_code(param->result), TRUE, device_addr, bt_ipsp_iface_info->if_name,
                 bt_event_slot_container[event_index].user_data);
                break;
@@ -1833,7 +1833,7 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
                BT_INFO("BLUETOOTH_EVENT_IPSP_DISCONNECTED");
                bt_ipsp_iface_info = (bt_ipsp_connection_info_t *)(param->param_data);
                _bt_convert_address_to_string(&device_addr, &bt_ipsp_iface_info->btaddr);
-               ((bt_le_ipsp_connection_state_changed_cb)bt_event_slot_container[event_index].callback)
+               ((bt_ipsp_connection_state_changed_cb)bt_event_slot_container[event_index].callback)
                (_bt_get_error_code(param->result), FALSE, device_addr, bt_ipsp_iface_info->if_name,
                 bt_event_slot_container[event_index].user_data);
                break;
@@ -2104,7 +2104,7 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us
 #endif
        case BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED: {
                BT_DBG("BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED"); /* LCOV_EXCL_LINE */
-               ((bt_le_ipsp_init_state_changed_cb)bt_event_slot_container[event_index].callback) /* LCOV_EXCL_LINE */
+               ((bt_ipsp_init_state_changed_cb)bt_event_slot_container[event_index].callback) /* LCOV_EXCL_LINE */
                        (_bt_get_error_code(param->result), *(bool *)(param->param_data), /* LCOV_EXCL_LINE */
                        bt_event_slot_container[event_index].user_data);
                break;
index a2a1b7a9cceb60a3adb4461d2f1e04d45c85a6c5..d7225a511fa3533b71afd91a89057b73714fcf21 100644 (file)
@@ -23,6 +23,7 @@
 #include <bluetooth-ipsp-api.h>
 
 #include "bluetooth.h"
+#include "bluetooth_internal.h"
 #include "bluetooth_private.h"
 
 static bool is_ipsp_initialized = false;
@@ -53,7 +54,7 @@ int __bt_check_ipsp_init_status(void)
        return BT_ERROR_NONE;
 }
 
-int bt_le_ipsp_is_initialized(void)
+int bt_ipsp_is_initialized(void)
 {
        BT_CHECK_IPSP_SUPPORT();
        BT_CHECK_INIT_STATUS();
@@ -61,7 +62,7 @@ int bt_le_ipsp_is_initialized(void)
        return BT_ERROR_NONE;
 }
 
-int bt_le_ipsp_initialize(bt_le_ipsp_init_state_changed_cb callback,
+int bt_ipsp_initialize(bt_ipsp_init_state_changed_cb callback,
                                                                void *user_data)
 {
        int error;
@@ -73,7 +74,7 @@ int bt_le_ipsp_initialize(bt_le_ipsp_init_state_changed_cb callback,
        BT_CHECK_INIT_STATUS();
        BT_CHECK_INPUT_PARAMETER(callback);
 
-       error = bluetooth_le_ipsp_init();
+       error = bluetooth_ipsp_init();
        error = _bt_get_error_code(error);
        if (BT_ERROR_NONE != error) {
                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error);
@@ -86,7 +87,7 @@ int bt_le_ipsp_initialize(bt_le_ipsp_init_state_changed_cb callback,
        return BT_ERROR_NONE;
 }
 
-int bt_le_ipsp_deinitialize(void)
+int bt_ipsp_deinitialize(void)
 {
        int error;
 
@@ -94,7 +95,7 @@ int bt_le_ipsp_deinitialize(void)
        BT_CHECK_INIT_STATUS();
        BT_CHECK_IPSP_INIT_STATUS();
 
-       error = bluetooth_le_ipsp_deinit();
+       error = bluetooth_ipsp_deinit();
        error = _bt_get_error_code(error);
        if (BT_ERROR_NONE != error) {
                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error), error);
@@ -105,7 +106,7 @@ int bt_le_ipsp_deinitialize(void)
        return BT_ERROR_NONE;
 }
 
-int bt_le_ipsp_connect(const char *address)
+int bt_ipsp_connect(const char *address)
 {
        int ret;
        bluetooth_device_address_t bd_addr = { {0,} };
@@ -116,7 +117,7 @@ int bt_le_ipsp_connect(const char *address)
 
        _bt_convert_address_to_hex(&bd_addr, address);
 
-       ret = _bt_get_error_code(bluetooth_le_ipsp_connect((ipsp_device_address_t *)&bd_addr));
+       ret = _bt_get_error_code(bluetooth_ipsp_connect((ipsp_device_address_t *)&bd_addr));
 
        if (ret != BT_ERROR_NONE)
                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
@@ -124,7 +125,7 @@ int bt_le_ipsp_connect(const char *address)
        return ret;
 }
 
-int bt_le_ipsp_disconnect(const char *address)
+int bt_ipsp_disconnect(const char *address)
 {
        int ret;
        bluetooth_device_address_t bd_addr = { {0,} };
@@ -135,7 +136,7 @@ int bt_le_ipsp_disconnect(const char *address)
 
        _bt_convert_address_to_hex(&bd_addr, address);
 
-       ret = _bt_get_error_code(bluetooth_le_ipsp_disconnect((ipsp_device_address_t *)&bd_addr));
+       ret = _bt_get_error_code(bluetooth_ipsp_disconnect((ipsp_device_address_t *)&bd_addr));
 
        if (ret != BT_ERROR_NONE)
                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
@@ -143,7 +144,7 @@ int bt_le_ipsp_disconnect(const char *address)
        return ret;
 }
 
-int bt_le_ipsp_set_connection_state_changed_cb(bt_le_ipsp_connection_state_changed_cb callback, void *user_data)
+int bt_ipsp_set_connection_state_changed_cb(bt_ipsp_connection_state_changed_cb callback, void *user_data)
 {
        BT_CHECK_IPSP_SUPPORT();
        BT_CHECK_INIT_STATUS();
@@ -153,7 +154,7 @@ int bt_le_ipsp_set_connection_state_changed_cb(bt_le_ipsp_connection_state_chang
        return BT_ERROR_NONE;
 }
 
-int bt_le_ipsp_unset_connection_state_changed_cb(void)
+int bt_ipsp_unset_connection_state_changed_cb(void)
 {
        BT_CHECK_IPSP_SUPPORT();
        BT_CHECK_INIT_STATUS();
index 1dd885214176da383cb7fce9addf8d030cbed220..9e3ebb927173a14ed178fd73be8085c55d2f6e15 100644 (file)
@@ -790,19 +790,19 @@ tc_table_t tc_ipsp[] = {
        /* IPSP functions */
        {"BACK"
                                , BT_UNIT_TEST_FUNCTION_BACK},
-       {"bt_le_ipsp_register[Server role]"
+       {"bt_ipsp_register[Server role]"
                                , BT_UNIT_TEST_FUNCTION_IPSP_REGISTER},
-       {"bt_le_ipsp_unregister[Server role]"
+       {"bt_ipsp_unregister[Server role]"
                                , BT_UNIT_TEST_FUNCTION_IPSP_UNREGISTER},
-       {"bt_le_ipsp_initialize[Server role]"
+       {"bt_ipsp_initialize[Server role]"
                                , BT_UNIT_TEST_FUNCTION_IPSP_INITIALIZE},
-       {"bt_le_ipsp_deinitialize[Server role]"
+       {"bt_ipsp_deinitialize[Server role]"
                                , BT_UNIT_TEST_FUNCTION_IPSP_DEINITIALIZE},
-       {"bt_le_ipsp_connect[Client role]"
+       {"bt_ipsp_connect[Client role]"
                                , BT_UNIT_TEST_FUNCTION_IPSP_CONNECT},
-       {"bt_le_ipsp_disconnect[Client role]"
+       {"bt_ipsp_disconnect[Client role]"
                                , BT_UNIT_TEST_FUNCTION_IPSP_DISCONNECT},
-       {"bt_le_ipsp_start_advertising[Server role]"
+       {"bt_ipsp_start_advertising[Server role]"
                                , BT_UNIT_TEST_FUNCTION_IPSP_START_ADVERTISING},
        {"bt_ipsp_set_connection_state_changed_cb[Client/Server role]"
                                , BT_UNIT_TEST_FUNCTION_IPSP_SET_CONNECTION_STATE_CHANGED_CB},
@@ -2656,7 +2656,7 @@ void __bt_hid_device_connection_state_changed_cb(int result,
        TC_PRT("Connected %d", connected);
 }
 
-void __bt_le_ipsp_init_state_changed_cb(int result,
+void __bt_ipsp_init_state_changed_cb(int result,
        bool ipsp_initialized, void *user_data)
 {
        TC_PRT("result: %s", __bt_get_error_message(result));
@@ -2668,7 +2668,7 @@ void __bt_le_ipsp_init_state_changed_cb(int result,
        }
 }
 
-void __bt_le_ipsp_connection_state_changed_cb(int result,
+void __bt_ipsp_connection_state_changed_cb(int result,
        bool connected, const char *remote_address, const char *iface_name, void *user_data)
 {
        TC_PRT("__bt_le_ipsp_connection_state_changed_cb: called");
@@ -7552,8 +7552,8 @@ int test_input_callback(void *data)
                case BT_UNIT_TEST_FUNCTION_IPSP_INITIALIZE:
                        /* Initialize IPSP server */
                        if (server != NULL && ipsp_h.svc != NULL) {
-                               ret = bt_le_ipsp_initialize(
-                                               &__bt_le_ipsp_init_state_changed_cb,
+                               ret = bt_ipsp_initialize(
+                                               &__bt_ipsp_init_state_changed_cb,
                                                NULL);
                                TC_PRT("bt_le_ipsp_initialize : returns %s\n", __bt_get_error_message(ret));
                        } else {
@@ -7562,20 +7562,20 @@ int test_input_callback(void *data)
                        break;
                case BT_UNIT_TEST_FUNCTION_IPSP_DEINITIALIZE:
                        /* De-Initialize IPSP server */
-                       ret = bt_le_ipsp_deinitialize();
+                       ret = bt_ipsp_deinitialize();
                        TC_PRT("bt_le_ipsp_deinitialize : returns %s\n", __bt_get_error_message(ret));
                        break;
                case BT_UNIT_TEST_FUNCTION_IPSP_CONNECT:
-                       ret = bt_le_ipsp_connect(remote_addr);
+                       ret = bt_ipsp_connect(remote_addr);
+                       TC_PRT("returns %s", __bt_get_error_message(ret));
                        break;
                case BT_UNIT_TEST_FUNCTION_IPSP_DISCONNECT:
-                       TC_PRT("PKPK : case BT_UNIT_TEST_FUNCTION_IPSP_DISCONNECT called");
-
-                       ret = bt_le_ipsp_disconnect(remote_addr);
+                       ret = bt_ipsp_disconnect(remote_addr);
+                       TC_PRT("returns %s", __bt_get_error_message(ret));
                        break;
                case BT_UNIT_TEST_FUNCTION_IPSP_START_ADVERTISING: {
                        const char *ipsp_svc_uuid_16 = "1820";
-                       ret = bt_le_ipsp_is_initialized();
+                       ret = bt_ipsp_is_initialized();
                        if (ret != BT_ERROR_NONE) {
                                TC_PRT("bt_le_ipsp_add_advertising_data: returns %s\n", __bt_get_error_message(ret));
                                break;
@@ -7626,13 +7626,13 @@ int test_input_callback(void *data)
                        break;
                }
                case BT_UNIT_TEST_FUNCTION_IPSP_SET_CONNECTION_STATE_CHANGED_CB:
-                       ret = bt_le_ipsp_set_connection_state_changed_cb(
-                                       __bt_le_ipsp_connection_state_changed_cb, NULL);
+                       ret = bt_ipsp_set_connection_state_changed_cb(
+                                       __bt_ipsp_connection_state_changed_cb, NULL);
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;
 
                case BT_UNIT_TEST_FUNCTION_IPSP_UNSET_CONNECTION_STATE_CHANGED_CB:
-                       ret = bt_le_ipsp_unset_connection_state_changed_cb();
+                       ret = bt_ipsp_unset_connection_state_changed_cb();
                        TC_PRT("returns %s\n", __bt_get_error_message(ret));
                        break;