media_metadata_attributes_t *metadata = NULL;
bluetooth_authentication_request_info_t *auth_information = NULL;
bt_le_data_length_params_t *data_length_info = NULL;
- bt_ipsp_connection_info_t *bt_ipsp_iface_info = NULL;
#ifdef TIZEN_GATT_CLIENT
bt_gatt_char_property_t *char_prop = NULL;
}
case BLUETOOTH_EVENT_IPSP_CONNECTED:
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_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);
-
- if (device_addr != NULL)
- free(device_addr);
break;
case BLUETOOTH_EVENT_IPSP_DISCONNECTED:
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_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);
-
- if (device_addr != NULL)
- free(device_addr);
break;
case BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED: {
bt_gatt_client_att_mtu_info_s *mtu_info = NULL;
}
case BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED: {
BT_DBG("BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED"); /* 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;
}
case BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED: {
* limitations under the License.
*/
-#include <glib.h>
-#include <dlog.h>
-#include <stdio.h>
-#include <stdbool.h>
-#include <string.h>
-#include <bluetooth-api.h>
-#include <bluetooth-ipsp-api.h>
-
#include "bluetooth.h"
#include "bluetooth_internal.h"
#include "bluetooth_private.h"
-static bool is_ipsp_initialized = false;
-
-#define BT_CHECK_IPSP_SUPPORT() \
-{ \
- BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_COMMON); \
- BT_CHECK_SUPPORTED_FEATURE(BT_FEATURE_IPSP); \
-}
-
-#define BT_CHECK_IPSP_INIT_STATUS() \
- if (__bt_check_ipsp_init_status() == BT_ERROR_NOT_INITIALIZED) { \
- LOGE("[%s] NOT_INITIALIZED(0x%08x)", __FUNCTION__, BT_ERROR_NOT_INITIALIZED); \
- return BT_ERROR_NOT_INITIALIZED; \
- }
-/* LCOV_EXCL_START */
-int __bt_check_ipsp_init_status(void)
-{
- if (is_ipsp_initialized != true) {
- BT_ERR("NOT_INITIALIZED(0x%08x)", BT_ERROR_NOT_INITIALIZED);
- return BT_ERROR_NOT_INITIALIZED;
- }
-
- return BT_ERROR_NONE;
-}
-
int bt_ipsp_initialize(bt_ipsp_init_state_changed_cb callback,
void *user_data)
{
- int error;
-
- if (is_ipsp_initialized)
- return BT_ERROR_ALREADY_DONE;
-
- BT_CHECK_IPSP_SUPPORT();
- BT_CHECK_INIT_STATUS();
- BT_CHECK_INPUT_PARAMETER(callback);
-
- 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);
- return error;
- }
-
- _bt_set_cb(BT_EVENT_IPSP_INIT_STATE_CHANGED, callback, user_data);
-
- is_ipsp_initialized = true;
- return BT_ERROR_NONE;
+ return BT_ERROR_NOT_SUPPORTED;
}
int bt_ipsp_deinitialize(void)
{
- int error;
-
- BT_CHECK_IPSP_SUPPORT();
- BT_CHECK_INIT_STATUS();
- BT_CHECK_IPSP_INIT_STATUS();
-
- 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);
- return error;
- }
-
- is_ipsp_initialized = false;
- return BT_ERROR_NONE;
+ return BT_ERROR_NOT_SUPPORTED;
}
int bt_ipsp_connect(const char *address)
{
- int ret;
- bluetooth_device_address_t bd_addr = { {0,} };
-
- BT_CHECK_IPSP_SUPPORT();
- BT_CHECK_INIT_STATUS();
- BT_CHECK_INPUT_PARAMETER(address);
-
- _bt_convert_address_to_hex(&bd_addr, address);
-
- 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);
-
- return ret;
+ return BT_ERROR_NOT_SUPPORTED;
}
int bt_ipsp_disconnect(const char *address)
{
- int ret;
- bluetooth_device_address_t bd_addr = { {0,} };
-
- BT_CHECK_IPSP_SUPPORT();
- BT_CHECK_INIT_STATUS();
- BT_CHECK_INPUT_PARAMETER(address);
-
- _bt_convert_address_to_hex(&bd_addr, address);
-
- 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);
-
- return ret;
+ return BT_ERROR_NOT_SUPPORTED;
}
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();
- BT_CHECK_INPUT_PARAMETER(callback);
- _bt_set_cb(BT_EVENT_IPSP_CONNECTION_STATUS, callback, user_data);
-
- return BT_ERROR_NONE;
+ return BT_ERROR_NOT_SUPPORTED;
}
int bt_ipsp_unset_connection_state_changed_cb(void)
{
- BT_CHECK_IPSP_SUPPORT();
- BT_CHECK_INIT_STATUS();
-
- _bt_unset_cb(BT_EVENT_IPSP_CONNECTION_STATUS);
- return BT_ERROR_NONE;
+ return BT_ERROR_NOT_SUPPORTED;
}
-
-/* LCOV_EXCL_STOP */