|| service_function == BT_GET_IS_ALIAS_SET
|| service_function == BT_GET_CONNECTED_LINK_TYPE
|| service_function == BT_IS_SERVICE_USED
+ || service_function == BT_RFCOMM_LISTEN_AND_ACCEPT
|| service_function == BT_RFCOMM_LISTEN
|| service_function == BT_HDP_REGISTER_SINK_APP
|| service_function == BT_HDP_UNREGISTER_SINK_APP
|| service_function == BT_GATT_SERVER_DELETE_SERVICE
|| service_function == BT_START_LE_DISCOVERY
|| service_function == BT_STOP_LE_DISCOVERY
- || service_function == BT_AUDIO_SELECT_ROLE
- || service_function == BT_OBEX_SERVER_ACCEPT_CONNECTION)
+#ifdef TIZEN_GATT_CLIENT
+ || service_function == BT_GATT_CLIENT_REGISTER
+ || service_function == BT_GATT_GET_PRIMARY_SERVICES
+ || service_function == BT_GATT_GET_SERVICE_PROPERTIES
+ || service_function == BT_GATT_GET_INCLUDED_SERVICES
+ || service_function == BT_GATT_GET_CHARACTERISTIC_PROPERTIES
+ || service_function == BT_GATT_WATCH_CHARACTERISTIC
+ || service_function == BT_GATT_ACQUIRE_WRITE
+#endif
+ || service_function == BT_AUDIO_SELECT_ROLE)
return TRUE;
else
return FALSE;
GVariant *temp = NULL;
int result = 0;
int request_id = -1;
- const char *sender = NULL;
g_variant_get(parameters, "(iii@ay@ay@ay@ay@ay)", &service_type,
&service_function, &request_type,
out_param1 = g_array_new(FALSE, FALSE, sizeof(gchar));
- sender = g_dbus_method_invocation_get_sender(invocation);
-
if (service_type == BT_CORE_SERVICE) {
BT_DBG("No need to check privilege from bt-core");
} else if (__bt_service_check_privilege(service_function,
#else
connected = _bt_is_device_connected(&address, service_type);
#endif
- BT_DBG("is_connected: %d", connected);
+ BT_INFO("is_connected: %d", connected);
g_array_append_vals(*out_param1, &connected, sizeof(gboolean));
break;
}
result = BLUETOOTH_ERROR_NONE;
break;
}
+ case BT_RFCOMM_LISTEN_AND_ACCEPT: {
+ char *uuid;
+ int socket_fd = -1;
+
+ sender = (char *)g_dbus_method_invocation_get_sender(context);
+ uuid = (char *)g_variant_get_data(in_param1);
+
+ result = _bt_rfcomm_socket_listen(sender, uuid, true);
+ if (result > 0) {
+ BT_ERR("BT_RFCOMM_LISTEN_AND_ACCEPT success, save context");
+
+ result = BLUETOOTH_ERROR_NONE;
+ _bt_save_invocation_context(context,
+ result, sender, function_name, NULL);
+ } else {
+ g_array_append_vals(*out_param1, &socket_fd, sizeof(int));
+ }
+ break;
+ }
case BT_RFCOMM_LISTEN: {
char *uuid;
int socket_fd = -1;
sender = (char *)g_dbus_method_invocation_get_sender(context);
uuid = (char *)g_variant_get_data(in_param1);
- result = _bt_rfcomm_socket_listen(sender, uuid);
+ result = _bt_rfcomm_socket_listen(sender, uuid, false);
if (result > 0) {
BT_ERR("BT_RFCOMM_LISTEN success, save context");
result = _bt_avrcp_control_cmd(key_code);
break;
}
+ case BT_AVRCP_HANDLE_CONTROL_TO_DEST: {
+ int key_code;
+ bluetooth_device_address_t address = { { 0 } };
+
+ __bt_service_get_parameters(in_param1, &key_code, sizeof(int));
+ __bt_service_get_parameters(in_param2,
+ &address, sizeof(bluetooth_device_address_t));
+
+ result = _bt_avrcp_control_cmd_to_dest(key_code, &address);
+ break;
+ }
case BT_AVRCP_CONTROL_SET_PROPERTY: {
int type;
unsigned int value;
result = _bt_avrcp_control_set_property(type, value);
break;
}
+ case BT_AVRCP_TRANSPORT_SET_PROPERTY: {
+ int type;
+ unsigned int value;
+ BT_DBG("+");
+
+ __bt_service_get_parameters(in_param1,
+ &type, sizeof(int));
+ __bt_service_get_parameters(in_param2,
+ &value, sizeof(unsigned int));
+
+ result = _bt_avrcp_transport_set_property(type, value);
+ BT_DBG("-");
+ break;
+ }
case BT_AVRCP_CONTROL_GET_PROPERTY: {
int type;
__bt_service_get_parameters(in_param1,
adv_handle, sizeof(int));
- __bt_service_get_parameters(in_param2,
- &adv, sizeof(bluetooth_advertising_data_t));
__bt_service_get_parameters(in_param3,
&length, sizeof(int));
+ __bt_service_get_parameters(in_param2,
+ &adv, length);
__bt_service_get_parameters(in_param4,
&use_reserved_slot, sizeof(gboolean));
result = _bt_set_advertising_data(app, *adv_handle,
__bt_service_get_parameters(in_param1,
adv_handle, sizeof(int));
- __bt_service_get_parameters(in_param2,
- &rsp, sizeof(bluetooth_scan_resp_data_t));
__bt_service_get_parameters(in_param3,
&length, sizeof(int));
+ __bt_service_get_parameters(in_param2,
+ &rsp, length);
__bt_service_get_parameters(in_param4,
&use_reserved_slot, sizeof(gboolean));
__bt_service_get_parameters(in_param4, &use_reserved_slot,
sizeof(gboolean));
- BT_DBG("bluetooth_advertising_params_t [%f %f %d %d]",
+ BT_DBG("bluetooth_advertising_params_t [%f %f %d %d %d]",
adv_params.interval_min, adv_params.interval_max,
- adv_params.filter_policy, adv_params.type);
+ adv_params.filter_policy, adv_params.type, adv_params.tx_power_level);
result = _bt_set_custom_advertising(app, *adv_handle,
enable, &adv_params, use_reserved_slot);
if (result != BLUETOOTH_ERROR_NONE) {
break;
}
+ case BT_GATT_SERVER_ACQURE_WRITE_RESPONSE: {
+
+ bluetooth_gatt_server_acquire_response_params_t param;
+ char *app;
+ GDBusMessage *msg;
+ msg = g_dbus_method_invocation_get_message(context);
+ GUnixFDList *fd_list;
+ int fd = -1;;
+ int *fd_list_array;
+ int len;
+
+ BT_ERR("sending acquire write respose \n");
+
+ fd_list = g_dbus_message_get_unix_fd_list(msg);
+
+ memset(¶m, 0x00, sizeof(bluetooth_gatt_server_acquire_response_params_t));
+
+ app = (char*)g_dbus_method_invocation_get_sender(context);
+
+ __bt_service_get_parameters(in_param1, ¶m,
+ sizeof(bluetooth_gatt_server_acquire_response_params_t));
+
+ BT_ERR("sending acquire write respose sent \n ");
+
+ fd_list_array = (int *)g_unix_fd_list_peek_fds(fd_list, &len);
+ BT_INFO("Num fds in fd_list is : %d, fd_list[0]: %d", len, fd_list_array[0]);
+ fd = fd_list_array[0];
+
+ param.fd = fd;
+ result = _bt_gatt_server_acquire_send_response(app, ¶m, fd_list);
+
+ break;
+ }
+ case BT_GATT_SERVER_ACQUIRE_NOTIFY_RESPONSE: {
+
+ bluetooth_gatt_server_acquire_response_params_t param;
+ char *app;
+ GDBusMessage *msg;
+ msg = g_dbus_method_invocation_get_message(context);
+ GUnixFDList *fd_list;
+ int fd = -1;
+ int *fd_list_array;
+ int len;
+
+ BT_ERR("sending acquire write respose \n");
+
+ fd_list = g_dbus_message_get_unix_fd_list(msg);
+
+ memset(¶m, 0x00, sizeof(bluetooth_gatt_server_acquire_response_params_t));
+
+ app = (char*)g_dbus_method_invocation_get_sender(context);
+
+ __bt_service_get_parameters(in_param1, ¶m,
+ sizeof(bluetooth_gatt_server_acquire_response_params_t));
+
+ BT_ERR("sending acquire write respose sent \n ");
+
+ fd_list_array = (int *)g_unix_fd_list_peek_fds(fd_list, &len);
+ BT_INFO("Num fds in fd_list is : %d, fd_list[0]: %d", len, fd_list_array[0]);
+ fd = fd_list_array[0];
+
+ param.fd = fd;
+ result = _bt_gatt_server_acquire_send_response(app, ¶m, fd_list);
+
+ break;
+ }
case BT_GATT_SERVER_SEND_INDICATION: {
bluetooth_gatt_server_indication_params_t param;
bluetooth_gatt_att_data_t data;
int instance_id;
char *app;
- memset(¶m, 0x00, sizeof(bluetooth_gatt_server_response_params_t));
+ memset(¶m, 0x00, sizeof(bluetooth_gatt_server_update_value_t));
app = (char*)g_dbus_method_invocation_get_sender(context);
}
break;
}
+#ifdef TIZEN_GATT_CLIENT
+ /* Local Async */
+ case BT_GATT_CLIENT_REGISTER: {
+ bluetooth_device_address_t address = { {0} };
+ char *addr;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+
+ __bt_service_get_parameters(in_param1,
+ &address, sizeof(bluetooth_device_address_t));
+
+ result = _bt_register_gatt_client_instance(sender, &address);
+ if (BLUETOOTH_ERROR_NONE == result) {
+ addr = g_malloc0(BT_ADDRESS_STRING_SIZE);
+
+ _bt_convert_addr_type_to_string(addr, address.addr);
+ BT_INFO("GATT Client: Save Invocation data GATT CLient Register app[%s] address [%s]", sender, addr);
+
+ /* Save the informations to invocation */
+ _bt_save_invocation_context(context, result, sender,
+ function_name, (gpointer)addr);
+ }
+ break;
+ }
+ /* Sync */
+ case BT_GATT_CLIENT_UNREGISTER: {
+ int client_id;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+ __bt_service_get_parameters(in_param1,
+ &client_id, sizeof(int));
+
+ result = _bt_unregister_gatt_client_instance(sender, client_id);
+ break;
+ }
+
+ /* Async: Remote Interaction */
+ case BT_GATT_ACQUIRE_WRITE: {
+
+ int fd = -1;
+ int mtu = -1;
+ bluetooth_gatt_client_char_prop_info_t param;
+
+ BT_INFO("GATT Client ACQUIRE WRITE recived");
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+
+ __bt_service_get_parameters(in_param1, ¶m,
+ sizeof(bluetooth_gatt_client_char_prop_info_t));
+
+
+ result = _bt_gatt_acquire_write(¶m , &fd, &mtu);
+
+ g_array_append_vals(*out_param1, &mtu, sizeof(int));
+
+ if (BLUETOOTH_ERROR_NONE == result)
+ BT_INFO("GATT Client: Save Invocation data for characteristic props app[%s] fd[ %d]", sender, fd);
+ else {
+ BT_ERR("Gatt Client Acqure Write");
+ break;
+ }
+
+ GUnixFDList *fd_list = NULL;
+ GError *error = NULL;
+
+ /* Add socket fd to unix_fd_list */
+ fd_list = g_unix_fd_list_new();
+ g_unix_fd_list_append(fd_list, fd, &error);
+ g_assert_no_error(error);
+
+ _bt_service_method_return_with_unix_fd_list(
+ context, *out_param1, result, fd_list);
+
+ close(fd);
+ g_object_unref(fd_list);
+
+ break;
+ }
+ /* Async: Remote Interaction */
+ case BT_CONNECT_LE: {
+ bluetooth_device_address_t address = { {0} };
+ gboolean auto_connect;
+ char *addr;
+ int client_id;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+
+ __bt_service_get_parameters(in_param1,
+ &address, sizeof(bluetooth_device_address_t));
+ __bt_service_get_parameters(in_param2,
+ &auto_connect, sizeof(gboolean));
+ __bt_service_get_parameters(in_param3,
+ &client_id, sizeof(int));
+
+ BT_INFO("GATT Client: client_id[%d]", client_id);
+ result = _bt_connect_le_device(&address, auto_connect, client_id);
+ if (BLUETOOTH_ERROR_NONE == result) {
+
+ addr = g_malloc0(BT_ADDRESS_STRING_SIZE);
+ BT_INFO("GATT Client: Save Invocation data Connect LE app[%s]", sender);
+
+ _bt_convert_addr_type_to_string(addr, address.addr);
+
+ /* Save the informations to invocation */
+ _bt_save_invocation_context(context, result, sender,
+ function_name, (gpointer)addr);
+ } else {
+ BT_INFO("GATT Client: gatt connect failed");
+ g_array_append_vals(*out_param1, &address,
+ sizeof(bluetooth_device_address_t));
+ }
+ break;
+ }
+ /* Async: Remote Interaction */
+ case BT_DISCONNECT_LE: {
+ bluetooth_device_address_t address = { {0} };
+ char *addr;
+ int client_id;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+
+ __bt_service_get_parameters(in_param1,
+ &address, sizeof(bluetooth_device_address_t));
+ __bt_service_get_parameters(in_param2,
+ &client_id, sizeof(int));
+
+ BT_INFO("GATT Disconnect using client Interface [%d]", client_id);
+ result = _bt_disconnect_le_device(&address, client_id);
+ if (BLUETOOTH_ERROR_NONE == result) {
+ addr = g_malloc0(BT_ADDRESS_STRING_SIZE);
+ BT_INFO("GATT Client: Save Invocation data DisConnect LE app[%s]", sender);
+
+ _bt_convert_addr_type_to_string(addr, address.addr);
+
+ /* Save the informations to invocation */
+ _bt_save_invocation_context(context, result, sender,
+ function_name, (gpointer)addr);
+ } else {
+ g_array_append_vals(*out_param1, &address,
+ sizeof(bluetooth_device_address_t));
+ }
+ break;
+ }
+ case BT_GATT_GET_PRIMARY_SERVICES: {
+ char *addr;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+ bluetooth_device_address_t address = { {0} };
+
+ __bt_service_get_parameters(in_param1, &address,
+ sizeof(bluetooth_device_address_t));
+
+ addr = g_malloc0(sizeof(char) * BT_ADDRESS_STRING_SIZE);
+ _bt_convert_addr_type_to_string(addr, address.addr);
+
+ result = _bt_gatt_get_primary_services(addr);
+ if (BLUETOOTH_ERROR_NONE == result) {
+ BT_INFO("GATT Client: Save Remote GATT Server address addr [%s] app[%s]",
+ addr, sender);
+ _bt_save_invocation_context(context, result, sender,
+ function_name, (gpointer)addr);
+ } else
+ g_free(addr);
+ break;
+ }
+ /* Local Async */
+ case BT_GATT_GET_SERVICE_PROPERTIES: {
+ bluetooth_gatt_client_svc_prop_info_t param;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+ memset(¶m, 0x00, sizeof(bluetooth_gatt_client_svc_prop_info_t));
+
+ __bt_service_get_parameters(in_param1, ¶m,
+ sizeof(bluetooth_gatt_client_svc_prop_info_t));
+
+ result = _bt_gatt_get_all_characteristic(¶m);
+ if (BLUETOOTH_ERROR_NONE == result) {
+ BT_INFO("GATT Client: Save Invocation data for Service props app[%s]", sender);
+
+ /* Save the informations to invocation */
+ _bt_save_invocation_context(context, result, sender,
+ function_name,
+ (gpointer)g_memdup(¶m, sizeof(bluetooth_gatt_client_svc_prop_info_t)));
+ }
+ break;
+ }
+ case BT_GATT_GET_CHARACTERISTIC_PROPERTIES: {
+ bluetooth_gatt_client_char_prop_info_t param;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+ memset(¶m, 0x00, sizeof(bluetooth_gatt_client_char_prop_info_t));
+
+ __bt_service_get_parameters(in_param1, ¶m,
+ sizeof(bluetooth_gatt_client_char_prop_info_t));
+
+ result = _bt_gatt_get_all_characteristic_properties(¶m);
+ if (BLUETOOTH_ERROR_NONE == result) {
+ BT_INFO("GATT Client: Save Invocation data for characteristic props app[%s]", sender);
+
+ /* Save the informations to invocation */
+ _bt_save_invocation_context(context, result, sender,
+ function_name,
+ (gpointer)g_memdup(¶m, sizeof(bluetooth_gatt_client_char_prop_info_t)));
+ }
+ break;
+ }
+ /* Async: Remote Interaction */
+ case BT_GATT_READ_CHARACTERISTIC: {
+ bluetooth_gatt_client_char_prop_info_t param;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+ memset(¶m, 0x00, sizeof(bluetooth_gatt_client_char_prop_info_t));
+
+ __bt_service_get_parameters(in_param1, ¶m,
+ sizeof(bluetooth_gatt_client_char_prop_info_t));
+
+ result = _bt_gatt_read_characteristic_value(¶m);
+ if (BLUETOOTH_ERROR_NONE == result) {
+ BT_INFO("GATT Client: Save Invocation data for characteristic props app[%s]", sender);
+
+ /* Save the informations to invocation */
+ _bt_save_invocation_context(context, result, sender,
+ function_name,
+ (gpointer)g_memdup(¶m, sizeof(bluetooth_gatt_client_char_prop_info_t)));
+ }
+ break;
+ }
+ /* Async: Remote Interaction */
+ case BT_GATT_READ_DESCRIPTOR_VALUE: {
+ bluetooth_gatt_client_desc_prop_info_t param;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+ memset(¶m, 0x00, sizeof(bluetooth_gatt_client_desc_prop_info_t));
+
+ __bt_service_get_parameters(in_param1, ¶m,
+ sizeof(bluetooth_gatt_client_desc_prop_info_t));
+
+ result = _bt_gatt_read_descriptor_value(¶m);
+ if (BLUETOOTH_ERROR_NONE == result) {
+ BT_INFO("GATT Client: Save Invocation data for Descriptor's props app[%s]", sender);
+
+ /* Save the informations to invocation */
+ _bt_save_invocation_context(context, result, sender,
+ function_name,
+ (gpointer)g_memdup(¶m, sizeof(bluetooth_gatt_client_desc_prop_info_t)));
+ }
+ break;
+ }
+ /* Async: Remote Interaction */
+ case BT_GATT_WRITE_CHARACTERISTIC_VALUE_BY_TYPE: {
+ bluetooth_gatt_client_char_prop_info_t param;
+ bluetooth_gatt_att_data_t data;
+ bluetooth_gatt_write_type_e write_type;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+
+ memset(&data, 0x00, sizeof(bluetooth_gatt_att_data_t));
+ memset(¶m, 0x00, sizeof(bluetooth_gatt_client_char_prop_info_t));
+
+ __bt_service_get_parameters(in_param1, ¶m,
+ sizeof(bluetooth_gatt_client_char_prop_info_t));
+ __bt_service_get_parameters(in_param2, &data,
+ sizeof(bluetooth_gatt_att_data_t));
+ __bt_service_get_parameters(in_param3, &write_type,
+ sizeof(bluetooth_gatt_write_type_e));
+
+ result = _bt_gatt_write_characteristic_value_by_type(¶m , &data, write_type);
+ if (BLUETOOTH_ERROR_NONE == result) {
+ BT_INFO("GATT Client: Save Invocation data for characteristic props app[%s]", sender);
+
+ /* Save the informations to invocation */
+ _bt_save_invocation_context(context, result, sender,
+ function_name,
+ (gpointer)g_memdup(¶m, sizeof(bluetooth_gatt_client_char_prop_info_t)));
+ }
+ break;
+ }
+ /* Async: Remote Interaction */
+ case BT_GATT_WRITE_DESCRIPTOR_VALUE: {
+ bluetooth_gatt_client_desc_prop_info_t param;
+ bluetooth_gatt_att_data_t data;
+ bluetooth_gatt_write_type_e write_type;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+ memset(&data, 0x00, sizeof(bluetooth_gatt_att_data_t));
+ memset(¶m, 0x00, sizeof(bluetooth_gatt_client_desc_prop_info_t));
+
+ __bt_service_get_parameters(in_param1, ¶m,
+ sizeof(bluetooth_gatt_client_desc_prop_info_t));
+ __bt_service_get_parameters(in_param2, &data,
+ sizeof(bluetooth_gatt_att_data_t));
+ __bt_service_get_parameters(in_param3, &write_type,
+ sizeof(bluetooth_gatt_write_type_e));
+
+ result = _bt_gatt_write_descriptor_value_by_type(¶m, &data, write_type);
+ if (BLUETOOTH_ERROR_NONE == result) {
+ BT_INFO("GATT Client: Save Invocation data for descriptor props app[%s]", sender);
+
+ /* Save the informations to invocation */
+ _bt_save_invocation_context(context, result, sender,
+ function_name,
+ (gpointer)g_memdup(¶m, sizeof(bluetooth_gatt_client_desc_prop_info_t)));
+ }
+ break;
+ }
+ /* Local Async */
+ case BT_GATT_WATCH_CHARACTERISTIC: {
+ bluetooth_gatt_client_char_prop_info_t param;
+ int client_id;
+ gboolean is_notify;
+ int fd = -1;
+ int mtu = 0;
+ gboolean is_indicate;
+
+
+ memset(¶m, 0x00, sizeof(bluetooth_gatt_client_char_prop_info_t));
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+
+ __bt_service_get_parameters(in_param1, ¶m,
+ sizeof(bluetooth_gatt_client_char_prop_info_t));
+ __bt_service_get_parameters(in_param2, &client_id,
+ sizeof(int));
+ __bt_service_get_parameters(in_param3, &is_notify,
+ sizeof(gboolean));
+ __bt_service_get_parameters(in_param4, &is_indicate,
+ sizeof(gboolean));
+
+#ifdef TIZEN_FEATURE_BT_GATT_CLIENT_FD_DISABLE
+ goto normal;
+#endif
+
+ if (is_indicate == false) {
+ result = _bt_gatt_acquire_notify(¶m , &fd, &mtu);
+ if (BLUETOOTH_ERROR_NONE == result && fd > -1) {
+ BT_INFO("GATT Client: Save Invocation data for characteristic props app[%s] fd[ %d]", sender, fd);
+
+ GUnixFDList *fd_list = NULL;
+ GError *error = NULL;
+
+ g_array_append_vals(*out_param1, &mtu, sizeof(int));
+ /* Add socket fd to unix_fd_list */
+ fd_list = g_unix_fd_list_new();
+ g_unix_fd_list_append(fd_list, fd, &error);
+ g_assert_no_error(error);
+ close(fd);
+ _bt_service_method_return_with_unix_fd_list(
+ context, *out_param1, result, fd_list);
+
+ g_object_unref(fd_list);
+ } else
+ goto normal;
+ } else {
+
+normal:
+ result = _bt_gatt_watch_characteristic(¶m , client_id, is_notify);
+ if (BLUETOOTH_ERROR_NONE == result) {
+ BT_INFO("GATT Client: Save Invocation data for characteristic props app[%s]", sender);
+
+ /* Save the informations to invocation */
+ _bt_save_invocation_context(context, result, sender, function_name,
+ (gpointer)g_memdup(¶m, sizeof(bluetooth_gatt_client_char_prop_info_t)));
+ }
+ }
+ break;
+ }
+ case BT_GATT_WATCH_SERVICE_CHANGED_INDICATION: {
+ gboolean is_enabled;
+ bluetooth_device_address_t address;
+
+ sender = (char*)g_dbus_method_invocation_get_sender(context);
+
+ __bt_service_get_parameters(in_param1,
+ &address, sizeof(bluetooth_device_address_t));
+ __bt_service_get_parameters(in_param2, &is_enabled,
+ sizeof(gboolean));
+ result = _bt_gatt_watch_service_changed_indication(sender, &address, is_enabled);
+ BT_INFO("Service changed indication from app [%s]", sender);
+
+ break;
+ }
+ case BT_LE_CONN_UPDATE: {
+ char *sender = NULL;
+ bluetooth_device_address_t local_address = { {0} };
+ bluetooth_le_connection_param_t parameters = {0};
+
+ sender = (char *)g_dbus_method_invocation_get_sender(context);
+
+ __bt_service_get_parameters(in_param1, &local_address,
+ sizeof(bluetooth_device_address_t));
+ __bt_service_get_parameters(in_param2, ¶meters,
+ sizeof(bluetooth_le_connection_param_t));
+
+ result = _bt_le_connection_update(sender,
+ local_address.addr,
+ parameters.interval_min,
+ parameters.interval_max,
+ parameters.latency,
+ parameters.timeout);
+ break;
+ }
+#endif
case BT_START_LE_DISCOVERY: {
sender = (char *)g_dbus_method_invocation_get_sender(context);
result = _bt_start_le_scan(sender);
break;
}
#endif
+ case BT_IS_ADVERTISING: {
+ gboolean advertising = FALSE;
+ advertising = _bt_is_advertising();
+ g_array_append_vals(*out_param1, &advertising,
+ sizeof(gboolean));
+ break;
+ }
+ case BT_IS_LE_2M_PHY_SUPPORTED: {
+ gboolean is_2m_phy_supported = FALSE;
+
+ is_2m_phy_supported = _bt_is_le_2m_phy_supported();
+ g_array_append_vals(*out_param1, &is_2m_phy_supported, sizeof(gboolean));
+ break;
+ }
+ case BT_IS_LE_CODED_PHY_SUPPORTED: {
+ gboolean is_coded_phy_supported = FALSE;
+
+ is_coded_phy_supported = _bt_is_le_coded_phy_supported();
+ g_array_append_vals(*out_param1, &is_coded_phy_supported, sizeof(gboolean));
+ break;
+ }
default:
BT_INFO("UnSupported function [%d]", function_name);
result = BLUETOOTH_ERROR_NOT_SUPPORT;
BT_DBG("BT_OPP_PUSH_FILES");
int i;
bluetooth_device_address_t address = { {0} };
- bt_file_path_t path;
+ bt_file_path_t *path;
char **file_path;
int file_count;
GArray *param2;
__bt_fill_garray_from_variant(in_param2, param2);
for (i = 0; i < file_count; i++) {
- path = g_array_index(param2, bt_file_path_t, i);
- file_path[i] = g_strdup(path.path);
+ path = &g_array_index(param2, bt_file_path_t, i);
+ file_path[i] = g_strdup(path->path);
}
BT_DBG("_bt_opp_client_push_files");
result = _bt_opp_client_push_files(request_id, context,
case BT_ENABLE_ADAPTER:
{
bt_status_t status;
-
+ set_adapter_request_state(TRUE);
status = _bt_adapter_get_status();
if (status == BT_ACTIVATING) {
result = BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED;
} else {
_bt_adapter_set_status(BT_ACTIVATING);
-
-#if TODO_40 /* Need to add this function */
- _bt_adapter_start_enable_timer();
-#endif
result = BLUETOOTH_ERROR_NONE;
}
case BT_DISABLE_ADAPTER:
{
bt_status_t status;
-
+ set_le_request_state(TRUE);
status = _bt_adapter_get_status();
if (status == BT_DEACTIVATING) {
BT_DBG("Disabling in progress");
result = BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED;
} else {
_bt_adapter_set_le_status(BT_LE_ACTIVATING);
-
-#if TODO_40 /* Need to add this function */
- _bt_adapter_start_le_enable_timer();
-#endif
result = BLUETOOTH_ERROR_NONE;
}
case BT_CANCEL_DISCOVERY:
case BT_OOB_ADD_REMOTE_DATA:
case BT_OOB_REMOVE_REMOTE_DATA:
+ case BT_OOB_READ_LOCAL_DATA:
case BT_SET_ADVERTISING:
case BT_SET_CUSTOM_ADVERTISING:
case BT_SET_ADVERTISING_PARAMETERS:
case BT_NETWORK_SERVER_DISCONNECT:
case BT_GATT_GET_PRIMARY_SERVICES:
+#ifdef TIZEN_GATT_CLIENT
+ case BT_GATT_GET_SERVICE_PROPERTIES: /* GATT Client */
+ case BT_GATT_GET_CHARACTERISTIC_PROPERTIES: /* GATT Client */
+ case BT_GATT_WATCH_SERVICE_CHANGED_INDICATION: /* GATT Client */
+#endif
case BT_GATT_DISCOVER_CHARACTERISTICS:
case BT_GATT_SET_PROPERTY_REQUEST:
case BT_GATT_READ_CHARACTERISTIC:
+#ifdef TIZEN_GATT_CLIENT
+ case BT_GATT_READ_DESCRIPTOR_VALUE: /* GATT Client */
+ case BT_GATT_WRITE_CHARACTERISTIC_VALUE_BY_TYPE: /* GATT Client */
+ case BT_GATT_ACQUIRE_WRITE:
+ case BT_GATT_WRITE_DESCRIPTOR_VALUE: /* GATT Client */
+ case BT_GATT_WATCH_CHARACTERISTIC: /* GATT Client */
+ case BT_GATT_CLIENT_REGISTER: /* GATT Client */
+ case BT_GATT_CLIENT_UNREGISTER: /* GATT Client */
+#endif
case BT_GATT_DISCOVER_CHARACTERISTICS_DESCRIPTOR:
case BT_GATT_REGISTER_APPLICATION:
case BT_GATT_REGISTER_SERVICE:
case BT_GATT_SERVER_STOP_SERVICE:
case BT_GATT_SERVER_DELETE_SERVICE:
case BT_GATT_SERVER_SEND_RESPONSE:
+ case BT_GATT_SERVER_ACQURE_WRITE_RESPONSE:
+ case BT_GATT_SERVER_ACQUIRE_NOTIFY_RESPONSE:
case BT_GATT_SERVER_SEND_INDICATION:
case BT_GATT_SERVER_UPDATE_VALUE:
case BT_GATT_SERVER_DEREGISTER:
#endif
+ case BT_REQ_ATT_MTU:
case BT_PBAP_CONNECT:
case BT_PBAP_DISCONNECT:
case BT_PBAP_GET_PHONEBOOK_SIZE:
case BT_PBAP_PULL_VCARD:
case BT_PBAP_PHONEBOOK_SEARCH:
+ case BT_RFCOMM_LISTEN_AND_ACCEPT:
+
ret_val = cynara_check(p_cynara, client_creds, client_session, user_creds,
BT_PRIVILEGE_PUBLIC);
case BT_AVRCP_CONTROL_GET_PROPERTY:
case BT_AVRCP_GET_TRACK_INFO:
case BT_AVRCP_TRANSPORT_SET_PROPERTY:
-
+ case BT_AVRCP_HANDLE_CONTROL_TO_DEST:
case BT_SET_CONTENT_PROTECT:
case BT_BOND_DEVICE_BY_TYPE:
case BT_SET_LE_STATIC_RANDOM_ADDRESS:
case BT_LE_CONN_UPDATE:
case BT_UPDATE_LE_CONNECTION_MODE:
- case BT_REQ_ATT_MTU:
case BT_GET_DEVICE_IDA:
case BT_LE_READ_MAXIMUM_DATA_LENGTH:
case BT_LE_WRITE_HOST_SUGGESTED_DATA_LENGTH:
case BT_LE_READ_HOST_SUGGESTED_DATA_LENGTH:
case BT_LE_SET_DATA_LENGTH:
- case BT_GET_ATT_MTU:
-
case BT_LE_IPSP_INIT:
case BT_LE_IPSP_DEINIT:
case BT_LE_IPSP_CONNECT:
case BT_GET_PROFILE_TRUSTED:
case BT_GET_SPEAKER_GAIN:
case BT_SET_SPEAKER_GAIN:
- case BT_OOB_READ_LOCAL_DATA:
case BT_RFCOMM_CLIENT_IS_CONNECTED:
case BT_RFCOMM_IS_UUID_AVAILABLE:
case BT_GET_ADVERTISING_DATA:
case BT_GET_SCAN_RESPONSE_DATA:
case BT_IS_ADVERTISING:
+ case BT_IS_LE_2M_PHY_SUPPORTED:
+ case BT_IS_LE_CODED_PHY_SUPPORTED:
case BT_REGISTER_SCAN_FILTER:
case BT_UNREGISTER_SCAN_FILTER:
case BT_UNREGISTER_ALL_SCAN_FILTERS:
case BT_IS_SCAN_FILTER_SUPPORTED:
+ case BT_GET_ATT_MTU:
case BT_OBEX_SERVER_ALLOCATE:
case BT_OBEX_SERVER_DEALLOCATE: