Palm Pre modem plugin
by morphis@gravedo.de
Hey,
I saw you added some time ago support for the Palm Pre MSM Modem. I am
working
on the FSO (http://www.freesmartphone.org/) side to support this kind of
MSM
modem as well. I am are currently stucked with the binary protocol spoken
between modem and userland in webOS.
The Problem why we do this is the following: As I and some other people
find out,
there is no support on the data channel (the one you use in oFono to speak
plain AT with the modem) for unsolicited responses.
So the only option is to support the binary protocol to get minimally the
response from the modem when for example a call arrives.
So my question is: How do you want to manage this with your plugin for the
Palm Pre modem? Do you even plan to use the serial interface on the
/dev/modemuart port?
regards,
morphis
11 years, 2 months
GPRS support for Ofono
by Ismo Puustinen
Hello List,
I started working on Ofono GPRS support.
The patch set contains:
1) Documentation describing how an Ofono GPRS D-Bus API would look like.
2) Common Ofono GPRS support.
3) Ofono GPRS ISI driver.
4) Test script for trying out the GPRS functionality.
Note that the GPRS support is in no way completed -- many things are
still TODO or have rough edges. However, I thought that it would be a
good idea to send the patches to the mailing list to gather comments
and improvement suggestions before finalizing the work.
PS. A disclaimer: I'm a Nokia engineer, even though I'm sending this
email from my personal email account (due to incompatibilities with
Nokia email servers). If you need to contact me off-the-list, please
use the email address ismo.h.puustinen(a)nokia.com .
--
Ismo Puustinen <ismo(a)iki.fi>
11 years, 2 months
[PATCH] Added udev rules for Option GI0201 and Option GTM382 modems.
by Marko Saukko
---
plugins/ofono.rules | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/plugins/ofono.rules b/plugins/ofono.rules
index ca00673..3db0cf4 100644
--- a/plugins/ofono.rules
+++ b/plugins/ofono.rules
@@ -11,8 +11,10 @@ ATTRS{idVendor}=="12d1", ENV{OFONO_DRIVER}="huawei"
ATTRS{idVendor}=="1410", ENV{OFONO_DRIVER}="novatel"
# Option Globetrotter
+ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6911", ENV{OFONO_DRIVER}="hso"
ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6971", ENV{OFONO_DRIVER}="hso"
ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7401", ENV{OFONO_DRIVER}="hso"
+ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7601", ENV{OFONO_DRIVER}="hso"
# Ericsson F3507g
ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="1900", ENV{OFONO_DRIVER}="mbm"
--
1.6.3.3
11 years, 3 months
[PATCH 2/2] Fix: Move CHLD from voicecall driver to plugin
by Zhenhua Zhang
The second patch is to move CHLD=? from voicecall.c to plugin.
According HFP v1.5 spec, AT+CHLD=? should be a part of SLC
connection. So we should not do it after SLC connection is
created.
---
drivers/hfpmodem/hfpmodem.h | 9 ++++++
drivers/hfpmodem/voicecall.c | 55 +-----------------------------------
plugins/hfp.c | 64 +++++++++++++++++++++++++++++++++++++++--
3 files changed, 70 insertions(+), 58 deletions(-)
diff --git a/drivers/hfpmodem/hfpmodem.h b/drivers/hfpmodem/hfpmodem.h
index c0e4c7e..1935cb2 100644
--- a/drivers/hfpmodem/hfpmodem.h
+++ b/drivers/hfpmodem/hfpmodem.h
@@ -42,6 +42,14 @@
#define HF_FEATURE_ENHANCED_CALL_STATUS 0x20
#define HF_FEATURE_ENHANCED_CALL_CONTROL 0x40
+#define AG_CHLD_0 0x01
+#define AG_CHLD_1 0x02
+#define AG_CHLD_1x 0x04
+#define AG_CHLD_2 0x08
+#define AG_CHLD_2x 0x10
+#define AG_CHLD_3 0x20
+#define AG_CHLD_4 0x40
+
enum hfp_indicator {
HFP_INDICATOR_SERVICE = 0,
HFP_INDICATOR_CALL,
@@ -56,6 +64,7 @@ enum hfp_indicator {
struct hfp_data {
GAtChat *chat;
unsigned int ag_features;
+ unsigned int ag_mpty_features;
unsigned int hf_features;
unsigned char cind_pos[HFP_INDICATOR_LAST];
unsigned int cind_val[HFP_INDICATOR_LAST];
diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c
index 52cdfd7..2cd14b5 100644
--- a/drivers/hfpmodem/voicecall.c
+++ b/drivers/hfpmodem/voicecall.c
@@ -39,16 +39,7 @@
#include "hfpmodem.h"
-#define AG_CHLD_0 0x01
-#define AG_CHLD_1 0x02
-#define AG_CHLD_1x 0x04
-#define AG_CHLD_2 0x08
-#define AG_CHLD_2x 0x10
-#define AG_CHLD_3 0x20
-#define AG_CHLD_4 0x40
-
static const char *none_prefix[] = { NULL };
-static const char *chld_prefix[] = { "+CHLD:", NULL };
static const char *clcc_prefix[] = { "+CLCC:", NULL };
struct voicecall_data {
@@ -900,47 +891,6 @@ static void ciev_notify(GAtResult *result, gpointer user_data)
ciev_callheld_notify(vc, value);
}
-static void chld_cb(gboolean ok, GAtResult *result, gpointer user_data)
-{
- struct voicecall_data *vd = user_data;
- unsigned int ag_mpty_feature = 0;
- GAtResultIter iter;
- const char *str;
-
- if (!ok)
- return;
-
- g_at_result_iter_init(&iter, result);
-
- if (!g_at_result_iter_next(&iter, "+CHLD:"))
- return;
-
- if (!g_at_result_iter_open_list(&iter))
- return;
-
- while (g_at_result_iter_next_unquoted_string(&iter, &str)) {
- if (!strcmp(str, "0"))
- ag_mpty_feature |= AG_CHLD_0;
- else if (!strcmp(str, "1"))
- ag_mpty_feature |= AG_CHLD_1;
- else if (!strcmp(str, "1x"))
- ag_mpty_feature |= AG_CHLD_1x;
- else if (!strcmp(str, "2"))
- ag_mpty_feature |= AG_CHLD_2;
- else if (!strcmp(str, "2x"))
- ag_mpty_feature |= AG_CHLD_2x;
- else if (!strcmp(str, "3"))
- ag_mpty_feature |= AG_CHLD_3;
- else if (!strcmp(str, "4"))
- ag_mpty_feature |= AG_CHLD_4;
- }
-
- if (!g_at_result_iter_close_list(&iter))
- return;
-
- vd->ag_mpty_features = ag_mpty_feature;
-}
-
static void hfp_voicecall_initialized(gboolean ok, GAtResult *result,
gpointer user_data)
{
@@ -970,14 +920,11 @@ static int hfp_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
vd->chat = data->chat;
vd->ag_features = data->ag_features;
+ vd->ag_mpty_features = data->ag_mpty_features;
memcpy(vd->cind_pos, data->cind_pos, HFP_INDICATOR_LAST);
memcpy(vd->cind_val, data->cind_val, HFP_INDICATOR_LAST);
- if (vd->ag_features & AG_FEATURE_3WAY)
- g_at_chat_send(vd->chat, "AT+CHLD=?", chld_prefix,
- chld_cb, vd, NULL);
-
ofono_voicecall_set_data(vc, vd);
g_at_chat_send(vd->chat, "AT+CLIP=1", NULL, NULL, NULL, NULL);
diff --git a/plugins/hfp.c b/plugins/hfp.c
index 6e630e8..b56abdb 100644
--- a/plugins/hfp.c
+++ b/plugins/hfp.c
@@ -55,6 +55,7 @@
static const char *brsf_prefix[] = { "+BRSF:", NULL };
static const char *cind_prefix[] = { "+CIND:", NULL };
static const char *cmer_prefix[] = { "+CMER:", NULL };
+static const char *chld_prefix[] = { "+CHLD:", NULL };
static int hfp_disable(struct ofono_modem *modem);
@@ -63,6 +64,60 @@ static void hfp_debug(const char *str, void *user_data)
ofono_info("%s", str);
}
+static void sevice_level_conn_established(struct ofono_modem *modem)
+{
+ struct hfp_data *data = ofono_modem_get_data(modem);
+
+ ofono_info("Service level connection established");
+ ofono_modem_set_powered(modem, TRUE);
+
+ g_at_chat_send(data->chat, "AT+CMEE=1", NULL, NULL, NULL, NULL);
+}
+
+static void chld_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct hfp_data *data = ofono_modem_get_data(modem);
+ unsigned int ag_mpty_feature = 0;
+ GAtResultIter iter;
+ const char *str;
+
+ if (!ok)
+ return;
+
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "+CHLD:"))
+ return;
+
+ if (!g_at_result_iter_open_list(&iter))
+ return;
+
+ while (g_at_result_iter_next_unquoted_string(&iter, &str)) {
+ if (!strcmp(str, "0"))
+ ag_mpty_feature |= AG_CHLD_0;
+ else if (!strcmp(str, "1"))
+ ag_mpty_feature |= AG_CHLD_1;
+ else if (!strcmp(str, "1x"))
+ ag_mpty_feature |= AG_CHLD_1x;
+ else if (!strcmp(str, "2"))
+ ag_mpty_feature |= AG_CHLD_2;
+ else if (!strcmp(str, "2x"))
+ ag_mpty_feature |= AG_CHLD_2x;
+ else if (!strcmp(str, "3"))
+ ag_mpty_feature |= AG_CHLD_3;
+ else if (!strcmp(str, "4"))
+ ag_mpty_feature |= AG_CHLD_4;
+ }
+
+ if (!g_at_result_iter_close_list(&iter))
+ return;
+
+ data->ag_mpty_features = ag_mpty_feature;
+
+ sevice_level_conn_established(modem);
+}
+
static void cmer_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_modem *modem = user_data;
@@ -73,10 +128,11 @@ static void cmer_cb(gboolean ok, GAtResult *result, gpointer user_data)
return;
}
- ofono_info("Service level connection established");
- g_at_chat_send(data->chat, "AT+CMEE=1", NULL, NULL, NULL, NULL);
-
- ofono_modem_set_powered(modem, TRUE);
+ if (data->ag_features & AG_FEATURE_3WAY)
+ g_at_chat_send(data->chat, "AT+CHLD=?", chld_prefix,
+ chld_cb, modem, NULL);
+ else
+ sevice_level_conn_established(modem);
}
static void cind_status_cb(gboolean ok, GAtResult *result,
--
1.6.2.5
11 years, 3 months
[PATCH 1/2] Fix: Change order of CMER and CIND in SLC connection
by Zhenhua Zhang
These two patches fix AT command order issue during service level
connection to comply with HFP v1.5 spec.
The first patch is to change order from CIND=?, CMER, CIND? to
CIND=?, CIND?, CMER.
---
plugins/hfp.c | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/plugins/hfp.c b/plugins/hfp.c
index fc29ad9..6e630e8 100644
--- a/plugins/hfp.c
+++ b/plugins/hfp.c
@@ -63,6 +63,22 @@ static void hfp_debug(const char *str, void *user_data)
ofono_info("%s", str);
}
+static void cmer_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct hfp_data *data = ofono_modem_get_data(modem);
+
+ if (!ok) {
+ hfp_disable(modem);
+ return;
+ }
+
+ ofono_info("Service level connection established");
+ g_at_chat_send(data->chat, "AT+CMEE=1", NULL, NULL, NULL, NULL);
+
+ ofono_modem_set_powered(modem, TRUE);
+}
+
static void cind_status_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
@@ -95,30 +111,14 @@ static void cind_status_cb(gboolean ok, GAtResult *result,
index += 1;
}
- ofono_info("Service level connection established");
- g_at_chat_send(data->chat, "AT+CMEE=1", NULL, NULL, NULL, NULL);
-
- ofono_modem_set_powered(modem, TRUE);
+ g_at_chat_send(data->chat, "AT+CMER=3,0,0,1", cmer_prefix,
+ cmer_cb, modem, NULL);
return;
error:
hfp_disable(modem);
}
-static void cmer_cb(gboolean ok, GAtResult *result, gpointer user_data)
-{
- struct ofono_modem *modem = user_data;
- struct hfp_data *data = ofono_modem_get_data(modem);
-
- if (!ok) {
- hfp_disable(modem);
- return;
- }
-
- g_at_chat_send(data->chat, "AT+CIND?", cind_prefix,
- cind_status_cb, modem, NULL);
-}
-
static void cind_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_modem *modem = user_data;
@@ -171,8 +171,8 @@ static void cind_cb(gboolean ok, GAtResult *result, gpointer user_data)
index += 1;
}
- g_at_chat_send(data->chat, "AT+CMER=3,0,0,1", cmer_prefix,
- cmer_cb, modem, NULL);
+ g_at_chat_send(data->chat, "AT+CIND?", cind_prefix,
+ cind_status_cb, modem, NULL);
return;
error:
--
1.6.2.5
11 years, 3 months
[PATCH] Fix: Add check for register_auto method
by Zhenhua Zhang
Add check for register_auto method to avoid crash. HFP backend
does not provide implementation for register_auto.
---
src/network.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/network.c b/src/network.c
index 8f99490..24cb911 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1305,8 +1305,11 @@ static void init_registration_status(const struct ofono_error *error,
if (netreg->mode == NETWORK_REGISTRATION_MODE_AUTO &&
(status == NETWORK_REGISTRATION_STATUS_NOT_REGISTERED ||
status == NETWORK_REGISTRATION_STATUS_DENIED ||
- status == NETWORK_REGISTRATION_STATUS_UNKNOWN))
- netreg->driver->register_auto(netreg, init_register, netreg);
+ status == NETWORK_REGISTRATION_STATUS_UNKNOWN)) {
+ if (netreg->driver->register_auto)
+ netreg->driver->register_auto(netreg, init_register,
+ netreg);
+ }
}
void ofono_netreg_strength_notify(struct ofono_netreg *netreg, int strength)
--
1.6.2.5
11 years, 3 months
Patch on unsupported AT command
by Gu, Yang
Hi all,
If some unsupported AT command is issued, different modem may have their own response. Now at my hand is a Huawei modem (EM770W), and it returns "COMMAND NOT SUPPORT". In my case, this modem doesn't support "AT+CGAUTO=0" in atmodem/gprs.c. Current oFono will hang there for it's not a valid return.
We may have some quirk to handle this problem, the same way as current code in network-registration.c with CALYPSO. But I wonder if it's better to add the response string into "terminator table", so that we don't need this kind of quirk here and there. I'm not sure if this is the better/best way to handle this problem. After all, the table may become larger and larger is more and more specific terminator like this are added.
Comments are welcome!
Regards,
-Yang
11 years, 3 months
[PATCH] Added test script to enter pin to sim card.
by Ryan M. Raasch
---
test/enter-pin.py | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
create mode 100755 test/enter-pin.py
diff --git a/test/enter-pin.py b/test/enter-pin.py
new file mode 100755
index 0000000..77de93a
--- /dev/null
+++ b/test/enter-pin.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+import dbus
+import sys
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+
+properties = manager.GetProperties()
+
+path = properties["Modems"][0]
+
+if len(path)==0:
+ print "No modems found"
+ exit
+
+modem = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.SimManager')
+properties = modem.GetProperties()
+if properties.has_key('PinRequired') and properties['PinRequired'] == sys.argv[1] :
+ modem.EnterPin(sys.argv[1], sys.argv[2])
+elif properties.has_key('PinRequired') and properties['PinRequired'] == 'none' :
+ print "Pin not needed"
+elif properties.has_key('PinRequired'):
+ print "Error: Pin type not supported (%s != %s)" % (sys.argv[1],properties['PinRequired'])
+
+
--
1.6.4.GIT
11 years, 3 months
First release with GPRS support
by Marcel Holtmann
Hello everyone,
I just tagged, pushed and uploaded 0.11 release of oFono. Besides the
usual bug fixes in various areas, this comes now with GPRS support. If
you happen to have a Ericsson MBM or Option HSO based modem, then you
under lucky ones who can try GPRS support.
To configure your Primary GPRS Context, you can use the create-context
script from within the test directory:
create-context <apn>
You just have to give it the APN from your GPRS network settings. And
then list-contexts will show you the configured context. A context needs
to only configured once by SIM card. It will be stored on a per SIM card
basis and restored after restart.
To activate or deactivate the actual connect, activate-context and/or
deactivate-context can be used. On success just call list-contexts again
and you will see your IP settings.
The integration of oFono GPRS support for ConnMan is work in progress
and we hope to finish that pretty soon. So the next ConnMan release
should be able to talk to oFono for data connections.
Regards
Marcel
11 years, 3 months