[PATCH] Add voicecall driver for Handsfree profile
by Zhang, Zhenhua
Hi,
The first patch is to handle right bracket in at command parser. It's
identical with the previous patch I sent in the list.
The second patch depends on the first one so I resend it again. It implements
voicecall driver for handsfree profile and use AT+CIEV indicator to notify call
status change. A field 'struct ofono_call *call' that point to the current call
is used to avoid searching call list each time. A boolean 'mpty_call' is to
indicate whether it is multi call or single call. The first version only
supports single call. The multicall patch will be based on this patch.
Please review it.
Regards,
Zhenhua
12 years, 7 months
[PATCH] Handle right bracket in g_at_result_iter_next_unquoted_string
by Zhang, Zhenhua
Allow g_at_result_iter_next_unquoted_string to handle the bracket when parsing
string like chld (1, 2). Original, it returns '1' and '2)'. Now it returns '1'
and '2'. g_at_result_iter_close_list handles the right bracket later.
---
gatchat/gatresult.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gatchat/gatresult.c b/gatchat/gatresult.c
index 1436ae3..3d07e13 100644
--- a/gatchat/gatresult.c
+++ b/gatchat/gatresult.c
@@ -131,12 +131,12 @@ gboolean g_at_result_iter_next_unquoted_string(GAtResultIter *iter,
goto out;
}
- if (line[pos] == '"')
+ if (line[pos] == '"' || line[pos] == ')')
return FALSE;
end = pos;
- while (end < len && line[end] != ',')
+ while (end < len && line[end] != ',' && line[end] != ')')
end += 1;
iter->buf[end] = '\0';
Regards,
Zhenhua
12 years, 7 months
[PATCH] When setting the serial port, the previous settings need to be preserved.
by Ryan Raasch
Hello,
This took a while to locate. Shouldn't it be possible to use stty
outside the daemon, and then daemon would just continue as usual?
In my case, the cread was being removed, so no input data could be read.
Thanks,
Ryan
Signed-off-by: Ryan M. Raasch <ryan.raasch(a)gmail.com>
---
gatchat/gattty.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
12 years, 7 months
Subject: RFC Migrate from RFC2822 to ISO8601 for time representations
by Olivier Le Thanh Duong
Hi,
the format used to represent time in ofono is currently RFC2822 which is
complex and a bit deprecated. I think it would be better to move to
ISO8601 which is a well used and supported [1] format and simpler to parse.
RFC2822 date example: Mon, 05 Oct 2009 19:31:32 +0200
ISO8601 date example: 2009-10-05T19:31:26+0200
The proposed patch makes this transition.
Any comments?
Regards,
Olivier
[1] for example Glib has a g_time_val_from_iso8601 which understand
timezone compared to strptime which doesn't support %z
From 16359eccfcb4a7a5444e6f87729008192edefc5e Mon Sep 17 00:00:00 2001
From: Olivier Le Thanh Duong <olivier.le.thanh(a)collabora.co.uk>
Date: Mon, 5 Oct 2009 19:10:25 +0200
Subject: [PATCH] Migrate from RFC2822 to ISO8601 for time representations
---
plugins/example_history.c | 6 +++---
src/sms.c | 4 ++--
src/voicecall.c | 2 +-
unit/test-sms.c | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/plugins/example_history.c b/plugins/example_history.c
index 384c88d..d923a8e 100644
--- a/plugins/example_history.c
+++ b/plugins/example_history.c
@@ -68,11 +68,11 @@ static void example_history_call_ended(struct
ofono_history_context *context,
else
ofono_debug("From: %s", from);
- strftime(buf, 127, "%a, %d %b %Y %H:%M:%S %z", localtime(&start));
+ strftime(buf, 127, "%Y-%m-%dT%H:%M:%S%z", localtime(&start));
buf[127] = '\0';
ofono_debug("StartTime: %s", buf);
- strftime(buf, 127, "%a, %d %b %Y %H:%M:%S %z", localtime(&end));
+ strftime(buf, 127, "%Y-%m-%dT%H:%M:%S%z", localtime(&end));
buf[127] = '\0';
ofono_debug("EndTime: %s", buf);
}
@@ -96,7 +96,7 @@ static void example_history_call_missed(struct
ofono_history_context *context,
from = phone_number_to_string(&call->phone_number);
ofono_debug("From: %s", from);
- strftime(buf, 127, "%a, %d %b %Y %H:%M:%S %z", localtime(&when));
+ strftime(buf, 127, "%Y-%m-%dT%H:%M:%S%z", localtime(&when));
buf[127] = '\0';
ofono_debug("When: %s", buf);
}
diff --git a/src/sms.c b/src/sms.c
index 141f288..e02ac85 100644
--- a/src/sms.c
+++ b/src/sms.c
@@ -467,11 +467,11 @@ static void dispatch_text_message(struct ofono_sms
*sms,
ts = sms_scts_to_time(scts, &remote);
- strftime(buf, 127, "%a, %d %b %Y %H:%M:%S %z", localtime(&ts));
+ strftime(buf, 127, "%Y-%m-%dT%H:%M:%S%z", localtime(&ts));
buf[127] = '\0';
ofono_dbus_dict_append(&dict, "LocalSentTime", DBUS_TYPE_STRING, &str);
- strftime(buf, 127, "%a, %d %b %Y %H:%M:%S %z", &remote);
+ strftime(buf, 127, "%Y-%m-%dT%H:%M:%S%z", &remote);
buf[127] = '\0';
ofono_dbus_dict_append(&dict, "SentTime", DBUS_TYPE_STRING, &str);
diff --git a/src/voicecall.c b/src/voicecall.c
index eff6321..3f70f9e 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -164,7 +164,7 @@ static const char *time_to_str(const time_t *t)
{
static char buf[128];
- strftime(buf, 127, "%a, %d %b %Y %H:%M:%S %z", localtime(t));
+ strftime(buf, 127, "%Y-%m-%dT%H:%M:%S%z", localtime(t));
buf[127] = '\0';
return buf;
diff --git a/unit/test-sms.c b/unit/test-sms.c
index ac4f1ff..9c1528c 100644
--- a/unit/test-sms.c
+++ b/unit/test-sms.c
@@ -59,12 +59,12 @@ static void print_scts(struct sms_scts *scts, const
char *prefix)
ts = sms_scts_to_time(scts, &remote);
- strftime(buf, 127, "%a, %d %b %Y %H:%M:%S %z", localtime(&ts));
+ strftime(buf, 127, "%Y-%m-%dT%H:%M:%S%z", localtime(&ts));
buf[127] = '\0';
g_print("local time: %s\n", buf);
- strftime(buf, 127, "%a, %d %b %Y %H:%M:%S %z", &remote);
+ strftime(buf, 127, "%Y-%m-%dT%H:%M:%S%z", &remote);
buf[127] = '\0';
g_print("remote time: %s\n", buf);
--
1.6.3.3
12 years, 7 months
[PATCH] SetProperty method and Powered property missing from modem-api doc.
by Marko Saukko
Hi,
SetProperty method and Powered Property where missing from modem-api.txt
Question:
I'm not sure if the "On success a PropertyChanged signal will be emitted."
message is valid, as the PropertyChanged signal is sent only once when doing
for example the following:
$ dbus-send --print-reply --system --dest=org.ofono /atgen0
org.ofono.Modem.SetProperty string:Powered variant:boolean:true
method return sender=:1.160 -> dest=:1.227 reply_serial=2
$ dbus-send --print-reply --system --dest=org.ofono /atgen0
org.ofono.Modem.SetProperty string:Powered variant:boolean:true
method return sender=:1.160 -> dest=:1.228 reply_serial=2
If I understood correctly the second method call is also successfull
eventhough no PropertyChanged signal is emitted.
Regards,
Marko
---
doc/modem-api.txt | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/doc/modem-api.txt b/doc/modem-api.txt
index 3058880..06a4ada 100644
--- a/doc/modem-api.txt
+++ b/doc/modem-api.txt
@@ -12,12 +12,27 @@ Methods dict GetProperties()
Possible Errors: [service].Error.InvalidArguments
+ void SetProperty(string property, variant value)
+
+ Changes the value of the specified property. Only
+ properties that are listed as read-write are
+ changeable. On success a PropertyChanged signal
+ will be emitted.
+
+ Possible Errors: [service].Error.InvalidArguments
+ [service].Error.DoesNotExist
+
Signals PropertyChanged(string name, variant value)
This signal indicates a changed value of the given
property.
-Properties string Manufacturer [readonly, optional]
+Properties boolean Powered [readwrite]
+
+ Boolean representing the power state of the modem
+ device.
+
+ string Manufacturer [readonly, optional]
String representing the manufacturer of the modem
device.
--
1.6.0.4
12 years, 7 months
Extend modem.conf
by Ryan Raasch
Hello,
I was wanting to extend the syntax of the modem.conf file. It is extra
work to maintain a different plugin file for each generic AT modem with
a different speed, serial settings.
I'm not sure on the best syntax for this. Maybe below could be a solution.
[generic]
Driver=atgen
Device=/dev/ttyS0:baud=115200:read=on:local:on
OR
[generic]
Driver=atgen
Device=/dev/ttyS0
DeviceOpts=baud=115200:read=on:local:on
Any opinions?
Also, shouldn't the "Driver" keyword in the file be named "Plugin"
instead? It may give a better indication where to read in the source.
Greetings,
Ryan
12 years, 7 months
[PATCH 1/1] Catch +CIEV commands from AG
by Gustavo F. Padovan
Add a callback to get status update from AG side. +CIEV commands send
updates such as roaming status, battery and signal level and call
status.
---
plugins/hfp.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/plugins/hfp.c b/plugins/hfp.c
index 9733cfc..211c874 100644
--- a/plugins/hfp.c
+++ b/plugins/hfp.c
@@ -104,6 +104,33 @@ error:
hfp_disable(modem);
}
+static void ciev_cb(GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct hfp_data *data = ofono_modem_get_data(modem);
+ GAtResultIter iter;
+ int index, value, i;
+
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "+CIEV:"))
+ goto error;
+
+ g_at_result_iter_next_number(&iter, &index);
+ g_at_result_iter_next_number(&iter, &value);
+
+ for (i = 0; i < HFP_INDICATOR_LAST; i++) {
+ if (index != data->cind_pos[i])
+ continue;
+
+ data->cind_val[i] = value;
+ }
+ return;
+
+error:
+ hfp_disable(modem);
+}
+
static void cmer_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_modem *modem = user_data;
@@ -116,6 +143,9 @@ static void cmer_cb(gboolean ok, GAtResult *result, gpointer user_data)
g_at_chat_send(data->chat, "AT+CIND?", cind_prefix,
cind_status_cb, modem, NULL);
+
+ g_at_chat_register(data->chat, "+CIEV:", ciev_cb, FALSE,
+ modem, NULL);
}
static void cind_cb(gboolean ok, GAtResult *result, gpointer user_data)
--
1.6.4.4
12 years, 7 months
How to talk with FreeRunner?
by Gu, Yang
Hi,
I just got a Openmoko FreeRunner and I wonder how oFono can talk with it. Use ser2net, but how? Can someone help on some simple steps or instructions? Thanks a lot!
By the way, the OS installed in it is Android Cupcake. Need I change to other OS?
Regards,
-Yang
12 years, 7 months
[PATCH] Handsfree profile plugins update
by Zhang, Zhenhua
Hi,
Attached is update patch for handsfree profile plugin. I move most stuff in
drivers/hfpmodem/hfp.c into plugins/hfp.c and simplify them. GSList *indies
is replaced as two indexable arrays (cind_names and cind_values), to improve
efficiency when we need access name and value by index. The whole logic is
the same comparing with previous patch.
Thanks for Denis and Gustavo for comments. Please review it.
Regards,
Zhenhua
12 years, 7 months
[PATCH] When setting the serial port, the previous settings need to be preserved.
by Ryan Raasch
When setting the serial terminal before starting the daemon, this will
prevent the overwriting of settings.
Ryan
---
gatchat/gattty.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gatchat/gattty.c b/gatchat/gattty.c
index 63d26d4..ed0fadf 100644
--- a/gatchat/gattty.c
+++ b/gatchat/gattty.c
@@ -220,6 +220,7 @@ static int open_device(const char *tty, GHashTable *options)
if (fd < 0)
return -1;
+ tcgetattr(fd,&ti);
tcflush(fd, TCIOFLUSH);
tcsetattr(fd, TCSANOW, &ti);
--
1.6.4.GIT
12 years, 7 months