Re: [PATCH] HACKING: Add ofono.conf file copy command required

2010-12-01 Thread Daniel Wagner
> +  Copy configuration file which specifies the required security policies
> +# sudo cp ./src/ofono.conf /etc/dbus-1/system.d/
> +

Considered to add this too?

sudo killall -HUP dbus-daemon


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


Re: [PATCH] HACKING: Add ofono.conf file copy command required

2010-12-01 Thread Marcel Holtmann
Hi Daniel,

> > +  Copy configuration file which specifies the required security policies
> > +# sudo cp ./src/ofono.conf /etc/dbus-1/system.d/
> > +
> 
> Considered to add this too?
> 
> sudo killall -HUP dbus-daemon

that is actually a bad idea. I would not recommend it. The dbus-daemon
should be built with inotify support and if not, then reboot of the
system is a better idea.

Regards

Marcel


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


[RFC PATCH 0/3] radio-settings: add frequency band selection

2010-12-01 Thread Lucas De Marchi
This series add frequency band selection feature in radio settings. The API
separates the GSM from the UMTS bands, although this is the same "property" in
modem I know to have this feature (huawei). The idea here is to be able to set
the frequency and it will be applied by the driver only when it actually makes
sense according to the mode selected.

So, we just pass both GSM and UMTS bands to the driver that has to choose the
right time to send the commands to the modem.

According to http://en.wikipedia.org/wiki/GSM_frequency_bands and
http://en.wikipedia.org/wiki/UMTS_frequency_bands, GSM and UMTS can use 14
bands each. However, very few are actually used in today modems, so I've just
added the important ones. Once new bands are used, it'll be very easy to extend
radio-settigs to cope with them.

I plan to support frequency band selection in huawei modem, once this series
and the previous one about adding radio-settings atom to huawei are accepted.

Lucas De Marchi (3):
  radio-settings: add frequency band selection methods
  radio-settings: add frequency band selection properties
  doc: document frequency band selection

 doc/radio-settings-api.txt |   43 
 include/radio-settings.h   |   33 ++
 src/radio-settings.c   |  250 +++-
 3 files changed, 324 insertions(+), 2 deletions(-)

-- 
1.7.3.2

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


[RFC PATCH 1/3] radio-settings: add frequency band selection methods

2010-12-01 Thread Lucas De Marchi
---
 include/radio-settings.h |   33 +
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/include/radio-settings.h b/include/radio-settings.h
index 45e88e7..e839231 100644
--- a/include/radio-settings.h
+++ b/include/radio-settings.h
@@ -35,6 +35,24 @@ enum ofono_radio_access_mode {
OFONO_RADIO_ACCESS_MODE_LTE = 3,
 };
 
+enum ofono_radio_band_gsm {
+   OFONO_RADIO_BAND_GSM_ANY= 0,
+   OFONO_RADIO_BAND_GSM_850= 1,
+   OFONO_RADIO_BAND_GSM_900P   = 2,
+   OFONO_RADIO_BAND_GSM_900E   = 3,
+   OFONO_RADIO_BAND_GSM_1800   = 4,
+   OFONO_RADIO_BAND_GSM_1900   = 5,
+};
+
+enum ofono_radio_band_umts {
+   OFONO_RADIO_BAND_UMTS_ANY   = 0,
+   OFONO_RADIO_BAND_UMTS_850   = 1,
+   OFONO_RADIO_BAND_UMTS_900   = 2,
+   OFONO_RADIO_BAND_UMTS_1700AWS   = 3,
+   OFONO_RADIO_BAND_UMTS_1900  = 4,
+   OFONO_RADIO_BAND_UMTS_2100  = 5,
+};
+
 struct ofono_radio_settings;
 
 typedef void (*ofono_radio_settings_rat_mode_set_cb_t)(const struct 
ofono_error *error,
@@ -43,6 +61,13 @@ typedef void 
(*ofono_radio_settings_rat_mode_query_cb_t)(const struct ofono_erro
enum ofono_radio_access_mode 
mode,
void *data);
 
+typedef void (*ofono_radio_settings_band_set_cb_t)(const struct ofono_error 
*error,
+   void *data);
+typedef void (*ofono_radio_settings_band_query_cb_t)(const struct ofono_error 
*error,
+   enum ofono_radio_band_gsm 
band_gsm,
+   enum ofono_radio_band_umts 
band_umts,
+   void *data);
+
 typedef void (*ofono_radio_settings_fast_dormancy_set_cb_t)(const struct 
ofono_error *error,
void *data);
 typedef void (*ofono_radio_settings_fast_dormancy_query_cb_t)(const struct 
ofono_error *error,
@@ -61,6 +86,14 @@ struct ofono_radio_settings_driver {
enum ofono_radio_access_mode mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data);
+   void (*query_band)(struct ofono_radio_settings *rs,
+   ofono_radio_settings_band_query_cb_t cb,
+   void *data);
+   void (*set_band)(struct ofono_radio_settings *rs,
+   enum ofono_radio_band_gsm band_gsm,
+   enum ofono_radio_band_umts band_umts,
+   ofono_radio_settings_band_set_cb_t cb,
+   void *data);
void (*query_fast_dormancy)(struct ofono_radio_settings *rs,
ofono_radio_settings_fast_dormancy_query_cb_t cb,
void *data);
-- 
1.7.3.2

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


[RFC PATCH 2/3] radio-settings: add frequency band selection properties

2010-12-01 Thread Lucas De Marchi
---
 src/radio-settings.c |  250 +-
 1 files changed, 248 insertions(+), 2 deletions(-)

diff --git a/src/radio-settings.c b/src/radio-settings.c
index ff6934b..8c82e29 100644
--- a/src/radio-settings.c
+++ b/src/radio-settings.c
@@ -41,8 +41,12 @@ struct ofono_radio_settings {
DBusMessage *pending;
int flags;
enum ofono_radio_access_mode mode;
-   enum ofono_radio_access_mode pending_mode;
+   enum ofono_radio_band_gsm band_gsm;
+   enum ofono_radio_band_umts band_umts;
ofono_bool_t fast_dormancy;
+   enum ofono_radio_access_mode pending_mode;
+   enum ofono_radio_band_gsm pending_band_gsm;
+   enum ofono_radio_band_umts pending_band_umts;
ofono_bool_t fast_dormancy_pending;
const struct ofono_radio_settings_driver *driver;
void *driver_data;
@@ -86,6 +90,100 @@ static gboolean radio_access_mode_from_string(const char 
*str,
return FALSE;
 }
 
+static const char *radio_band_gsm_to_string(enum ofono_radio_band_gsm band)
+{
+   switch (band) {
+   case OFONO_RADIO_BAND_GSM_ANY:
+   return "any";
+   case OFONO_RADIO_BAND_GSM_850:
+   return "850";
+   case OFONO_RADIO_BAND_GSM_900P:
+   return "900P";
+   case OFONO_RADIO_BAND_GSM_900E:
+   return "900E";
+   case OFONO_RADIO_BAND_GSM_1800:
+   return "1800";
+   case OFONO_RADIO_BAND_GSM_1900:
+   return "1900";
+   }
+
+   return "";
+}
+
+static gboolean radio_band_gsm_from_string(const char *str,
+   enum ofono_radio_band_gsm *band)
+
+{
+   if (g_str_equal(str, "any")) {
+   *band = OFONO_RADIO_BAND_GSM_ANY;
+   return TRUE;
+   } else if (g_str_equal(str, "850")) {
+   *band = OFONO_RADIO_BAND_GSM_850;
+   return TRUE;
+   } else if (g_str_equal(str, "900P")) {
+   *band = OFONO_RADIO_BAND_GSM_900P;
+   return TRUE;
+   } else if (g_str_equal(str, "900E")) {
+   *band = OFONO_RADIO_BAND_GSM_900E;
+   return TRUE;
+   } else if (g_str_equal(str, "1800")) {
+   *band = OFONO_RADIO_BAND_GSM_1800;
+   return TRUE;
+   } else if (g_str_equal(str, "1900")) {
+   *band = OFONO_RADIO_BAND_GSM_1900;
+   return TRUE;
+   }
+
+   return FALSE;
+}
+
+static const char *radio_band_umts_to_string(enum ofono_radio_band_umts band)
+{
+   switch (band) {
+   case OFONO_RADIO_BAND_UMTS_ANY:
+   return "any";
+   case OFONO_RADIO_BAND_UMTS_850:
+   return "850";
+   case OFONO_RADIO_BAND_UMTS_900:
+   return "900P";
+   case OFONO_RADIO_BAND_UMTS_1700AWS:
+   return "900E";
+   case OFONO_RADIO_BAND_UMTS_1900:
+   return "1800";
+   case OFONO_RADIO_BAND_UMTS_2100:
+   return "1900";
+   }
+
+   return "";
+}
+
+static gboolean radio_band_umts_from_string(const char *str,
+   enum ofono_radio_band_umts 
*band)
+
+{
+   if (g_str_equal(str, "any")) {
+   *band = OFONO_RADIO_BAND_GSM_ANY;
+   return TRUE;
+   } else if (g_str_equal(str, "850")) {
+   *band = OFONO_RADIO_BAND_UMTS_850;
+   return TRUE;
+   } else if (g_str_equal(str, "900")) {
+   *band = OFONO_RADIO_BAND_UMTS_900;
+   return TRUE;
+   } else if (g_str_equal(str, "1700AWS")) {
+   *band = OFONO_RADIO_BAND_UMTS_1700AWS;
+   return TRUE;
+   } else if (g_str_equal(str, "1900")) {
+   *band = OFONO_RADIO_BAND_UMTS_1900;
+   return TRUE;
+   } else if (g_str_equal(str, "2100")) {
+   *band = OFONO_RADIO_BAND_UMTS_2100;
+   return TRUE;
+   }
+
+   return FALSE;
+}
+
 static DBusMessage *radio_get_properties_reply(DBusMessage *msg,
struct ofono_radio_settings *rs)
 {
@@ -108,6 +206,18 @@ static DBusMessage *radio_get_properties_reply(DBusMessage 
*msg,
ofono_dbus_dict_append(&dict, "TechnologyPreference",
DBUS_TYPE_STRING, &mode);
 
+   if (rs->driver->query_band) {
+   const char *band = radio_band_gsm_to_string(rs->band_gsm);
+
+   ofono_dbus_dict_append(&dict, "GsmBand",
+   DBUS_TYPE_STRING, &band);
+
+   band = radio_band_umts_to_string(rs->band_umts);
+
+   ofono_dbus_dict_append(&dict, "UmtsBand",
+   DBUS_TYPE_STRING, &band);
+   }
+
if (rs->driver->query_fast_dormancy) {
dbus_bool_t value = rs->fast_dormancy;
ofono_dbus_dict_append(&dict, "FastDormancy",
@@ -159,6 +2

[RFC PATCH 3/3] doc: document frequency band selection

2010-12-01 Thread Lucas De Marchi
---
 doc/radio-settings-api.txt |   43 +++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/doc/radio-settings-api.txt b/doc/radio-settings-api.txt
index e073d1d..311759d 100644
--- a/doc/radio-settings-api.txt
+++ b/doc/radio-settings-api.txt
@@ -46,6 +46,49 @@ Properties   string TechnologyPreference [readwrite]
"umts"  Only UMTS used for radio access.
"lte"   Only LTE used for radio acccess.
 
+   string GsmBand [readwrite, optional]
+
+   Frequency band in which the modem is allowed to
+   operate when using "gsm" mode. Setting this property
+   has an imediate effect on modem only if
+   TechnologyPreference is set to "gsm".  Otherwise the
+   value is kept and applied whenever modem uses
+   this mode.
+
+   The possible values are:
+   "any"   Frequency band is selected
+   automatically by modem.
+   "850"   Operate only on 850 MHz.
+   "900P"  Operate only on 900 MHz, known as
+   Primary GSM-900 Band
+   "900E"  Operate only on 900 MHz, known as
+   Extended GSM-900 Band.
+   "1800"  Operate only on 1800 MHz, known as DCS.
+   "1900"  Operate only on 1900 MHz, known as PCS.
+
+   string UmtsBand [readwrite, optional]
+
+   Frequency band in which the modem is allowed to
+   operate when using "umts" mode. Setting this property
+   has an imediate effect on modem only if
+   TechnologyPreference is set to "gsm".  Otherwise the
+   value is kept and applied whenever modem uses
+   this mode.
+
+   The possible values are:
+   "any"   Frequency band is selected
+   automatically by modem.
+   "850"   Operate only on 850 MHz, known
+   as CLR (class V).
+   "900"   Operate only on 900 MHz, known
+   as GSM (class VII).
+   "1700AWS"   Operate only on 1700 MHz, known
+   as AWS (class IV).
+   "1900"  Operate only on 1900 MHz, known
+   as PCS (class II).
+   "2100"  Operate only on 2100 MHz, known
+   as IMT (class I).
+
boolean FastDormancy [readwrite, optional]
 
This property will enable or disable the fast
-- 
1.7.3.2

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


[PATCH] SMS character set unit tests.

2010-12-01 Thread Oleg Zhurakivskyy
---
 unit/test-sms.c |  244 +++
 1 files changed, 244 insertions(+), 0 deletions(-)

diff --git a/unit/test-sms.c b/unit/test-sms.c
index c8a9d9c..a7aa3da 100644
--- a/unit/test-sms.c
+++ b/unit/test-sms.c
@@ -471,6 +471,222 @@ static void test_submit_encode()
g_free(encoded_pdu);
 }
 
+struct sms_charset_data {
+   gchar *pdu;
+   gint data_len;
+   enum gsm_dialect locking_lang;
+   enum gsm_dialect single_lang;
+   gchar expected_text[];
+};
+
+static struct sms_charset_data sms_charset_default = {
+   .pdu =
+   "0001000B91" "5310101010" "108080" "8060402818" "0E888462C1"
+   "68381E9088" "6442A9582E" "988C06C4E9" "783EA09068" "442A994EA8"
+   "946AC56AB9" "5EB0986C46" "ABD96EB89C" "6EC7EBF97E" "C0A070482C"
+   "1A8FC8A472" "C96C3A9FD0" "A8744AAD5A" "AFD8AC76CB" "ED7ABFE0B0"
+   "784C2E9BCF" "E8B47ACD6E" "BBDFF0B87C" "4EAFDBEFF8" "BC7ECFEFFB"
+   "FF",
+   .data_len = 112,
+   .expected_text = {
+   0x40, 0xc2, 0xa3, 0x24, 0xc2, 0xa5, 0xc3, 0xa8, 0xc3, 0xa9,
+   0xc3, 0xb9, 0xc3, 0xac, 0xc3, 0xb2, 0xc3, 0x87, 0x0a, 0xc3,
+   0x98, 0xc3, 0xb8, 0x0d, 0xc3, 0x85, 0xc3, 0xa5, 0xce, 0x94,
+   0x5f, 0xce, 0xa6, 0xce, 0x93, 0xce, 0x9b, 0xce, 0xa9, 0xce,
+   0xa0, 0xce, 0xa8, 0xce, 0xa3, 0xce, 0x98, 0xce, 0x9e, 0x20,
+   0xc3, 0x86, 0xc3, 0xa6, 0xc3, 0x9f, 0xc3, 0x89, 0x20, 0x21,
+   0x22, 0x23, 0xc2, 0xa4, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a,
+   0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34,
+   0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e,
+   0x3f, 0xc2, 0xa1, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+   0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51,
+   0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0xc3,
+   0x84, 0xc3, 0x96, 0xc3, 0x91, 0xc3, 0x9c, 0xc2, 0xa7, 0xc2,
+   0xbf, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
+   0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73,
+   0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0xc3, 0xa4, 0xc3,
+   0xb6, 0xc3, 0xb1, 0xc3, 0xbc, 0xc3, 0xa0, 0x00
+   }
+};
+
+static struct sms_charset_data sms_charset_default_ext = {
+   .pdu =
+   "0001000B91" "5310101010" "10151B" "C58602DAA0" "36A9CD6BC3"
+   "DBF436BE0D" "705306",
+   .data_len = 19,
+   .expected_text = {
+   0x0c, 0x5e, 0x20, 0x7b, 0x7d, 0x5c, 0x5b, 0x7e, 0x5d, 0x7c,
+   0xe2, 0x82, 0xac, 0x00
+   }
+};
+
+static struct sms_charset_data sms_charset_turkey = {
+   .pdu =
+   "0001000B91" "5310101010" "108080" "8060402818" "0E888462C1"
+   "68381E9088" "6442A9582E" "988C06C4E9" "783EA09068" "442A994EA8"
+   "946AC56AB9" "5EB0986C46" "ABD96EB89C" "6EC7EBF97E" "C0A070482C"
+   "1A8FC8A472" "C96C3A9FD0" "A8744AAD5A" "AFD8AC76CB" "ED7ABFE0B0"
+   "784C2E9BCF" "E8B47ACD6E" "BBDFF0B87C" "4EAFDBEFF8" "BC7ECFEFFB"
+   "FF",
+   .data_len = 112,
+   .locking_lang = GSM_DIALECT_TURKISH,
+   .expected_text = {
+   0x40, 0xc2, 0xa3, 0x24, 0xc2, 0xa5, 0xe2, 0x82, 0xac, 0xc3,
+   0xa9, 0xc3, 0xb9, 0xc4, 0xb1, 0xc3, 0xb2, 0xc3, 0x87, 0x0a,
+   0xc4, 0x9e, 0xc4, 0x9f, 0x0d, 0xc3, 0x85, 0xc3, 0xa5, 0xce,
+   0x94, 0x5f, 0xce, 0xa6, 0xce, 0x93, 0xce, 0x9b, 0xce, 0xa9,
+   0xce, 0xa0, 0xce, 0xa8, 0xce, 0xa3, 0xce, 0x98, 0xce, 0x9e,
+   0x20, 0xc5, 0x9e, 0xc5, 0x9f, 0xc3, 0x9f, 0xc3, 0x89, 0x20,
+   0x21, 0x22, 0x23, 0xc2, 0xa4, 0x25, 0x26, 0x27, 0x28, 0x29,
+   0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33,
+   0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d,
+   0x3e, 0x3f, 0xc4, 0xb0, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46,
+   0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
+   0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a,
+   0xc3, 0x84, 0xc3, 0x96, 0xc3, 0x91, 0xc3, 0x9c, 0xc2, 0xa7,
+   0xc3, 0xa7, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
+   0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72,
+   0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0xc3, 0xa4,
+   0xc3, 0xb6, 0xc3, 0xb1, 0xc3, 0xbc, 0xc3, 0xa0, 0x00
+   }
+};
+
+static struct sms_charset_data sms_charset_turkey_ext = {
+   .pdu =
+   "0001000B91" "5310101010" "101A1B" "C586B2416D" "529BD786B7"
+   "E96D7C1BE0" "02C8011318" "870E",
+   .data_len = 23,
+   .locking_lang = GSM_DIALECT_TURKISH,
+   .single_lang = GSM_DIALECT_TURKISH,
+   .expected_text = {
+   0x0c, 0x5e, 0x7b, 0x7d, 0x5c, 0x5b, 0x7e, 0x5d, 0x7c, 0xc4,
+   0x9e, 0xc4, 0xb0, 0xc5, 0x9e, 0xc3, 0xa7, 

RE: [PATCH] doc: Add Location Services API

2010-12-01 Thread Simon LETHBRIDGE
Hi Rémi,

> >
> > Would it make sense to add a ResetStoredInfo signal to the DBUS API
> for
> > implementation in a modem specific way?
> 
> Yes. There are no standard commands for that and it is very much needed
> for
> conformance testing.
> 
> However, I would have thought that this was an issue between the
> automatic
> test equipment and the (Linux) positioning engine. In this case, what
> business
> does oFono and the modem have there? 

The assistance data reset command is received via control plane signalling for 
the 3GPP performance tests.

Regards,

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


Need Clarification on DCS handling in Status Report for SMS

2010-12-01 Thread Sankar
Hi,

While doing a code reading for ofono SMS, it is observed that there seems to
be an issue with the way DCS is handled for SMS status report notify.

In the decode SMS function, there is a check to find out if there is a PI
(parameter identifier). If there is a PI and no DCS flag set, then the ofono
core sets the dcs to default. If the PI itself is missing in the PDU
received from the network, then the dcs values are not set to default.

This seems to cause a problem, where, the decoding of dcs fails, and results
in not sending the delivery notification to clients.

Can some one please comment on this.

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


[PATCH] HACKING: add guidelines to patch submission

2010-12-01 Thread Lucas De Marchi
---
 HACKING |   19 +++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/HACKING b/HACKING
index e825185..3322554 100644
--- a/HACKING
+++ b/HACKING
@@ -91,3 +91,22 @@ Other debugging settings that can be toggled:
 
  - Environment variable OFONO_AT_DEBUG (set to 1): enable AT commands
debugging
+
+
+Submitting patches
+==
+
+If you fixed a bug or you want to add support for something, patches are
+welcome! In order to ease the inclusion of your patch, it's important to follow
+some rules, otherwise it will likely be rejected by maintainers:
+
+1) Do *not* add "Signed-off-by" lines in your commit messages. oFono does not
+use them, so including them is actually an error.
+
+2) Be sure to follow the coding style rules of oFono. They are listed in
+doc/coding-style.txt.
+
+3) Split your patch according to the top-level directories. E.g.: if you added
+a feature that touches files under 'include/', 'src/' and 'drivers/'
+directories, split in three separated patches, taking care not to
+break compilation.
-- 
1.7.3.2

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


Re: [ofono] vendor code

2010-12-01 Thread Pekka Pessi
Hi Tonny,

> Any possibility that this is a race condition?  Just while ofono
> sending AT+CGREG? to poll the CGREG state, modem already sent out
> unsolicited CGREG?  I saw at_util_parse_reg() also tries to skip
> unsolicited CREG/CGREG, so it looks like this is valid concern?

This definitely looks like glare to me, the modem sends unsolicited
response and then response to AT+CGREG?, and at_util_parse_reg() gets
very confused.

--Pekka

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


[PATCH] TODO: Mark Language Notification task as done

2010-12-01 Thread Jeevaka Badrappan
---
 TODO |6 --
 doc/features.txt |4 
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/TODO b/TODO
index a421a99..f64b122 100644
--- a/TODO
+++ b/TODO
@@ -359,12 +359,6 @@ Sim Toolkit
   Priority: High
   Complexity: C8
 
-- Support Language Notification proactive command.
-
-  Priority: Medium
-  Complexity: C1
-  Owner: Jeevaka Badrappan 
-
 - Support Provide Local Information.  Whenever oFono receives a Provide Local
   Information proactive command, it should check the type of the information
   requested.  If the information is about the time/date or the language of the
diff --git a/doc/features.txt b/doc/features.txt
index ef20cf2..bd73e2e 100644
--- a/doc/features.txt
+++ b/doc/features.txt
@@ -95,6 +95,10 @@ Supported Proactive Commands:
 
   NOTE: This command can also be handled by the modem.
 
+- Language Notification proactive command. Whenever oFono receives a Language
+  Notification proactive command, it prints the language code and sends
+  terminal response to the SIM immediately.
+
 - Sim icon support.  oFono supports icons that are stored on the SIM.  If the
   SIM notifies oFono that an icon is available for a particular proactive
   command, oFono passes this information to the UI.  The UI is able to obtain
-- 
1.7.0.4

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


RE: [RFC PATCH 1/3] radio-settings: add frequency band selection methods

2010-12-01 Thread Rajesh.Nagaiah
Hi Lucas, 

> +enum ofono_radio_band_gsm {
> + OFONO_RADIO_BAND_GSM_ANY= 0,
> + OFONO_RADIO_BAND_GSM_850= 1,
> + OFONO_RADIO_BAND_GSM_900P   = 2,
> + OFONO_RADIO_BAND_GSM_900E   = 3,
> + OFONO_RADIO_BAND_GSM_1800   = 4,
> + OFONO_RADIO_BAND_GSM_1900   = 5,
> +};
> +
> +enum ofono_radio_band_umts {
> + OFONO_RADIO_BAND_UMTS_ANY   = 0,
> + OFONO_RADIO_BAND_UMTS_850   = 1,
> + OFONO_RADIO_BAND_UMTS_900   = 2,
> + OFONO_RADIO_BAND_UMTS_1700AWS   = 3,
> + OFONO_RADIO_BAND_UMTS_1900  = 4,
> + OFONO_RADIO_BAND_UMTS_2100  = 5,
> +};

A minor coding style comment. Accodring to code style M11: Naming of
enums,
If the enum contents have values (e.g. from specification) then the
above 
formatting you have used is OK. But as these values are not defined as
such
in the specification as such, then it should be,

 enum ofono_radio_band_gsm {
OFONO_RADIO_BAND_GSM_ANY,
OFONO_RADIO_BAND_GSM_850,
OFONO_RADIO_BAND_GSM_900P,
OFONO_RADIO_BAND_GSM_900E,
OFONO_RADIO_BAND_GSM_1800,
OFONO_RADIO_BAND_GSM_1900,
 };

 enum ofono_radio_band_umts {
OFONO_RADIO_BAND_UMTS_ANY,
OFONO_RADIO_BAND_UMTS_850,
OFONO_RADIO_BAND_UMTS_900,
OFONO_RADIO_BAND_UMTS_1700AWS,
OFONO_RADIO_BAND_UMTS_19004,
OFONO_RADIO_BAND_UMTS_21005,
 };

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


RE: [RFC PATCH 3/3] doc: document frequency band selection

2010-12-01 Thread Rajesh.Nagaiah
Hi Lucas,

> +
> + string UmtsBand [readwrite, optional]
> +
> + Frequency band in which the modem is allowed to
> + operate when using "umts" mode. Setting this
property
> + has an imediate effect on modem only if
> + TechnologyPreference is set to "gsm".

Should be "Setting this property has an imediate effect on modem only if
TechnologyPreference is set to "umts"."

BR,
Rajesh

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


Re: [PATCH] Add voice call boolean property for MO/MT distinction

2010-12-01 Thread Pekka Pessi
Hi Marcel,

2010/11/29 Marcel Holtmann :
> Only because someone wants to shoehorn this into something nasty,
> doesn't mean we should do it.

I'd say it fits with oFono's overall strategy of following 27.007
whenever possible.

>And I am not going to scarifies the
> simplicity of the oFono D-Bus API for this.

Please. Have a look at the VoicecallManager API. Someone has
shoehorned all the nasty MMI-isms from 22.030 there. Surely we have to
have a separate ReleaseAndAnswer method, how else a dialer could
implement the intuitive "1" followed by SEND procedure?

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


Re: [RFC PATCH 3/3] doc: document frequency band selection

2010-12-01 Thread Lucas De Marchi
On Wed, Dec 1, 2010 at 8:29 PM,   wrote:
> Hi Lucas,
>
>> +
>> +             string UmtsBand [readwrite, optional]
>> +
>> +                     Frequency band in which the modem is allowed to
>> +                     operate when using "umts" mode. Setting this
> property
>> +                     has an imediate effect on modem only if
>> +                     TechnologyPreference is set to "gsm".
>
> Should be "Setting this property has an imediate effect on modem only if
> TechnologyPreference is set to "umts"."

Thanks, fixed.


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


Re: [RFC PATCH 1/3] radio-settings: add frequency band selection methods

2010-12-01 Thread Lucas De Marchi
On Wed, Dec 1, 2010 at 8:24 PM,   wrote:
> Hi Lucas,
>
>> +enum ofono_radio_band_gsm {
>> +     OFONO_RADIO_BAND_GSM_ANY        = 0,
>> +     OFONO_RADIO_BAND_GSM_850        = 1,
>> +     OFONO_RADIO_BAND_GSM_900P       = 2,
>> +     OFONO_RADIO_BAND_GSM_900E       = 3,
>> +     OFONO_RADIO_BAND_GSM_1800       = 4,
>> +     OFONO_RADIO_BAND_GSM_1900       = 5,
>> +};
>> +
>> +enum ofono_radio_band_umts {
>> +     OFONO_RADIO_BAND_UMTS_ANY       = 0,
>> +     OFONO_RADIO_BAND_UMTS_850       = 1,
>> +     OFONO_RADIO_BAND_UMTS_900       = 2,
>> +     OFONO_RADIO_BAND_UMTS_1700AWS   = 3,
>> +     OFONO_RADIO_BAND_UMTS_1900      = 4,
>> +     OFONO_RADIO_BAND_UMTS_2100      = 5,
>> +};
>
> A minor coding style comment. Accodring to code style M11: Naming of
> enums,
> If the enum contents have values (e.g. from specification) then the

What I understood is that "specification" is just an example, it might
be because of  other things.

But I agree with your comment.

Thanks, fixed.


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


[PATCH v2 1/3] radio-settings: add frequency band selection methods

2010-12-01 Thread Lucas De Marchi
---
 include/radio-settings.h |   33 +
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/include/radio-settings.h b/include/radio-settings.h
index 45e88e7..6c99278 100644
--- a/include/radio-settings.h
+++ b/include/radio-settings.h
@@ -35,6 +35,24 @@ enum ofono_radio_access_mode {
OFONO_RADIO_ACCESS_MODE_LTE = 3,
 };
 
+enum ofono_radio_band_gsm {
+   OFONO_RADIO_BAND_GSM_ANY,
+   OFONO_RADIO_BAND_GSM_850,
+   OFONO_RADIO_BAND_GSM_900P,
+   OFONO_RADIO_BAND_GSM_900E,
+   OFONO_RADIO_BAND_GSM_1800,
+   OFONO_RADIO_BAND_GSM_1900,
+};
+
+enum ofono_radio_band_umts {
+   OFONO_RADIO_BAND_UMTS_ANY,
+   OFONO_RADIO_BAND_UMTS_850,
+   OFONO_RADIO_BAND_UMTS_900,
+   OFONO_RADIO_BAND_UMTS_1700AWS,
+   OFONO_RADIO_BAND_UMTS_1900,
+   OFONO_RADIO_BAND_UMTS_2100,
+};
+
 struct ofono_radio_settings;
 
 typedef void (*ofono_radio_settings_rat_mode_set_cb_t)(const struct 
ofono_error *error,
@@ -43,6 +61,13 @@ typedef void 
(*ofono_radio_settings_rat_mode_query_cb_t)(const struct ofono_erro
enum ofono_radio_access_mode 
mode,
void *data);
 
+typedef void (*ofono_radio_settings_band_set_cb_t)(const struct ofono_error 
*error,
+   void *data);
+typedef void (*ofono_radio_settings_band_query_cb_t)(const struct ofono_error 
*error,
+   enum ofono_radio_band_gsm 
band_gsm,
+   enum ofono_radio_band_umts 
band_umts,
+   void *data);
+
 typedef void (*ofono_radio_settings_fast_dormancy_set_cb_t)(const struct 
ofono_error *error,
void *data);
 typedef void (*ofono_radio_settings_fast_dormancy_query_cb_t)(const struct 
ofono_error *error,
@@ -61,6 +86,14 @@ struct ofono_radio_settings_driver {
enum ofono_radio_access_mode mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data);
+   void (*query_band)(struct ofono_radio_settings *rs,
+   ofono_radio_settings_band_query_cb_t cb,
+   void *data);
+   void (*set_band)(struct ofono_radio_settings *rs,
+   enum ofono_radio_band_gsm band_gsm,
+   enum ofono_radio_band_umts band_umts,
+   ofono_radio_settings_band_set_cb_t cb,
+   void *data);
void (*query_fast_dormancy)(struct ofono_radio_settings *rs,
ofono_radio_settings_fast_dormancy_query_cb_t cb,
void *data);
-- 
1.7.3.2

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


[PATCH v2 2/3] radio-settings: add frequency band selection properties

2010-12-01 Thread Lucas De Marchi
---
 src/radio-settings.c |  250 +-
 1 files changed, 248 insertions(+), 2 deletions(-)

diff --git a/src/radio-settings.c b/src/radio-settings.c
index ff6934b..51158ef 100644
--- a/src/radio-settings.c
+++ b/src/radio-settings.c
@@ -41,8 +41,12 @@ struct ofono_radio_settings {
DBusMessage *pending;
int flags;
enum ofono_radio_access_mode mode;
-   enum ofono_radio_access_mode pending_mode;
+   enum ofono_radio_band_gsm band_gsm;
+   enum ofono_radio_band_umts band_umts;
ofono_bool_t fast_dormancy;
+   enum ofono_radio_access_mode pending_mode;
+   enum ofono_radio_band_gsm pending_band_gsm;
+   enum ofono_radio_band_umts pending_band_umts;
ofono_bool_t fast_dormancy_pending;
const struct ofono_radio_settings_driver *driver;
void *driver_data;
@@ -86,6 +90,100 @@ static gboolean radio_access_mode_from_string(const char 
*str,
return FALSE;
 }
 
+static const char *radio_band_gsm_to_string(enum ofono_radio_band_gsm band)
+{
+   switch (band) {
+   case OFONO_RADIO_BAND_GSM_ANY:
+   return "any";
+   case OFONO_RADIO_BAND_GSM_850:
+   return "850";
+   case OFONO_RADIO_BAND_GSM_900P:
+   return "900P";
+   case OFONO_RADIO_BAND_GSM_900E:
+   return "900E";
+   case OFONO_RADIO_BAND_GSM_1800:
+   return "1800";
+   case OFONO_RADIO_BAND_GSM_1900:
+   return "1900";
+   }
+
+   return "";
+}
+
+static gboolean radio_band_gsm_from_string(const char *str,
+   enum ofono_radio_band_gsm *band)
+
+{
+   if (g_str_equal(str, "any")) {
+   *band = OFONO_RADIO_BAND_GSM_ANY;
+   return TRUE;
+   } else if (g_str_equal(str, "850")) {
+   *band = OFONO_RADIO_BAND_GSM_850;
+   return TRUE;
+   } else if (g_str_equal(str, "900P")) {
+   *band = OFONO_RADIO_BAND_GSM_900P;
+   return TRUE;
+   } else if (g_str_equal(str, "900E")) {
+   *band = OFONO_RADIO_BAND_GSM_900E;
+   return TRUE;
+   } else if (g_str_equal(str, "1800")) {
+   *band = OFONO_RADIO_BAND_GSM_1800;
+   return TRUE;
+   } else if (g_str_equal(str, "1900")) {
+   *band = OFONO_RADIO_BAND_GSM_1900;
+   return TRUE;
+   }
+
+   return FALSE;
+}
+
+static const char *radio_band_umts_to_string(enum ofono_radio_band_umts band)
+{
+   switch (band) {
+   case OFONO_RADIO_BAND_UMTS_ANY:
+   return "any";
+   case OFONO_RADIO_BAND_UMTS_850:
+   return "850";
+   case OFONO_RADIO_BAND_UMTS_900:
+   return "900";
+   case OFONO_RADIO_BAND_UMTS_1700AWS:
+   return "1700AWS";
+   case OFONO_RADIO_BAND_UMTS_1900:
+   return "1900";
+   case OFONO_RADIO_BAND_UMTS_2100:
+   return "2100";
+   }
+
+   return "";
+}
+
+static gboolean radio_band_umts_from_string(const char *str,
+   enum ofono_radio_band_umts 
*band)
+
+{
+   if (g_str_equal(str, "any")) {
+   *band = OFONO_RADIO_BAND_GSM_ANY;
+   return TRUE;
+   } else if (g_str_equal(str, "850")) {
+   *band = OFONO_RADIO_BAND_UMTS_850;
+   return TRUE;
+   } else if (g_str_equal(str, "900")) {
+   *band = OFONO_RADIO_BAND_UMTS_900;
+   return TRUE;
+   } else if (g_str_equal(str, "1700AWS")) {
+   *band = OFONO_RADIO_BAND_UMTS_1700AWS;
+   return TRUE;
+   } else if (g_str_equal(str, "1900")) {
+   *band = OFONO_RADIO_BAND_UMTS_1900;
+   return TRUE;
+   } else if (g_str_equal(str, "2100")) {
+   *band = OFONO_RADIO_BAND_UMTS_2100;
+   return TRUE;
+   }
+
+   return FALSE;
+}
+
 static DBusMessage *radio_get_properties_reply(DBusMessage *msg,
struct ofono_radio_settings *rs)
 {
@@ -108,6 +206,18 @@ static DBusMessage *radio_get_properties_reply(DBusMessage 
*msg,
ofono_dbus_dict_append(&dict, "TechnologyPreference",
DBUS_TYPE_STRING, &mode);
 
+   if (rs->driver->query_band) {
+   const char *band = radio_band_gsm_to_string(rs->band_gsm);
+
+   ofono_dbus_dict_append(&dict, "GsmBand",
+   DBUS_TYPE_STRING, &band);
+
+   band = radio_band_umts_to_string(rs->band_umts);
+
+   ofono_dbus_dict_append(&dict, "UmtsBand",
+   DBUS_TYPE_STRING, &band);
+   }
+
if (rs->driver->query_fast_dormancy) {
dbus_bool_t value = rs->fast_dormancy;
ofono_dbus_dict_append(&dict, "FastDormancy",
@@ -159,6 

[PATCH v2 3/3] doc: document frequency band selection

2010-12-01 Thread Lucas De Marchi
---
 doc/radio-settings-api.txt |   43 +++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/doc/radio-settings-api.txt b/doc/radio-settings-api.txt
index e073d1d..216f534 100644
--- a/doc/radio-settings-api.txt
+++ b/doc/radio-settings-api.txt
@@ -46,6 +46,49 @@ Properties   string TechnologyPreference [readwrite]
"umts"  Only UMTS used for radio access.
"lte"   Only LTE used for radio acccess.
 
+   string GsmBand [readwrite, optional]
+
+   Frequency band in which the modem is allowed to
+   operate when using "gsm" mode. Setting this property
+   has an imediate effect on modem only if
+   TechnologyPreference is set to "gsm".  Otherwise the
+   value is kept and applied whenever modem uses
+   this mode.
+
+   The possible values are:
+   "any"   Frequency band is selected
+   automatically by modem.
+   "850"   Operate only on 850 MHz.
+   "900P"  Operate only on 900 MHz, known as
+   Primary GSM-900 Band
+   "900E"  Operate only on 900 MHz, known as
+   Extended GSM-900 Band.
+   "1800"  Operate only on 1800 MHz, known as DCS.
+   "1900"  Operate only on 1900 MHz, known as PCS.
+
+   string UmtsBand [readwrite, optional]
+
+   Frequency band in which the modem is allowed to
+   operate when using "umts" mode. Setting this property
+   has an imediate effect on modem only if
+   TechnologyPreference is set to "umts".  Otherwise the
+   value is kept and applied whenever modem uses
+   this mode.
+
+   The possible values are:
+   "any"   Frequency band is selected
+   automatically by modem.
+   "850"   Operate only on 850 MHz, known
+   as CLR (class V).
+   "900"   Operate only on 900 MHz, known
+   as GSM (class VII).
+   "1700AWS"   Operate only on 1700 MHz, known
+   as AWS (class IV).
+   "1900"  Operate only on 1900 MHz, known
+   as PCS (class II).
+   "2100"  Operate only on 2100 MHz, known
+   as IMT (class I).
+
boolean FastDormancy [readwrite, optional]
 
This property will enable or disable the fast
-- 
1.7.3.2

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


RE: Need Clarification on DCS handling in Status Report for SMS

2010-12-01 Thread Rajesh.Nagaiah
Hi Sankar,

> In the decode SMS function, there is a check to find out if 
> there is a PI (parameter identifier). If there is a PI and no 
> DCS flag set, then the ofono core sets the dcs to default. If 
> the PI itself is missing in the PDU received from the 
> network, then the dcs values are not set to default.
> 
> This seems to cause a problem, where, the decoding of dcs 
> fails, and results in not sending the delivery notification 
> to clients.

Yes, this is a bug. But rather than setting the DCS to default in
this case, we should rather not call that sms_dcs_decode() function
from ofono_sms_status_notify(), as the class information derived from
the DCS decoding is not used there and also we are not handling the
optional text information in the status report handling currently.

If we decide to handle this optional text information (most likely not
going to happen), then some modifications are required.

Also there is another bug in the current code which might not be
relevant
if we decide to remove the sms_dcs_decode() function call from
ofono_sms_status_notify(). In that function call instead of passing
s.status_report.dcs, we are currently passing s.deliver.dcs.

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


Re: Need Clarification on DCS handling in Status Report for SMS

2010-12-01 Thread Sankar
Hi Rajesh,


On Thu, Dec 2, 2010 at 7:33 AM,  wrote:

> Hi Sankar,
>
> > In the decode SMS function, there is a check to find out if
> > there is a PI (parameter identifier). If there is a PI and no
> > DCS flag set, then the ofono core sets the dcs to default. If
> > the PI itself is missing in the PDU received from the
> > network, then the dcs values are not set to default.
> >
> > This seems to cause a problem, where, the decoding of dcs
> > fails, and results in not sending the delivery notification
> > to clients.
>
> Yes, this is a bug. But rather than setting the DCS to default in
> this case, we should rather not call that sms_dcs_decode() function
> from ofono_sms_status_notify(), as the class information derived from
> the DCS decoding is not used there and also we are not handling the
> optional text information in the status report handling currently.
>
> If we decide to handle this optional text information (most likely not
> going to happen), then some modifications are required.
>
> Also there is another bug in the current code which might not be
> relevant
> if we decide to remove the sms_dcs_decode() function call from
> ofono_sms_status_notify(). In that function call instead of passing
> s.status_report.dcs, we are currently passing s.deliver.dcs.
>

Thanks for your inputs. Can you please let me know when this will be
addressed in the ofono.

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


[PATCH] gprs: Fix for gprs context conversion

2010-12-01 Thread Antti Paila
---
 src/gprs.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gprs.c b/src/gprs.c
index 610f3b2..58166f8 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -175,7 +175,7 @@ static gboolean gprs_context_string_to_type(const char *str,
return TRUE;
} else if (g_str_equal(str, "ims")) {
*out = OFONO_GPRS_CONTEXT_TYPE_IMS;
-   return FALSE;
+   return TRUE;
}
 
return FALSE;
-- 
1.7.1

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