RE: [PATCH] test: add a script for STK conformance tests

2010-12-20 Thread Lucas, GuillaumeX
Hi Denis,

 -Original Message-
 From: Denis Kenzior [mailto:denk...@gmail.com]
 Sent: Friday, December 17, 2010 4:32 PM
 To: ofono@ofono.org
 Cc: Lucas, GuillaumeX
 Subject: Re: [PATCH] test: add a script for STK conformance tests
 
 Hi Guillaume,
 
 On 12/16/2010 10:04 AM, Lucas, GuillaumeX wrote:
  From: Guillaume Lucas guillaumex.lu...@intel.com
 
  To be able to run STK conformance tests at ofono
  level, we need to have a STK agent registered. The
  test-stk-conformance script provided here do that.
  This script is for conformance so all the data input
  of the agent are displayed to be able to check them.
  The existing test-stk-menu is usable only when there
  is a STK menu provided by the (U)SIM card.
  ---
   test/test-stk-conformance |  226
 +
   1 files changed, 226 insertions(+), 0 deletions(-)
   create mode 100755 test/test-stk-conformance
 
 
 I really don't like the amount of code copying going on here.  Have you
 considered extending the current test-stk-menu with the ability to run
 as the 'default' agent instead?  Maybe via a command line option?
 

You're right, it will be probably better to extend the current stk test script.
I'll review my changes in this way.

Regards,
Guillaume
-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: Les Montalets- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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


[PATCH 0/4] Emergency Calls

2010-12-20 Thread Andras Domokos
Steps in handling emergency calls:
- subscribe to modem online notifications
- emergency call detected (phone number is an emergency number)
- increment emergency mode 
  - advertise Emergency property change on D-Bus (first call)
  - set modem online (minimal setup) if mode was offline
- adevertise Online property change on D-Bus
- if modem is not online postpone making the call, otherwise make
  the emergency call
- when modem online notification comes and there is postponed emergency call
  request, make the emergency call
- when an emergency call ends decrement emergency mode
  - set modem to pre emergency call state (last call)
- advertise Online property change on D-Bus (if any)
  - advertise Emergency property change on D-Bus (last call)

Andras Domokos (3):
  modem: add Emergency property
  modem: move dial request_cb function
  voicecall: add emergency call handling

 src/dbus.c  |7 ++
 src/modem.c |  207 ++-
 src/ofono.h |5 ++
 src/voicecall.c |  186 -
 4 files changed, 369 insertions(+), 36 deletions(-)

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


[RFC PATCH 1/3] modem: add Emergency property

2010-12-20 Thread Andras Domokos
---
 src/dbus.c  |7 ++
 src/modem.c |  207 ++-
 src/ofono.h |5 ++
 3 files changed, 216 insertions(+), 3 deletions(-)

diff --git a/src/dbus.c b/src/dbus.c
index c24615f..3be8d22 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -345,6 +345,13 @@ DBusMessage *__ofono_error_access_denied(DBusMessage *msg)
Operation not permitted);
 }
 
+DBusMessage *__ofono_error_emergency_active(DBusMessage *msg)
+{
+   return g_dbus_create_error(msg, OFONO_ERROR_INTERFACE
+   .EmergencyActive,
+   Emergency state active);
+}
+
 void __ofono_dbus_pending_reply(DBusMessage **msg, DBusMessage *reply)
 {
DBusConnection *conn = ofono_dbus_get_connection();
diff --git a/src/modem.c b/src/modem.c
index 2f9387c..1ad72bd 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -61,6 +61,8 @@ enum modem_state {
 struct ofono_modem {
char*path;
enum modem_statemodem_state;
+   enum modem_statemodem_state_pre_emergency;
+   ofono_bool_tmodem_state_pending;
GSList  *atoms;
struct ofono_watchlist  *atom_watches;
GSList  *interface_list;
@@ -73,6 +75,7 @@ struct ofono_modem {
guint   timeout;
ofono_bool_tonline;
struct ofono_watchlist  *online_watches;
+   unsigned intemergency;
GHashTable  *properties;
struct ofono_sim*sim;
unsigned intsim_watch;
@@ -401,6 +404,11 @@ static void modem_change_state(struct ofono_modem *modem,
 
modem-modem_state = new_state;
 
+   if (modem-emergency  0)
+   modem-modem_state_pre_emergency = new_state;
+
+   modem-modem_state_pending = FALSE;
+
if (old_state  new_state)
flush_atoms(modem, new_state);
 
@@ -440,11 +448,25 @@ static void sim_state_watch(enum ofono_sim_state 
new_state, void *user)
 
switch (new_state) {
case OFONO_SIM_STATE_NOT_PRESENT:
+   if (modem-emergency != 0) {
+   modem-modem_state_pre_emergency = MODEM_STATE_PRE_SIM;
+   break;
+   }
+
modem_change_state(modem, MODEM_STATE_PRE_SIM);
break;
case OFONO_SIM_STATE_INSERTED:
break;
case OFONO_SIM_STATE_READY:
+   if (modem-emergency != 0) {
+   modem-modem_state_pre_emergency = MODEM_STATE_OFFLINE;
+
+   if (modem-driver-set_online == NULL)
+   modem-modem_state_pre_emergency = 
MODEM_STATE_ONLINE;
+
+   break;
+   }
+
modem_change_state(modem, MODEM_STATE_OFFLINE);
 
/*
@@ -482,6 +504,73 @@ void __ofono_modem_remove_online_watch(struct ofono_modem 
*modem,
__ofono_watchlist_remove_item(modem-online_watches, id);
 }
 
+static void modem_change_online(struct ofono_modem *modem,
+   enum modem_state new_state)
+{
+   DBusConnection *conn = ofono_dbus_get_connection();
+   enum modem_state old_state = modem-modem_state;
+   ofono_bool_t new_online = new_state == MODEM_STATE_ONLINE;
+
+   DBG(old state: %d, new state: %d, old_state, new_state);
+
+   modem-modem_state = new_state;
+   modem-modem_state_pending = FALSE;
+   modem-online = new_online;
+
+   ofono_dbus_signal_property_changed(conn, modem-path,
+   OFONO_MODEM_INTERFACE, Online,
+   DBUS_TYPE_BOOLEAN, modem-online);
+
+   notify_online_watches(modem);
+}
+
+static void emergency_online_cb(const struct ofono_error *error, void *data)
+{
+   struct ofono_modem *modem = data;
+
+   DBG(modem: %p, modem);
+
+   if (error-type == OFONO_ERROR_TYPE_NO_ERROR 
+   modem-modem_state != MODEM_STATE_ONLINE) {
+   modem_change_online(modem, MODEM_STATE_ONLINE);
+   } else {
+   modem-modem_state_pending = FALSE;
+   notify_online_watches(modem);
+   }
+}
+
+static void emergency_offline_cb(const struct ofono_error *error, void *data)
+{
+   struct ofono_modem *modem = data;
+   DBusConnection *conn = ofono_dbus_get_connection();
+   const char *path = ofono_modem_get_path(modem);
+   gboolean state = FALSE;
+
+   DBG(modem: %p, modem);
+
+   if (error-type == OFONO_ERROR_TYPE_NO_ERROR 
+   modem-modem_state == MODEM_STATE_ONLINE) {
+   modem_change_online(modem, modem-modem_state_pre_emergency);
+   } else {
+   modem-modem_state_pending = FALSE;
+   notify_online_watches(modem);
+   }
+
+   modem-emergency--;
+   if 

[RFC PATCH 3/3] voicecall: add emergency call handling

2010-12-20 Thread Andras Domokos
---
 src/voicecall.c |  122 ++-
 1 files changed, 121 insertions(+), 1 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index 0120cd0..370f760 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -52,6 +52,7 @@ struct ofono_voicecall {
struct ofono_sim *sim;
unsigned int sim_watch;
unsigned int sim_state_watch;
+   unsigned int modem_online_watch;
const struct ofono_voicecall_driver *driver;
void *driver_data;
struct ofono_atom *atom;
@@ -134,6 +135,22 @@ static void add_to_en_list(GSList **l, const char **list)
*l = g_slist_prepend(*l, g_strdup(list[i++]));
 }
 
+static gint number_compare(gconstpointer a, gconstpointer b)
+{
+   const char *s1 = a, *s2 = b;
+   return strcmp(s1, s2);
+}
+
+static ofono_bool_t emergency_number(struct ofono_voicecall *vc,
+   const char *number)
+{
+   if (number == NULL)
+   return FALSE;
+
+   return g_slist_find_custom(vc-en_list,
+   number, number_compare) ? TRUE : FALSE;
+}
+
 static const char *disconnect_reason_to_string(enum ofono_disconnect_reason r)
 {
switch (r) {
@@ -1134,6 +1151,7 @@ handled:
 static void manager_dial_callback(const struct ofono_error *error, void *data)
 {
struct ofono_voicecall *vc = data;
+   struct ofono_modem *modem = __ofono_atom_get_modem(vc-atom);
DBusMessage *reply;
const char *number;
gboolean need_to_emit;
@@ -1152,8 +1170,12 @@ static void manager_dial_callback(const struct 
ofono_error *error, void *data)
 
dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH, path,
DBUS_TYPE_INVALID);
-   } else
+   } else {
+   if (emergency_number(vc, number))
+   ofono_modem_dec_emergency(modem);
+
reply = __ofono_error_failed(vc-pending);
+   }
 
__ofono_dbus_pending_reply(vc-pending, reply);
 
@@ -1165,6 +1187,7 @@ static DBusMessage *manager_dial(DBusConnection *conn,
DBusMessage *msg, void *data)
 {
struct ofono_voicecall *vc = data;
+   struct ofono_modem *modem = __ofono_atom_get_modem(vc-atom);
const char *number;
struct ofono_phone_number ph;
const char *clirstr;
@@ -1204,6 +1227,16 @@ static DBusMessage *manager_dial(DBusConnection *conn,
 
string_to_phone_number(number, ph);
 
+   if (emergency_number(vc, number)) {
+   int online;
+
+   ofono_modem_inc_emergency(modem);
+
+   online = ofono_modem_get_online(modem);
+   if (online != TRUE)
+   return NULL;
+   }
+
vc-driver-dial(vc, ph, clir, OFONO_CUG_OPTION_DEFAULT,
manager_dial_callback, vc);
 
@@ -1757,6 +1790,7 @@ void ofono_voicecall_disconnected(struct ofono_voicecall 
*vc, int id,
const struct ofono_error *error)
 {
struct ofono_modem *modem = __ofono_atom_get_modem(vc-atom);
+   const char *number;
GSList *l;
struct voicecall *call;
time_t ts;
@@ -1776,6 +1810,7 @@ void ofono_voicecall_disconnected(struct ofono_voicecall 
*vc, int id,
}
 
call = l-data;
+   number = phone_number_to_string(call-call-phone_number);
 
ts = time(NULL);
prev_status = call-call-status;
@@ -1814,6 +1849,9 @@ void ofono_voicecall_disconnected(struct ofono_voicecall 
*vc, int id,
 
voicecalls_emit_call_removed(vc, call);
 
+   if (emergency_number(vc, number))
+   ofono_modem_dec_emergency(modem);
+
voicecall_dbus_unregister(vc, call);
 
vc-call_list = g_slist_remove(vc-call_list, call);
@@ -2074,6 +2112,7 @@ static void voicecall_unregister(struct ofono_atom *atom)
 static void voicecall_remove(struct ofono_atom *atom)
 {
struct ofono_voicecall *vc = __ofono_atom_get_data(atom);
+   struct ofono_modem *modem = __ofono_atom_get_modem(atom);
 
DBG(atom: %p, atom);
 
@@ -2115,6 +2154,12 @@ static void voicecall_remove(struct ofono_atom *atom)
g_queue_free(vc-toneq);
}
 
+   if (vc-modem_online_watch) {
+   __ofono_modem_remove_online_watch(modem,
+   vc-modem_online_watch);
+   vc-modem_online_watch = 0;
+   }
+
g_free(vc);
 }
 
@@ -2212,6 +2257,7 @@ static void sim_watch(struct ofono_atom *atom,
 static void dial_request_cb(const struct ofono_error *error, void *data)
 {
struct ofono_voicecall *vc = data;
+   struct ofono_modem *modem = __ofono_atom_get_modem(vc-atom);
gboolean need_to_emit;
struct voicecall *v;
 
@@ -2221,6 +2267,10 @@ static void dial_request_cb(const struct ofono_error 
*error, void *data)
 

RE: Voice call audio routing

2010-12-20 Thread Kai.Vehmanen
Hi,

On 16 Dec 2010, Nicola Mfb wrote:
 While testing an e169 huawei card I was able to make voice calls and
 hear something with aplay and /dev/ttyUSB1.
 On the openmoko/freerunner is a matter of HW switches, on the n900
 IIRC is done with pulseaudio.
 I guess that voice call audio routing is not in oFono plans, if I'm
 correct is there a reference project (may be not depending deeply on
 meego) that abstracts that task in an extensible/pluggable way?

not really I'm afraid, no reference project yet. The MeeGo stack 
for N900 is the closest thing at the moment:
http://wiki.meego.com/ARM/N900/Features/CallAudio

There's nothing inherently specific to MeeGo in the above, but of 
course some parts of it are very specific to N900 and its modem. 
Fortunately these are mostly isolated into a separate PA modules (so 
the rest of the stuff could be shared with other modems). More
generally, the speech interface to modems is currently not at all 
standard, and the differences are fairly big among the current modems 
that supports this (the low-level hw interfaces are different, 
the protocols are different, the kernel drivers are different and 
so forth).

E.g. USB might be used as the interface in dongles for laptops, but
it is not really suitable as the primary interface when building
a phone (it might be used as a secondary channel to record calls,
but that's different). USB audio can still be supported of course,
but just as an example why not all modems will have an interface
such as the e169 has.

But e.g. if you got the e169 working with aplay, then in theory
it fits quite nicely to the N900 stack mentioned above. The same
pipeline (on N900) is already used for CS (with the device modem) and 
VoIP calls (with gstreamer/farsight), so architecture is in that sense 
ready to support other network source/destinations for voice streams.
The integration to oFono AudioSettings interface is also there
(so that the audio pipeline is automatically set up when there is 
a call).

br,
-- 
Kai Vehmanen

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


Re: [PATCH] stemodem: Fix for MT call not working when caller id is hidden.

2010-12-20 Thread Denis Kenzior
Hi Marit,

 I will look into that, but I would like to keep it out of this fix, and
 rather do it as an improvement, OK?

That's fine.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH] TODO: CDMA SMS and CDMA CMAS

2010-12-20 Thread Lei Yu

Hi Denis,

On 12/17/2010 03:29 PM, ext Denis Kenzior wrote:

Hi Lei,

On 12/08/2010 06:34 PM, Lei Yu wrote:

---
  TODO |  122 ++---
  1 files changed, 94 insertions(+), 28 deletions(-)



I get the following when trying to apply this patch:
fatal: cannot convert from unknown-8bit to UTF-8



Yes, I will fix this and re-submit the patch.


Also, in general we frown upon having major TODO list submissions with
the Owner field pre-set.  Some of these have slipped through previously,
but I will be more stringent about enforcing this in the future ;)

The purpose of the Owner field on the TODO is to indicate which tasks
are being worked on in the immediate present, so that others can pick up
tasks not being worked on.  So I'd really prefer you to submit this
patch without the Owner set, and take ownership of the particular task
as you go along.



Yes, I will remove the Owner field when I re-submit the TODO patch.


Regards,
-Denis


Regards,
Lei

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


Re: [PATCH v2 8/9] udev: Add cdmagen

2010-12-20 Thread Dara Spieker-Doyle

Hi Marcel

Thank you for reviewing these patches

On 12/18/2010 10:29 AM, ext Marcel Holtmann wrote:

Hi Dara,


struct ofono_modem *modem;
@@ -533,6 +552,8 @@ done:
add_isi(modem, udev_device);
else if (g_strcmp0(driver, n900) == 0)
add_isi(modem, udev_device);
+   else if (g_strcmp0(driver, cdmagen) == 0)
+   add_cdmagen(modem, udev_device);
  }


this is actually wrong. The generic drivers running against phonesim
should not be done via udev. We did remove atgen for a reason actually
since it was not really useful.


Actually, this driver is not for running against phonesim at all. This 
plugin is intended for use against the majority of CDMA AT Modem devices 
(phones and usb sticks) connected in a tethered mode.
Please see the other email thread in this series ([Patch v2 7/9]) for 
alternative name suggestion to clarify this.


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


Re: [PATCH v2 7/9] ofono-rules: Add cdmagen device

2010-12-20 Thread Dara Spieker-Doyle

Hi Marcel

On 12/18/2010 10:31 AM, ext Marcel Holtmann wrote:

Hi Dara,


  plugins/ofono.rules |4 
  1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/plugins/ofono.rules b/plugins/ofono.rules
index da8a8ef..34698f0 100644
--- a/plugins/ofono.rules
+++ b/plugins/ofono.rules
@@ -429,6 +429,10 @@ ATTRS{idVendor}==0930, ATTRS{idProduct}==1311, 
ENV{OFONO_DRIVER}=mbm
  # Nokia Internet Stick CS-10
  ATTRS{idVendor}==0421, ATTRS{idProduct}==060e, ENV{OFONO_DRIVER}=nokia

+# Nokia CDMA Device
+ATTRS{idVendor}==0421, ATTRS{idProduct}==023e, ENV{OFONO_DRIVER}=cdmagen
+ATTRS{idVendor}==0421, ATTRS{idProduct}==00b6, ENV{OFONO_DRIVER}=cdmagen
+


since this is Nokia specific device, then using nokiacdma would be a
better name. Or using OFONO_DRIVER=nokia NOKIA_MODE=cdma and sharing the
driver might be useful.

It really all depends how much they have in common.


Nothing. All Nokia CDMA devices actually contain Qualcomm modems, so 
perhaps a better name may be along the lines of msmcdmamodem for CDMA 
AT modem devices in a tethered mode?


So what kind of

hardware is this actually? A phone or a real USB dongle?


It is a phone.

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


[PATCH] phonesim: Add cfis and cphs file

2010-12-20 Thread Jeevaka Badrappan
---
 src/default.xml   |8 
 src/simfilesystem.cpp |1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/default.xml b/src/default.xml
index 54c7191..4491705 100644
--- a/src/default.xml
+++ b/src/default.xml
@@ -3352,6 +3352,10 @@ OK/response
 00 32 00 32 FF FF FF FF FF FF FF FF FF FF FF FF
 /file
 
+file name=EFcfis recordsize=16
+01 1E FF FF FF FF FF FF FF FF FF FF FF FF FF FF
+/file
+
 !-- Record 1
  Length of alpha identifier: 32 chars
  Alpha Identifier: ABC
@@ -3491,6 +3495,10 @@ OK/response
 02 3C 03 00
 /file
 
+file name=EFcphs_cff
+55 55
+/file
+
 file name=EFcphs_mbdn recordsize=48
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
diff --git a/src/simfilesystem.cpp b/src/simfilesystem.cpp
index 6e05039..5312a82 100644
--- a/src/simfilesystem.cpp
+++ b/src/simfilesystem.cpp
@@ -118,6 +118,7 @@ static SimFileInfo const knownFiles[] =
 {4F05,5F50, EFimg5,  0x14ff44,  
FILE_TYPE_TRANSPARENT},
 
 // CPHS 4.2
+{6F13,7F20, EFcphs_cff,  0x11ff44,  
FILE_TYPE_TRANSPARENT},
 {6F16,7F20, EFcphs_info, 0x14ff44,  
FILE_TYPE_TRANSPARENT},
 {6F17,7F20, EFcphs_mbdn, 0x11ff44,  
FILE_TYPE_LINEAR_FIXED},
 {6F11,7F20, EFcphs_mwis, 0x11ff44,  
FILE_TYPE_TRANSPARENT},
-- 
1.7.0.4

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


Re: [PATCH 1/5] cdma-sms: Add CDMA SMS Support

2010-12-20 Thread Denis Kenzior
Hi Lei,

On 12/08/2010 06:35 PM, Lei Yu wrote:
 ---
  Makefile.am|2 +-
  include/cdma-sms.h |   69 
 
  include/dbus.h |4 +++
  src/ofono.h|2 +

Can you do me a favor and split this up into two patches? One for dbus.h
and one for cdma-sms.h.  You can lump the ofono.h changes with your atom
implementation in src/

  4 files changed, 76 insertions(+), 1 deletions(-)
  create mode 100644 include/cdma-sms.h
 
 diff --git a/Makefile.am b/Makefile.am
 index cdb3166..13cbc37 100644
 --- a/Makefile.am
 +++ b/Makefile.am
 @@ -14,7 +14,7 @@ include_HEADERS = include/log.h include/plugin.h 
 include/history.h \
   include/gprs.h include/gprs-context.h \
   include/radio-settings.h include/stk.h \
   include/audio-settings.h include/nettime.h \
 - include/ctm.h
 + include/ctm.h include/cdma-sms.h
  
  nodist_include_HEADERS = include/version.h
  
 diff --git a/include/cdma-sms.h b/include/cdma-sms.h
 new file mode 100644
 index 000..2e7834d
 --- /dev/null
 +++ b/include/cdma-sms.h
 @@ -0,0 +1,69 @@
 +/*
 + *
 + *  oFono - Open Source Telephony
 + *
 + *  Copyright (C) 2010  Nokia 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
 + *
 + */
 +
 +#ifndef __OFONO_CDMASMS_H
 +#define __OFONO_CDMASMS_H

I suggest using the prefix OFONO_CDMA_

 +
 +#ifdef __cplusplus
 +extern C {
 +#endif
 +
 +#include ofono/types.h
 +
 +struct ofono_cdmasms;

So this would become ofono_cdma_sms...

 +
 +typedef void (*ofono_cdmasms_submit_cb_t)(const struct ofono_error *error,
 + void *data);
 +
 +struct ofono_cdmasms_driver {
 + const char *name;
 + int (*probe)(struct ofono_cdmasms *cdmasms, unsigned int vendor,
 + void *data);
 + void (*remove)(struct ofono_cdmasms *cdmasms);
 + void (*submit)(struct ofono_cdmasms *cdmasms, unsigned char *tpdu,
 + int tpdu_len, ofono_cdmasms_submit_cb_t cb, void *data);
 +};
 +
 +void ofono_cdmasms_deliver_notify(struct ofono_cdmasms *cdmasms,
 + unsigned char *pdu, int tpdu_len);
 +
 +int ofono_cdmasms_driver_register(const struct ofono_cdmasms_driver *d);
 +void ofono_cdmasms_driver_unregister(const struct ofono_cdmasms_driver *d);
 +
 +struct ofono_cdmasms *ofono_cdmasms_create(struct ofono_modem *modem,
 + unsigned int vendor,
 + const char *driver, void *data);
 +
 +void ofono_cdmasms_register(struct ofono_cdmasms *cdmasms);
 +void ofono_cdmasms_remove(struct ofono_cdmasms *cdmasms);
 +
 +void ofono_cdmasms_set_data(struct ofono_cdmasms *cdmasms, void *data);
 +void *ofono_cdmasms_get_data(struct ofono_cdmasms *cdmasms);
 +
 +struct ofono_atom *ofono_cdmasms_get_atom(struct ofono_cdmasms *cdmasms);
 +

Why do you need this one?  I don't see it being used anywhere

 +const char *ofono_cdmasms_get_path(struct ofono_cdmasms *cdmasms);

And this one?  Perhaps replacing this by a static function or even
calling ofono_atom_get_path() is sufficient.

 +
 +#ifdef __cplusplus
 +}
 +#endif
 +
 +#endif /* __OFONO_CDMASMS_H */
 diff --git a/include/dbus.h b/include/dbus.h
 index 9e29afb..0587e16 100644
 --- a/include/dbus.h
 +++ b/include/dbus.h
 @@ -55,6 +55,10 @@ extern C {
  #define OFONO_STK_INTERFACE OFONO_SERVICE .SimToolkit
  #define OFONO_SIM_APP_INTERFACE OFONO_SERVICE .SimToolkitAgent
  
 +/* CDMA Interfaces */
 +#define OFONO_CDMA_MESSAGE_MANAGER_INTERFACE org.ofono.cdma.MessageManager
 +
 +

Why two empty lines?

  /* Essentially a{sv} */
  #define OFONO_PROPERTIES_ARRAY_SIGNATURE 
 DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING \
   DBUS_TYPE_STRING_AS_STRING \
 diff --git a/src/ofono.h b/src/ofono.h
 index 792134b..9eb58fa 100644
 --- a/src/ofono.h
 +++ b/src/ofono.h
 @@ -126,6 +126,8 @@ enum ofono_atom_type {
   OFONO_ATOM_TYPE_STK = 20,
   OFONO_ATOM_TYPE_NETTIME = 21,
   OFONO_ATOM_TYPE_CTM = 22,
 + OFONO_ATOM_TYPE_CDMA_VOICECALL_MANAGER = 23,

This does not seem related...

 + OFONO_ATOM_TYPE_CDMA_MESSAGE_MANAGER = 24,
  };
  
  enum ofono_atom_watch_condition {

Regards,
-Denis

Re: [PATCH 2/5] cdma-sms: Add CDMA SMS Support

2010-12-20 Thread Denis Kenzior
On 12/08/2010 06:35 PM, Lei Yu wrote:
 ---
  Makefile.am|3 +-
  src/cdma-sms.c |  342 ++
  src/cdma-smsutil.c |  467 
 
  src/cdma-smsutil.h |  264 +

Please break this up into two patches, one for atom implementation
(along with ofono.h change from Patch 1) and the utilities in a separate
patch.  Otherwise it becomes a wee bit too big to handle ;)

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH 3/5] cdma-atmodem: Add CDMA SMS Support

2010-12-20 Thread Denis Kenzior
On 12/08/2010 06:35 PM, Lei Yu wrote:
 ---
  Makefile.am|7 ++
  configure.ac   |5 ++
  drivers/cdma-atmodem/atmodem.c |   47 
  drivers/cdma-atmodem/atmodem.h |   23 ++

You need to synchronize with Dara on this one.  Both of you are sending
the same stub implementation.  I suggest submitting this as a separate
patch.  And please name it cdmamodem/cdmamodem.c  .h.  Dara has this
right actually.

  drivers/cdma-atmodem/atutil.c  |   45 
  drivers/cdma-atmodem/atutil.h  |   64 +

As I mentioned before, please use the atutil.[ch] from atmodem directly.
 No need to create a new set of these...

  drivers/cdma-atmodem/sms.c |  151 
 

And this one should be in a separate patch ;)

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH 4/5] cdmaphonesim: Add CDMA SMS Support

2010-12-20 Thread Denis Kenzior
Hi Lei,

On 12/08/2010 06:35 PM, Lei Yu wrote:
 ---
  Makefile.am   |9 ++
  configure.ac  |6 +
  plugins/cdmaphonesim.c|  344 
 +
  plugins/cdmaphonesim.conf |   14 ++
  4 files changed, 373 insertions(+), 0 deletions(-)
  create mode 100644 plugins/cdmaphonesim.c
  create mode 100644 plugins/cdmaphonesim.conf
 

Have you considered adding a CDMA/GSM selector to phonesim.conf instead?
 So e.g. a new configuration key called 'Type' where type can be 'gsm'
or 'cdma'.

That way you can share much of the phonesim plugin plumbing and only
populate the atoms differently...

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH v2 1/9] dbus: Add CDMA Voicecall Interface

2010-12-20 Thread Denis Kenzior
Hi Dara,

On 12/17/2010 05:11 PM, Dara Spieker-Doyle wrote:
 ---
  include/dbus.h |3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)
 

Patch has been applied, thanks.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH v2 2/9] types: Add CDMA Phone Number

2010-12-20 Thread Denis Kenzior
Hi Dara,

On 12/17/2010 05:11 PM, Dara Spieker-Doyle wrote:
 ---
  include/types.h |8 
  1 files changed, 8 insertions(+), 0 deletions(-)
 
 diff --git a/include/types.h b/include/types.h
 index de15437..a394775 100644
 --- a/include/types.h
 +++ b/include/types.h
 @@ -84,6 +84,14 @@ struct ofono_phone_number {
   int type;
  };
  

I applied this patch, but amended the commit for some trivial style issues:

 +/* Length of NUM_FIELDS in 3GPP2 C.S0005-E v2.0*/

The closing comment */ should have a space in front

 +#define OFONO_CDMA_MAX_PHONE_NUMBER_LENGTH 256
 +
 +struct ofono_cdma_phone_number {
 + /*char maps to max size of CHARi (8 bit) in 3GPP2 C.S0005-E v2.0*/

Space after the comment opening and before the comment closing.

 + char number[OFONO_CDMA_MAX_PHONE_NUMBER_LENGTH];
 +};
 +
  struct ofono_call {
   unsigned int id;
   int type;

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH v2 3/9] cdma-voicecall: Add CDMA MO Call Support

2010-12-20 Thread Denis Kenzior
Hi Dara,

On 12/17/2010 05:11 PM, Dara Spieker-Doyle wrote:
 ---
  Makefile.am  |2 +-
  include/cdma-voicecall.h |   89 
 ++
  2 files changed, 90 insertions(+), 1 deletions(-)
  create mode 100644 include/cdma-voicecall.h
 
 diff --git a/Makefile.am b/Makefile.am
 index 12b3c33..1270be5 100644
 --- a/Makefile.am
 +++ b/Makefile.am
 @@ -14,7 +14,7 @@ include_HEADERS = include/log.h include/plugin.h 
 include/history.h \
   include/gprs.h include/gprs-context.h \
   include/radio-settings.h include/stk.h \
   include/audio-settings.h include/nettime.h \
 - include/ctm.h
 + include/ctm.h include/cdma-voicecall.h
  
  nodist_include_HEADERS = include/version.h
  
 diff --git a/include/cdma-voicecall.h b/include/cdma-voicecall.h
 new file mode 100644
 index 000..aaae028
 --- /dev/null
 +++ b/include/cdma-voicecall.h
 @@ -0,0 +1,89 @@
 +/*
 + *
 + *  oFono - Open Source Telephony
 + *
 + *  Copyright (C) 2010 Nokia 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
 + *
 + */
 +
 +#ifndef __OFONO_CDMA_VOICECALL_H
 +#define __OFONO_CDMA_VOICECALL_H
 +
 +#ifdef __cplusplus
 +extern C {
 +#endif
 +
 +#include ofono/types.h
 +
 +struct ofono_cdma_voicecall_manager;

Please call this ofono_cdma_voicecall.

 +
 +enum cdma_call_status {
 + CDMA_CALL_STATUS_ACTIVE,
 + CDMA_CALL_STATUS_DIALING,
 + CDMA_CALL_STATUS_ALERTING,
 + CDMA_CALL_STATUS_INCOMING,
 + CDMA_CALL_STATUS_DISCONNECTED
 +};
 +
 +typedef void (*ofono_cdma_voicecall_cb_t)(const struct ofono_error *error,
 + void *data);
 +
 +/* Voice call related functionality, including AT+CDV, AT+CHV */
 +struct ofono_cdma_voicecall_driver {
 + const char *name;
 + int (*probe)(struct ofono_cdma_voicecall_manager *vc,
 + unsigned int vendor, void *data);
 + void (*remove)(struct ofono_cdma_voicecall_manager *vc);
 +
 + void (*dial)(struct ofono_cdma_voicecall_manager *vc,
 + const struct ofono_cdma_phone_number *number,
 + ofono_cdma_voicecall_cb_t cb, void *data);
 +
 + /* Hangs up active, dialing, alerting or incoming calls */
 + void (*hangup)(struct ofono_cdma_voicecall_manager *vc,
 + ofono_cdma_voicecall_cb_t cb, void *data);
 +};
 +
 +void ofono_cdma_voicecall_manager_disconnected(
 + struct ofono_cdma_voicecall_manager *vc,
 + enum ofono_disconnect_reason reason,
 + const struct ofono_error *error);
 +
 +int ofono_cdma_voicecall_driver_register(
 + const struct ofono_cdma_voicecall_driver *d);
 +void ofono_cdma_voicecall_driver_unregister(
 + const struct ofono_cdma_voicecall_driver *d);
 +
 +struct ofono_cdma_voicecall_manager *ofono_cdma_voicecall_manager_create(
 + struct ofono_modem *modem,
 + unsigned int vendor,
 + const char *driver, void *data);
 +
 +void ofono_cdma_voicecall_manager_register(
 + struct ofono_cdma_voicecall_manager *vc);
 +void ofono_cdma_voicecall_manager_remove(
 + struct ofono_cdma_voicecall_manager *vc);
 +
 +void ofono_cdma_voicecall_manager_set_data(
 + struct ofono_cdma_voicecall_manager *vc, void *data);
 +void *ofono_cdma_voicecall_manager_get_data(
 + struct ofono_cdma_voicecall_manager *vc);
 +
 +#ifdef __cplusplus
 +}
 +#endif
 +
 +#endif /* __OFONO_CDMA_VOICECALL_H */

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH v2 4/9] cdma-voicecall: Add CDMA MO Call Support

2010-12-20 Thread Denis Kenzior
Hi Dara,

On 12/17/2010 05:11 PM, Dara Spieker-Doyle wrote:
 ---
  Makefile.am  |3 +-
  src/cdma-voicecall.c |  444 
 ++
  src/common.c |   41 +
  src/common.h |6 +
  src/ofono.h  |3 +
  5 files changed, 496 insertions(+), 1 deletions(-)
  create mode 100644 src/cdma-voicecall.c
 
 diff --git a/Makefile.am b/Makefile.am
 index 1270be5..40ff52d 100644
 --- a/Makefile.am
 +++ b/Makefile.am
 @@ -319,7 +319,8 @@ src_ofonod_SOURCES = $(gdbus_sources) $(builtin_sources) 
 src/ofono.ver \
   src/radio-settings.c src/stkutil.h src/stkutil.c \
   src/nettime.c src/stkagent.c src/stkagent.h \
   src/simfs.c src/simfs.h src/audio-settings.c \
 - src/smsagent.c src/smsagent.h src/ctm.c
 + src/smsagent.c src/smsagent.h src/ctm.c \
 + src/cdma-voicecall.c
  
  src_ofonod_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ @CAPNG_LIBS@ 
 -ldl
  
 diff --git a/src/cdma-voicecall.c b/src/cdma-voicecall.c
 new file mode 100644
 index 000..7baaff3
 --- /dev/null
 +++ b/src/cdma-voicecall.c
 @@ -0,0 +1,444 @@
 +/*
 + *
 + *  oFono - Open Source Telephony
 + *
 + *  Copyright (C) 2010 Nokia 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 string.h
 +#include stdio.h
 +#include time.h
 +#include errno.h
 +#include stdint.h
 +
 +#include glib.h
 +#include gdbus.h
 +
 +#include ofono.h
 +
 +#include common.h
 +
 +static GSList *g_drivers;
 +
 +struct ofono_cdma_voicecall_manager {
 + struct ofono_cdma_phone_number phone_number;
 + int direction;
 + enum cdma_call_status status;
 + time_t start_time;
 + DBusMessage *pending;
 + const struct ofono_cdma_voicecall_driver *driver;
 + void *driver_data;
 + struct ofono_atom *atom;
 +};
 +
 +static void generic_callback(const struct ofono_error *error, void *data);

In general we frown upon forward-declarations of static functions.  It
is better to move the function up to avoid this.

 +
 +static const char *disconnect_reason_to_string(enum ofono_disconnect_reason 
 r)
 +{
 + switch (r) {
 + case OFONO_DISCONNECT_REASON_LOCAL_HANGUP:
 + return local;
 + case OFONO_DISCONNECT_REASON_REMOTE_HANGUP:
 + return remote;
 + default:
 + return network;
 + }
 +}
 +
 +static const char *cdma_call_status_to_string(enum cdma_call_status status)
 +{
 + switch (status) {
 + case CDMA_CALL_STATUS_ACTIVE:
 + return active;
 + case CDMA_CALL_STATUS_DIALING:
 + return dialing;
 + case CDMA_CALL_STATUS_ALERTING:
 + return alerting;
 + case CDMA_CALL_STATUS_INCOMING:
 + return incoming;
 + default:

It would be better to use CDMA_CALL_STATUS_DISCONNECTED and avoid the
default condition here.  The compiler will warn us if some enum is not
being handled.

 + return disconnected;
 + }
 +}
 +
 +static const char *time_to_str(const time_t *t)
 +{
 + static char buf[128];
 + struct tm tm;
 +
 + strftime(buf, 127, %Y-%m-%dT%H:%M:%S%z, localtime_r(t, tm));
 + buf[127] = '\0';
 +
 + return buf;
 +}
 +
 +static void append_voicecall_properties(struct ofono_cdma_voicecall_manager 
 *v,
 + DBusMessageIter *dict)
 +{
 + const char *status;
 + const char *lineid;
 + const char *timestr;
 +
 + status = cdma_call_status_to_string(v-status);
 + lineid = cdma_phone_number_to_string(v-phone_number);
 +
 + ofono_dbus_dict_append(dict, State, DBUS_TYPE_STRING, status);
 +
 + ofono_dbus_dict_append(dict, LineIdentification,
 + DBUS_TYPE_STRING, lineid);
 +
 + if (v-status == CDMA_CALL_STATUS_ACTIVE) {
 + timestr = time_to_str(v-start_time);
 +
 + ofono_dbus_dict_append(dict, StartTime, DBUS_TYPE_STRING,
 + timestr);
 + }
 +}
 +
 +static DBusMessage *voicecall_manager_get_properties(DBusConnection *conn,
 + DBusMessage *msg, void *data)
 +{
 + struct 

Re: [PATCH v2 5/9] cdmamodem: Add CDMA MO Call Support

2010-12-20 Thread Denis Kenzior
Hi Dara,

On 12/17/2010 05:11 PM, Dara Spieker-Doyle wrote:
 ---
  Makefile.am   |7 ++
  configure.ac  |5 +
  drivers/cdmamodem/cdmamodem.c |   48 ++
  drivers/cdmamodem/cdmamodem.h |   25 ++

Please separate this out into two patches, one for adding the cdmamodem
stubs and one for the voicecall driver.

  drivers/cdmamodem/voicecall.c |  190 
 +
  5 files changed, 275 insertions(+), 0 deletions(-)
  create mode 100644 drivers/cdmamodem/cdmamodem.c
  create mode 100644 drivers/cdmamodem/cdmamodem.h
  create mode 100644 drivers/cdmamodem/voicecall.c
 

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH 2/5] cdma-sms: Add CDMA SMS Support

2010-12-20 Thread Lei Yu

Hi Denis,

On 12/20/2010 12:36 PM, ext Denis Kenzior wrote:

On 12/08/2010 06:35 PM, Lei Yu wrote:

---
  Makefile.am|3 +-
  src/cdma-sms.c |  342 ++
  src/cdma-smsutil.c |  467 
  src/cdma-smsutil.h |  264 +


Please break this up into two patches, one for atom implementation
(along with ofono.h change from Patch 1) and the utilities in a separate
patch.  Otherwise it becomes a wee bit too big to handle ;)



Will do.


Regards,
-Denis


Regards,
Lei

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


Re: [PATCH 3/5] cdma-atmodem: Add CDMA SMS Support

2010-12-20 Thread Lei Yu

Hi Denis,

On 12/20/2010 12:39 PM, ext Denis Kenzior wrote:

On 12/08/2010 06:35 PM, Lei Yu wrote:

---
  Makefile.am|7 ++
  configure.ac   |5 ++
  drivers/cdma-atmodem/atmodem.c |   47 
  drivers/cdma-atmodem/atmodem.h |   23 ++


You need to synchronize with Dara on this one.  Both of you are sending
the same stub implementation.  I suggest submitting this as a separate
patch.  And please name it cdmamodem/cdmamodem.c  .h.  Dara has this
right actually.



I will synchronize with Dara. Most likely, I will hold of submitting
update to my patch at least for 3/5 till Dara's patch is finalized and
accepted.


  drivers/cdma-atmodem/atutil.c  |   45 
  drivers/cdma-atmodem/atutil.h  |   64 +


As I mentioned before, please use the atutil.[ch] from atmodem directly.
  No need to create a new set of these...



I will fix this and resubmit after Dara's patch is finalized.


  drivers/cdma-atmodem/sms.c |  151 


And this one should be in a separate patch ;)



Will fix this.


Regards,
-Denis


Regards,
Lei

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


Re: [PATCH 1/2] set huawei em770 modem device to 01 to free up 00

2010-12-20 Thread Denis Kenzior
Hi,

On 12/10/2010 12:25 PM, F. Gau wrote:
 From: M. Dietrich m...@emdete.de
 
   device 00 is ppp capable while 01 is not. 01 does everything
   else fine so ofono works with it flawlessly.
 ---
  plugins/ofono.rules |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 

Patch has been applied, thanks.  I reworded the commit message slightly.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH 2/2] fake a sim-inserted status

2010-12-20 Thread Denis Kenzior
Hi,

On 12/10/2010 12:28 PM, F. Gau wrote:
 From: M. Dietrich m...@emdete.de
 
   while the sim detection does not work this patch at least allows to use
   those modems. until someone has the time to work out a correct solution
   this is a usefull workaround.
 ---
  plugins/huawei.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
 
 diff --git a/plugins/huawei.c b/plugins/huawei.c
 index 25dfaca..df506d3 100644
 --- a/plugins/huawei.c
 +++ b/plugins/huawei.c
 @@ -586,6 +586,7 @@ static void huawei_pre_sim(struct ofono_modem *modem)
   ofono_devinfo_create(modem, 0, atmodem, data-pcui);
   data-sim = ofono_sim_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
   atmodem, data-pcui);
 + ofono_sim_inserted_notify(data-sim, TRUE);
  
   data-sim_poll_count = 0;
   query_sim_state(modem);

I don't want to completely bypass the sim inserted logic (which seems to
work on other Huawei models) for the sake of EM770.

So I really prefer that we do this a bit smarter.  Even simple model to
behavior matching would be acceptable...

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH v2 3/9] cdma-voicecall: Add CDMA MO Call Support

2010-12-20 Thread Dara Spieker-Doyle

Hi Denis

Thank you for reviewing these patches. I will submit new versions for 
your comments, please see any open points inline.


On 12/20/2010 12:50 PM, ext Denis Kenzior wrote:


+ */
+
+#ifndef __OFONO_CDMA_VOICECALL_H
+#define __OFONO_CDMA_VOICECALL_H
+
+#ifdef __cplusplus
+extern C {
+#endif
+
+#includeofono/types.h
+
+struct ofono_cdma_voicecall_manager;


Please call this ofono_cdma_voicecall.
This is actually our preference as well as there is no multicall in 
CDMA, just the single voicecall. To that end, does it not make sense to 
also rename the interface Voicecall rather than VoiceCallManager?


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


Re: [PATCH v2 4/9] cdma-voicecall: Add CDMA MO Call Support

2010-12-20 Thread Dara Spieker-Doyle

Hi Denis

On 12/20/2010 01:01 PM, ext Denis Kenzior wrote:


+
+static const char *voicecall_build_path(struct ofono_cdma_voicecall_manager 
*vc)
+{
+ static char path[256];
+
+ snprintf(path, sizeof(path), %s/voicecall,
+ __ofono_atom_get_path(vc-atom));


I'm still confused what this is for?  The CDMA voicecall proposal does
not have leaf objects...
Sorry yes, this is the same oversight as before. I will fix this and 
remove these path references.


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


Re: [PATCH 4/5] cdmaphonesim: Add CDMA SMS Support

2010-12-20 Thread Lei Yu

Hi Denis,

On 12/20/2010 12:42 PM, ext Denis Kenzior wrote:

Hi Lei,

On 12/08/2010 06:35 PM, Lei Yu wrote:

---
  Makefile.am   |9 ++
  configure.ac  |6 +
  plugins/cdmaphonesim.c|  344 +
  plugins/cdmaphonesim.conf |   14 ++
  4 files changed, 373 insertions(+), 0 deletions(-)
  create mode 100644 plugins/cdmaphonesim.c
  create mode 100644 plugins/cdmaphonesim.conf



Have you considered adding a CDMA/GSM selector to phonesim.conf instead?
  So e.g. a new configuration key called 'Type' where type can be 'gsm'
or 'cdma'.

That way you can share much of the phonesim plugin plumbing and only
populate the atoms differently...



We thought about this briefly but decided not pursuing that path at this 
stage of CDMA development mainly due to following reasons: a). We think 
it may make more sense to let CDMA development evolving a bit more on 
its own and then evaluate to see for which part it makes sense
to merge. We are afraid merging too early will make the phonesim.c code 
looking ugly with a lot of if/else down the road. We are planning to 
evaluate things like this when we have at least a few CDMA atoms 
implemented. b). We definitely would like to cause as little disruption 
to GSM as possible at this stage of CDMA development.


I am definitely looking forward to hearing more from you and other 
people and open for any changes.



Regards,
-Denis


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


Re: [PATCH v2 3/9] cdma-voicecall: Add CDMA MO Call Support

2010-12-20 Thread Denis Kenzior
Hi Dara,

 +
 +struct ofono_cdma_voicecall_manager;

 Please call this ofono_cdma_voicecall.
 This is actually our preference as well as there is no multicall in
 CDMA, just the single voicecall. To that end, does it not make sense to
 also rename the interface Voicecall rather than VoiceCallManager?

This comment was based mostly on the naming of the current gsm voicecall
atom (e.g. ofono_voicecall, not ofono_voicecall_manager)

For the interface name I suggest we stick to .cdma.VoiceCallManager for
now to be consistent with the GSM naming.  However, I'm open to changing
this one in the future.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 2/2] huawei: fix SIM state notification when locked

2010-12-20 Thread Lucas De Marchi
When SIM is locked, huawei modem does not send any notification about
SIM state change because it does not differentiate 'invalid' from
'locked'.

In order to be able to unlock the sim, this patch forces a notification
of a valid state after a timeout.
---
 plugins/huawei.c |   40 
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/plugins/huawei.c b/plugins/huawei.c
index bff1343..7934956 100644
--- a/plugins/huawei.c
+++ b/plugins/huawei.c
@@ -56,6 +56,7 @@
 #include drivers/atmodem/vendor.h
 
 static const char *none_prefix[] = { NULL };
+static const char *cpin_prefix[] = { +CPIN:, NULL };
 static const char *sysinfo_prefix[] = { ^SYSINFO:, NULL };
 static const char *ussdmode_prefix[] = { ^USSDMODE:, NULL };
 static const char *cvoice_prefix[] = { ^CVOICE:, NULL };
@@ -226,6 +227,41 @@ static gboolean notify_sim_state(struct ofono_modem *modem,
return FALSE;
 }
 
+static void cpin_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   const char *value;
+   GAtResultIter iter;
+
+   if (!ok)
+   return;
+
+   g_at_result_iter_init(iter, result);
+
+   if (!g_at_result_iter_next(iter, +CPIN:))
+   return;
+
+   if (!g_at_result_iter_next_unquoted_string(iter, value))
+   return;
+
+   /* Force notification of SIM ready because it's in a locked state */
+   if (g_str_has_prefix(value, SIM))
+   notify_sim_state(modem, HUAWEI_SIM_STATE_VALID);
+}
+
+static gboolean query_sim_locked(gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct huawei_data *data = ofono_modem_get_data(modem);
+
+   data-sim_poll_timeout = 0;
+
+   g_at_chat_send(data-pcui, AT+CPIN?, cpin_prefix,
+   cpin_cb, modem, NULL);
+
+   return FALSE;
+}
+
 static void sysinfo_cb(gboolean ok, GAtResult *result, gpointer user_data)
 {
struct ofono_modem *modem = user_data;
@@ -264,6 +300,10 @@ static void sysinfo_cb(gboolean ok, GAtResult *result, 
gpointer user_data)
data-sim_poll_timeout = g_timeout_add_seconds(2,
query_sim_state,
modem);
+   } else if (sim_state == HUAWEI_SIM_STATE_INVALID_OR_LOCKED) {
+   data-sim_poll_timeout = g_timeout_add_seconds(2,
+   
query_sim_locked,
+   modem);
}
 }
 
-- 
1.7.3.4

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


Re: oFono release plan?

2010-12-20 Thread Denis Kenzior
Hi Sjur,

On 12/17/2010 10:21 AM, Sjur BRENDELAND wrote:
 Hi Denis and Marcel.
 
 Do you have a release plan defined for oFono? 
 When will you release oFono 1.0?
 

We do not have a concrete plan as of yet.  For the most part we were
quite happy with the current set of oFono APIs, however with LTE support
on the horizon we might have to revisit some of them.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH 1/4] sim: add method to query SIM Retry Counter

2010-12-20 Thread Lucas De Marchi
---
 include/sim.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/sim.h b/include/sim.h
index 7860e24..50529bb 100644
--- a/include/sim.h
+++ b/include/sim.h
@@ -108,6 +108,9 @@ typedef void (*ofono_sim_passwd_cb_t)(const struct 
ofono_error *error,
enum ofono_sim_password_type type,
void *data);
 
+typedef void (*ofono_sim_retry_counter_cb_t)(const struct ofono_error *error,
+   int retry_counter, void *data);
+
 typedef void (*ofono_sim_lock_unlock_cb_t)(const struct ofono_error *error,
void *data);
 
@@ -144,6 +147,8 @@ struct ofono_sim_driver {
ofono_sim_passwd_cb_t cb, void *data);
void (*send_passwd)(struct ofono_sim *sim, const char *passwd,
ofono_sim_lock_unlock_cb_t cb, void *data);
+   void (*query_retry_counter)(struct ofono_sim *sim,
+   ofono_sim_retry_counter_cb_t cb, void *data);
void (*reset_passwd)(struct ofono_sim *sim, const char *puk,
const char *passwd,
ofono_sim_lock_unlock_cb_t cb, void *data);
-- 
1.7.3.4

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


[PATCH 2/4] sim: add PinRetries property

2010-12-20 Thread Lucas De Marchi
---
 src/sim.c |   32 
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/src/sim.c b/src/sim.c
index 6217a25..8c05900 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -62,6 +62,8 @@ struct ofono_sim {
enum ofono_sim_password_type pin_type;
gboolean locked_pins[OFONO_SIM_PASSWORD_SIM_PUK]; /* Number of PINs */
 
+   unsigned char pin_retries;
+
enum ofono_sim_phase phase;
unsigned char mnc_length;
enum ofono_sim_cphs_phase cphs_phase;
@@ -369,6 +371,9 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
DBUS_TYPE_STRING,
(void *) pin_name);
 
+   ofono_dbus_dict_append(dict, PinRetries,
+   DBUS_TYPE_BYTE, sim-pin_retries);
+
 done:
dbus_message_iter_close_container(iter, dict);
 
@@ -1560,6 +1565,28 @@ static void sim_initialize_after_pin(struct ofono_sim 
*sim)
sim_cphs_information_read_cb, sim);
 }
 
+static void sim_retry_counter_query_cb(const struct ofono_error *error,
+   int retry, void *data)
+{
+   struct ofono_sim *sim = data;
+   DBusConnection *conn = ofono_dbus_get_connection();
+   const char *path = __ofono_atom_get_path(sim-atom);
+
+   if (error-type != OFONO_ERROR_TYPE_NO_ERROR) {
+   ofono_error(Querying PIN Retry Counter failed);
+
+   return;
+   }
+
+   if (sim-pin_retries != retry) {
+   sim-pin_retries = retry;
+   ofono_dbus_signal_property_changed(conn, path,
+   OFONO_SIM_MANAGER_INTERFACE,
+   PinRetries, DBUS_TYPE_BYTE,
+   retry);
+   }
+}
+
 static void sim_pin_query_cb(const struct ofono_error *error,
enum ofono_sim_password_type pin_type,
void *data)
@@ -1592,6 +1619,11 @@ static void sim_pin_query_cb(const struct ofono_error 
*error,
pin_name);
}
 
+   if (sim-driver-query_retry_counter != NULL) {
+   sim-driver-query_retry_counter(sim,
+   sim_retry_counter_query_cb, sim);
+   }
+
 checkdone:
if (pin_type == OFONO_SIM_PASSWORD_NONE)
sim_initialize_after_pin(sim);
-- 
1.7.3.4

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


[PATCH 3/4] doc: detail PinRetries property

2010-12-20 Thread Lucas De Marchi
---
 doc/sim-api.txt |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/doc/sim-api.txt b/doc/sim-api.txt
index d4d2b1b..c7d1faa 100644
--- a/doc/sim-api.txt
+++ b/doc/sim-api.txt
@@ -145,3 +145,13 @@ Properties boolean Present [readonly]
 
If BDN is enabled, oFono halts the SIM initialization
procedure and only emergency calls are allowed.
+
+   byte PinRetries [readonly]
+
+   Contains the retry counter for the current required
+   pin. This counter is tipically decremented whenever a
+   call to EnterPin() fails.
+
+   E.g.: if PinRequired is equal puk, this property
+   contains the number of times EnterPin can be called
+   with a wrong puk.
-- 
1.7.3.4

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


[PATCH 4/4] atmodem: implement method to query PIN Retry Counter

2010-12-20 Thread Lucas De Marchi
PIN retry counter is implemented for huaweimodem and it'd be very
similar for other vendors.
---
 drivers/atmodem/sim.c |   70 +
 1 files changed, 70 insertions(+), 0 deletions(-)

diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index 1653ede..4d0d40c 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -52,6 +52,7 @@ struct sim_data {
 
 static const char *crsm_prefix[] = { +CRSM:, NULL };
 static const char *cpin_prefix[] = { +CPIN:, NULL };
+static const char *xcpin_prefix[] = { ^CPIN:, NULL };
 static const char *clck_prefix[] = { +CLCK:, NULL };
 static const char *none_prefix[] = { NULL };
 
@@ -456,6 +457,74 @@ static struct {
{ OFONO_SIM_PASSWORD_PHCORP_PUK,PH-CORP PUK   },
 };
 
+static void at_xcpin_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+   struct cb_data *cbd = user_data;
+   ofono_sim_retry_counter_cb_t cb = cbd-cb;
+   const char *final = g_at_result_final_response(result);
+   GAtResultIter iter;
+   int retry;
+   struct ofono_error error;
+
+   decode_at_error(error, final);
+
+   if (!ok) {
+   cb(error, -1, cbd-data);
+   return;
+   }
+
+   g_at_result_iter_init(iter, result);
+
+   if (!g_at_result_iter_next(iter, ^CPIN:))
+   goto error;
+
+   /* Skip status since we are not interested in this */
+   if (!g_at_result_iter_skip_next(iter))
+   goto error;
+
+   /*
+* Number is optional. In case number is not present, pin is not
+* required.
+*/
+   if (!g_at_result_iter_next_number(iter, retry))
+   retry = 0;
+
+   cb(error, retry, cbd-data);
+
+   return;
+
+error:
+   CALLBACK_WITH_FAILURE(cb, -1, cbd-data);
+}
+
+static void at_pin_retry_query(struct ofono_sim *sim,
+   ofono_sim_retry_counter_cb_t cb, void *data)
+{
+   struct sim_data *sd = ofono_sim_get_data(sim);
+
+   DBG();
+
+   if (sd-vendor == OFONO_VENDOR_QUALCOMM_MSM) {
+   struct cb_data *cbd = cb_data_new(cb, data);
+
+   if (cbd == NULL) {
+   CALLBACK_WITH_FAILURE(cb, -1, data);
+
+   return;
+   }
+
+   if (g_at_chat_send(sd-chat, AT^CPIN?, xcpin_prefix,
+   at_xcpin_cb, cbd, g_free)  0)
+   return;
+
+   g_free(cbd);
+
+   CALLBACK_WITH_FAILURE(cb, -1, data);
+   }
+
+   CALLBACK_WITH_SUCCESS(cb, 0, data);
+}
+
 static void at_cpin_cb(gboolean ok, GAtResult *result, gpointer user_data)
 {
struct cb_data *cbd = user_data;
@@ -886,6 +955,7 @@ static struct ofono_sim_driver driver = {
.write_file_cyclic  = at_sim_update_cyclic,
.read_imsi  = at_read_imsi,
.query_passwd_state = at_pin_query,
+   .query_retry_counter= at_pin_retry_query,
.send_passwd= at_pin_send,
.reset_passwd   = at_pin_send_puk,
.lock   = at_pin_enable,
-- 
1.7.3.4

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


[PATCH 0/4] Add SIM Retry Counter

2010-12-20 Thread Lucas De Marchi
These patches add SIM Retry counter feature to ofono and implement it for
huawei modem. I verified later the the latest version of 27.007 does has a
command for querying the retry counter. This would need to be implemented as
well and it's not done yet.

The implementation reads only one Retry Counter that is the same as the one
being requested in PinRequired property. Another approach was to read all the
counters (e.g. huawei exports counters for PIN, PIN2, PUK and PUK2), but the
Dbus API to expose to user was not so clear to me if I used this approach.
What do you think?


Lucas De Marchi (4):
  sim: add method to query SIM Retry Counter
  sim: add PinRetries property
  doc: detail PinRetries property
  atmodem: implement method to query PIN Retry Counter

 doc/sim-api.txt   |   10 +++
 drivers/atmodem/sim.c |   70 +
 include/sim.h |5 +++
 src/sim.c |   32 ++
 4 files changed, 117 insertions(+), 0 deletions(-)

-- 
1.7.3.4

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


[PATCH v2] TODO: CDMA SMS and CDMA CMAS

2010-12-20 Thread Lei Yu
---
 TODO |  116 ++---
 1 files changed, 89 insertions(+), 27 deletions(-)

diff --git a/TODO b/TODO
index d40c0ff..ee32e34 100644
--- a/TODO
+++ b/TODO
@@ -49,33 +49,6 @@ SMS
   Complexity: C1
   Owner: Kristen Carlson Accardi kris...@linux.intel.com
 
-- Add CDMA support to the SMS stack. The idea is to support only the PDU
-  mode. To start with only Submit and Deliver message handling for WMT
-  teleservice will be added to bring the basic CDMA SMS send and receive
-  functionality.
-
-  Priority: Low
-  Complexity: C8
-  Owner: Rajesh Kadhiravan Nagaiah rajesh.naga...@elektrobit.com
-
-- Add CDMA Delivery(Status) Report handling to the SMS stack.
-
-  Priority: Low
-  Complexity: C4
-  Owner: Rajesh Kadhiravan Nagaiah rajesh.naga...@elektrobit.com
-
-- Add CDMA Voice Mail Notification handling to the SMS stack. In CDMA the
-  Message Waiting indication is notified through a specific teleservice ID
-  VMN. No update to corresponding elementary files required since they are
-  not present in the R-UIM. This will result in the message waiting
-  indication being initially processed within the SMS atom and then being
-  passed for delivery to the message waiting atom. Furthemore note that in
-  CDMA only voice mail type is supported.
-
-  Priority: Low
-  Complexity: C4
-  Owner: Rajesh Kadhiravan Nagaiah rajesh.naga...@elektrobit.com
-
 - Asynchronously acknowledge SMS DELIVER messages sent by the SMS driver
   to core using ofono_sms_deliver_notify().  This may require the struct
   ofono_sms_driver to be extended with one more function pointer like:
@@ -529,3 +502,92 @@ CDMA Voicecall
   Priority: High
   Complexity: C2
   Owner: Dara Spieker-Doyle dara.spieker-do...@nokia.com
+
+CDMA SMS
+==
+
+- Support CDMA SMS stack in PDU mode. This includes basic support of
+  SMS Point-to-Point Message, SMS Broadcast Message and SMS Acknowledge
+  Message as per 3GPP2 C.S0015-B version 2.0.
+
+  Priority: High
+  Complexity: C4
+
+- Support sending Wireless Messaging Teleservice (WMT) Submit Message and
+  receiving WMT Deliver Messsage as defined 3GPP2 C.S0015-B version 2.0.
+
+  Priority: High
+  Complexity: C4
+
+- Support Delivery Acknowledgment. oFono allows requesting of CDMA SMS
+  Delivery Acknowledgment via the MessageManager's
+  UseDeliveryAcknowledgement property. If enabled, oFono's CDMA SMS stack
+  will encode the Reply Option subparameter in the Submit message and
+  process incoming SMS Delivery Acknowledgment Message. oFono will notify
+  UI either via DBus or history plugin API.
+
+  Priority: Medium
+  Complexity: C2
+
+- Support receiving Voice Mail Notification (VMN) Teleservice Deliver
+  message. CDMA network uses VMN Teleservice to deliver the number of
+  messages stored at the Voice Mail System to the CDMA mobile subscriber.
+
+  Priority: High
+  Complexity: C4
+
+- Support sending Wireless Enhanced Messaging Teleservice (WEMT) Submit
+  Message and receiving WEMT Deliver Messsage as defined 3GPP2 C.S0015-B
+  version 2.0.
+
+  WMT does not support message fragmentation thus can not be used to for
+  long message. WEMT is devised to support long message and Enhanced
+  Messaging Service (EMS). The WEMT SMS message's CHARi field of the
+  subparameter User Data encapsulate GSM-SMS TP-User Data as defined in
+  Section 9.2.3.24 of 3GPP TS 23.040.
+
+  Priority: Medium
+  Complexity: C4
+
+- Support sending Wireless Application Protocol (WAP) Teleservice Submit
+  Message and receiving WAP Deliver Messsage as defined 3GPP2 C.S0015-B
+  version 2.0.
+
+  Priority: Medium
+  Complexity: C4
+
+- Support Call-Back Number. The Call-Back Number subparameter indicates
+  the number to be dialed in reply to a received SMS message.
+
+  In transmit direction, oFono allows setting of Call-Back Number. If the
+  Call Back Number property is set, CDMA SMS stack will encode Call-Back
+  Number subparameter in the Submit Message.
+
+  In receiving direction, oFono will process the Call-Back Number
+  subparameter in the incoming Deliver Message and notify UI of the
+  Call-Back Number together with the newly received text message.
+
+  Priority: Medium
+  Complexity: C2
+
+- Support immediately displayed message. oFono CDMA SMS stack will
+  process the optional Message Display Mode subparameter in the incoming
+  SMS message. If Message Display Mode subparameter indicates the
+  message display mode is Immediate Display, oFono will send
+  ImmediateMessage signal, otherwise oFono will send IncomingMessage
+  signal.
+
+  Priority: Medium
+  Complexity: C2
+
+
+CDMA CMAS
+==
+
+- Support Commercial Mobile Alert Service (CMAS) over CDMA systems. CMAS
+  over CDMA system is defined in TIA-1149. The CMAS message is carried in
+  the CHARi field of the User Data subparameter of CDMA SMS Broadcast
+  message.
+
+  Priority: Medium
+  Complexity: C4
-- 
1.7.0.4

___
ofono mailing 

Re: [PATCH 4/5] cdmaphonesim: Add CDMA SMS Support

2010-12-20 Thread Denis Kenzior
Hi Lei,


 Have you considered adding a CDMA/GSM selector to phonesim.conf instead?
   So e.g. a new configuration key called 'Type' where type can be 'gsm'
 or 'cdma'.

 That way you can share much of the phonesim plugin plumbing and only
 populate the atoms differently...

 
 We thought about this briefly but decided not pursuing that path at this
 stage of CDMA development mainly due to following reasons: a). We think
 it may make more sense to let CDMA development evolving a bit more on
 its own and then evaluate to see for which part it makes sense
 to merge. We are afraid merging too early will make the phonesim.c code
 looking ugly with a lot of if/else down the road. We are planning to
 evaluate things like this when we have at least a few CDMA atoms
 implemented. b). We definitely would like to cause as little disruption
 to GSM as possible at this stage of CDMA development.

Ok I'm still waffling on this one but I can accept a temporary cdma
phonesim plugin for now.

Can you make sure to strip it down some more? For instance you can omit
Multiplexer and Modem configure key handling.

And having a separate configure option for cdma phonesim seems unneeded.
 Lump this one with --enable-phonesim.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH v2] TODO: CDMA SMS and CDMA CMAS

2010-12-20 Thread Denis Kenzior
Hi Lei,

On 12/20/2010 04:18 PM, Lei Yu wrote:
 ---
  TODO |  116 ++---
  1 files changed, 89 insertions(+), 27 deletions(-)
 

Patch has been applied, thanks.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH 4/5] cdmaphonesim: Add CDMA SMS Support

2010-12-20 Thread Lei Yu

On 12/20/2010 02:32 PM, ext Denis Kenzior wrote:

Hi Lei,



Have you considered adding a CDMA/GSM selector to phonesim.conf instead?
   So e.g. a new configuration key called 'Type' where type can be 'gsm'
or 'cdma'.

That way you can share much of the phonesim plugin plumbing and only
populate the atoms differently...



We thought about this briefly but decided not pursuing that path at this
stage of CDMA development mainly due to following reasons: a). We think
it may make more sense to let CDMA development evolving a bit more on
its own and then evaluate to see for which part it makes sense
to merge. We are afraid merging too early will make the phonesim.c code
looking ugly with a lot of if/else down the road. We are planning to
evaluate things like this when we have at least a few CDMA atoms
implemented. b). We definitely would like to cause as little disruption
to GSM as possible at this stage of CDMA development.


Ok I'm still waffling on this one but I can accept a temporary cdma
phonesim plugin for now.



As you can see I am also waffling on this. :-) I will stick with 
separate cdma phonesim plugin for now.



Can you make sure to strip it down some more? For instance you can omit
Multiplexer and Modem configure key handling.



Yes, I will strip it down more.


And having a separate configure option for cdma phonesim seems unneeded.
  Lump this one with --enable-phonesim.



Yes, I will do this.


Regards,
-Denis


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


Re: PATCH: Enable udev-based autodetection of calypso modem on Freerunner

2010-12-20 Thread Denis Kenzior
Hi Neil,

On 12/15/2010 04:12 PM, Neil Jerram wrote:
 Hi all,
 
 With the patch below, ofono-0.36 (the current Debian unstable version)
 detects the calypso modem on my freerunner.  (Whereas without it, it
 doesn't.)

We prefer if you use git send-email to format the patch for submission.
 For now I applied your patch without the ofono.rules changes.

 
 I don't feel confident that the ofono.rules change is in its nicest
 possible form, and (IIUC) it's dependent on these earlier rules in
 /lib/udev/rules.d/55-openmoko-gta01-gta02.rules on my phone:
 
 # Samsung UARTS
 KERNEL==s3c2410_serial[0-9],   NAME=ttySAC%n
 KERNEL==ttySAC[0-9],   NAME=ttySAC%n
 
 Given that the actual udev DB entry, under 2.6.34, is:
 
 P: /devices/platform/s3c2440-uart.0/tty/ttySAC0
 N: ttySAC0
 S: char/204:64
 E: UDEV_LOG=3
 E: DEVPATH=/devices/platform/s3c2440-uart.0/tty/ttySAC0
 E: MAJOR=204
 E: MINOR=64
 E: DEVNAME=/dev/ttySAC0
 E: SUBSYSTEM=tty
 E: DEVLINKS=/dev/char/204:64
 

I think the better way would be to drop a udev rule directly into
/etc/udev.d or similar.  The rule should be as simple as:
KERNEL==ttySAC0, ENV{OFONO_DRIVER}=calypso

Let me know if this works for you and I can add a comment in the calypso
plugin.

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


Re: [PATCH] Add initial support for Cinterion TC65 modem

2010-12-20 Thread Denis Kenzior
Hi Oskari,

On 12/10/2010 01:08 AM, Oskari Timperi wrote:
 ---
  Makefile.am|3 +
  plugins/tc65.c |  279 
 
  2 files changed, 282 insertions(+), 0 deletions(-)
  create mode 100644 plugins/tc65.c
 
 diff --git a/Makefile.am b/Makefile.am
 index cdb3166..779df9b 100644
 --- a/Makefile.am
 +++ b/Makefile.am
 @@ -286,6 +286,9 @@ builtin_sources += plugins/ste.c
  
  builtin_modules += caif
  builtin_sources += plugins/caif.c
 +
 +builtin_modules += tc65
 +builtin_sources += plugins/tc65.c
  endif
  
  if MAINTAINER_MODE
 diff --git a/plugins/tc65.c b/plugins/tc65.c
 new file mode 100644
 index 000..36c579e
 --- /dev/null
 +++ b/plugins/tc65.c
 @@ -0,0 +1,279 @@
 +/*
 + *
 + *  oFono - Open Source Telephony
 + *
 + *  Copyright (C) 2008-2010  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 errno.h
 +#include stdlib.h
 +
 +#include glib.h
 +#include gatchat.h
 +#include gattty.h
 +
 +#define OFONO_API_SUBJECT_TO_CHANGE
 +#include ofono/plugin.h
 +#include ofono/log.h
 +#include ofono/modem.h
 +#include ofono/call-barring.h
 +#include ofono/call-forwarding.h
 +#include ofono/call-meter.h
 +#include ofono/call-settings.h
 +#include ofono/devinfo.h
 +#include ofono/message-waiting.h
 +#include ofono/netreg.h
 +#include ofono/phonebook.h
 +#include ofono/sim.h
 +#include ofono/stk.h

This driver does not use sim toolkit, so this include can be dropped

 +#include ofono/sms.h
 +#include ofono/ssn.h
 +#include ofono/ussd.h
 +#include ofono/voicecall.h
 +
 +#include drivers/atmodem/atutil.h
 +#include drivers/atmodem/sim-poll.h

sim-poll is sim toolkit specific, so this one can be dropped as well.

 +
 +#include ofono/gprs.h
 +#include ofono/gprs-context.h
 +
 +static const char *g_device = /dev/ttyS0;
 +
 +static int tc65_probe(struct ofono_modem *modem)
 +{
 + return 0;
 +}
 +
 +static void tc65_remove(struct ofono_modem *modem)
 +{
 +}
 +
 +static void tc65_debug(const char *str, void *user_data)
 +{
 + const char *prefix = user_data;
 +
 + ofono_info(%s%s, prefix, str);
 +}
 +
 +static int tc65_enable(struct ofono_modem *modem)
 +{
 + GAtChat *chat;
 + GIOChannel *channel;
 + GAtSyntax *syntax;
 + GHashTable *options;
 + const char *device;
 +
 + DBG(%p, modem);
 +
 + options = g_hash_table_new_full(g_str_hash, g_str_equal,
 + g_free, g_free);
 + if (!options)
 + return -ENOMEM;
 +
 + device = getenv(OFONO_TC65_DEVICE);
 + if (!device)
 + device = g_device;
 +

I really suggest using udev for this.  You can very easily create a udev
rule even for static serial devices.  See the recent thread about
calypso driver.

 + g_hash_table_insert(options, g_strdup(Baud),
 + g_strdup(115200));
 + g_hash_table_insert(options, g_strdup(StopBits),
 + g_strdup(1));
 + g_hash_table_insert(options, g_strdup(DataBits),
 + g_strdup(8));
 + g_hash_table_insert(options, g_strdup(Parity),
 + g_strdup(none));
 + g_hash_table_insert(options, g_strdup(XonXoff),
 + g_strdup(off));
 + g_hash_table_insert(options, g_strdup(RtsCts),
 + g_strdup(on));
 + g_hash_table_insert(options, g_strdup(Local),
 + g_strdup(on));
 + g_hash_table_insert(options, g_strdup(Read),
 + g_strdup(on));
 +
 + channel = g_at_tty_open(device, options);
 +
 + g_hash_table_destroy(options);
 +
 + if (!channel)
 + return -EIO;
 +
 + /*
 +  * TC65 works almost as the 27.007 says. But for example after
 +  * AT+CRSM the modem replies with the data in the queried EF and
 +  * writes three pairs of CRLF after the data and before OK.
 +  */
 + syntax = g_at_syntax_new_gsm_permissive();
 +
 + chat = g_at_chat_new(channel, syntax);
 + g_at_syntax_unref(syntax);
 + g_io_channel_unref(channel);
 +
 + if (!chat)
 + return -ENOMEM;
 +
 + if (getenv(OFONO_AT_DEBUG))
 + g_at_chat_set_debug(chat, tc65_debug, );
 +
 + 

[PATCH 2/2] doc: Describe DisplayAlphaId().

2010-12-20 Thread Andrzej Zaborowski
---
 doc/stk-api.txt |   12 ++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/doc/stk-api.txt b/doc/stk-api.txt
index 79daee6..80d3ed6 100644
--- a/doc/stk-api.txt
+++ b/doc/stk-api.txt
@@ -249,12 +249,20 @@ Methods   byte RequestSelection(string title, 
byte icon_id,
 
Possible Errors: [service].Error.SimToolkit.EndSession
 
+   void DisplayAlphaId(string text, byte icon_id)
+
+   Supplies a text string and/or icon concerning the
+   current activity in the terminal and UICC.  The
+   text should be displayed to the user on screen
+   until the call is canceled using Cancel().  This
+   method should not return.
+
void Cancel()
 
Asks the agent to cancel any ongoing operation in
progress.  This is usually either because the agent
-   is taking too long to respond or the Sim Application
-   has terminated the session.
+   is taking too long to respond, the Sim Application
+   has terminated the session or a task has finished.
 
void Release()
 
-- 
1.7.1.86.g0e460.dirty

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


[PATCH] sim: Set valid number length in empty EFmsisdn records.

2010-12-20 Thread Andrzej Zaborowski
Valid number length range is 1 - 10 bytes, other values, such as 0xff,
could potentially crash external parsers.
---
 src/sim.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/sim.c b/src/sim.c
index 9263e75..b98c4b2 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -437,6 +437,8 @@ static gboolean set_own_numbers(struct ofono_sim *sim,
new_numbers = new_numbers-next;
} else {
memset(efmsisdn, 0xff, sim-efmsisdn_length);
+   /* Set number length */
+   efmsisdn[sim-efmsisdn_length - 14] = 1;
}
 
if (ofono_sim_write(req-sim, SIM_EFMSISDN_FILEID,
-- 
1.7.1.86.g0e460.dirty

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


[PATCH v3, Part1, 0/5] Add CDMA MO Call Support

2010-12-20 Thread Dara Spieker-Doyle
This series of patches is the first part of the split of the version 2 series,
concerning the changes needed to provide foundation support for cdmamodem
driver and the introducing the cdma-voicecall atom. Not included in this part
of the series is the cdmagen plugin for testing these changes with hardware as
this is under further discussion. Part2 will be submitted once the naming
convention for this plugin has been resolved.
This part also contains the relevant test scripts, although these will fail
for now until the cdmagen plugin changes have been submitted.

Implementation of the following has been carried out in this set of patches:

They cover making a simple MO call over a CDMA network, including call
state management, LineIdentification, dialing and hanging up through the
cdma-voicecall atom DBus interface. 
Currently, the implemented call states available are dialing and
disconnected, initiated on dialing and hanging up, and the LineIdentification
property is updated only upon dialing. The StartTime for when a call would 
become
active has been implemented, but is untested until support for call state
transition changes is implemented. This is future work.

AT command support for dial and hangup is provided with a cdma-atmodem driver.
Also included in these patches are test scripts and a CDMA generic hardware
plugin (cdmagen) to support testing of these features.

These patches have been tested against the Nokia 7205 CDMA device in a tethered
mode.

Limitations
---
The Nokia 7205 device does not support an AT interface for reporting request
responses, such as the call status and remote/network disconnect reasons, so
these are currently untested.

Dara Spieker-Doyle (5):
  cdma-voicecall: Add CDMA MO Call Support
  cdma-voicecall: Add CDMA MO Call Support
  cdmamodem: Add cdmamodem stubs
  cdmamodem: Add CDMA MO Call Support with voicecall driver
  test: Add CDMA MO Call Support

 Makefile.am   |   17 ++-
 configure.ac  |5 +
 drivers/cdmamodem/cdmamodem.c |   48 +
 drivers/cdmamodem/cdmamodem.h |   25 +++
 drivers/cdmamodem/voicecall.c |  190 ++
 include/cdma-voicecall.h  |   89 +
 src/cdma-voicecall.c  |  430 +
 src/common.c  |   41 
 src/common.h  |6 +
 src/ofono.h   |3 +
 test/cdma-dial-number |   24 +++
 test/cdma-hangup  |   20 ++
 test/cdma-list-call   |   30 +++
 13 files changed, 925 insertions(+), 3 deletions(-)
 create mode 100644 drivers/cdmamodem/cdmamodem.c
 create mode 100644 drivers/cdmamodem/cdmamodem.h
 create mode 100644 drivers/cdmamodem/voicecall.c
 create mode 100644 include/cdma-voicecall.h
 create mode 100644 src/cdma-voicecall.c
 create mode 100755 test/cdma-dial-number
 create mode 100755 test/cdma-hangup
 create mode 100755 test/cdma-list-call

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


[PATCH v3, Part1, 1/5] cdma-voicecall: Add CDMA MO Call Support

2010-12-20 Thread Dara Spieker-Doyle
---
 Makefile.am  |2 +-
 include/cdma-voicecall.h |   89 ++
 2 files changed, 90 insertions(+), 1 deletions(-)
 create mode 100644 include/cdma-voicecall.h

diff --git a/Makefile.am b/Makefile.am
index 12b3c33..1270be5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,7 +14,7 @@ include_HEADERS = include/log.h include/plugin.h 
include/history.h \
include/gprs.h include/gprs-context.h \
include/radio-settings.h include/stk.h \
include/audio-settings.h include/nettime.h \
-   include/ctm.h
+   include/ctm.h include/cdma-voicecall.h
 
 nodist_include_HEADERS = include/version.h
 
diff --git a/include/cdma-voicecall.h b/include/cdma-voicecall.h
new file mode 100644
index 000..6cd0984
--- /dev/null
+++ b/include/cdma-voicecall.h
@@ -0,0 +1,89 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2010 Nokia 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
+ *
+ */
+
+#ifndef __OFONO_CDMA_VOICECALL_H
+#define __OFONO_CDMA_VOICECALL_H
+
+#ifdef __cplusplus
+extern C {
+#endif
+
+#include ofono/types.h
+
+struct ofono_cdma_voicecall;
+
+enum cdma_call_status {
+   CDMA_CALL_STATUS_ACTIVE,
+   CDMA_CALL_STATUS_DIALING,
+   CDMA_CALL_STATUS_ALERTING,
+   CDMA_CALL_STATUS_INCOMING,
+   CDMA_CALL_STATUS_DISCONNECTED
+};
+
+typedef void (*ofono_cdma_voicecall_cb_t)(const struct ofono_error *error,
+   void *data);
+
+/* Voice call related functionality, including AT+CDV, AT+CHV */
+struct ofono_cdma_voicecall_driver {
+   const char *name;
+   int (*probe)(struct ofono_cdma_voicecall *vc,
+   unsigned int vendor, void *data);
+   void (*remove)(struct ofono_cdma_voicecall *vc);
+
+   void (*dial)(struct ofono_cdma_voicecall *vc,
+   const struct ofono_cdma_phone_number *number,
+   ofono_cdma_voicecall_cb_t cb, void *data);
+
+   /* Hangs up active, dialing, alerting or incoming calls */
+   void (*hangup)(struct ofono_cdma_voicecall *vc,
+   ofono_cdma_voicecall_cb_t cb, void *data);
+};
+
+void ofono_cdma_voicecall_disconnected(
+   struct ofono_cdma_voicecall *vc,
+   enum ofono_disconnect_reason reason,
+   const struct ofono_error *error);
+
+int ofono_cdma_voicecall_driver_register(
+   const struct ofono_cdma_voicecall_driver *d);
+void ofono_cdma_voicecall_driver_unregister(
+   const struct ofono_cdma_voicecall_driver *d);
+
+struct ofono_cdma_voicecall *ofono_cdma_voicecall_create(
+   struct ofono_modem *modem,
+   unsigned int vendor,
+   const char *driver, void *data);
+
+void ofono_cdma_voicecall_register(
+   struct ofono_cdma_voicecall *vc);
+void ofono_cdma_voicecall_remove(
+   struct ofono_cdma_voicecall *vc);
+
+void ofono_cdma_voicecall_set_data(
+   struct ofono_cdma_voicecall *vc, void *data);
+void *ofono_cdma_voicecall_get_data(
+   struct ofono_cdma_voicecall *vc);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __OFONO_CDMA_VOICECALL_H */
-- 
1.7.0.4

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


[PATCH v3, Part1, 2/5] cdma-voicecall: Add CDMA MO Call Support

2010-12-20 Thread Dara Spieker-Doyle
---
 Makefile.am  |3 +-
 src/cdma-voicecall.c |  430 ++
 src/common.c |   41 +
 src/common.h |6 +
 src/ofono.h  |3 +
 5 files changed, 482 insertions(+), 1 deletions(-)
 create mode 100644 src/cdma-voicecall.c

diff --git a/Makefile.am b/Makefile.am
index 1270be5..40ff52d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -319,7 +319,8 @@ src_ofonod_SOURCES = $(gdbus_sources) $(builtin_sources) 
src/ofono.ver \
src/radio-settings.c src/stkutil.h src/stkutil.c \
src/nettime.c src/stkagent.c src/stkagent.h \
src/simfs.c src/simfs.h src/audio-settings.c \
-   src/smsagent.c src/smsagent.h src/ctm.c
+   src/smsagent.c src/smsagent.h src/ctm.c \
+   src/cdma-voicecall.c
 
 src_ofonod_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ @CAPNG_LIBS@ -ldl
 
diff --git a/src/cdma-voicecall.c b/src/cdma-voicecall.c
new file mode 100644
index 000..a36af75
--- /dev/null
+++ b/src/cdma-voicecall.c
@@ -0,0 +1,430 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2010 Nokia 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 string.h
+#include stdio.h
+#include time.h
+#include errno.h
+#include stdint.h
+
+#include glib.h
+#include gdbus.h
+
+#include ofono.h
+
+#include common.h
+
+static GSList *g_drivers;
+
+struct ofono_cdma_voicecall {
+   struct ofono_cdma_phone_number phone_number;
+   int direction;
+   enum cdma_call_status status;
+   time_t start_time;
+   DBusMessage *pending;
+   const struct ofono_cdma_voicecall_driver *driver;
+   void *driver_data;
+   struct ofono_atom *atom;
+};
+
+static const char *disconnect_reason_to_string(enum ofono_disconnect_reason r)
+{
+   switch (r) {
+   case OFONO_DISCONNECT_REASON_LOCAL_HANGUP:
+   return local;
+   case OFONO_DISCONNECT_REASON_REMOTE_HANGUP:
+   return remote;
+   default:
+   return network;
+   }
+}
+
+static const char *cdma_call_status_to_string(enum cdma_call_status status)
+{
+   switch (status) {
+   case CDMA_CALL_STATUS_ACTIVE:
+   return active;
+   case CDMA_CALL_STATUS_DIALING:
+   return dialing;
+   case CDMA_CALL_STATUS_ALERTING:
+   return alerting;
+   case CDMA_CALL_STATUS_INCOMING:
+   return incoming;
+   case CDMA_CALL_STATUS_DISCONNECTED:
+   return disconnected;
+   }
+
+   return NULL;
+}
+
+static const char *time_to_str(const time_t *t)
+{
+   static char buf[128];
+   struct tm tm;
+
+   strftime(buf, 127, %Y-%m-%dT%H:%M:%S%z, localtime_r(t, tm));
+   buf[127] = '\0';
+
+   return buf;
+}
+
+static void generic_callback(const struct ofono_error *error, void *data)
+{
+   struct ofono_cdma_voicecall *vc = data;
+   DBusMessage *reply;
+
+   if (error-type == OFONO_ERROR_TYPE_NO_ERROR)
+   reply = dbus_message_new_method_return(vc-pending);
+   else
+   reply = __ofono_error_failed(vc-pending);
+
+   __ofono_dbus_pending_reply(vc-pending, reply);
+}
+
+static void append_voicecall_properties(struct ofono_cdma_voicecall *vc,
+   DBusMessageIter *dict)
+{
+   const char *status;
+   const char *lineid;
+   const char *timestr;
+
+   status = cdma_call_status_to_string(vc-status);
+   lineid = cdma_phone_number_to_string(vc-phone_number);
+
+   ofono_dbus_dict_append(dict, State, DBUS_TYPE_STRING, status);
+
+   ofono_dbus_dict_append(dict, LineIdentification,
+   DBUS_TYPE_STRING, lineid);
+
+   if (vc-status == CDMA_CALL_STATUS_ACTIVE) {
+   timestr = time_to_str(vc-start_time);
+
+   ofono_dbus_dict_append(dict, StartTime, DBUS_TYPE_STRING,
+   timestr);
+   }
+}
+
+static DBusMessage *voicecall_manager_get_properties(DBusConnection *conn,
+   DBusMessage *msg, void *data)
+{
+   struct ofono_cdma_voicecall *vc = data;
+   

[PATCH v3, Part1, 3/5] cdmamodem: Add cdmamodem stubs

2010-12-20 Thread Dara Spieker-Doyle
---
 Makefile.am   |6 +
 configure.ac  |5 
 drivers/cdmamodem/cdmamodem.c |   45 +
 drivers/cdmamodem/cdmamodem.h |   22 
 4 files changed, 78 insertions(+), 0 deletions(-)
 create mode 100644 drivers/cdmamodem/cdmamodem.c
 create mode 100644 drivers/cdmamodem/cdmamodem.h

diff --git a/Makefile.am b/Makefile.am
index 40ff52d..861237c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -242,6 +242,12 @@ conf_DATA += plugins/phonesim.conf
 endif
 endif
 
+if CDMA_ATMODEM
+builtin_modules += cdma_atmodem
+builtin_sources += drivers/cdmamodem/cdmamodem.h \
+   drivers/cdmamodem/cdmamodem.c
+endif
+
 builtin_modules += g1
 builtin_sources += plugins/g1.c
 
diff --git a/configure.ac b/configure.ac
index 5c18f68..9cc0689 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,6 +160,11 @@ AC_ARG_ENABLE(atmodem, AC_HELP_STRING([--disable-atmodem],
[enable_atmodem=${enableval}])
 AM_CONDITIONAL(ATMODEM, test ${enable_atmodem} != no)
 
+AC_ARG_ENABLE(cdmaatmodem, AC_HELP_STRING([--disable-cdmamodem],
+   [disable CDMA AT modem support]),
+   [enable_cdma_atmodem=${enableval}])
+AM_CONDITIONAL(CDMA_ATMODEM, test ${enable_cdma_atmodem} != no)
+
 AC_ARG_ENABLE(phonesim, AC_HELP_STRING([--disable-phonesim],
[disable Phone simulator support]),
[enable_phonesim=${enableval}])
diff --git a/drivers/cdmamodem/cdmamodem.c b/drivers/cdmamodem/cdmamodem.c
new file mode 100644
index 000..25bd0f3
--- /dev/null
+++ b/drivers/cdmamodem/cdmamodem.c
@@ -0,0 +1,45 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2010 Nokia 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 cdmamodem.h
+
+static int cdma_atmodem_init(void)
+{
+   return 0;
+}
+
+static void cdma_atmodem_exit(void)
+{
+}
+
+OFONO_PLUGIN_DEFINE(cdma_atmodem, CDMA AT modem driver, VERSION,
+   OFONO_PLUGIN_PRIORITY_DEFAULT, cdma_atmodem_init, cdma_atmodem_exit)
diff --git a/drivers/cdmamodem/cdmamodem.h b/drivers/cdmamodem/cdmamodem.h
new file mode 100644
index 000..114d1fd
--- /dev/null
+++ b/drivers/cdmamodem/cdmamodem.h
@@ -0,0 +1,22 @@
+/*
+ *
+ *  oFono - Open Source Telephony
+ *
+ *  Copyright (C) 2010 Nokia 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
-- 
1.7.0.4

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


[PATCH v3, Part1, 5/5] test: Add CDMA MO Call Support

2010-12-20 Thread Dara Spieker-Doyle
---
 Makefile.am   |5 -
 test/cdma-dial-number |   24 
 test/cdma-hangup  |   20 
 test/cdma-list-call   |   30 ++
 4 files changed, 78 insertions(+), 1 deletions(-)
 create mode 100755 test/cdma-dial-number
 create mode 100755 test/cdma-hangup
 create mode 100755 test/cdma-list-call

diff --git a/Makefile.am b/Makefile.am
index 50e893f..32ded3d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -431,7 +431,10 @@ test_scripts = test/backtrace \
test/test-push-notification \
test/test-smart-messaging \
test/send-vcard \
-   test/set-tty
+   test/set-tty \
+   test/cdma-list-call \
+   test/cdma-dial-number \
+   test/cdma-hangup
 
 if TEST
 testdir = $(pkglibdir)/test
diff --git a/test/cdma-dial-number b/test/cdma-dial-number
new file mode 100755
index 000..948d32d
--- /dev/null
+++ b/test/cdma-dial-number
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+   'org.ofono.Manager')
+
+if len(sys.argv)  2:
+   path = sys.argv[1]
+   number = sys.argv[2]
+else:
+   modems = manager.GetModems()
+   path, properties = modems[0]
+   number = sys.argv[1]
+
+print Using modem %s % path
+
+manager = dbus.Interface(bus.get_object('org.ofono', path),
+   
'org.ofono.cdma.VoiceCallManager')
+
+manager.Dial(number)
\ No newline at end of file
diff --git a/test/cdma-hangup b/test/cdma-hangup
new file mode 100755
index 000..f8e631e
--- /dev/null
+++ b/test/cdma-hangup
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+   'org.ofono.Manager')
+
+if len(sys.argv)  2:
+   path = sys.argv[1]
+else:
+   modems = manager.GetModems()
+   path, properties = modems[0]
+
+manager = dbus.Interface(bus.get_object('org.ofono', path),
+   
'org.ofono.cdma.VoiceCallManager')
+
+manager.Hangup()
diff --git a/test/cdma-list-call b/test/cdma-list-call
new file mode 100755
index 000..9f9fdbc
--- /dev/null
+++ b/test/cdma-list-call
@@ -0,0 +1,30 @@
+#!/usr/bin/python
+
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+   'org.ofono.Manager')
+
+modems = manager.GetModems()
+
+for path, properties in modems:
+   print [ %s ] % (path)
+
+   if org.ofono.cdma.VoiceCallManager not in properties[Interfaces]:
+   continue
+
+   mgr = dbus.Interface(bus.get_object('org.ofono', path),
+   'org.ofono.cdma.VoiceCallManager')
+
+   properties = mgr.GetProperties()
+
+   for key in properties.keys():
+   if key in [Interfaces, Features]:
+   val = 
+   for i in properties[key]:
+   val += i +  
+   else:
+   val = str(properties[key])
+   print %s = %s % (key, val)
\ No newline at end of file
-- 
1.7.0.4

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


Failed to create CAIF socket for AT

2010-12-20 Thread krishna k

Hello Sjur,

Thanks for your reply.

I am trying to understand CAIF protocol implementation in OFono.  I am getting 
Failed to create CAIF socket for AT when i am trying to enable my modem.

I appended below rule to 97-ofono-rules in /etc/udev.

ATTRS{idVendor}==major-number, ATTRS{idProduct}==minor-number, 
ENV{OFONO_DRIVER}=ste

After appending the above line in rules file, my modem insertion and removal is 
getting recognized by oFono core daemon and displaying debug statements like 
below..

plugins/udev.c:remove_modem() xx.

When i list my modem information with list-modem script. I got output as 
below..

[ /ste0 ]
Interfaces =
Powered = 0
Features =
Online = 0

If i am connecting nokia Phone in PC Suite mode it is working fine. I am 
getting below information if i list nokia phone info using list-modem script

[ /isigen1 ]
Features = sim 
Powered = 1
Interfaces = org.ofono.Phonebook org.ofono.SimManager 
org.ofono.VoiceCallManager 
Online = 0
Model = Nokia E71
Manufacturer = Nokia
Serial = 
Revision = xxx
09-02-10
RM-346
(c) Nokia
[ org.ofono.Phonebook ]
[ org.ofono.SimManager ]
FixedDialing = 0
SubscriberNumbers = 
BarredDialing = 0
CardIdentifier = 123456566
LockedPins = 
PinRequired = none
SubscriberIdentity = 123445566
Present = 1
[ org.ofono.VoiceCallManager ]
EmergencyNumbers = 119 118 999 110 08 000 911 112 


I found add_isi() (every modem vendor have their own in udev.c) function is 
getting get invoked, when i am dealing with nokia phone (PC Suite Mode). Is it 
necessary to have add_ste() function to work with CAIF protocol.

Please suggest.

Please suggest me how to start open contribution for oFono Testing.

Thank You.

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


Re: [PATCH 0/4 v2] Network Time plugin

2010-12-20 Thread Antti Paila
Hi,

Could someone review this patch. It has been waiting for review a while
now. Thanks.

-Antti  

On Fri, 2010-12-10 at 09:53 +0200, Antti Paila wrote:
 This series of patches introduces the network time part of the NITZ feature 
  as outlined in 3GPP spec 22.042. The Network Time plugin has two DBUS 
  interfaces for client applications: notification signal and polling method 
  call. The time information consists of three dictionary entries: 1) time and 
  date in seconds from epoch (renormalized to time indicatation arrival time);
  2) daylight saving time; 3) timezone.
  
  include/dbus.h |1 +
  plugins/nettime.c | 285 +
  Makefile.am |   10 --
  test/get-nettime |   25 +
  test/test-nettime |   46 ++
  doc/network-time-api.txt |   31 +++


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


Re: [PATCH 3/4] doc: detail PinRetries property

2010-12-20 Thread Sankar
Hi Lucas,

On Tue, Dec 21, 2010 at 3:26 AM, Lucas De Marchi 
lucas.demar...@profusion.mobi wrote:

 ---
  doc/sim-api.txt |   10 ++
  1 files changed, 10 insertions(+), 0 deletions(-)

 diff --git a/doc/sim-api.txt b/doc/sim-api.txt
 index d4d2b1b..c7d1faa 100644
 --- a/doc/sim-api.txt
 +++ b/doc/sim-api.txt
 @@ -145,3 +145,13 @@ Properties boolean Present [readonly]

If BDN is enabled, oFono halts the SIM
 initialization
procedure and only emergency calls are allowed.
 +
 +   byte PinRetries [readonly]
 +
 +   Contains the retry counter for the current required
 +   pin. This counter is tipically decremented whenever
 a
 +   call to EnterPin() fails.
 +
 +   E.g.: if PinRequired is equal puk, this property
 +   contains the number of times EnterPin can be called
 +   with a wrong puk.

Does this property also mention how many retries are possible when the user
enters a wrong PUK for unblocking the sim pin.

Thanks,
Sankar.

 --
 1.7.3.4

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

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