X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bt-service-adaptation%2Fservices%2Fbt-request-handler.c;h=d1d12035036b559696505b3e28c0e3f4bb9670b1;hb=39ba85ec55b2de81bb872bacb035f6731e56086e;hp=47175a5a12336df4f776ff20067f2941d4eec407;hpb=c02dabaa9103704294aa02047a3410a3d9690e2f;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git diff --git a/bt-service-adaptation/services/bt-request-handler.c b/bt-service-adaptation/services/bt-request-handler.c index 47175a5..d1d1203 100644 --- a/bt-service-adaptation/services/bt-request-handler.c +++ b/bt-service-adaptation/services/bt-request-handler.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "bluetooth-api.h" #include "bluetooth-audio-api.h" @@ -193,9 +194,7 @@ static void __bt_service_get_parameters(GVariant *in_param, static gboolean __bt_is_sync_function(int service_function) { /*TODO: Keep adding sync methods with expect replies from bluetooth service */ - if (service_function == BT_ENABLE_ADAPTER - || service_function == BT_DISABLE_ADAPTER - || service_function == BT_GET_LOCAL_ADDRESS + if (service_function == BT_GET_LOCAL_ADDRESS || service_function == BT_GET_LOCAL_NAME || service_function == BT_GET_LOCAL_VERSION || service_function == BT_GET_BONDED_DEVICES @@ -441,24 +440,10 @@ int __bt_bluez_request(int function_name, switch (function_name) { case BT_ENABLE_ADAPTER: { result = _bt_enable_adapter(); - /* Save invocation */ - if (result == BLUETOOTH_ERROR_NONE) { - BT_DBG("_bt_enable_adapter scheduled successfully! save invocation context"); - sender = (char*)g_dbus_method_invocation_get_sender(context); - _bt_save_invocation_context(context, result, sender, - function_name, NULL); - } break; } case BT_DISABLE_ADAPTER: { result = _bt_disable_adapter(); - /* Save invocation */ - if (result == BLUETOOTH_ERROR_NONE) { - BT_DBG("_bt_disable_adapter scheduled successfully! save invocation context"); - sender = (char*)g_dbus_method_invocation_get_sender(context); - _bt_save_invocation_context(context, result, sender, - function_name, NULL); - } break; } case BT_RECOVER_ADAPTER: @@ -900,6 +885,31 @@ int __bt_bluez_request(int function_name, result = _bt_set_white_list(&address, address_type, is_add); break; } + case BT_UPDATE_LE_CONNECTION_MODE: { + char *sender = NULL; + bluetooth_device_address_t remote_address = { { 0 } }; + bluetooth_le_connection_param_t parameters = { 0 }; + bluetooth_le_connection_mode_t mode = BLUETOOTH_LE_CONNECTION_MODE_BALANCED; + + __bt_service_get_parameters(in_param1, &remote_address, + sizeof(bluetooth_device_address_t)); + __bt_service_get_parameters(in_param2, &mode, + sizeof(bluetooth_le_connection_mode_t)); + + result = _bt_get_le_connection_parameter(mode, ¶meters); + if (result != BLUETOOTH_ERROR_NONE) + break; + + sender = (char *)g_dbus_method_invocation_get_sender(context); + + result = _bt_le_connection_update(sender, + remote_address.addr, + parameters.interval_min, + parameters.interval_max, + parameters.latency, + parameters.timeout); + break; + } case BT_SET_MANUFACTURER_DATA: { bluetooth_manufacturer_data_t m_data = { 0 }; __bt_service_get_parameters(in_param1, @@ -4300,6 +4310,8 @@ fail: void _bt_service_unregister(void) { if (bt_service_conn) { + sd_notify(0, "STOPPING=1"); + if (owner_sig_id > 0) { g_dbus_connection_signal_unsubscribe( bt_service_conn, owner_sig_id);