[PATCH] default.xml: accept SMS with SMSC num 123

2012-08-30 Thread Nicolas Bertrand
Reply to the SMS pdu with CMGS:0 when SMSC is set to 123.
This is used by Send SMS in Demo sim app
---
 src/default.xml |7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/default.xml b/src/default.xml
index 568259b..78fc9ae 100644
--- a/src/default.xml
+++ b/src/default.xml
@@ -2757,6 +2757,13 @@
response+CMGS: 0\n\nOK/response
switch name=default/
 /chat
+
+chat
+!-- Accept messages with SMSC set to 123 (STK app) --
+command038121F3*/command
+response+CMGS: 0\n\nOK/response
+switch name=default/
+/chat
 /state
 
 chat
-- 
1.7.9.5

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 0/3] Add STK APDU editor

2012-08-24 Thread Nicolas Bertrand
Add to phonesim the capability to symply send STK APDU

Nicolas Bertrand (3):
  phonesim: accept STK command without application
  controlbase_ui: Add manual stk command editor
  control: Link functionnality to STK command editor

 src/control.cpp|   12 
 src/control.h  |2 ++
 src/controlbase.ui |   46 ++
 src/phonesim.cpp   |8 ++--
 4 files changed, 66 insertions(+), 2 deletions(-)

-- 
1.7.9.5

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 2/3] controlbase_ui: Add manual stk command editor

2012-08-24 Thread Nicolas Bertrand
---
 src/controlbase.ui |   46 ++
 1 file changed, 46 insertions(+)

diff --git a/src/controlbase.ui b/src/controlbase.ui
index 4eb1355..e230d7c 100644
--- a/src/controlbase.ui
+++ b/src/controlbase.ui
@@ -1161,6 +1161,52 @@
 /widget
/item
item
+widget class=QGroupBox name=gbSTKCmd
+ property name=title
+  stringSTK Command/string
+ /property
+ property name=flat
+  boolfalse/bool
+ /property
+ widget class=QPushButton name=pbSTKCmdSend
+  property name=geometry
+   rect
+x80/x
+y150/y
+width141/width
+height31/height
+   /rect
+  /property
+  property name=text
+   stringSend/string
+  /property
+ /widget
+ widget class=QTextEdit name=teSTKCmdEditor
+  property name=geometry
+   rect
+x235/x
+y20/y
+width401/width
+height161/height
+   /rect
+  /property
+ /widget
+ widget class=QPushButton name=pbSTKClear
+  property name=geometry
+   rect
+x80/x
+y100/y
+width141/width
+height31/height
+   /rect
+  /property
+  property name=text
+   stringClear/string
+  /property
+ /widget
+/widget
+   /item
+   item
 widget class=QGroupBox name=gbSATK
  property name=title
   stringApplication/string
-- 
1.7.9.5

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 3/3] control: Link functionnality to STK command editor

2012-08-24 Thread Nicolas Bertrand
---
 src/control.cpp |   12 
 src/control.h   |2 ++
 2 files changed, 14 insertions(+)

diff --git a/src/control.cpp b/src/control.cpp
index 3f1dd45..f518201 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -91,6 +91,8 @@ ControlWidget::ControlWidget(const QString ruleFile, Control 
*parent)
 connect(ui-pbAlerting, SIGNAL(clicked()), this, SLOT(setStateAlerting()));
 connect(ui-pbActive, SIGNAL(clicked()), this, SLOT(setStateConnected()));
 connect(ui-pbHangup, SIGNAL(clicked()), this, SLOT(setStateHangup()));
+connect(ui-pbSTKCmdSend, SIGNAL(clicked()), this, SLOT(STKCmdSend()));
+connect(ui-pbSTKClear, SIGNAL(clicked()), this, SLOT(STKClear()));
 
 QStringList headers;
 headers  Sender  Priority  Notification Status;
@@ -625,6 +627,16 @@ void Control::handleNewApp()
 widget-handleNewApp();
 }
 
+void ControlWidget::STKCmdSend()
+{
+emit unsolicitedCommand( +CUSATP:  + ui-teSTKCmdEditor-toPlainText() );
+}
+
+void ControlWidget::STKClear()
+{
+ui-teSTKCmdEditor-clear();
+}
+
 void ControlWidget::simAppStart()
 {
 if ( ui-cbSimApps-currentIndex() = 0 )
diff --git a/src/control.h b/src/control.h
index fd1a4e6..c4d5244 100644
--- a/src/control.h
+++ b/src/control.h
@@ -107,6 +107,8 @@ private slots:
 void setStateAlerting();
 void setStateConnected();
 void setStateHangup();
+void STKCmdSend();
+void STKClear();
 
 signals:
 void unsolicitedCommand(const QString );
-- 
1.7.9.5

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH v2] Speedup: Use speedup specific driver for ussd

2012-04-17 Thread Nicolas Bertrand
---
 plugins/speedup.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/plugins/speedup.c b/plugins/speedup.c
index ca6ed13..0261f49 100644
--- a/plugins/speedup.c
+++ b/plugins/speedup.c
@@ -2,7 +2,7 @@
  *
  *  oFono - Open Source Telephony
  *
- *  Copyright (C) 2008-2011  Intel Corporation. All rights reserved.
+ *  Copyright (C) 2008-2012  Intel Corporation. All rights reserved.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
@@ -282,8 +282,7 @@ static void speedup_post_online(struct ofono_modem *modem)
 
ofono_cbs_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
atmodem, data-aux);
-   ofono_ussd_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
-   atmodem, data-aux);
+   ofono_ussd_create(modem, 0, speedupmodem, data-aux);
 }
 
 static struct ofono_modem_driver speedup_driver = {
-- 
1.7.5.4

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 0/3] Speedup ussd driver

2012-04-16 Thread Nicolas Bertrand
Speedup is using its own way to handle USSD strings, so the 
implementation of this driver avoid some specific code in atmodem.

Nicolas Bertrand (3):
  Speedup: Add speedup driver to handle USSD
  Speedup: Use speedup specific driver for ussd
  Makefile: Add speedup modem target

 Makefile.am |6 +
 drivers/speedupmodem/speedupmodem.c |   49 
 drivers/speedupmodem/speedupmodem.h |   25 
 drivers/speedupmodem/ussd.c |  225 +++
 plugins/speedup.c   |4 +-
 5 files changed, 307 insertions(+), 2 deletions(-)
 create mode 100644 drivers/speedupmodem/speedupmodem.c
 create mode 100644 drivers/speedupmodem/speedupmodem.h
 create mode 100644 drivers/speedupmodem/ussd.c

-- 
1.7.5.4

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 1/3] Speedup: Add speedup driver to handle USSD

2012-04-16 Thread Nicolas Bertrand
---
 drivers/speedupmodem/speedupmodem.c |   49 
 drivers/speedupmodem/speedupmodem.h |   25 
 drivers/speedupmodem/ussd.c |  224 +++
 3 files changed, 298 insertions(+), 0 deletions(-)
 create mode 100644 drivers/speedupmodem/speedupmodem.c
 create mode 100644 drivers/speedupmodem/speedupmodem.h
 create mode 100644 drivers/speedupmodem/ussd.c

diff --git a/drivers/speedupmodem/speedupmodem.c 
b/drivers/speedupmodem/speedupmodem.c
new file mode 100644
index 000..d31c324
--- /dev/null
+++ b/drivers/speedupmodem/speedupmodem.c
@@ -0,0 +1,49 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2008-2012  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
+#include glib.h
+#include gatchat.h
+
+#define OFONO_API_SUBJECT_TO_CHANGE
+#include ofono/plugin.h
+#include ofono/types.h
+
+#include speedupmodem.h
+
+static int speedupmodem_init(void)
+{
+   speedup_ussd_init();
+
+   return 0;
+}
+
+static void speedupmodem_exit(void)
+{
+   speedup_ussd_exit();
+}
+
+OFONO_PLUGIN_DEFINE(speedupmodem, SpeedUp modem driver, VERSION,
+   OFONO_PLUGIN_PRIORITY_DEFAULT,
+   speedupmodem_init, speedupmodem_exit)
diff --git a/drivers/speedupmodem/speedupmodem.h 
b/drivers/speedupmodem/speedupmodem.h
new file mode 100644
index 000..38ad013
--- /dev/null
+++ b/drivers/speedupmodem/speedupmodem.h
@@ -0,0 +1,25 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2008-2011  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#include drivers/atmodem/atutil.h
+
+extern void speedup_ussd_init(void);
+extern void speedup_ussd_exit(void);
diff --git a/drivers/speedupmodem/ussd.c b/drivers/speedupmodem/ussd.c
new file mode 100644
index 000..02d3487
--- /dev/null
+++ b/drivers/speedupmodem/ussd.c
@@ -0,0 +1,224 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2008-2012  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
+#include stdio.h
+#include errno.h
+
+#include glib.h
+
+#include ofono/log.h
+#include ofono/modem.h
+#include ofono/ussd.h
+#include util.h
+
+#include gatchat.h
+
+#include speedupmodem.h
+
+static const char *cusd_prefix[] = { +CUSD:, NULL };
+static const char *none_prefix[] = { NULL };
+
+struct ussd_data {
+   GAtChat *chat;
+};
+
+static void cusd_parse(GAtResult *result, struct ofono_ussd *ussd)
+{
+   GAtResultIter iter;
+   int status, dcs;
+   const char *content;
+   unsigned char msg[160];
+   const unsigned char *msg_ptr = NULL;
+   long msg_len;
+
+   g_at_result_iter_init(iter, result);
+
+   if (!g_at_result_iter_next(iter, +CUSD:))
+   return;
+
+   if (!g_at_result_iter_next_number(iter, status))
+   return;
+
+   if (!g_at_result_iter_next_string(iter, content))
+   

[PATCH 0/2] ussd fixes

2012-04-10 Thread Nicolas Bertrand
Fix some issues with ussd:
- Crash with speedup dongles
- Crash with ZTE dongles

Nicolas Bertrand (2):
  ussd: rise up buffer lenght for ussd strings
  ussd: Fix speedup ussd encoding

 drivers/atmodem/ussd.c |   15 +++
 plugins/speedup.c  |2 +-
 2 files changed, 12 insertions(+), 5 deletions(-)

-- 
1.7.5.4

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 2/2] ussd: Fix speedup ussd encoding

2012-04-10 Thread Nicolas Bertrand
Speedup dongles encode USSD strings in GSM7
packed, so we don't have to pack it ourselves.
---
 drivers/atmodem/ussd.c |   13 ++---
 plugins/speedup.c  |2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c
index f5b38e2..e90db11 100644
--- a/drivers/atmodem/ussd.c
+++ b/drivers/atmodem/ussd.c
@@ -136,9 +136,15 @@ static void cusd_parse(GAtResult *result, struct 
ofono_ussd *ussd)
case SMS_CHARSET_7BIT:
switch (data-charset) {
case AT_UTIL_CHARSET_GSM:
-   msg_ptr = pack_7bit_own_buf((const guint8 *) content,
-   -1, 0, TRUE, msg_len,
-   0, msg);
+   if (data-vendor == OFONO_VENDOR_SPEEDUP)
+   msg_ptr = decode_hex_own_buf(content, -1,
+   msg_len,
+   0, msg);
+   else
+   msg_ptr = pack_7bit_own_buf((const guint8 *)
+   content, -1, 0,
+   TRUE, msg_len,
+   0, msg);
break;
 
case AT_UTIL_CHARSET_UTF8:
@@ -242,6 +248,7 @@ static void cusd_cancel_cb(gboolean ok, GAtResult *result, 
gpointer user_data)
switch (data-vendor) {
case OFONO_VENDOR_GOBI:
case OFONO_VENDOR_QUALCOMM_MSM:
+   case OFONO_VENDOR_SPEEDUP:
/* All errors and notifications arrive unexpected and
 * thus just reset the state here. This is safer than
 * getting stuck in a dead-lock. */
diff --git a/plugins/speedup.c b/plugins/speedup.c
index ca6ed13..5cc380f 100644
--- a/plugins/speedup.c
+++ b/plugins/speedup.c
@@ -282,7 +282,7 @@ static void speedup_post_online(struct ofono_modem *modem)
 
ofono_cbs_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
atmodem, data-aux);
-   ofono_ussd_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
+   ofono_ussd_create(modem, OFONO_VENDOR_SPEEDUP,
atmodem, data-aux);
 }
 
-- 
1.7.5.4

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] ussd: Fix crash with long ussd string

2012-03-30 Thread Nicolas Bertrand
Some ZTE modem convert USSD string into UCS2 without respecting
the limitation of 160 bytes. So cut off the string if greater than
this limit
---
 drivers/atmodem/ussd.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c
index 443251a..bdee2d9 100644
--- a/drivers/atmodem/ussd.c
+++ b/drivers/atmodem/ussd.c
@@ -158,7 +158,7 @@ static void cusd_parse(GAtResult *result, struct ofono_ussd 
*ussd)
 
case SMS_CHARSET_8BIT:
case SMS_CHARSET_UCS2:
-   msg_ptr = decode_hex_own_buf(content, -1, msg_len, 0, msg);
+   msg_ptr = decode_hex_own_buf(content, 320, msg_len, 0, msg);
break;
}
 
-- 
1.7.5.4

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCHv2] sim: Use quoted string with AT+CRSM data parameter

2012-03-22 Thread Nicolas Bertrand
Fix issue with some modems preventing to update elementary files
(speedup, ZTE, huawei, MBM)
---
 drivers/atmodem/sim.c |  127 -
 1 files changed, 41 insertions(+), 86 deletions(-)

diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index 8ee9822..a75d51f 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -298,71 +298,44 @@ static void at_crsm_update_cb(gboolean ok, GAtResult 
*result,
cb(error, cbd-data);
 }
 
-static void at_sim_update_binary(struct ofono_sim *sim, int fileid,
-   int start, int length,
-   const unsigned char *value,
-   ofono_sim_write_cb_t cb, void *data)
-{
-   struct sim_data *sd = ofono_sim_get_data(sim);
-   struct cb_data *cbd = cb_data_new(cb, data);
-   char *buf = g_try_new(char, 36 + length * 2);
-   int len, ret;
-
-   if (buf == NULL)
-   goto error;
-
-   len = sprintf(buf, AT+CRSM=214,%i,%i,%i,%i,, fileid,
-   start  8, start  0xff, length);
-
-   for (; length; length--)
-   len += sprintf(buf + len, %02hhX, *value++);
-
-   ret = g_at_chat_send(sd-chat, buf, crsm_prefix,
-   at_crsm_update_cb, cbd, g_free);
-
-   g_free(buf);
-
-   if (ret  0)
-   return;
-
-error:
-   g_free(cbd);
-
-   CALLBACK_WITH_FAILURE(cb, data);
-}
-
-static void at_sim_update_record(struct ofono_sim *sim, int fileid,
-   int record, int length,
-   const unsigned char *value,
-   ofono_sim_write_cb_t cb, void *data)
+static void at_sim_update_file(struct ofono_sim *sim, int cmd, int fileid,
+   int p1, int p2, int p3, const unsigned char *value,
+   ofono_sim_write_cb_t cb, void *data)
 {
struct sim_data *sd = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(cb, data);
char *buf;
+   char *quote = ;
int len, ret;
-   int size = 36 + length * 2;
+   int size = 36 + p3 * 2;
 
-   if (sd-vendor == OFONO_VENDOR_MBM)
-   size += 2; /*Add quotes*/
+   DBG();
+
+   /* Add quotes */
+   switch (sd-vendor) {
+   case OFONO_VENDOR_MBM:
+   case OFONO_VENDOR_ZTE:
+   case OFONO_VENDOR_HUAWEI:
+   case OFONO_VENDOR_SPEEDUP:
+   quote = \;
+   size += 2;
+   break;
+   }
 
buf = g_try_new(char, size);
if (buf == NULL)
goto error;
 
-   len = sprintf(buf, AT+CRSM=220,%i,%i,4,%i,, fileid,
-   record, length);
+   len = sprintf(buf, AT+CRSM=%i,%i,%i,%i,%i,%s, cmd, fileid,
+   p1, p2, p3, quote);
 
-   if (sd-vendor == OFONO_VENDOR_MBM)
-   len += sprintf(buf + len, \);
-
-   for (; length; length--)
+   for (; p3; p3--)
len += sprintf(buf + len, %02hhX, *value++);
 
-   if (sd-vendor == OFONO_VENDOR_MBM)
-   sprintf(buf + len, \);
+   sprintf(buf + len, %s, quote);
 
ret = g_at_chat_send(sd-chat, buf, crsm_prefix,
-   at_crsm_update_cb, cbd, g_free);
+   at_crsm_update_cb, cbd, g_free);
 
g_free(buf);
 
@@ -375,46 +348,28 @@ error:
CALLBACK_WITH_FAILURE(cb, data);
 }
 
-static void at_sim_update_cyclic(struct ofono_sim *sim, int fileid,
-   int length, const unsigned char *value,
-   ofono_sim_write_cb_t cb, void *data)
+static void at_sim_update_binary(struct ofono_sim *sim, int fileid,
+   int start, int length, const unsigned char *value,
+   ofono_sim_write_cb_t cb, void *data)
 {
-   struct sim_data *sd = ofono_sim_get_data(sim);
-   struct cb_data *cbd = cb_data_new(cb, data);
-   char *buf;
-   int len, ret;
-   int size = 36 + length * 2;
-
-   if (sd-vendor == OFONO_VENDOR_MBM)
-   size += 2; /* Add quotes */
-
-   buf = g_try_new(char, size);
-   if (buf == NULL)
-   goto error;
-
-   len = sprintf(buf, AT+CRSM=220,%i,0,3,%i,, fileid, length);
-
-   if (sd-vendor == OFONO_VENDOR_MBM)
-   len += sprintf(buf + len, \);
-
-   for (; length; length--)
-   len += sprintf(buf + len, %02hhX, *value++);
-
-   if (sd-vendor == OFONO_VENDOR_MBM)
-   sprintf(buf + len, \);
-
-   ret = g_at_chat_send(sd-chat, buf, crsm_prefix,
-   at_crsm_update_cb, cbd, g_free);
-
-   g_free(buf);
-
-   if (ret  0)
-   return;
+   at_sim_update_file(sim, 214, fileid, start  8, start  0xff,
+   length, value, cb, data);
+}
 
-error:
-   g_free(cbd);
+static void 

[PATCH] sim: Use quoted string with AT+CRSM data parameter

2012-03-21 Thread Nicolas Bertrand
Fix issue with some modems preventing to update elementary files
(speedup, ZTE, huawei, MBM)
---
 drivers/atmodem/sim.c |   52 ++--
 1 files changed, 45 insertions(+), 7 deletions(-)

diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index 8ee9822..f307708 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -305,18 +305,38 @@ static void at_sim_update_binary(struct ofono_sim *sim, 
int fileid,
 {
struct sim_data *sd = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(cb, data);
-   char *buf = g_try_new(char, 36 + length * 2);
+   char *buf;
int len, ret;
+   int size = 36 + length * 2;
 
+   if (sd-vendor == OFONO_VENDOR_MBM ||
+   sd-vendor == OFONO_VENDOR_ZTE ||
+   sd-vendor == OFONO_VENDOR_HUAWEI ||
+   sd-vendor == OFONO_VENDOR_SPEEDUP)
+   size += 2; /*Add quotes*/
+
+   buf = g_try_new(char, size);
if (buf == NULL)
goto error;
 
len = sprintf(buf, AT+CRSM=214,%i,%i,%i,%i,, fileid,
start  8, start  0xff, length);
 
+   if (sd-vendor == OFONO_VENDOR_MBM ||
+   sd-vendor == OFONO_VENDOR_ZTE ||
+   sd-vendor == OFONO_VENDOR_HUAWEI ||
+   sd-vendor == OFONO_VENDOR_SPEEDUP)
+   sprintf(buf + len, \);
+
for (; length; length--)
len += sprintf(buf + len, %02hhX, *value++);
 
+   if (sd-vendor == OFONO_VENDOR_MBM ||
+   sd-vendor == OFONO_VENDOR_ZTE ||
+   sd-vendor == OFONO_VENDOR_HUAWEI ||
+   sd-vendor == OFONO_VENDOR_SPEEDUP)
+   sprintf(buf + len, \);
+
ret = g_at_chat_send(sd-chat, buf, crsm_prefix,
at_crsm_update_cb, cbd, g_free);
 
@@ -342,7 +362,10 @@ static void at_sim_update_record(struct ofono_sim *sim, 
int fileid,
int len, ret;
int size = 36 + length * 2;
 
-   if (sd-vendor == OFONO_VENDOR_MBM)
+   if (sd-vendor == OFONO_VENDOR_MBM ||
+   sd-vendor == OFONO_VENDOR_ZTE ||
+   sd-vendor == OFONO_VENDOR_HUAWEI ||
+   sd-vendor == OFONO_VENDOR_SPEEDUP)
size += 2; /*Add quotes*/
 
buf = g_try_new(char, size);
@@ -352,13 +375,19 @@ static void at_sim_update_record(struct ofono_sim *sim, 
int fileid,
len = sprintf(buf, AT+CRSM=220,%i,%i,4,%i,, fileid,
record, length);
 
-   if (sd-vendor == OFONO_VENDOR_MBM)
+   if (sd-vendor == OFONO_VENDOR_MBM ||
+   sd-vendor == OFONO_VENDOR_ZTE ||
+   sd-vendor == OFONO_VENDOR_HUAWEI ||
+   sd-vendor == OFONO_VENDOR_SPEEDUP)
len += sprintf(buf + len, \);
 
for (; length; length--)
len += sprintf(buf + len, %02hhX, *value++);
 
-   if (sd-vendor == OFONO_VENDOR_MBM)
+   if (sd-vendor == OFONO_VENDOR_MBM ||
+   sd-vendor == OFONO_VENDOR_ZTE ||
+   sd-vendor == OFONO_VENDOR_HUAWEI ||
+   sd-vendor == OFONO_VENDOR_SPEEDUP)
sprintf(buf + len, \);
 
ret = g_at_chat_send(sd-chat, buf, crsm_prefix,
@@ -385,7 +414,10 @@ static void at_sim_update_cyclic(struct ofono_sim *sim, 
int fileid,
int len, ret;
int size = 36 + length * 2;
 
-   if (sd-vendor == OFONO_VENDOR_MBM)
+   if (sd-vendor == OFONO_VENDOR_MBM ||
+   sd-vendor == OFONO_VENDOR_ZTE ||
+   sd-vendor == OFONO_VENDOR_HUAWEI ||
+   sd-vendor == OFONO_VENDOR_SPEEDUP)
size += 2; /* Add quotes */
 
buf = g_try_new(char, size);
@@ -394,13 +426,19 @@ static void at_sim_update_cyclic(struct ofono_sim *sim, 
int fileid,
 
len = sprintf(buf, AT+CRSM=220,%i,0,3,%i,, fileid, length);
 
-   if (sd-vendor == OFONO_VENDOR_MBM)
+   if (sd-vendor == OFONO_VENDOR_MBM ||
+   sd-vendor == OFONO_VENDOR_ZTE ||
+   sd-vendor == OFONO_VENDOR_HUAWEI ||
+   sd-vendor == OFONO_VENDOR_SPEEDUP)
len += sprintf(buf + len, \);
 
for (; length; length--)
len += sprintf(buf + len, %02hhX, *value++);
 
-   if (sd-vendor == OFONO_VENDOR_MBM)
+   if (sd-vendor == OFONO_VENDOR_MBM ||
+   sd-vendor == OFONO_VENDOR_ZTE ||
+   sd-vendor == OFONO_VENDOR_HUAWEI ||
+   sd-vendor == OFONO_VENDOR_SPEEDUP)
sprintf(buf + len, \);
 
ret = g_at_chat_send(sd-chat, buf, crsm_prefix,
-- 
1.7.5.4

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] udevng: use huaweicdma driver for olive V-ME101

2011-11-18 Thread Nicolas Bertrand
---
 plugins/udevng.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index be87320..8d478cf 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -800,11 +800,10 @@ static struct {
{ hso,hso   },
{ gobi,   qcserial  },
{ sierra, sierra},
-   { huawei, option,   201e, 2009  },
+   { huaweicdma, option,   201e, 2009  },
{ huawei, cdc_ether,12d1  },
{ huawei, option,   12d1  },
{ huaweicdma, option,   12d1, 140b  },
-   { huaweicdma, option,   201e  },
{ speedupcdma,option,   1c9e, 9e00  },
{ speedup,option,   1c9e  },
{ speedup,option,   2020  },
-- 
1.7.4.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] udevng: Add support of SU-7300

2011-11-17 Thread Nicolas Bertrand
Add setup_speedupcdma in order to support the specificities of cdma modems

---
 plugins/udevng.c |   44 +++-
 1 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index e0f5fd8..35f8c1e 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -289,6 +289,48 @@ static gboolean setup_huawei(struct modem_info *modem)
return TRUE;
 }
 
+static gboolean setup_speedupcdma(struct modem_info *modem)
+{
+   const char *aux = NULL, *mdm = NULL;
+   GSList *list;
+
+   DBG(%s, modem-syspath);
+
+   for (list = modem-devices; list; list = list-next) {
+   struct device_info *info = list-data;
+
+   DBG(%s %s %s %s, info-devnode, info-interface,
+   info-number, info-label);
+
+   if (g_strcmp0(info-label, aux) == 0) {
+   aux = info-devnode;
+   if (mdm != NULL)
+   break;
+   } else if (g_strcmp0(info-label, modem) == 0) {
+   mdm = info-devnode;
+   if (aux != NULL)
+   break;
+   } else if (g_strcmp0(info-interface, 255/255/255) == 0) {
+   if (g_strcmp0(info-number, 00) == 0)
+   mdm = info-devnode;
+   else if (g_strcmp0(info-number, 02) == 0)
+   aux = info-devnode;
+   else if (g_strcmp0(info-number, 03) == 0)
+   aux = info-devnode;
+   }
+   }
+
+   if (aux == NULL || mdm == NULL)
+   return FALSE;
+
+   DBG(aux=%s modem=%s, aux, mdm);
+
+   ofono_modem_set_string(modem-modem, Aux, aux);
+   ofono_modem_set_string(modem-modem, Modem, mdm);
+
+   return TRUE;
+}
+
 static gboolean setup_speedup(struct modem_info *modem)
 {
const char *aux = NULL, *mdm = NULL;
@@ -614,7 +656,7 @@ static struct {
{ sierra, setup_sierra},
{ huawei, setup_huawei},
{ huaweicdma, setup_huawei},
-   { speedupcdma,setup_speedup   },
+   { speedupcdma,setup_speedupcdma},
{ speedup,setup_speedup   },
{ linktop,setup_linktop   },
{ alcatel,setup_alcatel   },
-- 
1.7.4.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCHv2 0/2] CPIN polling mechanism

2011-07-21 Thread Nicolas Bertrand
v2 changes:
 - change AT channel from modem to aux
 - raise timeout to 20 since some dongle take a while to be
   operational
 - send sim inserted notify related to the current status

As no SIM card status urc is available with ZTE and Speedup, the SIM 
state is set by default to OFONO_SIM_STATE_INSERTED even if no SIM card 
is inserted. Also, we are facing with a modem latency after the ttyUSB 
is opened (first AT commands are failing and the PIN status query 
returns CME ERROR: 14 - SIM Busy).
So, to deal with those 2 issues, this patch set is introducing a 
preliminary PIN status polling in the ZTE/Speedup plugins. In practice, 
this polling is started after the modem is enabled and stopped when the 
CPIN query returns an other result than CME ERROR 14 or when the polling 
duration exceeds 5 seconds.
As a result, the SIM state is set according the result of the CPIN query 
and the update of the modem_powered state is postponed which delays the 
next AT commands.

Developed conjointly with philippe nunes.

Nicolas Bertrand (2):
  speedup: add cpin polling mechanism
  zte: add cpin polling mechanism

 plugins/speedup.c |   66 ++-
 plugins/zte.c |   67 +++-
 2 files changed, 129 insertions(+), 4 deletions(-)

-- 
1.7.4.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCHv2 1/2] speedup: add cpin polling mechanism

2011-07-21 Thread Nicolas Bertrand
Make sure that the SIM card is ready before sending commands
---
 plugins/speedup.c |   66 +++-
 1 files changed, 64 insertions(+), 2 deletions(-)

diff --git a/plugins/speedup.c b/plugins/speedup.c
index 7e89b6f..afd9b40 100644
--- a/plugins/speedup.c
+++ b/plugins/speedup.c
@@ -49,10 +49,14 @@
 #include drivers/atmodem/vendor.h
 
 static const char *none_prefix[] = { NULL };
+static const char *cpin_prefix[] = { +CPIN:, NULL };
 
 struct speedup_data {
GAtChat *modem;
GAtChat *aux;
+   guint cpin_poll_source;
+   guint cpin_poll_count;
+   gboolean have_sim;
struct ofono_gprs *gprs;
struct ofono_gprs_context *gc;
 };
@@ -83,6 +87,9 @@ static void speedup_remove(struct ofono_modem *modem)
g_at_chat_unref(data-modem);
g_at_chat_unref(data-aux);
 
+   if (data-cpin_poll_source  0)
+   g_source_remove(data-cpin_poll_source);
+
g_free(data);
 }
 
@@ -152,13 +159,68 @@ static void speedup_disconnect(gpointer user_data)
ofono_gprs_add_context(data-gprs, data-gc);
 }
 
+static gboolean init_simpin_check(gpointer user_data);
+
+static void simpin_check(gboolean ok, GAtResult *result, gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct speedup_data *data = ofono_modem_get_data(modem);
+   struct ofono_error error;
+
+   DBG();
+
+   decode_at_error(error, g_at_result_final_response(result));
+
+   /* Modem returns an error if SIM is not ready. */
+   switch (error.error) {
+   case 10:
+   case 13:
+   data-have_sim = FALSE;
+   break;
+   case 14: /* SIM Busy, wait and check again the SIM pin status */
+   if (data-cpin_poll_count++  20) {
+   data-cpin_poll_source =
+   g_timeout_add_seconds(1, init_simpin_check,
+   modem);
+   return;
+   }
+   /*SIM card is present but not accessible*/
+   data-have_sim = FALSE;
+   break;
+   default:
+   data-have_sim = TRUE;
+   }
+
+   data-cpin_poll_count = 0;
+
+   ofono_modem_set_powered(modem, TRUE);
+}
+
+static gboolean init_simpin_check(gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct speedup_data *data = ofono_modem_get_data(modem);
+
+   data-cpin_poll_source = 0;
+
+   g_at_chat_send(data-aux, AT+CPIN?, cpin_prefix,
+   simpin_check, modem, NULL);
+
+   return FALSE;
+}
+
 static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
 {
struct ofono_modem *modem = user_data;
 
DBG();
 
-   ofono_modem_set_powered(modem, ok);
+   if (!ok) {
+   ofono_modem_set_powered(modem, FALSE);
+   return;
+   }
+
+   init_simpin_check(modem);
 }
 
 static int speedup_enable(struct ofono_modem *modem)
@@ -272,7 +334,7 @@ static void speedup_pre_sim(struct ofono_modem *modem)
atmodem, data-aux);
 
if (sim)
-   ofono_sim_inserted_notify(sim, TRUE);
+   ofono_sim_inserted_notify(sim, data-have_sim);
 }
 
 static void speedup_post_sim(struct ofono_modem *modem)
-- 
1.7.4.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCHv2 2/2] zte: add cpin polling mechanism

2011-07-21 Thread Nicolas Bertrand
Make sure that the SIM card is ready before sending commands
---
 plugins/zte.c |   67 +++-
 1 files changed, 65 insertions(+), 2 deletions(-)

diff --git a/plugins/zte.c b/plugins/zte.c
index 4bac3cf..9964a44 100644
--- a/plugins/zte.c
+++ b/plugins/zte.c
@@ -49,10 +49,14 @@
 #include drivers/atmodem/vendor.h
 
 static const char *none_prefix[] = { NULL };
+static const char *cpin_prefix[] = { +CPIN:, NULL };
 
 struct zte_data {
GAtChat *modem;
GAtChat *aux;
+   guint cpin_poll_source;
+   guint cpin_poll_count;
+   gboolean have_sim;
struct ofono_gprs *gprs;
struct ofono_gprs_context *gc;
 };
@@ -83,6 +87,9 @@ static void zte_remove(struct ofono_modem *modem)
g_at_chat_unref(data-modem);
g_at_chat_unref(data-aux);
 
+   if (data-cpin_poll_source  0)
+   g_source_remove(data-cpin_poll_source);
+
g_free(data);
 }
 
@@ -152,13 +159,69 @@ static void zte_disconnect(gpointer user_data)
ofono_gprs_add_context(data-gprs, data-gc);
 }
 
+static gboolean init_simpin_check(gpointer user_data);
+
+static void simpin_check(gboolean ok, GAtResult *result, gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct zte_data *data = ofono_modem_get_data(modem);
+   struct ofono_error error;
+
+   DBG();
+
+   decode_at_error(error, g_at_result_final_response(result));
+
+   /* Modem returns an error if SIM is not ready. */
+   switch (error.error) {
+   case 10:
+   case 13:
+   data-have_sim = FALSE;
+   break;
+   case 14: /* SIM Busy, wait and check again the card status */
+   if (data-cpin_poll_count++  20) {
+   data-cpin_poll_source =
+   g_timeout_add_seconds(1, init_simpin_check,
+   modem);
+   return;
+   }
+   /*SIM card is present but not accessible*/
+   data-have_sim = FALSE;
+   break;
+   default:
+   data-have_sim = TRUE;
+   }
+
+   data-cpin_poll_count = 0;
+
+   ofono_modem_set_powered(modem, TRUE);
+}
+
+static gboolean init_simpin_check(gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct zte_data *data = ofono_modem_get_data(modem);
+
+   data-cpin_poll_source = 0;
+
+   g_at_chat_send(data-aux, AT+CPIN?, cpin_prefix,
+   simpin_check, modem, NULL);
+
+   return FALSE;
+}
+
+
 static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
 {
struct ofono_modem *modem = user_data;
 
DBG();
 
-   ofono_modem_set_powered(modem, ok);
+   if (!ok) {
+   ofono_modem_set_powered(modem, FALSE);
+   return;
+   }
+
+   init_simpin_check(modem);
 }
 
 static int zte_enable(struct ofono_modem *modem)
@@ -273,7 +336,7 @@ static void zte_pre_sim(struct ofono_modem *modem)
atmodem, data-aux);
 
if (sim)
-   ofono_sim_inserted_notify(sim, TRUE);
+   ofono_sim_inserted_notify(sim, data-have_sim);
 }
 
 static void zte_post_sim(struct ofono_modem *modem)
-- 
1.7.4.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 0/2] CPIN polling mechanism

2011-07-20 Thread Nicolas Bertrand
As no SIM card status urc is available with ZTE and Speedup, the SIM 
state is set by default to OFONO_SIM_STATE_INSERTED even if no SIM card 
is inserted. Also, we are facing with a modem latency after the ttyUSB 
is opened (first AT commands are failing and the PIN status query 
returns CME ERROR: 14 - SIM Busy).
So, to deal with those 2 issues, this patch set is introducing a 
preliminary PIN status polling in the ZTE/Speedup plugins. In practice, 
this polling is started after the modem is enabled and stopped when the 
CPIN query returns an other result than CME ERROR 14 or when the polling 
duration exceeds 5 seconds.
As a result, the SIM state is set according the result of the CPIN query 
and the update of the modem_powered state is postponed which delays the 
next AT commands.

Developed conjointly with philippe nunes.


Nicolas Bertrand (2):
  speedup: add cpin polling mechanism
  zte: add cpin polling mechanism

 plugins/speedup.c |   64 +++-
 plugins/zte.c |   65 -
 2 files changed, 127 insertions(+), 2 deletions(-)

-- 
1.7.4.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 1/2] speedup: add cpin polling mechanism

2011-07-20 Thread Nicolas Bertrand
Make sure that the SIM card is ready before sending commands
---
 plugins/speedup.c |   64 -
 1 files changed, 63 insertions(+), 1 deletions(-)

diff --git a/plugins/speedup.c b/plugins/speedup.c
index 7e89b6f..23ba173 100644
--- a/plugins/speedup.c
+++ b/plugins/speedup.c
@@ -49,10 +49,14 @@
 #include drivers/atmodem/vendor.h
 
 static const char *none_prefix[] = { NULL };
+static const char *cpin_prefix[] = { +CPIN:, NULL };
 
 struct speedup_data {
GAtChat *modem;
GAtChat *aux;
+   guint cpin_poll_source;
+   guint cpin_poll_count;
+   gboolean have_sim;
struct ofono_gprs *gprs;
struct ofono_gprs_context *gc;
 };
@@ -83,6 +87,9 @@ static void speedup_remove(struct ofono_modem *modem)
g_at_chat_unref(data-modem);
g_at_chat_unref(data-aux);
 
+   if (data-cpin_poll_source  0)
+   g_source_remove(data-cpin_poll_source);
+
g_free(data);
 }
 
@@ -152,13 +159,68 @@ static void speedup_disconnect(gpointer user_data)
ofono_gprs_add_context(data-gprs, data-gc);
 }
 
+static gboolean init_simpin_check(gpointer user_data);
+
+static void simpin_check(gboolean ok, GAtResult *result, gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct speedup_data *data = ofono_modem_get_data(modem);
+   struct ofono_error error;
+
+   DBG();
+
+   decode_at_error(error, g_at_result_final_response(result));
+
+   /* Modem returns an error if SIM is not ready. */
+   switch (error.error) {
+   case 10:
+   case 13:
+   data-have_sim = FALSE;
+   break;
+   case 14: /* SIM Busy, wait and check again the SIM pin status */
+   if (data-cpin_poll_count++  5) {
+   data-cpin_poll_source =
+   g_timeout_add_seconds(1, init_simpin_check,
+   modem);
+   return;
+   }
+   /*SIM card is present but not accessible*/
+   data-have_sim = FALSE;
+   break;
+   default:
+   data-have_sim = TRUE;
+   }
+
+   data-cpin_poll_count = 0;
+
+   ofono_modem_set_powered(modem, TRUE);
+}
+
+static gboolean init_simpin_check(gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct speedup_data *data = ofono_modem_get_data(modem);
+
+   data-cpin_poll_source = 0;
+
+   g_at_chat_send(data-modem, AT+CPIN?, cpin_prefix,
+   simpin_check, modem, NULL);
+
+   return FALSE;
+}
+
 static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
 {
struct ofono_modem *modem = user_data;
 
DBG();
 
-   ofono_modem_set_powered(modem, ok);
+   if (!ok) {
+   ofono_modem_set_powered(modem, FALSE);
+   return;
+   }
+
+   init_simpin_check(modem);
 }
 
 static int speedup_enable(struct ofono_modem *modem)
-- 
1.7.4.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 2/2] zte: add cpin polling mechanism

2011-07-20 Thread Nicolas Bertrand
Make sure that the SIM card is ready before sending commands
---
 plugins/zte.c |   65 -
 1 files changed, 64 insertions(+), 1 deletions(-)

diff --git a/plugins/zte.c b/plugins/zte.c
index 4bac3cf..53b3fa0 100644
--- a/plugins/zte.c
+++ b/plugins/zte.c
@@ -49,10 +49,14 @@
 #include drivers/atmodem/vendor.h
 
 static const char *none_prefix[] = { NULL };
+static const char *cpin_prefix[] = { +CPIN:, NULL };
 
 struct zte_data {
GAtChat *modem;
GAtChat *aux;
+   guint cpin_poll_source;
+   guint cpin_poll_count;
+   gboolean have_sim;
struct ofono_gprs *gprs;
struct ofono_gprs_context *gc;
 };
@@ -83,6 +87,9 @@ static void zte_remove(struct ofono_modem *modem)
g_at_chat_unref(data-modem);
g_at_chat_unref(data-aux);
 
+   if (data-cpin_poll_source  0)
+   g_source_remove(data-cpin_poll_source);
+
g_free(data);
 }
 
@@ -152,13 +159,69 @@ static void zte_disconnect(gpointer user_data)
ofono_gprs_add_context(data-gprs, data-gc);
 }
 
+static gboolean init_simpin_check(gpointer user_data);
+
+static void simpin_check(gboolean ok, GAtResult *result, gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct zte_data *data = ofono_modem_get_data(modem);
+   struct ofono_error error;
+
+   DBG();
+
+   decode_at_error(error, g_at_result_final_response(result));
+
+   /* Modem returns an error if SIM is not ready. */
+   switch (error.error) {
+   case 10:
+   case 13:
+   data-have_sim = FALSE;
+   break;
+   case 14: /* SIM Busy, wait and check again the card status */
+   if (data-cpin_poll_count++  5) {
+   data-cpin_poll_source =
+   g_timeout_add_seconds(1, init_simpin_check,
+   modem);
+   return;
+   }
+   /*SIM card is present but not accessible*/
+   data-have_sim = FALSE;
+   break;
+   default:
+   data-have_sim = TRUE;
+   }
+
+   data-cpin_poll_count = 0;
+
+   ofono_modem_set_powered(modem, TRUE);
+}
+
+static gboolean init_simpin_check(gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct zte_data *data = ofono_modem_get_data(modem);
+
+   data-cpin_poll_source = 0;
+
+   g_at_chat_send(data-modem, AT+CPIN?, cpin_prefix,
+   simpin_check, modem, NULL);
+
+   return FALSE;
+}
+
+
 static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
 {
struct ofono_modem *modem = user_data;
 
DBG();
 
-   ofono_modem_set_powered(modem, ok);
+   if (!ok) {
+   ofono_modem_set_powered(modem, FALSE);
+   return;
+   }
+
+   init_simpin_check(modem);
 }
 
 static int zte_enable(struct ofono_modem *modem)
-- 
1.7.4.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] rules: Add ofono rules for ZTE MF190

2011-07-11 Thread Nicolas Bertrand
---
 plugins/ofono.rules |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/plugins/ofono.rules b/plugins/ofono.rules
index 1fcdddb..794a02d 100644
--- a/plugins/ofono.rules
+++ b/plugins/ofono.rules
@@ -24,6 +24,9 @@ ATTRS{idVendor}==19d2, ATTRS{idProduct}==0063, 
ENV{OFONO_IFACE_NUM}==01, E
 ATTRS{idVendor}==19d2, ATTRS{idProduct}==0117, ENV{OFONO_IFACE_NUM}==02, 
ENV{OFONO_ZTE_TYPE}=modem
 ATTRS{idVendor}==19d2, ATTRS{idProduct}==0117, ENV{OFONO_IFACE_NUM}==01, 
ENV{OFONO_ZTE_TYPE}=aux
 
+ATTRS{idVendor}==19d2, ATTRS{idProduct}==0124, ENV{OFONO_IFACE_NUM}==04, 
ENV{OFONO_ZTE_TYPE}=modem
+ATTRS{idVendor}==19d2, ATTRS{idProduct}==0124, ENV{OFONO_IFACE_NUM}==01, 
ENV{OFONO_ZTE_TYPE}=aux
+
 ATTRS{idVendor}==19d2, ATTRS{idProduct}==0017, ENV{OFONO_IFACE_NUM}==03, 
ENV{OFONO_ZTE_TYPE}=modem
 ATTRS{idVendor}==19d2, ATTRS{idProduct}==0017, ENV{OFONO_IFACE_NUM}==01, 
ENV{OFONO_ZTE_TYPE}=aux
 
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] call-settings: fix typo

2011-06-17 Thread Nicolas Bertrand
---
 src/call-settings.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/call-settings.c b/src/call-settings.c
index 2d68adc..692d3b4 100644
--- a/src/call-settings.c
+++ b/src/call-settings.c
@@ -733,7 +733,7 @@ static void clir_ss_query_callback(const struct ofono_error 
*error,
 
switch (network) {
case CLIR_STATUS_UNKNOWN:
-   value = uknown;
+   value = unknown;
break;
 
case CLIR_STATUS_PROVISIONED_PERMANENT:
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] call-forward: Call forwarding state handling

2011-06-16 Thread Nicolas Bertrand
When CFU is active be cautious with conditional
call-forward activation/deactivation
---
 src/call-forwarding.c |   46 --
 1 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index 73ce433..eff5e9d 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -504,6 +504,7 @@ static DBusMessage *cf_get_properties_reply(DBusMessage 
*msg,
DBusMessageIter dict;
int i;
dbus_bool_t status;
+   GSList *hidden = NULL;
 
reply = dbus_message_new_method_return(msg);
if (reply == NULL)
@@ -515,17 +516,33 @@ static DBusMessage *cf_get_properties_reply(DBusMessage 
*msg,
OFONO_PROPERTIES_ARRAY_SIGNATURE,
dict);
 
-   for (i = 0; i  4; i++)
-   property_append_cf_conditions(dict, cf-cf_conditions[i],
-   BEARER_CLASS_VOICE,
-   cf_type_lut[i]);
-
if ((cf-flags  CALL_FORWARDING_FLAG_CPHS_CFF) ||
cf-cfis_record_id  0)
status = is_cfu_enabled(cf, NULL);
else
status = FALSE;
 
+   /*
+* If unconditional call-forwarding is enabled,
+* hide conditionnal status
+*/
+   if (status == TRUE) {
+   struct ofono_call_forwarding_condition cd = {0, 0, {, 0}, 0};
+
+   for (i = 0; i  4; i++)
+   hidden = g_slist_prepend(hidden, cd);
+   }
+
+   for (i = 0; i  4; i++)
+   property_append_cf_conditions(dict, (status 
+   i != CALL_FORWARDING_TYPE_UNCONDITIONAL) ?
+   hidden : cf-cf_conditions[i],
+   BEARER_CLASS_VOICE,
+   cf_type_lut[i]);
+
+   if (status == TRUE)
+   g_slist_free(hidden);
+
ofono_dbus_dict_append(dict, ForwardingFlagOnSim, DBUS_TYPE_BOOLEAN,
status);
 
@@ -552,6 +569,13 @@ static void get_query_cf_callback(const struct ofono_error 
*error, int total,
cf-flags |= CALL_FORWARDING_FLAG_CACHED;
}
 
+   if (cf-query_next == CALL_FORWARDING_TYPE_UNCONDITIONAL 
+   is_cfu_enabled(cf, NULL) == TRUE) {
+   DBusMessage *reply = cf_get_properties_reply(cf-pending, cf);
+   __ofono_dbus_pending_reply(cf-pending, reply);
+   return;
+   }
+
if (cf-query_next == CALL_FORWARDING_TYPE_NOT_REACHABLE) {
DBusMessage *reply = cf_get_properties_reply(cf-pending, cf);
__ofono_dbus_pending_reply(cf-pending, reply);
@@ -575,7 +599,8 @@ static DBusMessage *cf_get_properties(DBusConnection *conn, 
DBusMessage *msg,
struct ofono_modem *modem = __ofono_atom_get_modem(cf-atom);
 
if ((cf-flags  CALL_FORWARDING_FLAG_CACHED) ||
-   ofono_modem_get_online(modem) == FALSE)
+   ofono_modem_get_online(modem) == FALSE ||
+   is_cfu_enabled(cf, NULL) == TRUE)
return cf_get_properties_reply(msg, cf);
 
if (cf-driver-query == NULL)
@@ -698,6 +723,15 @@ static void set_property_callback(const struct ofono_error 
*error, void *data)
return;
}
 
+   if (cf-query_next != CALL_FORWARDING_TYPE_UNCONDITIONAL 
+   is_cfu_enabled(cf, NULL) == TRUE) {
+   DBusMessage *reply;
+   cf-flags = ~CALL_FORWARDING_FLAG_CACHED;
+   reply = dbus_message_new_method_return(cf-pending);
+   __ofono_dbus_pending_reply(cf-pending, reply);
+   return;
+   }
+
/* Successfully set, query the entire set just in case */
set_query_next_cf_cond(cf);
 }
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] call-forward: Call forwarding state handling

2011-06-07 Thread Nicolas Bertrand
When CFU is active be cautious with conditional
call-forward activation/deactivation
---
 src/call-forwarding.c |   44 ++--
 1 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index 73ce433..42d681e 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -504,6 +504,7 @@ static DBusMessage *cf_get_properties_reply(DBusMessage 
*msg,
DBusMessageIter dict;
int i;
dbus_bool_t status;
+   GSList *hidden = NULL;
 
reply = dbus_message_new_method_return(msg);
if (reply == NULL)
@@ -515,17 +516,31 @@ static DBusMessage *cf_get_properties_reply(DBusMessage 
*msg,
OFONO_PROPERTIES_ARRAY_SIGNATURE,
dict);
 
-   for (i = 0; i  4; i++)
-   property_append_cf_conditions(dict, cf-cf_conditions[i],
-   BEARER_CLASS_VOICE,
-   cf_type_lut[i]);
-
if ((cf-flags  CALL_FORWARDING_FLAG_CPHS_CFF) ||
cf-cfis_record_id  0)
status = is_cfu_enabled(cf, NULL);
else
status = FALSE;
 
+   // If unconditional call-forwarding is enabled,
+   // hide conditionnal status
+   if (status == TRUE) {
+   struct ofono_call_forwarding_condition cd = {0, 0, {, 0}, 0};
+
+   for (i = 0; i  4; i++)
+   hidden = g_slist_prepend(hidden, cd);
+   }
+
+   for (i = 0; i  4; i++)
+   property_append_cf_conditions(dict, (status 
+   i != CALL_FORWARDING_TYPE_UNCONDITIONAL) ?
+   hidden : cf-cf_conditions[i],
+   BEARER_CLASS_VOICE,
+   cf_type_lut[i]);
+
+   if (status == TRUE)
+   g_slist_free(hidden);
+
ofono_dbus_dict_append(dict, ForwardingFlagOnSim, DBUS_TYPE_BOOLEAN,
status);
 
@@ -552,6 +567,13 @@ static void get_query_cf_callback(const struct ofono_error 
*error, int total,
cf-flags |= CALL_FORWARDING_FLAG_CACHED;
}
 
+   if (cf-query_next == CALL_FORWARDING_TYPE_UNCONDITIONAL 
+   is_cfu_enabled(cf, NULL) == TRUE) {
+   DBusMessage *reply = cf_get_properties_reply(cf-pending, cf);
+   __ofono_dbus_pending_reply(cf-pending, reply);
+   return;
+   }
+
if (cf-query_next == CALL_FORWARDING_TYPE_NOT_REACHABLE) {
DBusMessage *reply = cf_get_properties_reply(cf-pending, cf);
__ofono_dbus_pending_reply(cf-pending, reply);
@@ -575,7 +597,8 @@ static DBusMessage *cf_get_properties(DBusConnection *conn, 
DBusMessage *msg,
struct ofono_modem *modem = __ofono_atom_get_modem(cf-atom);
 
if ((cf-flags  CALL_FORWARDING_FLAG_CACHED) ||
-   ofono_modem_get_online(modem) == FALSE)
+   ofono_modem_get_online(modem) == FALSE ||
+   is_cfu_enabled(cf, NULL) == TRUE)
return cf_get_properties_reply(msg, cf);
 
if (cf-driver-query == NULL)
@@ -698,6 +721,15 @@ static void set_property_callback(const struct ofono_error 
*error, void *data)
return;
}
 
+   if (cf-query_next != CALL_FORWARDING_TYPE_UNCONDITIONAL 
+   is_cfu_enabled(cf, NULL) == TRUE) {
+   DBusMessage *reply;
+   cf-flags = ~CALL_FORWARDING_FLAG_CACHED;
+   reply = dbus_message_new_method_return(cf-pending);
+   __ofono_dbus_pending_reply(cf-pending, reply);
+   return;
+   }
+
/* Successfully set, query the entire set just in case */
set_query_next_cf_cond(cf);
 }
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] TODO: Set owner of call forwarding state handling

2011-05-31 Thread Nicolas Bertrand
---
 TODO |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/TODO b/TODO
index 73768a5..6dafba5 100644
--- a/TODO
+++ b/TODO
@@ -214,6 +214,7 @@ Supplementary Services
 
   Priority: High
   Complexity: C1
+  Owner: Nicolas Bertrand nicolas.bertr...@linux.intel.com
 
 
 Voicecall
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 0/5] Add support of remote hangup

2011-05-18 Thread Nicolas Bertrand
These patchs introduce the possibility of remote hangup
by selecting the call in the call table and use the new 
button hangup.

Nicolas Bertrand (5):
  controlbase: Add hangup button
  callmanager: Remote hangup slot
  hardwaremanipulator: add hangup signal
  control: Handle hangup call
  phonesim: Connect hangup signal

 src/callmanager.cpp   |   23 +++
 src/callmanager.h |3 +++
 src/control.cpp   |   24 +++-
 src/control.h |2 ++
 src/controlbase.ui|7 +++
 src/hardwaremanipulator.h |1 +
 src/phonesim.cpp  |2 ++
 7 files changed, 61 insertions(+), 1 deletions(-)

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 1/5] controlbase: Add hangup button

2011-05-18 Thread Nicolas Bertrand
---
 src/controlbase.ui |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/controlbase.ui b/src/controlbase.ui
index 45b60f9..50315db 100644
--- a/src/controlbase.ui
+++ b/src/controlbase.ui
@@ -1410,6 +1410,13 @@ p, li { white-space: pre-wrap; }
/property
   /widget
  /item
+ item
+  widget class=QPushButton name=pbHangup
+   property name=text
+stringHangup/string
+   /property
+  /widget
+ /item
 /layout
/item
item
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 4/5] control: Handle hangup call

2011-05-18 Thread Nicolas Bertrand
---
 src/control.cpp |   24 +++-
 src/control.h   |2 ++
 2 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/src/control.cpp b/src/control.cpp
index 60f23f2..7c52564 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -90,6 +90,7 @@ ControlWidget::ControlWidget(const QString ruleFile, Control 
*parent)
 connect(ui-pbSendNotif, SIGNAL(clicked()), this, SLOT(sendCSSN()));
 connect(ui-pbAlerting, SIGNAL(clicked()), this, SLOT(setStateAlerting()));
 connect(ui-pbActive, SIGNAL(clicked()), this, SLOT(setStateConnected()));
+connect(ui-pbHangup, SIGNAL(clicked()), this, SLOT(setStateHangup()));
 
 QStringList headers;
 headers  Sender  Priority  Notification Status;
@@ -127,7 +128,8 @@ Control::Control(const QString ruleFile, SimRules *sr, 
QObject *parent)
  SIGNAL(switchTo(QString))
  SIGNAL(startIncomingCall(QString, QString, QString))
  SIGNAL(stateChangedToAlerting())
- SIGNAL(stateChangedToConnected());
+ SIGNAL(stateChangedToConnected())
+ SIGNAL(stateChangedToHangup(int));
 
 foreach (QByteArray sig, proxySignals)
 connect(widget, sig, this, sig);
@@ -182,6 +184,26 @@ void ControlWidget::setStateAlerting()
 emit stateChangedToAlerting();
 }
 
+void ControlWidget::setStateHangup()
+{
+QList QTableWidgetItem * items = ui-twCallMgt-selectedItems();
+
+foreach ( QTableWidgetItem *item, items )
+{
+int row = item-row();
+if ( row = 0 )
+{
+QTableWidgetItem *itemCallId = ui-twCallMgt-item( row, 0 );
+if ( itemCallId != 0 )
+{
+QString strid = itemCallId-text();
+int id = strid.toInt();
+emit p-stateChangedToHangup( id );
+}
+}
+}
+}
+
 void ControlWidget::setCssiEnabled( bool enableCSSI )
 {
 ui-cbCSSI-setEnabled( enableCSSI );
diff --git a/src/control.h b/src/control.h
index 3b8ff64..fd1a4e6 100644
--- a/src/control.h
+++ b/src/control.h
@@ -106,6 +106,7 @@ private slots:
 void sendCSSN();
 void setStateAlerting();
 void setStateConnected();
+void setStateHangup();
 
 signals:
 void unsolicitedCommand(const QString );
@@ -115,6 +116,7 @@ signals:
 void startIncomingCall(const QString , const QString , const QString );
 void stateChangedToAlerting();
 void stateChangedToConnected();
+void stateChangedToHangup( int callId );
 
 protected:
 void closeEvent(QCloseEvent *event);
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 5/5] phonesim: Connect hangup signal

2011-05-18 Thread Nicolas Bertrand
---
 src/phonesim.cpp |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/phonesim.cpp b/src/phonesim.cpp
index d3bd049..aa49f46 100644
--- a/src/phonesim.cpp
+++ b/src/phonesim.cpp
@@ -534,6 +534,8 @@ SimRules::SimRules( int fd, QObject *p,  const QString 
filename, HardwareManipu
 SLOT( dialingToAlerting() ) );
 connect ( machine, SIGNAL( stateChangedToConnected() ), _callManager,
 SLOT( dialingToConnected() ) );
+connect ( machine, SIGNAL( stateChangedToHangup( int ) ), _callManager,
+SLOT( hangupRemote( int ) ) );
 }
 
 connect(this,SIGNAL(readyRead()),
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 3/5] hardwaremanipulator: add hangup signal

2011-05-18 Thread Nicolas Bertrand
---
 src/hardwaremanipulator.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/hardwaremanipulator.h b/src/hardwaremanipulator.h
index 9a82ca0..881125e 100644
--- a/src/hardwaremanipulator.h
+++ b/src/hardwaremanipulator.h
@@ -60,6 +60,7 @@ signals:
 void startIncomingCall(const QString number, const QString 
called_number, const QString name);
 void stateChangedToAlerting();
 void stateChangedToConnected();
+void stateChangedToHangup( int callId );
 
 protected:
 virtual QString constructCBMessage(const QString messageCode, int 
geographicalScope, const QString updateNumber, const QString channel,
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] callmanager: Remove connect and alert timers

2011-05-12 Thread Nicolas Bertrand
---
 src/callmanager.cpp |   29 -
 src/callmanager.h   |2 --
 2 files changed, 0 insertions(+), 31 deletions(-)

diff --git a/src/callmanager.cpp b/src/callmanager.cpp
index 8085056..fb132b5 100644
--- a/src/callmanager.cpp
+++ b/src/callmanager.cpp
@@ -31,14 +31,6 @@ CallManager::CallManager( QObject *parent )
 _multipartyLimit = -1;
 numRings = 0;
 
-connectTimer = new QTimer(this);
-connectTimer-setSingleShot(true);
-connect( connectTimer, SIGNAL(timeout()), this, SLOT(dialingToConnected()) 
);
-
-alertingTimer = new QTimer(this);
-alertingTimer-setSingleShot(true);
-connect( alertingTimer, SIGNAL(timeout()), this, SLOT(dialingToAlerting()) 
);
-
 hangupTimer = new QTimer(this);
 hangupTimer-setSingleShot(true);
 connect( hangupTimer, SIGNAL(timeout()), this, SLOT(hangupTimeout()) );
@@ -155,10 +147,6 @@ bool CallManager::command( const QString cmd )
 sendState( info );
 send( OK );
 
-// Start timers to transition the dialing call to alerting and 
connected.
-alertingTimer-start(2500);
-connectTimer-start(3000);
-
 // Data call - phone number 696969
 } else if ( cmd.startsWith( ATD ) ) {
 // Data call setup.
@@ -183,10 +171,6 @@ bool CallManager::command( const QString cmd )
 // Advertise the call state change and then return to command 
mode.
 sendState( info );
 send( CONNECT 19200 );
-
-// Start timers to transition the dialing call to alerting and 
connected.
-alertingTimer-start(2500);
-connectTimer-start(3000);
 } else {
 // If not a data line
 emit send( NO CARRIER );
@@ -397,8 +381,6 @@ void CallManager::hangupAll()
 sendState( callList[index] );
 }
 callList.clear();
-connectTimer-stop();
-alertingTimer-stop();
 hangupTimer-stop();
 emit callStatesChanged( callList );
 }
@@ -533,8 +515,6 @@ bool CallManager::chld1()
 } else if ( ( id = idForDialing() ) = 0 ) {
 // We have a dialing call.
 hangupCall(id);
-connectTimer-stop();
-alertingTimer-stop();
 hangupTimer-stop();
 return true;
 } else {
@@ -550,8 +530,6 @@ bool CallManager::chld1x( int x )
 if ( callList[index].id == x ) {
 if ( callList[index].state == CallState_Dialing ||
  callList[index].state == CallState_Alerting ) {
-connectTimer-stop();
-alertingTimer-stop();
 hangupTimer-stop();
 }
 callList[index].state = CallState_Hangup;
@@ -700,10 +678,6 @@ bool CallManager::chld4()
 
 void CallManager::dialingToConnected()
 {
-// Stop timers in case they are still active
-alertingTimer-stop();
-connectTimer-stop();
-
 // Find the currently dialing or alerting call.
 int index = indexForId( idForState( CallState_Dialing ) );
 if ( index  0 )
@@ -730,9 +704,6 @@ void CallManager::dialingToConnected()
 
 void CallManager::dialingToAlerting()
 {
-// Stop the timer in case it is still active
-alertingTimer-stop();
-
 // Find the currently dialing or alerting call.
 int index = indexForId( idForState( CallState_Dialing ) );
 if ( index  0 )
diff --git a/src/callmanager.h b/src/callmanager.h
index c953a7d..ff3ac30 100644
--- a/src/callmanager.h
+++ b/src/callmanager.h
@@ -143,8 +143,6 @@ private slots:
 
 private:
 QListCallInfo callList;
-QTimer *connectTimer;
-QTimer *alertingTimer;
 QTimer *hangupTimer;
 QTimer *ringTimer;
 bool _holdWillFail;
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 0/5] Introduce call management buttons

2011-05-11 Thread Nicolas Bertrand
This patch add support of call state management.
Buttons Alerting and Active permit to change the state of on-going call.

Nicolas Bertrand (5):
  controlbase: Add call state management buttons
  hardwaremanipulator: Call state changed signals
  callmanager: Change call state management slots
  control: handle call management buttons
  phonesim: connect call mangagement signals

 src/callmanager.cpp   |7 +++
 src/callmanager.h |   12 ++--
 src/control.cpp   |   12 
 src/control.h |2 ++
 src/controlbase.ui|   18 ++
 src/hardwaremanipulator.h |2 ++
 src/phonesim.cpp  |4 
 7 files changed, 51 insertions(+), 6 deletions(-)

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 1/5] controlbase: Add call state management buttons

2011-05-11 Thread Nicolas Bertrand
---
 src/controlbase.ui |   18 ++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/controlbase.ui b/src/controlbase.ui
index dd60cda..45b60f9 100644
--- a/src/controlbase.ui
+++ b/src/controlbase.ui
@@ -1395,6 +1395,24 @@ p, li { white-space: pre-wrap; }
 /widget
/item
item
+layout class=QHBoxLayout name=horizontalLayout_4
+ item
+  widget class=QPushButton name=pbAlerting
+   property name=text
+stringAlerting/string
+   /property
+  /widget
+ /item
+ item
+  widget class=QPushButton name=pbActive
+   property name=text
+stringActive/string
+   /property
+  /widget
+ /item
+/layout
+   /item
+   item
 layout class=QHBoxLayout name=horizontalLayout_3
  item
   widget class=QGroupBox name=gbIncomingCall
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 2/5] hardwaremanipulator: Call state changed signals

2011-05-11 Thread Nicolas Bertrand
---
 src/hardwaremanipulator.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/hardwaremanipulator.h b/src/hardwaremanipulator.h
index ae8e716..9a82ca0 100644
--- a/src/hardwaremanipulator.h
+++ b/src/hardwaremanipulator.h
@@ -58,6 +58,8 @@ signals:
 void variableChanged(const QString n, const QString v);
 void switchTo(const QString cmd);
 void startIncomingCall(const QString number, const QString 
called_number, const QString name);
+void stateChangedToAlerting();
+void stateChangedToConnected();
 
 protected:
 virtual QString constructCBMessage(const QString messageCode, int 
geographicalScope, const QString updateNumber, const QString channel,
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 3/5] callmanager: Change call state management slots

2011-05-11 Thread Nicolas Bertrand
---
 src/callmanager.cpp |7 +++
 src/callmanager.h   |   12 ++--
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/callmanager.cpp b/src/callmanager.cpp
index 0ede2ad..8085056 100644
--- a/src/callmanager.cpp
+++ b/src/callmanager.cpp
@@ -700,6 +700,10 @@ bool CallManager::chld4()
 
 void CallManager::dialingToConnected()
 {
+// Stop timers in case they are still active
+alertingTimer-stop();
+connectTimer-stop();
+
 // Find the currently dialing or alerting call.
 int index = indexForId( idForState( CallState_Dialing ) );
 if ( index  0 )
@@ -726,6 +730,9 @@ void CallManager::dialingToConnected()
 
 void CallManager::dialingToAlerting()
 {
+// Stop the timer in case it is still active
+alertingTimer-stop();
+
 // Find the currently dialing or alerting call.
 int index = indexForId( idForState( CallState_Dialing ) );
 if ( index  0 )
diff --git a/src/callmanager.h b/src/callmanager.h
index 228e26c..c953a7d 100644
--- a/src/callmanager.h
+++ b/src/callmanager.h
@@ -100,6 +100,12 @@ public slots:
 void startIncomingCall( const QString number, const QString calledNumber,
 const QString name );
 
+// Transition the active dialing or alerting call to connected.
+void dialingToConnected();
+
+// Transition the active dialing call to alerting.
+void dialingToAlerting();
+
 signals:
 // Send a response to a command.
 void send( const QString line );
@@ -118,12 +124,6 @@ signals:
 void callStatesChanged( QListCallInfo *list );
 
 private slots:
-// Transition the active dialing or alerting call to connected.
-void dialingToConnected();
-
-// Transition the active dialing call to alerting.
-void dialingToAlerting();
-
 // Transition the waiting call to incoming.
 void waitingToIncoming();
 
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 4/5] control: handle call management buttons

2011-05-11 Thread Nicolas Bertrand
---
 src/control.cpp |   12 
 src/control.h   |2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/control.cpp b/src/control.cpp
index de141c3..4fdba27 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -88,6 +88,8 @@ ControlWidget::ControlWidget(const QString ruleFile, Control 
*parent)
 connect(ui-pbSendGNSSData, SIGNAL(clicked()), this, SLOT(sendGNSSData()));
 connect(ui-pbGNSSDefault, SIGNAL(clicked()), this, 
SLOT(setDefaultGNSSData()));
 connect(ui-pbSendNotif, SIGNAL(clicked()), this, SLOT(sendCSSN()));
+connect(ui-pbAlerting, SIGNAL(clicked()), this, SLOT(setStateAlerting()));
+connect(ui-pbActive, SIGNAL(clicked()), this, SLOT(setStateConnected()));
 
 QStringList headers;
 headers  Sender  Priority  Notification Status;
@@ -168,6 +170,16 @@ void Control::callManagement( QListCallInfo *list )
 widget-setCssuEnabled( enableCSSU );
 }
 
+void ControlWidget::setStateConnected()
+{
+emit p-stateChangedToConnected();
+}
+
+void ControlWidget::setStateAlerting()
+{
+emit p-stateChangedToAlerting();
+}
+
 void ControlWidget::setCssiEnabled( bool enableCSSI )
 {
 ui-cbCSSI-setEnabled( enableCSSI );
diff --git a/src/control.h b/src/control.h
index ac39eb3..1d8f06f 100644
--- a/src/control.h
+++ b/src/control.h
@@ -104,6 +104,8 @@ private slots:
 void sendGNSSData();
 void setDefaultGNSSData();
 void sendCSSN();
+void setStateAlerting();
+void setStateConnected();
 
 signals:
 void unsolicitedCommand(const QString );
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 5/5] phonesim: connect call mangagement signals

2011-05-11 Thread Nicolas Bertrand
---
 src/phonesim.cpp |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/phonesim.cpp b/src/phonesim.cpp
index 6b45cf6..d3bd049 100644
--- a/src/phonesim.cpp
+++ b/src/phonesim.cpp
@@ -530,6 +530,10 @@ SimRules::SimRules( int fd, QObject *p,  const QString 
filename, HardwareManipu
  _callManager, 
SLOT(startIncomingCall(QString,QString,QString)) );
 connect ( _callManager, SIGNAL( callStatesChanged( QListCallInfo * ) 
),
   machine, SLOT( callManagement( QListCallInfo * ) ) );
+connect ( machine, SIGNAL( stateChangedToAlerting() ), _callManager,
+SLOT( dialingToAlerting() ) );
+connect ( machine, SIGNAL( stateChangedToConnected() ), _callManager,
+SLOT( dialingToConnected() ) );
 }
 
 connect(this,SIGNAL(readyRead()),
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] controlbase: Gather call elements on the same tab

2011-05-06 Thread Nicolas Bertrand
Group CSSU/CSSI and incomming call UI together on the same Call tab

---
 src/controlbase.ui |  267 ++--
 1 files changed, 132 insertions(+), 135 deletions(-)

diff --git a/src/controlbase.ui b/src/controlbase.ui
index 41c6d12..dd60cda 100644
--- a/src/controlbase.ui
+++ b/src/controlbase.ui
@@ -113,144 +113,34 @@
   /widget
  /item
  item
-  widget class=QGroupBox name=gbIncomingCall
-   property name=title
-stringIncoming Call/string
-   /property
-   layout class=QGridLayout name=gridLayout
-item row=0 column=0
- widget class=QCheckBox name=cbCaller
-  property name=text
-   stringCaller Identity/string
-  /property
-  property name=checked
-   booltrue/bool
-  /property
- /widget
-/item
-item row=0 column=1
- widget class=QLineEdit name=leCaller/
-/item
-item row=1 column=0
- widget class=QCheckBox name=cbCallerName
-  property name=text
-   stringCaller Name/string
-  /property
- /widget
-/item
-item row=1 column=1
- widget class=QLineEdit name=leCallerName
-  property name=enabled
-   boolfalse/bool
-  /property
- /widget
-/item
-item row=2 column=0
- widget class=QCheckBox name=cbCalledLine
-  property name=text
-   stringCalled Line/string
-  /property
- /widget
-/item
-item row=2 column=1
- widget class=QLineEdit name=leCalledLine
-  property name=enabled
-   boolfalse/bool
-  /property
- /widget
-/item
-item row=3 column=0 colspan=2
- layout class=QHBoxLayout
-  property name=spacing
-   number6/number
-  /property
-  property name=margin
-   number0/number
-  /property
-  item
-   spacer
-property name=orientation
- enumQt::Horizontal/enum
-/property
-property name=sizeHint stdset=0
- size
-  width111/width
-  height20/height
- /size
-/property
-   /spacer
-  /item
-  item
-   widget class=QPushButton name=pbIncomingCall
-property name=text
- stringamp;Call/string
-/property
-   /widget
-  /item
- /layout
-/item
-   /layout
-  /widget
- /item
-/layout
-   /item
-   item
-layout class=QHBoxLayout name=horizontalLayout_3
- item
   spacer name=horizontalSpacer
property name=orientation
 enumQt::Horizontal/enum
/property
-   property name=sizeType
-enumQSizePolicy::Fixed/enum
-   /property
property name=sizeHint stdset=0
 size
- width322/width
+ width40/width
  height20/height
 /size
/property
   /spacer
  /item
- item
-  widget class=QGroupBox name=gbCallSettings
-   property name=title
-stringCall Settings/string
-   /property
-   layout class=QGridLayout name=gridLayout_2
-item row=0 column=1
- widget class=QComboBox name=cbCSSU/
-/item
-item row=1 column=1
- widget class=QComboBox name=cbCSSI/
-/item
-item row=0 column=0
- widget class=QLabel name=lbCSSU
-  property name=text
-   stringCSSU/string
-  /property
- /widget
-/item
-item row=1 column=0
- widget class=QLabel name=lbCSSI
-  property name=text
-   stringCSSI/string
-  /property
- /widget
-/item
-item row=2 column=1
- widget class=QPushButton name=pbSendNotif
-  property name=text
-   stringSend Notification/string
-  /property
- /widget
-/item
-   /layout
-  /widget
- /item
 /layout
/item
item
+spacer name=verticalSpacer
+ property name=orientation
+  enumQt::Vertical/enum
+ /property
+ property name=sizeHint stdset=0
+  size
+   width20/width
+   height10/height
+  /size
+ /property
+/spacer
+   /item
+   

[PATCH v2 0/6] phonesim: Add call status UI

2011-05-02 Thread Nicolas Bertrand
This  patch introduce a new tab call in phonesim UI in order to display calls
informationsi (id, number, status, name and direction).
The interface to send CSSU and CSSI notification is now dynamic based on the
type of current calls.
Fix some coding-style violations.

Nicolas Bertrand (6):
  callmanager: Add signal on call status change
  control: Update UI using call status
  hardwaremanipulator: add callmanagement method
  phonesim: Connect call status signal
  controlbase.ui: Add call mangement tab
  control: Update call view

 src/callmanager.cpp |   22 +++
 src/callmanager.h   |3 +
 src/control.cpp |  140 ++-
 src/control.h   |6 ++
 src/controlbase.ui  |   61 +++
 src/hardwaremanipulator.cpp |4 +
 src/hardwaremanipulator.h   |2 +
 src/phonesim.cpp|2 +
 8 files changed, 224 insertions(+), 16 deletions(-)

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH v2 2/6] control: Update UI using call status

2011-05-02 Thread Nicolas Bertrand
---
 src/control.cpp |   40 +++-
 src/control.h   |5 +
 2 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/src/control.cpp b/src/control.cpp
index 645219c..1e71593 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -134,6 +134,32 @@ Control::~Control()
 delete widget;
 }
 
+void Control::callManagement( QListCallInfo *list )
+{
+bool enableCSSU = false;
+bool enableCSSI = false;
+
+foreach( CallInfo i, *list ) {
+if ( i.incoming  !enableCSSU )
+enableCSSU = true;
+if ( !i.incoming  !enableCSSI )
+enableCSSI = true;
+}
+
+widget-setCssiEnabled( enableCSSI );
+widget-setCssuEnabled( enableCSSU );
+}
+
+void ControlWidget::setCssiEnabled( bool enableCSSI )
+{
+ui-cbCSSI-setEnabled( enableCSSI );
+}
+
+void ControlWidget::setCssuEnabled( bool enableCSSU )
+{
+ui-cbCSSU-setEnabled( enableCSSU );
+}
+
 void Control::setPhoneNumber( const QString number )
 {
 widget-setWindowTitle(Phonesim - Number:  + number);
@@ -146,6 +172,10 @@ void Control::warning( const QString title, const QString 
message )
 
 void ControlWidget::handleCSSNNotif()
 {
+
+ui-cbCSSU-setEnabled( false );
+ui-cbCSSI-setEnabled( false );
+
 ui-cbCSSU-insertItem(0, );
 ui-cbCSSU-insertItem(1, 0 - forwarded, 0);
 ui-cbCSSU-insertItem(3, 2 - on hold, 2);
@@ -160,15 +190,15 @@ void ControlWidget::handleCSSNNotif()
 
 void ControlWidget::sendCSSN()
 {
-QVariant v = ui-cbCSSU-itemData(ui-cbCSSU-currentIndex());
+QVariant v = ui-cbCSSU-itemData( ui-cbCSSU-currentIndex() );
 
-if (v.canConvertint())
-emit unsolicitedCommand(+CSSU: +QString::number(v.toInt()));
+if ( v.canConvertint()  ui-cbCSSU-isEnabled() )
+emit unsolicitedCommand( +CSSU: +QString::number( v.toInt() ) );
 
 v = ui-cbCSSI-itemData(ui-cbCSSI-currentIndex());
 
-if (v.canConvertint())
-emit unsolicitedCommand(+CSSI: +QString::number(v.toInt()));
+if ( v.canConvertint()  ui-cbCSSI-isEnabled() )
+emit unsolicitedCommand( +CSSI: +QString::number( v.toInt() ) );
 }
 
 void ControlWidget::sendSQ()
diff --git a/src/control.h b/src/control.h
index c17146a..3acffc9 100644
--- a/src/control.h
+++ b/src/control.h
@@ -25,6 +25,7 @@
 #include QtScript
 #include ui_controlbase.h
 #include attranslator.h
+#include callmanager.h
 
 class Control;
 
@@ -71,6 +72,9 @@ public:
 void handleToData( const QString );
 void handleNewApp();
 void handleCSSNNotif();
+void setCssuEnabled( bool enableCSSU );
+void setCssiEnabled( bool enableCSSI );
+
 
 private slots:
 void sendSQ();
@@ -146,6 +150,7 @@ public slots:
 void handleToData( const QString );
 void setPhoneNumber( const QString );
 void handleNewApp();
+void callManagement( QListCallInfo *info );
 
 protected:
 virtual void warning( const QString, const QString );
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH v2 3/6] hardwaremanipulator: add callmanagement method

2011-05-02 Thread Nicolas Bertrand
---
 src/hardwaremanipulator.cpp |4 
 src/hardwaremanipulator.h   |2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/hardwaremanipulator.cpp b/src/hardwaremanipulator.cpp
index c7bbe6a..909ce2a 100644
--- a/src/hardwaremanipulator.cpp
+++ b/src/hardwaremanipulator.cpp
@@ -337,3 +337,7 @@ void HardwareManipulator::simAppAbort()
 if (app)
 return app-abort();
 }
+
+void HardwareManipulator::callManagement( QListCallInfo *info )
+{
+}
diff --git a/src/hardwaremanipulator.h b/src/hardwaremanipulator.h
index df8f65e..ae8e716 100644
--- a/src/hardwaremanipulator.h
+++ b/src/hardwaremanipulator.h
@@ -27,6 +27,7 @@
 class QSMSMessage;
 class QVMMessage;
 class SimRules;
+struct CallInfo;
 class HardwareManipulator : public QObject
 {
 Q_OBJECT
@@ -49,6 +50,7 @@ public slots:
 virtual void simAppStart( int appIndex );
 virtual void simAppAbort();
 virtual void handleNewApp();
+virtual void callManagement( QListCallInfo *info );
 
 signals:
 void unsolicitedCommand(const QString cmd);
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH v2 1/6] callmanager: Add signal on call status change

2011-05-02 Thread Nicolas Bertrand
---
 src/callmanager.cpp |   22 ++
 src/callmanager.h   |3 +++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/src/callmanager.cpp b/src/callmanager.cpp
index 585a3ac..0ede2ad 100644
--- a/src/callmanager.cpp
+++ b/src/callmanager.cpp
@@ -149,6 +149,8 @@ bool CallManager::command( const QString cmd )
 info.dialBack = false;
 callList += info;
 
+emit callStatesChanged( callList );
+
 // Advertise the call state change and then return to command mode.
 sendState( info );
 send( OK );
@@ -176,6 +178,8 @@ bool CallManager::command( const QString cmd )
 info.dialBack = false;
 callList += info;
 
+emit callStatesChanged( callList );
+
 // Advertise the call state change and then return to command 
mode.
 sendState( info );
 send( CONNECT 19200 );
@@ -369,6 +373,7 @@ void CallManager::startIncomingCall( const QString number,
 callList += info;
 
 emitRing(info);
+emit callStatesChanged( callList );
 
 // Announce the incoming call using Ericsson-style state notifications.
 sendState( info );
@@ -395,6 +400,7 @@ void CallManager::hangupAll()
 connectTimer-stop();
 alertingTimer-stop();
 hangupTimer-stop();
+emit callStatesChanged( callList );
 }
 
 void CallManager::hangupConnected()
@@ -412,6 +418,8 @@ void CallManager::hangupConnected()
 
 if ( !hasCall( CallState_Held ) )
 waitingToIncoming();
+
+emit callStatesChanged( callList );
 }
 
 void CallManager::hangupHeld()
@@ -429,6 +437,8 @@ void CallManager::hangupHeld()
 
 if ( !hasCall( CallState_Active ) )
 waitingToIncoming();
+
+emit callStatesChanged( callList );
 }
 
 void CallManager::hangupConnectedAndHeld()
@@ -445,6 +455,7 @@ void CallManager::hangupConnectedAndHeld()
 }
 callList = newCallList;
 waitingToIncoming();
+emit callStatesChanged( callList );
 }
 
 void CallManager::hangupCall( int id )
@@ -466,11 +477,13 @@ bool CallManager::acceptCall()
 changeGroup( CallState_Active, CallState_Held );
 callList[index].state = CallState_Active;
 sendState( callList[index] );
+emit callStatesChanged( callList );
 return true;
 } else {
 // Only held calls, or no other calls, so just make the incoming call 
active.
 callList[index].state = CallState_Active;
 sendState( callList[index] );
+emit callStatesChanged( callList );
 return true;
 }
 }
@@ -500,6 +513,7 @@ bool CallManager::chld1()
 int index = indexForId(id);
 callList[index].state = CallState_Active;
 sendState( callList[index] );
+emit callStatesChanged( callList );
 return true;
 } else if ( hasCall( CallState_Held ) ) {
 // Hangup the active calls and activate the held ones.
@@ -508,6 +522,7 @@ bool CallManager::chld1()
 if ( callList[index].state == CallState_Held ) {
 callList[index].state = CallState_Active;
 sendState( callList[index] );
+emit callStatesChanged( callList );
 }
 }
 return true;
@@ -551,6 +566,7 @@ bool CallManager::chld1x( int x )
 if ( !hasCall( CallState_Active )  !hasCall( CallState_Held ) )
 waitingToIncoming();
 
+emit callStatesChanged( callList );
 return found;
 }
 
@@ -570,6 +586,7 @@ bool CallManager::chld2()
 int index = indexForId( id );
 callList[index].state = CallState_Active;
 sendState( callList[index] );
+emit callStatesChanged( callList );
 return true;
 } else if ( hasCall( CallState_Active )  hasCall( CallState_Held ) ) {
 // Swap the active and held calls.
@@ -620,6 +637,7 @@ bool CallManager::chld2x( int x )
 // No active calls, so make just this call active.
 callList[index].state = CallState_Active;
 sendState( callList[index] );
+emit callStatesChanged( callList );
 }
 return true;
 } else if ( callList[index].state == CallState_Active ) {
@@ -634,6 +652,7 @@ bool CallManager::chld2x( int x )
 return false;
 callList[index2].state = CallState_Held;
 sendState( callList[index2] );
+emit callStatesChanged( callList );
 }
 }
 return true;
@@ -691,6 +710,7 @@ void CallManager::dialingToConnected()
 // Transition the call to its new state.
 callList[index].state = CallState_Active;
 sendState( callList[index] );
+emit callStatesChanged( callList );
 // If the dialed number starts with 05123, disconnect the
 // call after xx seconds, where xx is part of the dial string
 // as 05123xx
@@ -714,6 +734,7 @@ void CallManager::dialingToAlerting()
 // Transition the call to its new state.
 

[PATCH v2 4/6] phonesim: Connect call status signal

2011-05-02 Thread Nicolas Bertrand
---
 src/phonesim.cpp |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/phonesim.cpp b/src/phonesim.cpp
index a822cd9..6b45cf6 100644
--- a/src/phonesim.cpp
+++ b/src/phonesim.cpp
@@ -528,6 +528,8 @@ SimRules::SimRules( int fd, QObject *p,  const QString 
filename, HardwareManipu
 if ( machine ) {
 connect( machine, SIGNAL(startIncomingCall(QString,QString,QString)),
  _callManager, 
SLOT(startIncomingCall(QString,QString,QString)) );
+connect ( _callManager, SIGNAL( callStatesChanged( QListCallInfo * ) 
),
+  machine, SLOT( callManagement( QListCallInfo * ) ) );
 }
 
 connect(this,SIGNAL(readyRead()),
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH v2 5/6] controlbase.ui: Add call mangement tab

2011-05-02 Thread Nicolas Bertrand
---
 src/controlbase.ui |   61 
 1 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/src/controlbase.ui b/src/controlbase.ui
index cfadfe8..41c6d12 100644
--- a/src/controlbase.ui
+++ b/src/controlbase.ui
@@ -1458,6 +1458,67 @@ p, li { white-space: pre-wrap; }
/property
   /widget
  /widget
+ widget class=QWidget name=tab_9
+  attribute name=title
+   stringCall/string
+  /attribute
+  layout class=QVBoxLayout name=verticalLayout_3
+   item
+widget class=QTableWidget name=twCallMgt
+ property name=columnCount
+  number5/number
+ /property
+ attribute name=horizontalHeaderMinimumSectionSize
+  number50/number
+ /attribute
+ attribute name=horizontalHeaderShowSortIndicator stdset=0
+  booltrue/bool
+ /attribute
+ attribute name=verticalHeaderDefaultSectionSize
+  number50/number
+ /attribute
+ column
+  property name=text
+   stringid/string
+  /property
+ /column
+ column
+  property name=text
+   stringnumber/string
+  /property
+ /column
+ column
+  property name=text
+   stringstate/string
+  /property
+ /column
+ column
+  property name=text
+   stringname/string
+  /property
+ /column
+ column
+  property name=text
+   stringtype/string
+  /property
+ /column
+/widget
+   /item
+   item
+spacer name=verticalSpacer
+ property name=orientation
+  enumQt::Vertical/enum
+ /property
+ property name=sizeHint stdset=0
+  size
+   width20/width
+   height40/height
+  /size
+ /property
+/spacer
+   /item
+  /layout
+ /widget
 /widget
/item
item
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH v2 6/6] control: Update call view

2011-05-02 Thread Nicolas Bertrand
---
 src/control.cpp |  100 +--
 src/control.h   |3 +-
 2 files changed, 91 insertions(+), 12 deletions(-)

diff --git a/src/control.cpp b/src/control.cpp
index 1e71593..a9b2fd5 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -136,14 +136,79 @@ Control::~Control()
 
 void Control::callManagement( QListCallInfo *list )
 {
+int row = 0;
 bool enableCSSU = false;
 bool enableCSSI = false;
 
+widget-clearCallView();
+
 foreach( CallInfo i, *list ) {
+QString param[5];
+
 if ( i.incoming  !enableCSSU )
 enableCSSU = true;
 if ( !i.incoming  !enableCSSI )
 enableCSSI = true;
+
+param[0].setNum( i.id );
+param[1] = i.number;
+
+switch( i.state ) {
+
+case CallState_Active:
+{
+param[2] = Active;
+}
+break;
+
+case CallState_Held:
+{
+param[2] = Held;
+}
+break;
+
+case CallState_Dialing:
+{
+param[2] = Dialing;
+}
+break;
+
+case CallState_Alerting:
+{
+param[2] = Alerting;
+}
+break;
+
+case CallState_Incoming:
+{
+param[2] = Incoming;
+}
+break;
+
+case CallState_Waiting:
+{
+param[2] = Waiting;
+}
+break;
+
+case CallState_Hangup:
+{
+param[2] = Hangup;
+}
+break;
+
+case CallState_SwapDummy:
+{
+param[2] = SwapDummy;
+}
+break;
+}
+
+param[3] = i.name;
+param[4] = i.incoming ? incoming : outgoing;
+
+widget-updateCallView( param, row );
+row++;
 }
 
 widget-setCssiEnabled( enableCSSI );
@@ -160,6 +225,20 @@ void ControlWidget::setCssuEnabled( bool enableCSSU )
 ui-cbCSSU-setEnabled( enableCSSU );
 }
 
+void ControlWidget::clearCallView()
+{
+ui-twCallMgt-clearContents();
+}
+
+void ControlWidget::updateCallView( QString callParameters [5], int row )
+{
+if ( row  ui-twCallMgt-rowCount() - 1 )
+ui-twCallMgt-insertRow( row );
+
+for ( int i = 0; i  5; i++ )
+ui-twCallMgt-setItem( row, i, new QTableWidgetItem( 
callParameters[i] ) );
+}
+
 void Control::setPhoneNumber( const QString number )
 {
 widget-setWindowTitle(Phonesim - Number:  + number);
@@ -172,20 +251,19 @@ void Control::warning( const QString title, const 
QString message )
 
 void ControlWidget::handleCSSNNotif()
 {
-
 ui-cbCSSU-setEnabled( false );
 ui-cbCSSI-setEnabled( false );
 
-ui-cbCSSU-insertItem(0, );
-ui-cbCSSU-insertItem(1, 0 - forwarded, 0);
-ui-cbCSSU-insertItem(3, 2 - on hold, 2);
-ui-cbCSSU-insertItem(4, 3 - retrieved, 3);
-ui-cbCSSU-insertItem(5, 4 - multiparty, 4);
+ui-cbCSSU-insertItem( 0,  );
+ui-cbCSSU-insertItem( 1, 0 - forwarded, 0 );
+ui-cbCSSU-insertItem( 3, 2 - on hold, 2 );
+ui-cbCSSU-insertItem( 4, 3 - retrieved, 3 );
+ui-cbCSSU-insertItem( 5, 4 - multiparty, 4 );
 
-ui-cbCSSI-insertItem(0, );
-ui-cbCSSI-insertItem(3, 2 - forwarded, 2);
-ui-cbCSSI-insertItem(6, 5 - outgoing barred, 5);
-ui-cbCSSI-insertItem(7, 6 - incomming barred, 6);
+ui-cbCSSI-insertItem( 0,  );
+ui-cbCSSI-insertItem( 3, 2 - forwarded, 2 );
+ui-cbCSSI-insertItem( 6, 5 - outgoing barred, 5 );
+ui-cbCSSI-insertItem( 7, 6 - incomming barred, 6 );
 }
 
 void ControlWidget::sendCSSN()
@@ -195,7 +273,7 @@ void ControlWidget::sendCSSN()
 if ( v.canConvertint()  ui-cbCSSU-isEnabled() )
 emit unsolicitedCommand( +CSSU: +QString::number( v.toInt() ) );
 
-v = ui-cbCSSI-itemData(ui-cbCSSI-currentIndex());
+v = ui-cbCSSI-itemData( ui-cbCSSI-currentIndex() );
 
 if ( v.canConvertint()  ui-cbCSSI-isEnabled() )
 emit unsolicitedCommand( +CSSI: +QString::number( v.toInt() ) );
diff --git a/src/control.h b/src/control.h
index 3acffc9..ac39eb3 100644
--- a/src/control.h
+++ b/src/control.h
@@ -74,7 +74,8 @@ public:
 void handleCSSNNotif();
 void setCssuEnabled( bool enableCSSU );
 void setCssiEnabled( bool enableCSSI );
-
+void updateCallView( QString callParameters [5], int row );
+void clearCallView();
 
 private slots:
 void sendSQ();
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 1/6] callmanager: Add signal on call status change

2011-04-28 Thread Nicolas Bertrand
---
 src/callmanager.cpp |   34 ++
 src/callmanager.h   |3 +++
 2 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/src/callmanager.cpp b/src/callmanager.cpp
index 585a3ac..9823f05 100644
--- a/src/callmanager.cpp
+++ b/src/callmanager.cpp
@@ -149,6 +149,8 @@ bool CallManager::command( const QString cmd )
 info.dialBack = false;
 callList += info;
 
+emit sendCallStatus( callList );
+
 // Advertise the call state change and then return to command mode.
 sendState( info );
 send( OK );
@@ -176,6 +178,8 @@ bool CallManager::command( const QString cmd )
 info.dialBack = false;
 callList += info;
 
+emit sendCallStatus( callList );
+
 // Advertise the call state change and then return to command 
mode.
 sendState( info );
 send( CONNECT 19200 );
@@ -369,6 +373,7 @@ void CallManager::startIncomingCall( const QString number,
 callList += info;
 
 emitRing(info);
+emit sendCallStatus( callList );
 
 // Announce the incoming call using Ericsson-style state notifications.
 sendState( info );
@@ -395,6 +400,7 @@ void CallManager::hangupAll()
 connectTimer-stop();
 alertingTimer-stop();
 hangupTimer-stop();
+emit sendCallStatus( callList );
 }
 
 void CallManager::hangupConnected()
@@ -412,6 +418,8 @@ void CallManager::hangupConnected()
 
 if ( !hasCall( CallState_Held ) )
 waitingToIncoming();
+
+emit sendCallStatus( callList );
 }
 
 void CallManager::hangupHeld()
@@ -429,6 +437,8 @@ void CallManager::hangupHeld()
 
 if ( !hasCall( CallState_Active ) )
 waitingToIncoming();
+
+emit sendCallStatus( callList );
 }
 
 void CallManager::hangupConnectedAndHeld()
@@ -445,6 +455,7 @@ void CallManager::hangupConnectedAndHeld()
 }
 callList = newCallList;
 waitingToIncoming();
+emit sendCallStatus( callList );
 }
 
 void CallManager::hangupCall( int id )
@@ -464,15 +475,13 @@ bool CallManager::acceptCall()
 } else if ( hasCall( CallState_Active ) ) {
 // Put the active calls on hold and accept the incoming call.
 changeGroup( CallState_Active, CallState_Held );
-callList[index].state = CallState_Active;
-sendState( callList[index] );
-return true;
-} else {
-// Only held calls, or no other calls, so just make the incoming call 
active.
-callList[index].state = CallState_Active;
-sendState( callList[index] );
-return true;
 }
+
+   // No more active calls, so accept incoming
+callList[index].state = CallState_Active;
+sendState( callList[index] );
+emit sendCallStatus( callList );
+   return true;
 }
 
 bool CallManager::chld0()
@@ -500,6 +509,7 @@ bool CallManager::chld1()
 int index = indexForId(id);
 callList[index].state = CallState_Active;
 sendState( callList[index] );
+emit sendCallStatus( callList );
 return true;
 } else if ( hasCall( CallState_Held ) ) {
 // Hangup the active calls and activate the held ones.
@@ -508,6 +518,7 @@ bool CallManager::chld1()
 if ( callList[index].state == CallState_Held ) {
 callList[index].state = CallState_Active;
 sendState( callList[index] );
+emit sendCallStatus( callList );
 }
 }
 return true;
@@ -551,6 +562,7 @@ bool CallManager::chld1x( int x )
 if ( !hasCall( CallState_Active )  !hasCall( CallState_Held ) )
 waitingToIncoming();
 
+emit sendCallStatus( callList );
 return found;
 }
 
@@ -570,6 +582,7 @@ bool CallManager::chld2()
 int index = indexForId( id );
 callList[index].state = CallState_Active;
 sendState( callList[index] );
+emit sendCallStatus( callList );
 return true;
 } else if ( hasCall( CallState_Active )  hasCall( CallState_Held ) ) {
 // Swap the active and held calls.
@@ -620,6 +633,7 @@ bool CallManager::chld2x( int x )
 // No active calls, so make just this call active.
 callList[index].state = CallState_Active;
 sendState( callList[index] );
+emit sendCallStatus( callList );
 }
 return true;
 } else if ( callList[index].state == CallState_Active ) {
@@ -634,6 +648,7 @@ bool CallManager::chld2x( int x )
 return false;
 callList[index2].state = CallState_Held;
 sendState( callList[index2] );
+emit sendCallStatus( callList );
 }
 }
 return true;
@@ -691,6 +706,7 @@ void CallManager::dialingToConnected()
 // Transition the call to its new state.
 callList[index].state = CallState_Active;
 sendState( callList[index] );
+emit sendCallStatus( callList );
 // If the dialed number starts with 05123, 

[PATCH 0/6] phonesim: Add call status UI

2011-04-28 Thread Nicolas Bertrand
This patch introduce a new tab call in phonesim UI in order to display calls
informations (id, number, status, name and direction).
The interface to send CSSU and CSSI notification is now dynamic based on the
type of current calls.

Nicolas Bertrand (6):
  callmanager: Add signal on call status change
  control: Update UI using call status
  hardwaremanipulator: add callmanagement method
  phonesim: Connect call status signal
  controlbase.ui: Add call mangement tab
  control: Update call view

 src/callmanager.cpp |   34 ---
 src/callmanager.h   |3 +
 src/control.cpp |  140 ++-
 src/control.h   |6 ++
 src/controlbase.ui  |   61 +++
 src/hardwaremanipulator.cpp |4 +
 src/hardwaremanipulator.h   |2 +
 src/phonesim.cpp|2 +
 8 files changed, 228 insertions(+), 24 deletions(-)

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 3/6] hardwaremanipulator: add callmanagement method

2011-04-28 Thread Nicolas Bertrand
---
 src/hardwaremanipulator.cpp |4 
 src/hardwaremanipulator.h   |2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/hardwaremanipulator.cpp b/src/hardwaremanipulator.cpp
index c7bbe6a..909ce2a 100644
--- a/src/hardwaremanipulator.cpp
+++ b/src/hardwaremanipulator.cpp
@@ -337,3 +337,7 @@ void HardwareManipulator::simAppAbort()
 if (app)
 return app-abort();
 }
+
+void HardwareManipulator::callManagement( QListCallInfo *info )
+{
+}
diff --git a/src/hardwaremanipulator.h b/src/hardwaremanipulator.h
index df8f65e..ae8e716 100644
--- a/src/hardwaremanipulator.h
+++ b/src/hardwaremanipulator.h
@@ -27,6 +27,7 @@
 class QSMSMessage;
 class QVMMessage;
 class SimRules;
+struct CallInfo;
 class HardwareManipulator : public QObject
 {
 Q_OBJECT
@@ -49,6 +50,7 @@ public slots:
 virtual void simAppStart( int appIndex );
 virtual void simAppAbort();
 virtual void handleNewApp();
+virtual void callManagement( QListCallInfo *info );
 
 signals:
 void unsolicitedCommand(const QString cmd);
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 2/6] control: Update UI using call status

2011-04-28 Thread Nicolas Bertrand
---
 src/control.cpp |   40 +++-
 src/control.h   |5 +
 2 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/src/control.cpp b/src/control.cpp
index 645219c..2f12d91 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -134,6 +134,32 @@ Control::~Control()
 delete widget;
 }
 
+void Control::callManagement( QListCallInfo *list )
+{
+   bool enableCSSU = false;
+   bool enableCSSI = false;
+
+   foreach( CallInfo i, *list ) {
+   if ( i.incoming  !enableCSSU )
+   enableCSSU = true;
+   if ( !i.incoming  !enableCSSI )
+   enableCSSI = true;
+   }
+
+   widget-CSSIactivation( enableCSSI );
+   widget-CSSUactivation( enableCSSU );
+}
+
+void ControlWidget::CSSIactivation( bool enableCSSI )
+{
+ui-cbCSSI-setEnabled( enableCSSI );
+}
+
+void ControlWidget::CSSUactivation( bool enableCSSU )
+{
+ui-cbCSSU-setEnabled( enableCSSU );
+}
+
 void Control::setPhoneNumber( const QString number )
 {
 widget-setWindowTitle(Phonesim - Number:  + number);
@@ -146,6 +172,10 @@ void Control::warning( const QString title, const QString 
message )
 
 void ControlWidget::handleCSSNNotif()
 {
+
+ui-cbCSSU-setEnabled( false );
+ui-cbCSSI-setEnabled( false );
+
 ui-cbCSSU-insertItem(0, );
 ui-cbCSSU-insertItem(1, 0 - forwarded, 0);
 ui-cbCSSU-insertItem(3, 2 - on hold, 2);
@@ -160,15 +190,15 @@ void ControlWidget::handleCSSNNotif()
 
 void ControlWidget::sendCSSN()
 {
-QVariant v = ui-cbCSSU-itemData(ui-cbCSSU-currentIndex());
+QVariant v = ui-cbCSSU-itemData( ui-cbCSSU-currentIndex() );
 
-if (v.canConvertint())
-emit unsolicitedCommand(+CSSU: +QString::number(v.toInt()));
+if ( v.canConvertint()  ui-cbCSSU-isEnabled() )
+emit unsolicitedCommand( +CSSU: +QString::number( v.toInt() ) );
 
 v = ui-cbCSSI-itemData(ui-cbCSSI-currentIndex());
 
-if (v.canConvertint())
-emit unsolicitedCommand(+CSSI: +QString::number(v.toInt()));
+if ( v.canConvertint()  ui-cbCSSI-isEnabled() )
+emit unsolicitedCommand( +CSSI: +QString::number( v.toInt() ) );
 }
 
 void ControlWidget::sendSQ()
diff --git a/src/control.h b/src/control.h
index c17146a..2ccde29 100644
--- a/src/control.h
+++ b/src/control.h
@@ -25,6 +25,7 @@
 #include QtScript
 #include ui_controlbase.h
 #include attranslator.h
+#include callmanager.h
 
 class Control;
 
@@ -71,6 +72,9 @@ public:
 void handleToData( const QString );
 void handleNewApp();
 void handleCSSNNotif();
+void CSSUactivation( bool enableCSSU );
+void CSSIactivation( bool enableCSSI );
+
 
 private slots:
 void sendSQ();
@@ -146,6 +150,7 @@ public slots:
 void handleToData( const QString );
 void setPhoneNumber( const QString );
 void handleNewApp();
+void callManagement( QListCallInfo *info );
 
 protected:
 virtual void warning( const QString, const QString );
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 4/6] phonesim: Connect call status signal

2011-04-28 Thread Nicolas Bertrand
---
 src/phonesim.cpp |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/phonesim.cpp b/src/phonesim.cpp
index a822cd9..cda32dd 100644
--- a/src/phonesim.cpp
+++ b/src/phonesim.cpp
@@ -528,6 +528,8 @@ SimRules::SimRules( int fd, QObject *p,  const QString 
filename, HardwareManipu
 if ( machine ) {
 connect( machine, SIGNAL(startIncomingCall(QString,QString,QString)),
  _callManager, 
SLOT(startIncomingCall(QString,QString,QString)) );
+connect ( _callManager, SIGNAL( sendCallStatus( QListCallInfo * ) ),
+  machine, SLOT( callManagement( QListCallInfo * ) ) );
 }
 
 connect(this,SIGNAL(readyRead()),
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 5/6] controlbase.ui: Add call mangement tab

2011-04-28 Thread Nicolas Bertrand
---
 src/controlbase.ui |   61 
 1 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/src/controlbase.ui b/src/controlbase.ui
index cfadfe8..41c6d12 100644
--- a/src/controlbase.ui
+++ b/src/controlbase.ui
@@ -1458,6 +1458,67 @@ p, li { white-space: pre-wrap; }
/property
   /widget
  /widget
+ widget class=QWidget name=tab_9
+  attribute name=title
+   stringCall/string
+  /attribute
+  layout class=QVBoxLayout name=verticalLayout_3
+   item
+widget class=QTableWidget name=twCallMgt
+ property name=columnCount
+  number5/number
+ /property
+ attribute name=horizontalHeaderMinimumSectionSize
+  number50/number
+ /attribute
+ attribute name=horizontalHeaderShowSortIndicator stdset=0
+  booltrue/bool
+ /attribute
+ attribute name=verticalHeaderDefaultSectionSize
+  number50/number
+ /attribute
+ column
+  property name=text
+   stringid/string
+  /property
+ /column
+ column
+  property name=text
+   stringnumber/string
+  /property
+ /column
+ column
+  property name=text
+   stringstate/string
+  /property
+ /column
+ column
+  property name=text
+   stringname/string
+  /property
+ /column
+ column
+  property name=text
+   stringtype/string
+  /property
+ /column
+/widget
+   /item
+   item
+spacer name=verticalSpacer
+ property name=orientation
+  enumQt::Vertical/enum
+ /property
+ property name=sizeHint stdset=0
+  size
+   width20/width
+   height40/height
+  /size
+ /property
+/spacer
+   /item
+  /layout
+ /widget
 /widget
/item
item
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 6/6] control: Update call view

2011-04-28 Thread Nicolas Bertrand
---
 src/control.cpp |  100 +--
 src/control.h   |3 +-
 2 files changed, 91 insertions(+), 12 deletions(-)

diff --git a/src/control.cpp b/src/control.cpp
index 2f12d91..dec3aea 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -136,14 +136,79 @@ Control::~Control()
 
 void Control::callManagement( QListCallInfo *list )
 {
+   int row = 0;
bool enableCSSU = false;
bool enableCSSI = false;
 
+   widget-clearCallView();
+
foreach( CallInfo i, *list ) {
+   QString param[5];
+
if ( i.incoming  !enableCSSU )
enableCSSU = true;
if ( !i.incoming  !enableCSSI )
enableCSSI = true;
+
+   param[0].setNum( i.id );
+   param[1] = i.number;
+
+   switch( i.state ) {
+
+case CallState_Active:
+{
+param[2] = Active;
+}
+break;
+
+case CallState_Held:
+{
+param[2] = Held;
+}
+break;
+
+case CallState_Dialing:
+{
+param[2] = Dialing;
+}
+break;
+
+case CallState_Alerting:
+{
+param[2] = Alerting;
+}
+break;
+
+case CallState_Incoming:
+{
+param[2] = Incoming;
+}
+break;
+
+case CallState_Waiting:
+{
+param[2] = Waiting;
+}
+break;
+
+case CallState_Hangup:
+{
+param[2] = Hangup;
+}
+break;
+
+case CallState_SwapDummy:
+{
+param[2] = SwapDummy;
+}
+break;
+   }
+
+   param[3] = i.name;
+   param[4] = i.incoming ? incoming : outgoing;
+
+   widget-updateCallView( param, row );
+   row++;
}
 
widget-CSSIactivation( enableCSSI );
@@ -160,6 +225,20 @@ void ControlWidget::CSSUactivation( bool enableCSSU )
 ui-cbCSSU-setEnabled( enableCSSU );
 }
 
+void ControlWidget::clearCallView()
+{
+ui-twCallMgt-clearContents();
+}
+
+void ControlWidget::updateCallView( QString callParameters [5], int row )
+{
+   if ( row  ui-twCallMgt-rowCount() - 1 )
+   ui-twCallMgt-insertRow( row );
+
+   for ( int i = 0; i  5; i++ )
+   ui-twCallMgt-setItem( row, i, new QTableWidgetItem( 
callParameters[i] ) );
+}
+
 void Control::setPhoneNumber( const QString number )
 {
 widget-setWindowTitle(Phonesim - Number:  + number);
@@ -172,20 +251,19 @@ void Control::warning( const QString title, const 
QString message )
 
 void ControlWidget::handleCSSNNotif()
 {
-
 ui-cbCSSU-setEnabled( false );
 ui-cbCSSI-setEnabled( false );
 
-ui-cbCSSU-insertItem(0, );
-ui-cbCSSU-insertItem(1, 0 - forwarded, 0);
-ui-cbCSSU-insertItem(3, 2 - on hold, 2);
-ui-cbCSSU-insertItem(4, 3 - retrieved, 3);
-ui-cbCSSU-insertItem(5, 4 - multiparty, 4);
+ui-cbCSSU-insertItem( 0,  );
+ui-cbCSSU-insertItem( 1, 0 - forwarded, 0 );
+ui-cbCSSU-insertItem( 3, 2 - on hold, 2 );
+ui-cbCSSU-insertItem( 4, 3 - retrieved, 3 );
+ui-cbCSSU-insertItem( 5, 4 - multiparty, 4 );
 
-ui-cbCSSI-insertItem(0, );
-ui-cbCSSI-insertItem(3, 2 - forwarded, 2);
-ui-cbCSSI-insertItem(6, 5 - outgoing barred, 5);
-ui-cbCSSI-insertItem(7, 6 - incomming barred, 6);
+ui-cbCSSI-insertItem( 0,  );
+ui-cbCSSI-insertItem( 3, 2 - forwarded, 2 );
+ui-cbCSSI-insertItem( 6, 5 - outgoing barred, 5 );
+ui-cbCSSI-insertItem( 7, 6 - incomming barred, 6 );
 }
 
 void ControlWidget::sendCSSN()
@@ -195,7 +273,7 @@ void ControlWidget::sendCSSN()
 if ( v.canConvertint()  ui-cbCSSU-isEnabled() )
 emit unsolicitedCommand( +CSSU: +QString::number( v.toInt() ) );
 
-v = ui-cbCSSI-itemData(ui-cbCSSI-currentIndex());
+v = ui-cbCSSI-itemData( ui-cbCSSI-currentIndex() );
 
 if ( v.canConvertint()  ui-cbCSSI-isEnabled() )
 emit unsolicitedCommand( +CSSI: +QString::number( v.toInt() ) );
diff --git a/src/control.h b/src/control.h
index 2ccde29..20bdc86 100644
--- a/src/control.h
+++ b/src/control.h
@@ -74,7 +74,8 @@ public:
 void handleCSSNNotif();
 void CSSUactivation( bool enableCSSU );
 void CSSIactivation( bool enableCSSI );
-
+void updateCallView( QString callParameters [5], int row );
+void clearCallView();
 
 private slots:
 void sendSQ();
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] callmanager: change state of waiting call

2011-04-15 Thread Nicolas Bertrand
becomes incoming when all active and held are released

---
 src/callmanager.cpp |   25 +
 src/callmanager.h   |3 +++
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/src/callmanager.cpp b/src/callmanager.cpp
index be17b83..929c182 100644
--- a/src/callmanager.cpp
+++ b/src/callmanager.cpp
@@ -409,6 +409,9 @@ void CallManager::hangupConnected()
 }
 }
 callList = newCallList;
+
+if ( !hasCall( CallState_Held ) )
+waitingToIncoming();
 }
 
 void CallManager::hangupHeld()
@@ -423,6 +426,9 @@ void CallManager::hangupHeld()
 }
 }
 callList = newCallList;
+
+if ( !hasCall( CallState_Active ) )
+waitingToIncoming();
 }
 
 void CallManager::hangupConnectedAndHeld()
@@ -438,6 +444,7 @@ void CallManager::hangupConnectedAndHeld()
 }
 }
 callList = newCallList;
+waitingToIncoming();
 }
 
 void CallManager::hangupCall( int id )
@@ -508,10 +515,6 @@ bool CallManager::chld1()
 // We only have active calls - hang them up.
 hangupConnected();
 return true;
-} else if ( hasCall( CallState_Active ) ) {
-// We only have active calls - hang them up.
-hangupConnected();
-return true;
 } else if ( ( id = idForDialing() ) = 0 ) {
 // We have a dialing call.
 hangupCall(id);
@@ -544,6 +547,10 @@ bool CallManager::chld1x( int x )
 }
 }
 callList = newCallList;
+
+if ( !hasCall( CallState_Active )   !hasCall( CallState_Held ) )
+waitingToIncoming();
+
 return found;
 }
 
@@ -709,6 +716,16 @@ void CallManager::dialingToAlerting()
 sendState( callList[index] );
 }
 
+void CallManager::waitingToIncoming()
+{
+   int index = indexForId( idForState( CallState_Waiting ) );
+   if ( index  0 )
+   return;
+
+callList[index].state = CallState_Incoming;
+sendState( callList[index] );
+}
+
 void CallManager::dialBack()
 {
 startIncomingCall( 1234567, 7654321, Alice, true );
diff --git a/src/callmanager.h b/src/callmanager.h
index 90cb9bd..5876c87 100644
--- a/src/callmanager.h
+++ b/src/callmanager.h
@@ -121,6 +121,9 @@ private slots:
 // Transition the active dialing call to alerting.
 void dialingToAlerting();
 
+// Transition the waiting call to incoming.
+void waitingToIncoming();
+
 // Handle dial-backs.
 void dialBack();
 void dialBackWithHangup5();
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] Avoid error when URL is null

2011-04-05 Thread Nicolas Bertrand
Avoid error with STK command LAUNCH BROWSER and default URL

---
 src/stkagent.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/stkagent.c b/src/stkagent.c
index 54ca575..220812e 100644
--- a/src/stkagent.c
+++ b/src/stkagent.c
@@ -1061,6 +1061,9 @@ int stk_agent_confirm_launch_browser(struct stk_agent 
*agent, const char *text,
if (agent-msg == NULL)
return -ENOMEM;
 
+   if (url == NULL)
+   url = ;
+
dbus_message_append_args(agent-msg,
DBUS_TYPE_STRING, text,
DBUS_TYPE_BYTE, icon_id,
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 1/2] phonesim: add CSSU/CSSI UI

2011-03-29 Thread Nicolas Bertrand
---
 src/controlbase.ui |   65 +++
 1 files changed, 54 insertions(+), 11 deletions(-)

diff --git a/src/controlbase.ui b/src/controlbase.ui
index 11943ed..cfadfe8 100644
--- a/src/controlbase.ui
+++ b/src/controlbase.ui
@@ -195,17 +195,60 @@
 /layout
/item
item
-spacer
- property name=orientation
-  enumQt::Vertical/enum
- /property
- property name=sizeHint stdset=0
-  size
-   width566/width
-   height101/height
-  /size
- /property
-/spacer
+layout class=QHBoxLayout name=horizontalLayout_3
+ item
+  spacer name=horizontalSpacer
+   property name=orientation
+enumQt::Horizontal/enum
+   /property
+   property name=sizeType
+enumQSizePolicy::Fixed/enum
+   /property
+   property name=sizeHint stdset=0
+size
+ width322/width
+ height20/height
+/size
+   /property
+  /spacer
+ /item
+ item
+  widget class=QGroupBox name=gbCallSettings
+   property name=title
+stringCall Settings/string
+   /property
+   layout class=QGridLayout name=gridLayout_2
+item row=0 column=1
+ widget class=QComboBox name=cbCSSU/
+/item
+item row=1 column=1
+ widget class=QComboBox name=cbCSSI/
+/item
+item row=0 column=0
+ widget class=QLabel name=lbCSSU
+  property name=text
+   stringCSSU/string
+  /property
+ /widget
+/item
+item row=1 column=0
+ widget class=QLabel name=lbCSSI
+  property name=text
+   stringCSSI/string
+  /property
+ /widget
+/item
+item row=2 column=1
+ widget class=QPushButton name=pbSendNotif
+  property name=text
+   stringSend Notification/string
+  /property
+ /widget
+/item
+   /layout
+  /widget
+ /item
+/layout
/item
item
 widget class=QCheckBox name=atCheckBox
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 2/2] phonesim: Add CSSU/CSSI notification support

2011-03-29 Thread Nicolas Bertrand
---
 src/control.cpp |   30 +-
 src/control.h   |2 ++
 2 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/src/control.cpp b/src/control.cpp
index 279bade..645219c 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -87,6 +87,7 @@ ControlWidget::ControlWidget(const QString ruleFile, Control 
*parent)
 connect(ui-pbReset, SIGNAL(clicked()), this, SLOT(modemSilentReset()));
 connect(ui-pbSendGNSSData, SIGNAL(clicked()), this, SLOT(sendGNSSData()));
 connect(ui-pbGNSSDefault, SIGNAL(clicked()), this, 
SLOT(setDefaultGNSSData()));
+connect(ui-pbSendNotif, SIGNAL(clicked()), this, SLOT(sendCSSN()));
 
 QStringList headers;
 headers  Sender  Priority  Notification Status;
@@ -94,6 +95,7 @@ ControlWidget::ControlWidget(const QString ruleFile, Control 
*parent)
 ui-twMessageList-verticalHeader()-hide();
 
 handleNewApp();
+handleCSSNNotif();
 
 show();
 }
@@ -142,13 +144,39 @@ void Control::warning( const QString title, const 
QString message )
 QMessageBox::warning(widget, title, message, OK);
 }
 
+void ControlWidget::handleCSSNNotif()
+{
+ui-cbCSSU-insertItem(0, );
+ui-cbCSSU-insertItem(1, 0 - forwarded, 0);
+ui-cbCSSU-insertItem(3, 2 - on hold, 2);
+ui-cbCSSU-insertItem(4, 3 - retrieved, 3);
+ui-cbCSSU-insertItem(5, 4 - multiparty, 4);
+
+ui-cbCSSI-insertItem(0, );
+ui-cbCSSI-insertItem(3, 2 - forwarded, 2);
+ui-cbCSSI-insertItem(6, 5 - outgoing barred, 5);
+ui-cbCSSI-insertItem(7, 6 - incomming barred, 6);
+}
+
+void ControlWidget::sendCSSN()
+{
+QVariant v = ui-cbCSSU-itemData(ui-cbCSSU-currentIndex());
+
+if (v.canConvertint())
+emit unsolicitedCommand(+CSSU: +QString::number(v.toInt()));
+
+v = ui-cbCSSI-itemData(ui-cbCSSI-currentIndex());
+
+if (v.canConvertint())
+emit unsolicitedCommand(+CSSI: +QString::number(v.toInt()));
+}
+
 void ControlWidget::sendSQ()
 {
 emit 
variableChanged(SQ,QString::number(ui-hsSignalQuality-value())+,99);
 emit unsolicitedCommand(+CSQ: 
+QString::number(ui-hsSignalQuality-value())+,99);
 }
 
-
 void ControlWidget::sendBC()
 {
 bool charging = ui-hsBatteryCharging-checkState() == Qt::Checked;
diff --git a/src/control.h b/src/control.h
index eac4288..c17146a 100644
--- a/src/control.h
+++ b/src/control.h
@@ -70,6 +70,7 @@ public:
 void handleFromData( const QString );
 void handleToData( const QString );
 void handleNewApp();
+void handleCSSNNotif();
 
 private slots:
 void sendSQ();
@@ -97,6 +98,7 @@ private slots:
 void modemSilentReset();
 void sendGNSSData();
 void setDefaultGNSSData();
+void sendCSSN();
 
 signals:
 void unsolicitedCommand(const QString );
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 0/2] Phonesim: add support for CSSU/CSSI notification

2011-03-29 Thread Nicolas Bertrand
Add UI to be able to send CSSU and CSSI notification with phonesim

Nicolas Bertrand (2):
  phonesim: add CSSU/CSSI UI
  phonesim: Add CSSU/CSSI notification support

 src/control.cpp|   30 +++-
 src/control.h  |2 +
 src/controlbase.ui |   65 +++
 3 files changed, 85 insertions(+), 12 deletions(-)

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH] Set owner CSSU/CSSI support task

2011-03-24 Thread Nicolas Bertrand
---
 TODO |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/TODO b/TODO
index ed644c9..6769906 100644
--- a/TODO
+++ b/TODO
@@ -21,3 +21,7 @@ Call Management
 - Add support for +CSSU / +CSSI notifications.  These can be used to simulate
   the remote party putting the call on hold, retrieving or creating an mpty
   call.
+
+  Priority: Low
+  Complexity: C1
+  Owner: Nicolas Bertrand nicolas.bertr...@linux.intel.com
\ No newline at end of file
-- 
1.7.1

___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono