[PATCHv2] network: query signal strength

2010-12-17 Thread Marit Henriksen
From: Marit Henriksen marit.henrik...@stericsson.com

Signal strength is set to -1 whenever registration status changes
and differs from registered or roaming. When registration status
changes again to registered or roaming, the signal strength needs to
be updated, added query towards driver to get it.
---
 src/network.c |   28 
 1 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/src/network.c b/src/network.c
index d203bee..50539a2 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1296,6 +1296,19 @@ emit:
notify_status_watches(netreg);
 }
 
+static void signal_strength_callback(const struct ofono_error *error,
+   int strength, void *data)
+{
+   struct ofono_netreg *netreg = data;
+
+   if (error-type != OFONO_ERROR_TYPE_NO_ERROR) {
+   DBG(Error during signal strength query);
+   return;
+   }
+
+   ofono_netreg_strength_notify(netreg, strength);
+}
+
 void ofono_netreg_status_notify(struct ofono_netreg *netreg, int status,
int lac, int ci, int tech)
 {
@@ -1319,6 +1332,9 @@ void ofono_netreg_status_notify(struct ofono_netreg 
*netreg, int status,
if (netreg-driver-current_operator)
netreg-driver-current_operator(netreg,
current_operator_callback, netreg);
+   if (netreg-driver-strength)
+   netreg-driver-strength(netreg,
+   signal_strength_callback, netreg);
} else {
struct ofono_error error;
 
@@ -1345,18 +1361,6 @@ void ofono_netreg_time_notify(struct ofono_netreg 
*netreg,
__ofono_nettime_info_received(modem, info);
 }
 
-static void signal_strength_callback(const struct ofono_error *error,
-   int strength, void *data)
-{
-   struct ofono_netreg *netreg = data;
-
-   if (error-type != OFONO_ERROR_TYPE_NO_ERROR) {
-   DBG(Error during signal strength query);
-   return;
-   }
-
-   ofono_netreg_strength_notify(netreg, strength);
-}
 
 static void init_registration_status(const struct ofono_error *error,
int status, int lac, int ci, int tech,
-- 
1.7.1

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


[RFC PATCH] TODO: add owner to 'Network updating the emergency number' task

2010-12-17 Thread Petteri Tikander
---
 TODO |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/TODO b/TODO
index a3f7379..21fc723 100644
--- a/TODO
+++ b/TODO
@@ -410,6 +410,7 @@ Emergency Calls

   Priority: High
   Complexity: C2
+  Owner: Petteri Tikander petteri.tikan...@ixonos.com

 - Extend the voicecall interface with a property indicating whether this call
   is an emergency call (essentially the CLI matches one of the numbers on the
--
1.7.0.4

-- See us at Mobile World Congress, 14-17 February 2011, in Barcelona, Spain. 
Visit the Ixonos booth Hall 1, # 1E19.

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


Re: [PATCH] smsutil: do not hardcode TP-ValidityPeriod

2010-12-17 Thread Pekka Pessi
Hi Denis,

2010/12/17 Denis Kenzior denk...@gmail.com:
 Can I get a bit more of an explanation from you as to why the 'absent'
 validity period is better than hardcoding this to 24 hours?

If there is an explicit validity period, it overrides the default
validity period set by operator. I'd rather let operator-set default
validity period.

-- 
Pekka.Pessi mail at nokia.com
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH] smsutil: do not hardcode TP-ValidityPeriod

2010-12-17 Thread Denis Kenzior
Hi Pekka,

On 12/17/2010 07:29 AM, Pekka Pessi wrote:
 Hi Denis,
 
 2010/12/17 Denis Kenzior denk...@gmail.com:
 Can I get a bit more of an explanation from you as to why the 'absent'
 validity period is better than hardcoding this to 24 hours?
 
 If there is an explicit validity period, it overrides the default
 validity period set by operator. I'd rather let operator-set default
 validity period.
 

Sounds good.  Can you resend this patch with the description stating the
above?

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


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

2010-12-17 Thread Denis Kenzior
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?

Regards,
-Denis
___
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-17 Thread Denis Kenzior
Hi Marit,

On 12/16/2010 07:56 AM, Marit Henriksen wrote:
 From: Marit Henriksen marit.henrik...@stericsson.com
 
 In *ECAV, the number will not be included if caller id is hidden.
 Set it to an empty string in that case.
 ---
  drivers/stemodem/voicecall.c |   10 +++---
  1 files changed, 7 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/stemodem/voicecall.c b/drivers/stemodem/voicecall.c
 index b9d91d2..d900666 100644
 --- a/drivers/stemodem/voicecall.c
 +++ b/drivers/stemodem/voicecall.c
 @@ -442,10 +442,14 @@ static void ecav_notify(GAtResult *result, gpointer 
 user_data)
   if (status == CALL_STATUS_DIALING ||
   status == CALL_STATUS_WAITING ||
   status == CALL_STATUS_INCOMING) {
 + /*
 + * If caller uses hidden id, the number and
 + * number type might not be present. Don't
 + * look for type if number is not present.
 + */
   if (!g_at_result_iter_next_string(iter, num))
 - return;
 -
 - if (!g_at_result_iter_next_number(iter, num_type))
 + num = ;
 + else if (!g_at_result_iter_next_number(iter, num_type))
   return;

One small nitpick, but you're not initializing num_type if the number is
missing.  While this probably works out, I'd rather be a bit more
pedantic inside the driver.  Can you initialize it to unknown number
type (I think 128 is preferred by 27.007) in this case?

   }
  

I also notice that you're not ever able to report the clip_validity == 1
case (e.g. number withheld).  Since oFono does make a distinction
between the various clip_validity types, it would be nice if there was a
way around this limitation.

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


oFono release plan?

2010-12-17 Thread Sjur BRENDELAND
Hi Denis and Marcel.

Do you have a release plan defined for oFono? 
When will you release oFono 1.0?

Thanks,

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


Re: [PATCH] use ofono_error instead of DBG for errors

2010-12-17 Thread Denis Kenzior
Hi Gustavo,

On 12/16/2010 12:04 PM, Gustavo F. Padovan wrote:
 ---
  src/call-barring.c|6 +++---
  src/call-forwarding.c |8 
  src/call-meter.c  |6 +++---
  src/call-settings.c   |   14 +++---
  src/cbs.c |2 +-
  src/ctm.c |4 ++--
  src/gprs.c|6 +++---
  src/network.c |8 
  src/radio-settings.c  |   12 ++--
  src/sms.c |4 ++--
  src/ussd.c|2 +-
  src/voicecall.c   |6 +++---
  12 files changed, 39 insertions(+), 39 deletions(-)
 

Actually some of these should be DBG and not ofono_error.  In many of
these cases the input depends on the user (e.g. having the right
password, etc) so reporting an error is the wrong thing to do.  In other
cases the error depends on the network state, etc.

 diff --git a/src/call-barring.c b/src/call-barring.c
 index bb15530..95f489e 100644
 --- a/src/call-barring.c
 +++ b/src/call-barring.c
 @@ -327,7 +327,7 @@ static void cb_ss_set_lock_callback(const struct 
 ofono_error *error,
   struct ofono_call_barring *cb = data;
  
   if (error-type != OFONO_ERROR_TYPE_NO_ERROR) {
 - DBG(Enabling/disabling Call Barring via SS failed);
 + ofono_error(Enabling/disabling Call Barring via SS failed);
   __ofono_dbus_pending_reply(cb-pending,
   __ofono_error_failed(cb-pending));
   return;

For instance, this one requires PIN2

 @@ -733,7 +733,7 @@ static void set_lock_callback(const struct ofono_error 
 *error, void *data)
   struct ofono_call_barring *cb = data;
  
   if (error-type != OFONO_ERROR_TYPE_NO_ERROR) {
 - DBG(Enabling/disabling a lock failed);
 + ofono_error(Enabling/disabling a lock failed);
   __ofono_dbus_pending_reply(cb-pending,
   __ofono_error_failed(cb-pending));
   return;

Same as above

 @@ -883,7 +883,7 @@ static void disable_all_callback(const struct ofono_error 
 *error, void *data)
   struct ofono_call_barring *cb = data;
  
   if (error-type != OFONO_ERROR_TYPE_NO_ERROR) {
 - DBG(Disabling all barring failed);
 + ofono_error(Disabling all barring failed);
   __ofono_dbus_pending_reply(cb-pending,
   __ofono_error_failed(cb-pending));

And here

   return;
 diff --git a/src/call-forwarding.c b/src/call-forwarding.c
 index bb8aa37..9a2fd85 100644
 --- a/src/call-forwarding.c
 +++ b/src/call-forwarding.c
 @@ -549,7 +549,7 @@ static void set_property_callback(const struct 
 ofono_error *error, void *data)
   struct ofono_call_forwarding *cf = data;
  
   if (error-type != OFONO_ERROR_TYPE_NO_ERROR) {
 - DBG(Error occurred during set/erasure);
 + ofono_error(Error occurred during set/erasure);
   __ofono_dbus_pending_reply(cf-pending,
   __ofono_error_failed(cf-pending));
   return;
 @@ -674,7 +674,7 @@ static void disable_conditional_callback(const struct 
 ofono_error *error,
   struct ofono_call_forwarding *cf = data;
  
   if (error-type != OFONO_ERROR_TYPE_NO_ERROR) {
 - DBG(Error occurred during conditional erasure);
 + ofono_error(Error occurred during conditional erasure);
  
   __ofono_dbus_pending_reply(cf-pending,
   __ofono_error_failed(cf-pending));
 @@ -692,7 +692,7 @@ static void disable_all_callback(const struct ofono_error 
 *error, void *data)
   struct ofono_call_forwarding *cf = data;
  
   if (error-type != OFONO_ERROR_TYPE_NO_ERROR) {
 - DBG(Error occurred during erasure of all);
 + ofono_error(Error occurred during erasure of all);
  
   __ofono_dbus_pending_reply(cf-pending,
   __ofono_error_failed(cf-pending));
 @@ -877,7 +877,7 @@ static void cf_ss_control_callback(const struct 
 ofono_error *error, void *data)
   struct ofono_call_forwarding *cf = data;
  
   if (error-type != OFONO_ERROR_TYPE_NO_ERROR) {
 - DBG(Error occurred during cf ss control set/erasure);
 + ofono_error(Error occurred during cf ss control set/erasure);
  
   __ofono_dbus_pending_reply(cf-pending,
   __ofono_error_failed(cf-pending));

These depend on the network state and can fail...

 diff --git a/src/call-meter.c b/src/call-meter.c
 index ac3ae6b..8a45d15 100644
 --- a/src/call-meter.c
 +++ b/src/call-meter.c
 @@ -336,7 +336,7 @@ static void set_acm_max_callback(const struct ofono_error 
 *error, void *data)
   struct ofono_call_meter *cm = data;
  
   if (error-type != OFONO_ERROR_TYPE_NO_ERROR) {
 - DBG(Setting acm_max failed);
 + ofono_error(Setting acm_max failed);
   

Re: TODO: Network updating the emergency number list

2010-12-17 Thread Denis Kenzior
Hi Petteri,

On 12/17/2010 03:10 AM, Tikander Petteri wrote:
 Hi,
 
 I have investigated a little bit dynamic updating of emergency numbers
 by network. So I suggest, I'll register new notification-handler for
 '+CEN'-report in voicecall-driver. And naturally give those new
 emergency-numbers for voicecall-atom to be analyzed.
 
 First version of network-ECC handling will enable +CEN-reporting
 statically in driver-probing. Then it listens '+CEN'-reports and after
 receiving new numbers compares those numbers with already stored numbers
 (SIM/default ECC's) and sends property-changed signal for same old good
 EmergencyNumbers-property, if new emergency numbers have been received
 from the network.
 

Sounds good to me.

 According to TS.27007 network emergency numbers are not necessarily
 received from the same operator as currently registered, so this should
 probably also be considered in the future.
 

Can you do me a favor and investigate what oFono's behavior should be if
we receive emergency numbers that are not relevant to the currently
registered PLMN?  We should also update the task description with the above.

 My test-modem doesn't actually support '+CEN'-reports, but I can update
 a little bit Phonesim for simulating of testing the unsolicited network
 emergency-numbers.

Sounds good.

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


Re: [RFC PATCH] TODO: add owner to 'Network updating the emergency number' task

2010-12-17 Thread Denis Kenzior
Hi Petteri,

On 12/17/2010 03:56 AM, Petteri Tikander wrote:
 ---
  TODO |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
 

Patch has been applied.  Thanks for taking up this task.

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


[PATCH] Mark CNAP task as done

2010-12-17 Thread Gustavo F. Padovan
---
 TODO |6 --
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/TODO b/TODO
index a3f7379..4c3506e 100644
--- a/TODO
+++ b/TODO
@@ -246,12 +246,6 @@ Supplementary Services
   Priority: Low
   Complexity: C8
 
-- Calling Name Presentation (CNAP) support
-
-  Priority: Low
-  Complexity: C2
-  Owner: Gustavo F Padovan pado...@profusion.mobi
-
 - User to User Signaling (UUS) support
 
   Priority: Low
-- 
1.7.3.2

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


RE: TODO: Network updating the emergency number list

2010-12-17 Thread Bastian, Waldo
 Hi,
 
 I have investigated a little bit dynamic updating of emergency numbers
 by network. So I suggest, I'll register new notification-handler for
 '+CEN'-report in voicecall-driver. And naturally give those new
 emergency-numbers for voicecall-atom to be analyzed.

The modem will typically already analyze the new emergency-numbers, filter out 
the ones that are not applicable and merge the numbers from the various sources 
in the right priority. Some modems are able to communicate the resulting 
effective list of emergency-numbers, in which case the voicecall-atom should 
just use the list of emergency numbers reported by the modem without doing any 
additional merging/analyzing.

This also eliminates room for error if the algorithm that the ofono voicecall 
atom uses differs for some reason from the algorithm used by the modem.

For modems that aren't able to communicate their effective list of emergency 
numbers ofono would still need to create such list by itself as it does now.

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


Re: [PATCH] Mark CNAP task as done

2010-12-17 Thread Denis Kenzior
Hi Gustavo,

On 12/17/2010 10:54 AM, Gustavo F. Padovan wrote:
 ---
  TODO |6 --
  1 files changed, 0 insertions(+), 6 deletions(-)
 

Patch has been applied, thanks.

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


Re: [PATCH] voicecall: Add emergency property

2010-12-17 Thread Denis Kenzior
Hi John,

On 12/07/2010 06:20 AM, John Mathew wrote:
 ---
  doc/voicecall-api.txt |5 +
  src/voicecall.c   |   37 +
  2 files changed, 42 insertions(+), 0 deletions(-)
 

I applied this patch but broke it up into two.  One for the doc changes
and one for voicecall atom changes.

I've also updated the features document and the TODO list for you ;)

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


RE: TODO: Network updating the emergency number list

2010-12-17 Thread Rajesh.Nagaiah
Hi Denis,
 
 Hi Petteri,
 
 On 12/17/2010 03:10 AM, Tikander Petteri wrote:
  Hi,

  According to TS.27007 network emergency numbers are not necessarily 
  received from the same operator as currently registered, so this 
  should probably also be considered in the future.
  
 
 Can you do me a favor and investigate what oFono's behavior 
 should be if we receive emergency numbers that are not 
 relevant to the currently registered PLMN?  We should also 
 update the task description with the above.

The ECC list downloaded from the network are country specific ones, 
so this ECC list usually can be notified by any available network not 
necessarily by the serving network. The ECC list thats downloaded from 
the serving network has to be reset when the phone registers in another 
network with a different MCC ( not MNC ), as this ECC list is country 
specific not operator specific.

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


Re: [PATCH] test/list-modems : print Strength as an integer

2010-12-17 Thread Benoît Monin
Hi Denis,

Le vendredi 17 décembre 2010 01:56:48 Denis Kenzior, vous avez écrit :
[snip]
 Can you make sure to configure your MTA agent correctly?
 
Duh, my dog ate my patch, again.
Sorry about that, resending now.

--
Cheers,
Benoît.
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


[PATCH resend] test/list-modems : print Strength as an integer

2010-12-17 Thread Benoît Monin
org.ofono.NetworkRegistration property Strength is an integer,
so print it as such.
---
 test/list-modems |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/test/list-modems b/test/list-modems
index 557efd5..8c075ac 100755
--- a/test/list-modems
+++ b/test/list-modems
@@ -51,7 +51,8 @@ for path, properties in modems:
elif key in [MobileNetworkCodeLength,
VoicemailMessageCount,
MicrophoneVolume,
-   SpeakerVolume]:
+   SpeakerVolume,
+   Strength]:
val = int(properties[key])
elif key in [MainMenu]:
val = , .join([ text +  ( + str(int(icon)) +
-- 
1.7.1

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


Re: TODO: Network updating the emergency number list

2010-12-17 Thread Denis Kenzior
Hi Rajesh,

 Can you do me a favor and investigate what oFono's behavior 
 should be if we receive emergency numbers that are not 
 relevant to the currently registered PLMN?  We should also 
 update the task description with the above.
 
 The ECC list downloaded from the network are country specific ones, 
 so this ECC list usually can be notified by any available network not 
 necessarily by the serving network. The ECC list thats downloaded from 
 the serving network has to be reset when the phone registers in another 
 network with a different MCC ( not MNC ), as this ECC list is country 
 specific not operator specific.


Sounds reasonable.  Is this relevant only when the ME is registered with
the IMSI known or also when the SIM is not present / PIN not entered?
For these cases, what happens when we're in an area with multiple
networks with multiple MCCs.

Final question, is there a spec that describes this behavior?

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


RE: TODO: Network updating the emergency number list

2010-12-17 Thread Rajesh.Nagaiah
Hi Denis, 

 Hi Rajesh,
 
  Can you do me a favor and investigate what oFono's 
 behavior should be 
  if we receive emergency numbers that are not relevant to the 
  currently registered PLMN?  We should also update the task 
  description with the above.
  
  The ECC list downloaded from the network are country 
 specific ones, so 
  this ECC list usually can be notified by any available network not 
  necessarily by the serving network. The ECC list thats 
 downloaded from 
  the serving network has to be reset when the phone registers in 
  another network with a different MCC ( not MNC ), as this 
 ECC list is 
  country specific not operator specific.
 
 
 Sounds reasonable.  Is this relevant only when the ME is 
 registered with the IMSI known or also when the SIM is not 
 present / PIN not entered?

Only when the SIM/USIM is present.

 For these cases, what happens when we're in an area with 
 multiple networks with multiple MCCs.

Good question :)
 
 Final question, is there a spec that describes this behavior?

3GPP TS 22.101 Section 10

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


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

2010-12-17 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..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;
+
+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 */
-- 
1.7.0.4

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


[PATCH v2 0/9] Add CDMA MO Call Support

2010-12-17 Thread Dara Spieker-Doyle
Submitting new versions for review comments.

This set of patches introduces the foundation for CDMA Voicecall support in
oFono. 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 (9):
  dbus: Add CDMA Voicecall Interface
  types: Add CDMA Phone Number
  cdma-voicecall: Add CDMA MO Call Support
  cdma-voicecall: Add CDMA MO Call Support
  cdmamodem: Add CDMA MO Call Support
  cdmagen: Add CDMA MO Call Support
  ofono-rules: Add cdmagen device
  udev: Add cdmagen
  test: Add CDMA MO Call Support

 Makefile.am   |   20 ++-
 configure.ac  |5 +
 drivers/cdmamodem/cdmamodem.c |   48 +
 drivers/cdmamodem/cdmamodem.h |   25 +++
 drivers/cdmamodem/voicecall.c |  190 ++
 include/cdma-voicecall.h  |   89 
 include/dbus.h|3 +
 include/types.h   |8 +
 plugins/cdmagen.c |  274 +
 plugins/ofono.rules   |4 +
 plugins/udev.c|   21 ++
 src/cdma-voicecall.c  |  444 +
 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 +++
 18 files changed, 1252 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 plugins/cdmagen.c
 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 v2 1/9] dbus: Add CDMA Voicecall Interface

2010-12-17 Thread Dara Spieker-Doyle
---
 include/dbus.h |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/dbus.h b/include/dbus.h
index 9e29afb..c527515 100644
--- a/include/dbus.h
+++ b/include/dbus.h
@@ -55,6 +55,9 @@ extern C {
 #define OFONO_STK_INTERFACE OFONO_SERVICE .SimToolkit
 #define OFONO_SIM_APP_INTERFACE OFONO_SERVICE .SimToolkitAgent
 
+/* CDMA Interfaces */
+#define OFONO_CDMA_VOICECALL_MANAGER_INTERFACE 
org.ofono.cdma.VoiceCallManager
+
 /* Essentially a{sv} */
 #define OFONO_PROPERTIES_ARRAY_SIGNATURE DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING \
DBUS_TYPE_STRING_AS_STRING \
-- 
1.7.0.4

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


[PATCH v2 6/9] cdmagen: Add CDMA MO Call Support

2010-12-17 Thread Dara Spieker-Doyle
---
 Makefile.am   |3 +
 plugins/cdmagen.c |  274 +
 2 files changed, 277 insertions(+), 0 deletions(-)
 create mode 100644 plugins/cdmagen.c

diff --git a/Makefile.am b/Makefile.am
index 50e893f..9949bcc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -293,6 +293,9 @@ builtin_sources += plugins/ste.c
 
 builtin_modules += caif
 builtin_sources += plugins/caif.c
+
+builtin_modules += cdmagen
+builtin_sources += plugins/cdmagen.c
 endif
 
 if MAINTAINER_MODE
diff --git a/plugins/cdmagen.c b/plugins/cdmagen.c
new file mode 100644
index 000..4ec4614
--- /dev/null
+++ b/plugins/cdmagen.c
@@ -0,0 +1,274 @@
+/*
+ * This file is part of 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 stdlib.h
+#include errno.h
+#include termios.h
+#include string.h
+#include unistd.h
+#include sys/types.h
+#include sys/stat.h
+#include fcntl.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/cdma-voicecall.h
+#include drivers/atmodem/atutil.h
+
+#include common.h
+
+struct cdmagen_data {
+   GAtChat *chat;
+   ofono_bool_t online;
+   ofono_bool_t registration_status;
+};
+
+static void cdmagen_debug(const char *str, void *data)
+{
+   const char *prefix = data;
+
+   ofono_info(%s%s, prefix, str);
+}
+
+static int cdmagen_probe(struct ofono_modem *modem)
+{
+   struct cdmagen_data *data;
+
+   DBG(%p, modem);
+
+   data = g_try_new0(struct cdmagen_data, 1);
+   if (data == NULL)
+   return -ENOMEM;
+
+   ofono_modem_set_data(modem, data);
+
+   return 0;
+}
+
+static void cdmagen_remove(struct ofono_modem *modem)
+{
+   struct cdmagen_data *data = ofono_modem_get_data(modem);
+
+   DBG(%p, modem);
+
+   ofono_modem_set_data(modem, NULL);
+
+   if (data-chat)
+   g_at_chat_unref(data-chat);
+
+   g_free(data);
+}
+
+static GAtChat *create_port(const char *device)
+{
+   GAtSyntax *syntax;
+   GIOChannel *channel;
+   GAtChat *chat;
+
+   channel = g_at_tty_open(device, NULL);
+   if (channel == NULL)
+   return NULL;
+
+   syntax = g_at_syntax_new_gsmv1();
+
+   chat = g_at_chat_new(channel, syntax);
+   g_at_syntax_unref(syntax);
+   g_io_channel_unref(channel);
+
+   if (chat == NULL)
+   return NULL;
+
+   return chat;
+}
+
+static GAtChat *open_device(struct ofono_modem *modem,
+   const char *key, char *debug)
+{
+   const char *device;
+   GAtChat *chat;
+
+   device = ofono_modem_get_string(modem, key);
+   if (device == NULL)
+   return NULL;
+
+   DBG(%s %s, key, device);
+
+   chat = create_port(device);
+   if (chat == NULL)
+   return NULL;
+
+   g_at_chat_add_terminator(chat, COMMAND NOT SUPPORT, -1, FALSE);
+
+   if (getenv(OFONO_AT_DEBUG))
+   g_at_chat_set_debug(chat, cdmagen_debug, debug);
+
+   return chat;
+}
+
+static void cdmagen_disconnect(gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct cdmagen_data *data = ofono_modem_get_data(modem);
+
+   DBG(%p, modem);
+
+   g_at_chat_unref(data-chat);
+   data-chat = NULL;
+
+   data-chat = open_device(modem, Device, CDMA Device: );
+   if (data-chat == NULL)
+   return;
+
+   g_at_chat_set_disconnect_function(data-chat,
+   cdmagen_disconnect, modem);
+}
+
+/* power up hardware */
+static int cdmagen_enable(struct ofono_modem *modem)
+{
+   struct cdmagen_data *data = ofono_modem_get_data(modem);
+
+   DBG(%p, modem);
+
+   ofono_modem_set_boolean(modem, no_sim_required, TRUE);
+
+   data-chat = open_device(modem, Device, CDMA Device: );
+   if (data-chat == NULL)
+   return -EINVAL;
+
+   g_at_chat_set_disconnect_function(data-chat,
+   cdmagen_disconnect, modem);
+
+   if (getenv(OFONO_AT_DEBUG))
+   g_at_chat_set_debug(data-chat, cdmagen_debug,
+   

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

2010-12-17 Thread Dara Spieker-Doyle
---
 Makefile.am   |7 ++
 configure.ac  |5 +
 drivers/cdmamodem/cdmamodem.c |   48 ++
 drivers/cdmamodem/cdmamodem.h |   25 ++
 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

diff --git a/Makefile.am b/Makefile.am
index 40ff52d..50e893f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -242,6 +242,13 @@ conf_DATA += plugins/phonesim.conf
 endif
 endif
 
+if CDMA_ATMODEM
+builtin_modules += cdma_atmodem
+builtin_sources += drivers/cdmamodem/cdmamodem.h \
+   drivers/cdmamodem/cdmamodem.c \
+   drivers/cdmamodem/voicecall.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..20e6d96
--- /dev/null
+++ b/drivers/cdmamodem/cdmamodem.c
@@ -0,0 +1,48 @@
+/*
+ *
+ *  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)
+{
+   cdma_at_voicecall_init();
+
+   return 0;
+}
+
+static void cdma_atmodem_exit(void)
+{
+   cdma_at_voicecall_exit();
+}
+
+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..a5991cf
--- /dev/null
+++ b/drivers/cdmamodem/cdmamodem.h
@@ -0,0 +1,25 @@
+/*
+ *
+ *  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
+
+extern void cdma_at_voicecall_init();
+extern void cdma_at_voicecall_exit();
diff --git a/drivers/cdmamodem/voicecall.c b/drivers/cdmamodem/voicecall.c
new file mode 100644
index 000..f9955d6
--- /dev/null
+++ b/drivers/cdmamodem/voicecall.c
@@ -0,0 +1,190 @@
+/*
+ *
+ *  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 

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

2010-12-17 Thread Dara Spieker-Doyle
---
 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);
+
+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:
+   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 ofono_cdma_voicecall_manager *v = data;
+   DBusMessage *reply;
+   DBusMessageIter iter;
+   DBusMessageIter dict;
+
+   reply = dbus_message_new_method_return(msg);
+
+   if (reply == NULL)
+   return NULL;
+
+   dbus_message_iter_init_append(reply, iter);
+
+   dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
+   

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

2010-12-17 Thread Dara Spieker-Doyle
---
 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
+
 # Nokia Internet Stick CS-17
 ATTRS{idVendor}==0421, ATTRS{idProduct}==0623, ENV{OFONO_DRIVER}=nokia
 
-- 
1.7.0.4

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


[PATCH v2 8/9] udev: Add cdmagen

2010-12-17 Thread Dara Spieker-Doyle
---
 plugins/udev.c |   21 +
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/plugins/udev.c b/plugins/udev.c
index 255755e..e9541ac 100644
--- a/plugins/udev.c
+++ b/plugins/udev.c
@@ -449,6 +449,25 @@ static void add_isi(struct ofono_modem *modem,
ofono_modem_register(modem);
 }
 
+static void add_cdmagen(struct ofono_modem *modem,
+   struct udev_device *udev_device)
+{
+   const char *devnode;
+   int registered;
+
+   DBG(modem %p, modem);
+
+   devnode = udev_device_get_devnode(udev_device);
+
+   registered = ofono_modem_get_integer(modem, Registered);
+   if (registered != 0)
+   return;
+
+   ofono_modem_set_string(modem, Device, devnode);
+   ofono_modem_set_integer(modem, Registered, 1);
+   ofono_modem_register(modem);
+}
+
 static void add_modem(struct udev_device *udev_device)
 {
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);
 }
 
 static gboolean devpath_remove(gpointer key, gpointer value, gpointer 
user_data)
-- 
1.7.0.4

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


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

2010-12-17 Thread Dara Spieker-Doyle
---
 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;
 };
 
+/* Length of NUM_FIELDS in 3GPP2 C.S0005-E v2.0*/
+#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*/
+   char number[OFONO_CDMA_MAX_PHONE_NUMBER_LENGTH];
+};
+
 struct ofono_call {
unsigned int id;
int type;
-- 
1.7.0.4

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


[PATCH v2 9/9] test: Add CDMA MO Call Support

2010-12-17 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 9949bcc..d0d269a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -434,7 +434,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..e62018f
--- /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


Re: [PATCH resend] test/list-modems : print Strength as an integer

2010-12-17 Thread Denis Kenzior
Hi Benoît,

On 12/17/2010 02:33 PM, Benoît Monin wrote:
 org.ofono.NetworkRegistration property Strength is an integer,
 so print it as such.
 ---
  test/list-modems |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
 

Patch has been applied, thanks.

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


Re: [PATCH 1/7] call-forwarding: Read/Write cfis/cphs-cff

2010-12-17 Thread Denis Kenzior
Hi Jeevaka,

On 12/17/2010 01:04 AM, Jeevaka Badrappan wrote:
 ---
  src/call-forwarding.c |  243 
 -
  1 files changed, 241 insertions(+), 2 deletions(-)
 

So I applied this patch but refactored it very heavily afterward.  Can
you do review the changes and make sure you're OK with them?  Can you
also submit the needed records for phonesim, so we can get those tested
as well?

I still have one concern with cfis_record_id selection logic.  There are
a couple of possibilities we might not be handling correctly:

- if no EFcfis records contain proper MSP ids
- if EFcfis record has a valid MSP id, but is relevant to teleservices
besides voice.  We still potentially select this record, even though a
voice specific record might or might not exist.

Overall I think we need to test this feature quite a bit more...

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


Re: [PATCH v2] TODO: Add CDMA Voicecall Support Tasks

2010-12-17 Thread Denis Kenzior
Hi Dara,

On 12/10/2010 05:42 PM, Dara Spieker-Doyle wrote:
 ---
  TODO |   58 ++
  1 files changed, 58 insertions(+), 0 deletions(-)
 

Patch has been applied, thanks.

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


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

2010-12-17 Thread Denis Kenzior
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

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.

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


Re: [PATCH 1/2] modem: add Lockdown property to Modem interface

2010-12-17 Thread Denis Kenzior
Hi Gustavo,

On 12/03/2010 03:59 PM, Gustavo F. Padovan wrote:
 Setting Lockdown to TRUE means power down the modem and hold a lock that
 only permits the lock's owner power up the modem back. When released
 it restores the last state of the modem before holding the lock.
 ---
  doc/modem-api.txt |9 
  src/modem.c   |  129 
 +
  2 files changed, 138 insertions(+), 0 deletions(-)

Can you break this up into two patches, one for doc and one for src?

 
 diff --git a/doc/modem-api.txt b/doc/modem-api.txt
 index b92e53c..45043b0 100644
 --- a/doc/modem-api.txt
 +++ b/doc/modem-api.txt
 @@ -37,6 +37,15 @@ Properties boolean Powered [readwrite]
   Boolean representing the rf state of the modem.
   Online is false in flight mode.
  
 + boolean Lockdown [readwrite]
 +
 + Boolean representing the lock state of the modem.
 + Setting it to true, makes the calling application hold
 + the modem lock and power it down. Setting to false
 + makes the it release the modem lock. Only the
 + application that holds the lock can power up the modem.
 + If the the application exits Lockdown is set to false.
 +
   boolean Emergency [readonly, optional, experimental]
  
   Boolean representing the emergency mode of the
 diff --git a/src/modem.c b/src/modem.c
 index b334b58..a9a6e87 100644
 --- a/src/modem.c
 +++ b/src/modem.c
 @@ -71,6 +71,9 @@ struct ofono_modem {
   ofono_bool_tpowered;
   ofono_bool_tpowered_pending;
   ofono_bool_tget_online;
 + ofono_bool_tlockdown;
 + char*lock_owner;
 + guint   lock_watch;
   guint   timeout;
   ofono_bool_tonline;
   struct ofono_watchlist  *online_watches;
 @@ -583,6 +586,9 @@ void __ofono_modem_append_properties(struct ofono_modem 
 *modem,
   ofono_dbus_dict_append(dict, Powered, DBUS_TYPE_BOOLEAN,
   modem-powered);
  
 + ofono_dbus_dict_append(dict, Lockdown, DBUS_TYPE_BOOLEAN,
 + modem-lockdown);
 +
   devinfo_atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_DEVINFO);
  
   /* We cheat a little here and don't check the registered status */
 @@ -686,6 +692,16 @@ static int set_powered(struct ofono_modem *modem, 
 ofono_bool_t powered)
   return err;
  }
  
 +static void lockdown_remove(struct ofono_modem *modem)
 +{
 + DBusConnection *conn =ofono_dbus_get_connection();
 +
 + g_free(modem-lock_owner);
 + g_dbus_remove_watch(conn, modem-lock_watch);
 + modem-lock_watch = 0;
 + modem-lockdown = FALSE;
 +}
 +
  static gboolean set_powered_timeout(gpointer user)
  {
   struct ofono_modem *modem = user;
 @@ -712,11 +728,107 @@ static gboolean set_powered_timeout(gpointer user)
  
   reply = __ofono_error_timed_out(modem-pending);
   __ofono_dbus_pending_reply(modem-pending, reply);
 +
 + if (modem-lockdown)
 + lockdown_remove(modem);
   }
  
   return FALSE;
  }
  
 +static void lockdown_disconnect(DBusConnection *conn, void *user_data)
 +{
 + struct ofono_modem *modem = user_data;
 +
 + DBG();
 +
 + g_free(modem-lock_owner);
 +
 + modem-lockdown = FALSE;
 +
 + ofono_dbus_signal_property_changed(conn, modem-path,
 + OFONO_MODEM_INTERFACE,
 + Lockdown, DBUS_TYPE_BOOLEAN,
 + modem-lockdown);

Should you also be removing the lock_watch here?  Since the lock_watch
is no longer relevant and you'll be leaking it otherwise.

 +}
 +
 +static DBusMessage *set_property_lockdown(struct ofono_modem *modem,
 + DBusMessage *msg,
 + DBusMessageIter *var)
 +{
 + DBusConnection *conn = ofono_dbus_get_connection();
 + ofono_bool_t lockdown;
 + const char *caller;
 + int err;
 +
 + if (dbus_message_iter_get_arg_type(var) != DBUS_TYPE_BOOLEAN)
 + return __ofono_error_invalid_args(msg);
 +
 + dbus_message_iter_get_basic(var, lockdown);
 +
 + if (modem-pending != NULL)
 + return __ofono_error_busy(msg);
 +
 + if (modem-lockdown == lockdown)
 + return dbus_message_new_method_return(msg);
 +
 + caller = dbus_message_get_sender(msg);
 +
 + if (lockdown) {
 + dbus_bool_t powered;
 +
 + modem-lock_owner = g_strdup(caller);
 +
 + modem-lock_watch = g_dbus_add_service_watch(conn,
 + modem-lock_owner, NULL,
 + lockdown_disconnect, modem, NULL);
 +
 + if (modem-lock_watch 

Re: [PATCH] modem: add support to restore state when resetting the modem

2010-12-17 Thread Denis Kenzior
Hi Gustavo,

On 12/07/2010 12:31 PM, Gustavo F. Padovan wrote:
 ---
  src/modem.c |   60 +++---
  1 files changed, 36 insertions(+), 24 deletions(-)
 

Patch has been applied, thanks.

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


[PATCH v2] ifx: Adding modem selftest to Infineon modem

2010-12-17 Thread Robertino Benis
Hi all,

This is a second attempt to submit a patch that triggers Infineon
modem selftest during ofono boot. Patch addresses issues raised
by Marcel from the previous submission.

Thank you,
-- r.


---
 plugins/ifx.c |   87 +
 1 files changed, 81 insertions(+), 6 deletions(-)

diff --git a/plugins/ifx.c b/plugins/ifx.c
index 2f4c65b..3647dbc 100644
--- a/plugins/ifx.c
+++ b/plugins/ifx.c
@@ -71,6 +71,8 @@
 #define GPRS3_DLC   4
 #define AUX_DLC 5
 
+#define IFX_SELF_TESTS_TIMEOUT 5
+
 static char *dlc_prefixes[NUM_DLC] = { Voice: , Net: , GPRS1: ,
GPRS2: , GPRS3: , Aux:  };
 
@@ -80,6 +82,18 @@ static const char *dlc_nodes[NUM_DLC] = { /dev/ttyGSM1, 
/dev/ttyGSM2,
 
 static const char *none_prefix[] = { NULL };
 static const char *xdrv_prefix[] = { +XDRV:, NULL };
+static const char *empty_prefix[] = { , NULL };
+
+struct ifx_self_tests {
+   char *test_desc;
+   char *at_cmd;
+};
+
+static const struct ifx_self_tests mst[] = {
+   { RTC GTI Test, a...@rtc:rtc_gti_test_verify_32khz() },
+   { Device Version Test, a...@vers:device_version_id() },
+   { NULL, NULL }
+};
 
 struct ifx_data {
GIOChannel *device;
@@ -99,6 +113,8 @@ struct ifx_data {
int audio_loopback;
struct ofono_sim *sim;
gboolean have_sim;
+   guint self_test_timeout;
+   int self_test_idx;
 };
 
 static void ifx_debug(const char *str, void *user_data)
@@ -545,6 +561,64 @@ static gboolean mux_timeout_cb(gpointer user_data)
return FALSE;
 }
 
+static gboolean self_test_timeout_cb(gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct ifx_data *data = ofono_modem_get_data(modem);
+
+   ofono_error(Modem %s: TIMED OUT,
+   mst[data-self_test_idx].test_desc);
+
+   g_source_remove(data-self_test_timeout);
+   data-self_test_timeout = 0;
+
+   shutdown_device(data);
+   ofono_modem_set_powered(modem, FALSE);
+
+   return FALSE;
+}
+
+static void ifx_self_test_cb(gboolean ok, GAtResult *result,
+   gpointer user_data)
+{
+   struct ofono_modem *modem = user_data;
+   struct ifx_data *data = ofono_modem_get_data(modem);
+
+   if (data-self_test_timeout  0) {
+   g_source_remove(data-self_test_timeout);
+   data-self_test_timeout = 0;
+   }
+
+   if (!ok) {
+   ofono_error(Modem %s: FAIL,
+   mst[data-self_test_idx].test_desc);
+   shutdown_device(data);
+   ofono_modem_set_powered(modem, FALSE);
+
+   return;
+   }
+
+   data-self_test_idx++;
+
+   if (mst[data-self_test_idx].at_cmd != NULL) {
+   g_at_chat_send(data-dlcs[AUX_DLC],
+   mst[data-self_test_idx].at_cmd,
+   empty_prefix, ifx_self_test_cb, modem, NULL);
+
+   data-self_test_timeout = g_timeout_add_seconds(
+   IFX_SELF_TESTS_TIMEOUT, self_test_timeout_cb, modem);
+
+   } else {/* Enable  MUX Channels */
+   data-frame_size = 1509;
+   g_at_chat_send(data-dlcs[AUX_DLC],
+   AT+CMUX=0,0,,1509,10,3,30,,, NULL,
+   mux_setup_cb, modem, NULL);
+
+   data-mux_init_timeout = g_timeout_add_seconds(5,
+   mux_timeout_cb, modem);
+   }
+}
+
 static int ifx_enable(struct ofono_modem *modem)
 {
struct ifx_data *data = ofono_modem_get_data(modem);
@@ -598,15 +672,16 @@ static int ifx_enable(struct ofono_modem *modem)
g_at_chat_send(chat, ATE0 +CMEE=1, NULL,
NULL, NULL, NULL);
 
-   data-frame_size = 1509;
+   /* Execute Modem Self tests */
 
-   g_at_chat_send(chat, AT+CMUX=0,0,,1509,10,3,30,,, NULL,
-   mux_setup_cb, modem, NULL);
+   data-dlcs[AUX_DLC] = chat;
+   data-self_test_idx = 0;
 
-   data-mux_init_timeout = g_timeout_add_seconds(5, mux_timeout_cb,
-   modem);
+   g_at_chat_send(data-dlcs[AUX_DLC], mst[data-self_test_idx].at_cmd,
+   empty_prefix, ifx_self_test_cb, modem, NULL);
 
-   data-dlcs[AUX_DLC] = chat;
+   data-self_test_timeout = g_timeout_add_seconds(IFX_SELF_TESTS_TIMEOUT,
+   self_test_timeout_cb,   modem);
 
return -EINPROGRESS;
 }
-- 
1.7.0.4

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