* [PATCH 1/3] Fix not stopping name resolving when discovery is suspended
@ 2011-02-14 10:21 Luiz Augusto von Dentz
2011-02-14 10:21 ` [PATCH 2/3] Fix not resetting indicators whenever the driver is initialized Luiz Augusto von Dentz
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2011-02-14 10:21 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
During device creation if discovery is active we suspend it to avoid
interfering with pairing, but although it attempt to cancel name request
there could be one already completed which would cause next name on the
list to be requested.
---
src/adapter.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index 3e609c1..fd4b685 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -268,6 +268,10 @@ int adapter_resolve_names(struct btd_adapter *adapter)
struct remote_dev_info *dev, match;
int err;
+ /* Do not attempt to resolve more names if on suspended state */
+ if (adapter->state & STATE_SUSPENDED)
+ return 0;
+
memset(&match, 0, sizeof(struct remote_dev_info));
bacpy(&match.bdaddr, BDADDR_ANY);
match.name_status = NAME_REQUIRED;
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] Fix not resetting indicators whenever the driver is initialized
2011-02-14 10:21 [PATCH 1/3] Fix not stopping name resolving when discovery is suspended Luiz Augusto von Dentz
@ 2011-02-14 10:21 ` Luiz Augusto von Dentz
2011-02-14 10:26 ` Luiz Augusto von Dentz
2011-02-14 10:21 ` [PATCH 3/3] Fix not updating call indicator when parsing call info reply Luiz Augusto von Dentz
2011-02-15 14:14 ` [PATCH 1/3] Fix not stopping name resolving when discovery is suspended Johan Hedberg
2 siblings, 1 reply; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2011-02-14 10:21 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
This may cause invalid values to be reported since the status of call can
change during the time adaptor was off.
---
audio/telephony-maemo6.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
index 0c99c34..0ab1a77 100644
--- a/audio/telephony-maemo6.c
+++ b/audio/telephony-maemo6.c
@@ -1981,6 +1981,15 @@ int telephony_init(void)
DBG("telephony-maemo6 registering %s interface on path %s",
TELEPHONY_MAEMO_INTERFACE, TELEPHONY_MAEMO_PATH);
+ /* Reset indicators */
+ telephony_update_indicator(maemo_indicators, "battchg", 5);
+ telephony_update_indicator(maemo_indicators, "signal", 0);
+ telephony_update_indicator(maemo_indicators, "service", 0);
+ telephony_update_indicator(maemo_indicators, "call", 0);
+ telephony_update_indicator(maemo_indicators, "callsetup", 0);
+ telephony_update_indicator(maemo_indicators, "callhelp", 0);
+ telephony_update_indicator(maemo_indicators, "roam", 0);
+
telephony_ready_ind(features, maemo_indicators, BTRH_NOT_SUPPORTED,
chld_str);
if (send_method_call("org.freedesktop.Hal",
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] Fix not updating call indicator when parsing call info reply
2011-02-14 10:21 [PATCH 1/3] Fix not stopping name resolving when discovery is suspended Luiz Augusto von Dentz
2011-02-14 10:21 ` [PATCH 2/3] Fix not resetting indicators whenever the driver is initialized Luiz Augusto von Dentz
@ 2011-02-14 10:21 ` Luiz Augusto von Dentz
2011-02-15 14:14 ` [PATCH 1/3] Fix not stopping name resolving when discovery is suspended Johan Hedberg
2 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2011-02-14 10:21 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
This can happen if there is a call with a status different than idle when
adaptor is turned on the call indicators weren't updated.
---
audio/telephony-maemo6.c | 63 ++++++++++++++++++++++++++-------------------
1 files changed, 36 insertions(+), 27 deletions(-)
diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
index 0ab1a77..0ba21b8 100644
--- a/audio/telephony-maemo6.c
+++ b/audio/telephony-maemo6.c
@@ -973,35 +973,13 @@ static void handle_create_requested(DBusMessage *msg)
EV_CALLSETUP_OUTGOING);
}
-static void handle_call_status(DBusMessage *msg, const char *call_path)
+static void call_set_status(struct csd_call *call, dbus_uint32_t status)
{
- struct csd_call *call;
- dbus_uint32_t status, cause_type, cause, prev_status;
+ dbus_uint32_t prev_status;
int callheld = telephony_get_indicator(maemo_indicators, "callheld");
- if (!dbus_message_get_args(msg, NULL,
- DBUS_TYPE_UINT32, &status,
- DBUS_TYPE_UINT32, &cause_type,
- DBUS_TYPE_UINT32, &cause,
- DBUS_TYPE_INVALID)) {
- error("Unexpected paramters in Instance.CallStatus() signal");
- return;
- }
-
- call = find_call(call_path);
- if (!call) {
- error("Didn't find any matching call object for %s",
- call_path);
- return;
- }
-
- if (status > 16) {
- error("Invalid call status %u", status);
- return;
- }
-
prev_status = call->status;
- DBG("Call %s changed from %s to %s", call_path,
+ DBG("Call %s changed from %s to %s", call->object_path,
call_status_str[prev_status], call_status_str[status]);
if (prev_status == status) {
@@ -1132,6 +1110,35 @@ static void handle_call_status(DBusMessage *msg, const char *call_path)
}
}
+static void handle_call_status(DBusMessage *msg, const char *call_path)
+{
+ struct csd_call *call;
+ dbus_uint32_t status, cause_type, cause;
+
+ if (!dbus_message_get_args(msg, NULL,
+ DBUS_TYPE_UINT32, &status,
+ DBUS_TYPE_UINT32, &cause_type,
+ DBUS_TYPE_UINT32, &cause,
+ DBUS_TYPE_INVALID)) {
+ error("Unexpected paramters in Instance.CallStatus() signal");
+ return;
+ }
+
+ call = find_call(call_path);
+ if (!call) {
+ error("Didn't find any matching call object for %s",
+ call_path);
+ return;
+ }
+
+ if (status > 16) {
+ error("Invalid call status %u", status);
+ return;
+ }
+
+ call_set_status(call, status);
+}
+
static void handle_conference(DBusMessage *msg, gboolean joined)
{
const char *path;
@@ -1470,13 +1477,12 @@ static void parse_call_list(DBusMessageIter *iter)
if (!call) {
call = g_new0(struct csd_call, 1);
call->object_path = g_strdup(object_path);
- call->status = (int) status;
calls = g_slist_append(calls, call);
DBG("telephony-maemo6: new csd call instance at %s",
object_path);
}
- if (call->status == CSD_CALL_STATUS_IDLE)
+ if (status == CSD_CALL_STATUS_IDLE)
continue;
/* CSD gives incorrect call_hold property sometimes */
@@ -1493,6 +1499,9 @@ static void parse_call_list(DBusMessageIter *iter)
g_free(call->number);
call->number = g_strdup(number);
+ /* Update indicators */
+ call_set_status(call, status);
+
} while (dbus_message_iter_next(iter));
}
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/3] Fix not resetting indicators whenever the driver is initialized
2011-02-14 10:21 ` [PATCH 2/3] Fix not resetting indicators whenever the driver is initialized Luiz Augusto von Dentz
@ 2011-02-14 10:26 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2011-02-14 10:26 UTC (permalink / raw)
To: linux-bluetooth
Hi,
On Mon, Feb 14, 2011 at 12:21 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
>
> This may cause invalid values to be reported since the status of call can
> change during the time adaptor was off.
> ---
> audio/telephony-maemo6.c | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
> index 0c99c34..0ab1a77 100644
> --- a/audio/telephony-maemo6.c
> +++ b/audio/telephony-maemo6.c
> @@ -1981,6 +1981,15 @@ int telephony_init(void)
> DBG("telephony-maemo6 registering %s interface on path %s",
> TELEPHONY_MAEMO_INTERFACE, TELEPHONY_MAEMO_PATH);
>
> + /* Reset indicators */
> + telephony_update_indicator(maemo_indicators, "battchg", 5);
> + telephony_update_indicator(maemo_indicators, "signal", 0);
> + telephony_update_indicator(maemo_indicators, "service", 0);
> + telephony_update_indicator(maemo_indicators, "call", 0);
> + telephony_update_indicator(maemo_indicators, "callsetup", 0);
> + telephony_update_indicator(maemo_indicators, "callhelp", 0);
> + telephony_update_indicator(maemo_indicators, "roam", 0);
> +
> telephony_ready_ind(features, maemo_indicators, BTRH_NOT_SUPPORTED,
> chld_str);
> if (send_method_call("org.freedesktop.Hal",
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Please ignore this, it is probably better to just reset the fields
directly and not call telephony_update_indicator.
--
Luiz Augusto von Dentz
Computer Engineer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] Fix not stopping name resolving when discovery is suspended
2011-02-14 10:21 [PATCH 1/3] Fix not stopping name resolving when discovery is suspended Luiz Augusto von Dentz
2011-02-14 10:21 ` [PATCH 2/3] Fix not resetting indicators whenever the driver is initialized Luiz Augusto von Dentz
2011-02-14 10:21 ` [PATCH 3/3] Fix not updating call indicator when parsing call info reply Luiz Augusto von Dentz
@ 2011-02-15 14:14 ` Johan Hedberg
2 siblings, 0 replies; 5+ messages in thread
From: Johan Hedberg @ 2011-02-15 14:14 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hi Luiz,
On Mon, Feb 14, 2011, Luiz Augusto von Dentz wrote:
> During device creation if discovery is active we suspend it to avoid
> interfering with pairing, but although it attempt to cancel name request
> there could be one already completed which would cause next name on the
> list to be requested.
> ---
> src/adapter.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
All three patches (v2 of 2/3) have been pushed upstream. Thanks.
Johan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-02-15 14:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-14 10:21 [PATCH 1/3] Fix not stopping name resolving when discovery is suspended Luiz Augusto von Dentz
2011-02-14 10:21 ` [PATCH 2/3] Fix not resetting indicators whenever the driver is initialized Luiz Augusto von Dentz
2011-02-14 10:26 ` Luiz Augusto von Dentz
2011-02-14 10:21 ` [PATCH 3/3] Fix not updating call indicator when parsing call info reply Luiz Augusto von Dentz
2011-02-15 14:14 ` [PATCH 1/3] Fix not stopping name resolving when discovery is suspended Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox