* [PATCH] drivers: Add data strength notification support
@ 2011-12-06 9:33 Guillaume Zajac
2011-12-07 15:56 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Guillaume Zajac @ 2011-12-06 9:33 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1463 bytes --]
---
drivers/huaweicdmamodem/network-registration.c | 28 ++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/drivers/huaweicdmamodem/network-registration.c b/drivers/huaweicdmamodem/network-registration.c
index 25c6291..fc054d5 100644
--- a/drivers/huaweicdmamodem/network-registration.c
+++ b/drivers/huaweicdmamodem/network-registration.c
@@ -141,6 +141,31 @@ error:
ofono_error("Invalid RSSILVL value");
}
+static void hrssilvl_notify(GAtResult *result, gpointer user_data)
+{
+ struct ofono_cdma_netreg *netreg = user_data;
+ int strength;
+ GAtResultIter iter;
+
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "^HRSSILVL:"))
+ goto error;
+
+ if (!g_at_result_iter_next_number(&iter, &strength))
+ goto error;
+
+ if (strength == 99)
+ strength = 100;
+
+ ofono_cdma_netreg_data_strength_notify(netreg, strength);
+
+ return;
+
+error:
+ ofono_error("Invalid HRSSILVL value");
+}
+
static void probe_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_cdma_netreg *netreg = user_data;
@@ -157,6 +182,9 @@ static void probe_cb(gboolean ok, GAtResult *result, gpointer user_data)
g_at_chat_register(chat, "^RSSILVL:",
rssilvl_notify, FALSE, netreg, NULL);
+ g_at_chat_register(chat, "^HRSSILVL:",
+ hrssilvl_notify, FALSE, netreg, NULL);
+
ofono_cdma_netreg_register(netreg);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers: Add data strength notification support
2011-12-06 9:33 [PATCH] drivers: Add data strength notification support Guillaume Zajac
@ 2011-12-07 15:56 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2011-12-07 15:56 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]
Hi Guillaume,
On 12/06/2011 03:33 AM, Guillaume Zajac wrote:
> ---
> drivers/huaweicdmamodem/network-registration.c | 28 ++++++++++++++++++++++++
> 1 files changed, 28 insertions(+), 0 deletions(-)
>
Patch has been applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-07 15:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-06 9:33 [PATCH] drivers: Add data strength notification support Guillaume Zajac
2011-12-07 15:56 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.