summaryrefslogtreecommitdiffstats
path: root/drivers/atmodem/call-forwarding.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-05-21 16:17:20 -0500
committerDenis Kenzior <denkenz@gmail.com>2009-05-21 17:05:27 -0500
commit6fb0d8dbfef6ff9e76d5dda990e52a2beb1fef0e (patch)
tree5f2ef450476382226ca2d782bd50c582b8571283 /drivers/atmodem/call-forwarding.c
parent8b49de31cf730336379ca0fbc617ef978450b28f (diff)
downloadofono-6fb0d8dbfef6ff9e76d5dda990e52a2beb1fef0e.tar.bz2
Make the Call Forwarding atmodem driver work
Diffstat (limited to 'drivers/atmodem/call-forwarding.c')
-rw-r--r--drivers/atmodem/call-forwarding.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/atmodem/call-forwarding.c b/drivers/atmodem/call-forwarding.c
index edc7023b..cddda569 100644
--- a/drivers/atmodem/call-forwarding.c
+++ b/drivers/atmodem/call-forwarding.c
@@ -188,8 +188,13 @@ static void at_ccfc_erasure(struct ofono_modem *modem, int type, int cls,
ofono_generic_cb_t cb, void *data)
{
char buf[128];
+ int len;
+
+ len = sprintf(buf, "AT+CCFC=%d,4", type);
+
+ if (cls != 7)
+ sprintf(buf + len, ",,,%d", cls);
- sprintf(buf, "AT+CCFC=%d,4,,,%d", type, cls);
at_ccfc_set(modem, buf, cb, data);
}
@@ -197,8 +202,13 @@ static void at_ccfc_deactivation(struct ofono_modem *modem, int type, int cls,
ofono_generic_cb_t cb, void *data)
{
char buf[128];
+ int len;
+
+ len = sprintf(buf, "AT+CCFC=%d,0", type);
+
+ if (cls != 7)
+ sprintf(buf + len, ",,,%d", cls);
- sprintf(buf, "AT+CCFC=%d,0,,,%d", type, cls);
at_ccfc_set(modem, buf, cb, data);
}
@@ -206,8 +216,13 @@ static void at_ccfc_activation(struct ofono_modem *modem, int type, int cls,
ofono_generic_cb_t cb, void *data)
{
char buf[128];
+ int len;
+
+ len = sprintf(buf, "AT+CCFC=%d,1", type);
+
+ if (cls != 7)
+ sprintf(buf + len, ",,,%d", cls);
- sprintf(buf, "AT+CCFC=%d,1,,,%d", type, cls);
at_ccfc_set(modem, buf, cb, data);
}
@@ -219,7 +234,7 @@ static void at_ccfc_registration(struct ofono_modem *modem, int type, int cls,
char buf[128];
int offset;
- offset = sprintf(buf, "AT+CCFC=%d,3,%s,%d,%d", type,
+ offset = sprintf(buf, "AT+CCFC=%d,3,\"%s\",%d,%d", type,
number, number_type, cls);
if (type == 2 || type == 4 || type == 5)