} bt_telephony_info_t;
-char *src_addr = NULL;
-guint owner_id = 0;
+static char *src_addr = NULL;
+static guint owner_id = 0;
#define BLUETOOTH_TELEPHONY_ERROR (__bluetooth_telephony_error_quark())
{
BT_DBG("+");
- if (strcasecmp(interface_name, HFP_AGENT_SERVICE) == 0) {
- if (strcasecmp(signal_name, HFP_NREC_STATUS_CHANGE) == 0)
- __bluetooth_handle_nrec_status_change(parameters);
- else if (strcasecmp(signal_name, HFP_ANSWER_CALL) == 0)
- __bluetooth_telephony_answer_call(parameters);
- else if (strcasecmp(signal_name, HFP_REJECT_CALL) == 0)
- __bluetooth_telephony_reject_call(parameters);
- else if (strcasecmp(signal_name, HFP_RELEASE_CALL) == 0)
- __bluetooth_telephony_release_call(parameters);
- else if (strcasecmp(signal_name, HFP_THREEWAY_CALL) == 0)
- __bluetooth_telephony_threeway_call(parameters);
- } else if (strcasecmp(interface_name, BLUEZ_HEADSET_INTERFACE) == 0) {
+ if (strcasecmp(interface_name, BLUEZ_HEADSET_INTERFACE) == 0) {
if (strcasecmp(signal_name, "PropertyChanged") == 0) {
GVariant *values;
gchar *property;
}
g_variant_unref(values);
- }
+ } else if (strcasecmp(signal_name, HFP_NREC_STATUS_CHANGE) == 0)
+ __bluetooth_handle_nrec_status_change(parameters);
+ else if (strcasecmp(signal_name, HFP_ANSWER_CALL) == 0)
+ __bluetooth_telephony_answer_call(parameters);
+ else if (strcasecmp(signal_name, HFP_REJECT_CALL) == 0)
+ __bluetooth_telephony_reject_call(parameters);
+ else if (strcasecmp(signal_name, HFP_RELEASE_CALL) == 0)
+ __bluetooth_telephony_release_call(parameters);
+ else if (strcasecmp(signal_name, HFP_THREEWAY_CALL) == 0)
+ __bluetooth_telephony_threeway_call(parameters);
}
BT_DBG("-");
}
return BLUETOOTH_TELEPHONY_ERROR_INVALID_PARAM;
path = g_strdup(telephony_info.call_path);
- BT_DBG("path is [%s]", path);
bt_tel_id = g_dbus_connection_register_object(telephony_dbus_info.conn,
path, node_info->interfaces[0],
gchar *name;
name = g_strdup_printf("org.tizen.csd.Call.Instance.p%d", getpid());
- BT_DBG("well-known name: %s", name);
owner_id = g_bus_own_name_on_connection(telephony_dbus_info.conn,
name, G_BUS_NAME_OWNER_FLAGS_NONE, NULL, NULL, NULL, NULL);
- BT_DBG("owner_id: %d", owner_id);
+ BT_DBG("well-known name: %s, owner_id: %d", name, owner_id);
g_free(name);
node_info = __bt_telephony_create_method_node_info(
if (conn == NULL)
return -1;
- static guint subscribe_event1_id = 0;
- static guint subscribe_event2_id = 0;
- static guint subscribe_event3_id = 0;
- static guint subscribe_event4_id = 0;
- static guint subscribe_event5_id = 0;
- static guint subscribe_event6_id = 0;
+ static guint event_id = 0;
if (subscribe == TRUE) {
- if (subscribe_event1_id == 0) {
- subscribe_event1_id = g_dbus_connection_signal_subscribe(conn,
+ if (event_id == 0) {
+ event_id = g_dbus_connection_signal_subscribe(conn,
NULL, BLUEZ_HEADSET_INTERFACE,
- "PropertyChanged", NULL, NULL, 0,
- __bluetooth_telephony_event_filter,
- NULL, NULL);
- }
- if (subscribe_event2_id == 0) {
- subscribe_event2_id = g_dbus_connection_signal_subscribe(conn,
- NULL, HFP_AGENT_SERVICE,
- HFP_NREC_STATUS_CHANGE, NULL, NULL, 0,
- __bluetooth_telephony_event_filter,
- NULL, NULL);
- }
-
- if (subscribe_event3_id == 0) {
- subscribe_event3_id = g_dbus_connection_signal_subscribe(conn,
- NULL, HFP_AGENT_SERVICE,
- HFP_ANSWER_CALL, NULL, NULL, 0,
- __bluetooth_telephony_event_filter,
- NULL, NULL);
- }
- if (subscribe_event4_id == 0) {
- subscribe_event4_id = g_dbus_connection_signal_subscribe(conn,
- NULL, HFP_AGENT_SERVICE,
- HFP_REJECT_CALL, NULL, NULL, 0,
- __bluetooth_telephony_event_filter,
- NULL, NULL);
- }
- if (subscribe_event5_id == 0) {
- subscribe_event5_id = g_dbus_connection_signal_subscribe(conn,
- NULL, HFP_AGENT_SERVICE,
- HFP_RELEASE_CALL, NULL, NULL, 0,
- __bluetooth_telephony_event_filter,
- NULL, NULL);
- }
- if (subscribe_event6_id == 0) {
- subscribe_event6_id = g_dbus_connection_signal_subscribe(conn,
- NULL, HFP_AGENT_SERVICE,
- HFP_THREEWAY_CALL, NULL, NULL, 0,
+ NULL, NULL, NULL, 0,
__bluetooth_telephony_event_filter,
NULL, NULL);
}
-
return BLUETOOTH_TELEPHONY_ERROR_NONE;
} else {
- if (subscribe_event1_id > 0) {
- g_dbus_connection_signal_unsubscribe(conn,
- subscribe_event1_id);
- subscribe_event1_id = 0;
- }
- if (subscribe_event2_id > 0) {
- g_dbus_connection_signal_unsubscribe(conn,
- subscribe_event2_id);
- subscribe_event2_id = 0;
- }
- if (subscribe_event3_id > 0) {
- g_dbus_connection_signal_unsubscribe(conn,
- subscribe_event3_id);
- subscribe_event3_id = 0;
- }
- if (subscribe_event4_id > 0) {
- g_dbus_connection_signal_unsubscribe(conn,
- subscribe_event4_id);
- subscribe_event4_id = 0;
- }
- if (subscribe_event5_id > 0) {
- g_dbus_connection_signal_unsubscribe(conn,
- subscribe_event5_id);
- subscribe_event5_id = 0;
- }
- if (subscribe_event6_id > 0) {
+ if (event_id > 0) {
g_dbus_connection_signal_unsubscribe(conn,
- subscribe_event6_id);
- subscribe_event6_id = 0;
+ event_id);
+ event_id = 0;
}
return BLUETOOTH_TELEPHONY_ERROR_NONE;
}
return;
}
- BT_INFO("Adapter Path = [%s]", path);
if (strcasecmp(path, DEFAULT_ADAPTER_OBJECT_PATH) == 0) {
if (__bt_telephony_get_src_addr(optional_param))
BT_ERR("Fail to get the local adapter address");