[PATCH] doc/connman: fix doc error
by caiwen.zhang@intel.com
From: Caiwen Zhang <caiwen.zhang(a)intel.com>
---
doc/connman-api.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/connman-api.txt b/doc/connman-api.txt
index 1ce1d61..9220d0d 100644
--- a/doc/connman-api.txt
+++ b/doc/connman-api.txt
@@ -106,7 +106,7 @@ Properties boolean Attached [readonly]
GPRS service registration (if known).
Possible values are:
- "none", "gsm", "edge", "umts", "hsdpa", "hsupa",
+ "none", "gprs", "edge", "umts", "hsdpa", "hsupa",
"hspa" (HSDPA and HSUPA at the same time) and
"lte"
--
1.9.1
4 years, 11 months
[PATCH] Radio-setting: Add GSM and UMTS band
by Antara Borwankar
From: Antara Borwankar <antara.borwankar(a)gmail.com>
To add GSM band and UMTS band to persitent data
---
src/radio-settings.c | 100 ++++++++++++++++++++++++++++++++++-----------------
1 file changed, 68 insertions(+), 32 deletions(-)
diff --git a/src/radio-settings.c b/src/radio-settings.c
index 7bbd811..15d2f8e 100644
--- a/src/radio-settings.c
+++ b/src/radio-settings.c
@@ -72,7 +72,7 @@ static const char *radio_access_mode_to_string(enum ofono_radio_access_mode m)
case OFONO_RADIO_ACCESS_MODE_LTE:
return "lte";
default:
- return "";
+ return NULL;
}
}
@@ -114,7 +114,7 @@ static const char *radio_band_gsm_to_string(enum ofono_radio_band_gsm band)
return "1900";
}
- return "";
+ return NULL;
}
static gboolean radio_band_gsm_from_string(const char *str,
@@ -160,7 +160,7 @@ static const char *radio_band_umts_to_string(enum ofono_radio_band_umts band)
return "2100";
}
- return "";
+ return NULL;
}
static gboolean radio_band_umts_from_string(const char *str,
@@ -311,6 +311,12 @@ static void radio_set_band(struct ofono_radio_settings *rs)
OFONO_RADIO_SETTINGS_INTERFACE,
"GsmBand", DBUS_TYPE_STRING,
&str_band);
+
+ if (rs->settings) {
+ g_key_file_set_integer(rs->settings, SETTINGS_GROUP,
+ "GsmBand", rs->band_gsm);
+ storage_sync(rs->imsi, SETTINGS_STORE, rs->settings);
+ }
}
if (rs->band_umts != rs->pending_band_umts) {
@@ -321,8 +327,13 @@ static void radio_set_band(struct ofono_radio_settings *rs)
OFONO_RADIO_SETTINGS_INTERFACE,
"UmtsBand", DBUS_TYPE_STRING,
&str_band);
- }
+ if (rs->settings) {
+ g_key_file_set_integer(rs->settings, SETTINGS_GROUP,
+ "UmtsBand", rs->band_umts);
+ storage_sync(rs->imsi, SETTINGS_STORE, rs->settings);
+ }
+ }
}
static void radio_band_set_callback(const struct ofono_error *error,
@@ -368,6 +379,12 @@ static void radio_set_rat_mode(struct ofono_radio_settings *rs,
OFONO_RADIO_SETTINGS_INTERFACE,
"TechnologyPreference",
DBUS_TYPE_STRING, &str_mode);
+
+ if (rs->settings) {
+ g_key_file_set_integer(rs->settings, SETTINGS_GROUP,
+ "TechnologyPreference", rs->mode);
+ storage_sync(rs->imsi, SETTINGS_STORE, rs->settings);
+ }
}
static void radio_mode_set_callback(const struct ofono_error *error, void *data)
@@ -578,15 +595,7 @@ static DBusMessage *radio_set_property(DBusConnection *conn, DBusMessage *msg,
rs->pending_mode = mode;
rs->driver->set_rat_mode(rs, mode, radio_mode_set_callback, rs);
-
- if (rs->settings) {
- const char *mode_str;
- mode_str = radio_access_mode_to_string(mode);
- g_key_file_set_string(rs->settings, SETTINGS_GROUP,
- "TechnologyPreference", mode_str);
- storage_sync(rs->imsi, SETTINGS_STORE, rs->settings);
- }
-
+ /* will be saved in radiosettng on success response*/
return NULL;
} else if (g_strcmp0(property, "GsmBand") == 0) {
const char *value;
@@ -610,7 +619,7 @@ static DBusMessage *radio_set_property(DBusConnection *conn, DBusMessage *msg,
rs->driver->set_band(rs, band, rs->band_umts,
radio_band_set_callback, rs);
-
+ /* will be saved in radiosettng on success response*/
return NULL;
} else if (g_strcmp0(property, "UmtsBand") == 0) {
const char *value;
@@ -634,7 +643,7 @@ static DBusMessage *radio_set_property(DBusConnection *conn, DBusMessage *msg,
rs->driver->set_band(rs, rs->band_gsm, band,
radio_band_set_callback, rs);
-
+ /* will be saved in radiosettng on success response*/
return NULL;
} else if (g_strcmp0(property, "FastDormancy") == 0) {
dbus_bool_t value;
@@ -804,12 +813,21 @@ static void radio_mode_set_callback_at_reg(const struct ofono_error *error,
*/
ofono_radio_finish_register(rs);
}
+static void radio_band_set_callback_at_reg(const struct ofono_error *error,
+ void *data)
+{
+ if (error->type != OFONO_ERROR_TYPE_NO_ERROR)
+ DBG("Error setting radio access mode register time");
+ /*
+ * Continue with atom register even if request fail at modem
+ * ofono_radio_finish_register called by radio_mode_set_callback_at_reg
+ */
+}
static void radio_load_settings(struct ofono_radio_settings *rs,
const char *imsi)
{
GError *error;
- char *strmode;
rs->settings = storage_open(imsi, SETTINGS_STORE);
@@ -820,34 +838,46 @@ static void radio_load_settings(struct ofono_radio_settings *rs,
if (rs->settings == NULL) {
DBG("radiosetting storage open failed");
rs->mode = OFONO_RADIO_ACCESS_MODE_ANY;
+ rs->band_gsm = OFONO_RADIO_BAND_GSM_ANY;
+ rs->band_umts = OFONO_RADIO_BAND_UMTS_ANY;
return;
}
rs->imsi = g_strdup(imsi);
error = NULL;
- strmode = g_key_file_get_string(rs->settings, SETTINGS_GROUP,
- "TechnologyPreference", &error);
+ rs->band_gsm = g_key_file_get_integer(rs->settings, SETTINGS_GROUP,
+ "GsmBand", &error);
- if (error) {
- g_error_free(error);
- goto setdefault;
+ if (error || radio_band_gsm_to_string(rs->band_gsm) == NULL) {
+ rs->band_gsm = OFONO_RADIO_BAND_GSM_ANY;
+ g_key_file_set_integer(rs->settings, SETTINGS_GROUP,
+ "GsmBand", rs->band_gsm);
}
- if (radio_access_mode_from_string(strmode, &rs->mode) == FALSE) {
- DBG("Invalid rat mode in storage; Setting default");
- goto setdefault;
+ error = NULL;
+ rs->band_umts = g_key_file_get_integer(rs->settings, SETTINGS_GROUP,
+ "UmtsBand", &error);
+
+ if (error || radio_band_umts_to_string(rs->band_umts) == NULL) {
+ rs->band_umts = OFONO_RADIO_BAND_UMTS_ANY;
+ g_key_file_set_integer(rs->settings, SETTINGS_GROUP,
+ "UmtsBand", rs->band_umts);
}
- g_free(strmode);
- return;
+ error = NULL;
+ rs->mode = g_key_file_get_integer(rs->settings, SETTINGS_GROUP,
+ "TechnologyPreference", &error);
+
+ if (error || radio_access_mode_to_string(rs->mode) == NULL) {
+ rs->mode = OFONO_RADIO_ACCESS_MODE_ANY;
+ g_key_file_set_integer(rs->settings, SETTINGS_GROUP,
+ "TechnologyPreference", rs->mode);
+ }
-setdefault:
- rs->mode = OFONO_RADIO_ACCESS_MODE_ANY;
- g_key_file_set_string(rs->settings, SETTINGS_GROUP,
- "TechnologyPreference", "any");
- storage_sync(rs->imsi, SETTINGS_STORE, rs->settings);
- g_free(strmode);
+ DBG("TechnologyPreference: %d", rs->mode);
+ DBG("GsmBand: %d", rs->band_gsm);
+ DBG("UmtsBand: %d", rs->band_umts);
}
void ofono_radio_settings_register(struct ofono_radio_settings *rs)
@@ -860,6 +890,12 @@ void ofono_radio_settings_register(struct ofono_radio_settings *rs)
radio_load_settings(rs, ofono_sim_get_imsi(sim));
+ if (rs->driver->set_band == NULL)
+ goto finish;
+
+ rs->driver->set_band(rs, rs->band_gsm, rs->band_umts,
+ radio_band_set_callback_at_reg, rs);
+
if (rs->driver->set_rat_mode == NULL)
goto finish;
--
1.9.1
4 years, 11 months
[PATCH v2 0/2] [RFC] Clean up undefined function pointer casts
by John Ernberg
From: John Ernberg <john.ernberg(a)actia.se>
v2: Bump glib requirement to version 2.32 to gain access to g_queue_free_full,
this saves using a wrapper function to clean up the queue in the stk.
John Ernberg (2):
configure: Bump glib dependecy to 2.32
stk: clean up undefined function pointer casts
configure.ac | 4 ++--
src/stk.c | 6 ++----
2 files changed, 4 insertions(+), 6 deletions(-)
--
1.9.1
4 years, 11 months
[PATCH 0/5] Clean up atoms on modem_unregister
by John Ernberg
From: John Ernberg <john.ernberg(a)actia.se>
When using e.g. a USB modem and it's unplugged oFono may crash with a
SIGSEGV or SIGFPE due to atoms not getting cleaned up properly.
John Ernberg (5):
modem: clean up atoms on modem_unregister
bluez4: track and clean up atom watches
bluez5: track and clean up atom watches
push notification: track and clean up atom watches
smart messaging: track and clean up atom watches
plugins/dun_gw_bluez4.c | 24 ++++++++++++++++++++++--
plugins/dun_gw_bluez5.c | 24 ++++++++++++++++++++++--
plugins/hfp_ag_bluez4.c | 25 ++++++++++++++++++++++---
plugins/hfp_ag_bluez5.c | 36 +++++++++++++++++++++++++++++++-----
plugins/push-notification.c | 26 +++++++++++++++++++++++---
plugins/smart-messaging.c | 26 +++++++++++++++++++++++---
src/modem.c | 3 +++
7 files changed, 146 insertions(+), 18 deletions(-)
--
1.9.1
4 years, 11 months
[PATCH] rilmodem: Driver code to set band mode and value
by Samrat Guha Niyogi
From: Antara Borwankar <antara.borwankar(a)gmail.com>
set_band driver to set GSM band and UMTS band
---
drivers/rilmodem/radio-settings.c | 109 ++++++++++++++++++++++++++++++++++++++
1 file changed, 109 insertions(+)
diff --git a/drivers/rilmodem/radio-settings.c b/drivers/rilmodem/radio-settings.c
index 90b49c6..eb26902 100644
--- a/drivers/rilmodem/radio-settings.c
+++ b/drivers/rilmodem/radio-settings.c
@@ -64,6 +64,22 @@
#define MTK_PREF_NET_TYPE_LTE_GSM_TYPE (MTK_PREF_NET_TYPE_BASE + 5)
#define MTK_PREF_NET_TYPE_LTE_GSM_MMDC_TYPE (MTK_PREF_NET_TYPE_BASE + 6)
+/*GSM Band*/
+#define PREF_NET_BAND_GSM_AUTOMATIC 255
+#define PREF_NET_BAND_GSM850 6
+#define PREF_NET_BAND_GSM900_P 1
+#define PREF_NET_BAND_GSM900_E 2
+#define PREF_NET_BAND_GSM1800 4
+#define PREF_NET_BAND_GSM1900 5
+
+/*UMTS Band*/
+#define PREF_NET_BAND_UMTS_AUTOMATIC 255
+#define PREF_NET_BAND_UMTS_V 54
+#define PREF_NET_BAND_UMTS_VIII 57
+#define PREF_NET_BAND_UMTS_IV 53
+#define PREF_NET_BAND_UMTS_II 51
+#define PREF_NET_BAND_UMTS_I 50
+
struct radio_data {
GRil *ril;
gboolean fast_dormancy;
@@ -288,6 +304,98 @@ static void ril_query_available_rats(struct ofono_radio_settings *rs,
CALLBACK_WITH_SUCCESS(cb, available_rats, data);
}
+static void ril_set_band_cb(struct ril_msg *message, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ struct ofono_radio_settings *rs = cbd->user;
+ struct radio_data *rd = ofono_radio_settings_get_data(rs);
+ ofono_radio_settings_band_set_cb_t cb = cbd->cb;
+
+ if (message->error == RIL_E_SUCCESS) {
+ g_ril_print_response_no_args(rd->ril, message);
+
+ CALLBACK_WITH_SUCCESS(cb, cbd->data);
+ } else {
+ CALLBACK_WITH_FAILURE(cb, cbd->data);
+ }
+}
+
+static void ril_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)
+{
+ struct radio_data *rd = ofono_radio_settings_get_data(rs);
+ struct cb_data *cbd = cb_data_new(cb, data, rs);
+ struct parcel rilp;
+ char cmd_buf[9], gsm_band[4], umts_band[4];
+ /* RIL_OEM_HOOK_STRING_SET_BAND_PREFERENCE = 0x000000CE */
+ int cmd_id = 0x000000CE;
+ sprintf(cmd_buf, "%d", cmd_id);
+
+ switch (band_gsm) {
+ case OFONO_RADIO_BAND_GSM_ANY:
+ sprintf(gsm_band, "%d", PREF_NET_BAND_GSM_AUTOMATIC);
+ break;
+ case OFONO_RADIO_BAND_GSM_850:
+ sprintf(gsm_band, "%d", PREF_NET_BAND_GSM850);
+ break;
+ case OFONO_RADIO_BAND_GSM_900P:
+ sprintf(gsm_band, "%d", PREF_NET_BAND_GSM900_P);
+ break;
+ case OFONO_RADIO_BAND_GSM_900E:
+ sprintf(gsm_band, "%d", PREF_NET_BAND_GSM900_E);
+ break;
+ case OFONO_RADIO_BAND_GSM_1800:
+ sprintf(gsm_band, "%d", PREF_NET_BAND_GSM1800);
+ break;
+ case OFONO_RADIO_BAND_GSM_1900:
+ sprintf(gsm_band, "%d", PREF_NET_BAND_GSM1900);
+ break;
+ default:
+ CALLBACK_WITH_FAILURE(cb, data);
+ return;
+ }
+
+ switch (band_umts) {
+ case OFONO_RADIO_BAND_UMTS_ANY:
+ sprintf(umts_band, "%d", PREF_NET_BAND_UMTS_AUTOMATIC);
+ break;
+ case OFONO_RADIO_BAND_UMTS_850:
+ sprintf(umts_band, "%d", PREF_NET_BAND_UMTS_V);
+ break;
+ case OFONO_RADIO_BAND_UMTS_900:
+ sprintf(umts_band, "%d", PREF_NET_BAND_UMTS_VIII);
+ break;
+ case OFONO_RADIO_BAND_UMTS_1700AWS:
+ sprintf(umts_band, "%d", PREF_NET_BAND_UMTS_IV);
+ break;
+ case OFONO_RADIO_BAND_UMTS_1900:
+ sprintf(umts_band, "%d", PREF_NET_BAND_UMTS_II);
+ break;
+ case OFONO_RADIO_BAND_UMTS_2100:
+ sprintf(umts_band, "%d", PREF_NET_BAND_UMTS_I);
+ break;
+ default:
+ CALLBACK_WITH_FAILURE(cb, data);
+ return;
+ }
+
+ parcel_init(&rilp);
+ parcel_w_int32(&rilp, 3); /* Number of params */
+ parcel_w_string(&rilp, cmd_buf);
+ parcel_w_string(&rilp, gsm_band);
+ parcel_w_string(&rilp, umts_band);
+
+ if (g_ril_send(rd->ril, RIL_REQUEST_OEM_HOOK_STRINGS, &rilp,
+ ril_set_band_cb, cbd, g_free) > 0)
+ return;
+
+ g_free(cbd);
+ CALLBACK_WITH_FAILURE(cb,data);
+}
+
static void ril_delayed_register(const struct ofono_error *error,
void *user_data)
{
@@ -329,6 +437,7 @@ static struct ofono_radio_settings_driver driver = {
.remove = ril_radio_settings_remove,
.query_rat_mode = ril_query_rat_mode,
.set_rat_mode = ril_set_rat_mode,
+ .set_band = ril_set_band,
.query_fast_dormancy = ril_query_fast_dormancy,
.set_fast_dormancy = ril_set_fast_dormancy,
.query_available_rats = ril_query_available_rats
--
1.9.1
4 years, 11 months
[PATCH 00/24] [RFC] Don't rely on undefined behavior when casting function pointers
by John Ernberg
From: John Ernberg <john.ernberg(a)actia.se>
Casting between incompatible function pointer types is undefined.
While it works fine on x86, it's not a good idea to depend on this.
This RFC uses g_slist_free_full where possible, and when it's not works around
the casting using other means such as wrappers or fixing function parameters.
John Ernberg (24):
atmodem: don't rely on undefined behavior when casting function
pointers
hfpmodem: don't rely on undefined behavior when casting function
pointers
ifxmodem: don't rely on undefined behavior when casting function
pointers
ril: don't rely on undefined behavior when casting function pointers
stemodem: don't rely on undefined behavior when casting function
pointers
gatchat: don't rely on undefined behavior when casting function
pointers
bluez4: don't rely on undefined behavior when casting function
pointers
sm: don't rely on undefined behavior when casting function pointers
cbs: don't rely on undefined behavior when casting function pointers
cdma/sms: don't rely on undefined behavior when casting function
pointers
handsfree: don't rely on undefined behavior when casting function
pointers
modem: don't rely on undefined behavior when casting function pointers
network: don't rely on undefined behavior when casting function
pointers
phonebook: don't rely on undefined behavior when casting function
pointers
sim: don't rely on undefined behavior when casting function pointers
simfs: don't rely on undefined behavior when casting function pointers
simutil: don't rely on undefined behavior when casting function
pointers
sms: don't rely on undefined behavior when casting function pointers
smsutil: don't rely on undefined behavior when casting function
pointers
stk: don't rely on undefined behavior when casting function pointers
stkutil: don't rely on undefined behavior when casting function
pointers
ussd: don't rely on undefined behavior when casting function pointers
voicecall: don't rely on undefined behavior when casting function
pointers
unittest: don't rely on undefined behavior when casting function
pointers
drivers/atmodem/voicecall.c | 6 ++----
drivers/hfpmodem/voicecall.c | 6 ++----
drivers/ifxmodem/voicecall.c | 3 +--
drivers/rilmodem/voicecall.c | 6 ++----
drivers/stemodem/voicecall.c | 3 +--
gatchat/gatchat.c | 13 +++++--------
plugins/bluez4.c | 7 +++----
plugins/smart-messaging.c | 6 ++----
src/cbs.c | 27 +++++++++------------------
src/cdma-smsutil.c | 3 +--
src/handsfree.c | 3 +--
src/modem.c | 6 ++----
src/network.c | 3 +--
src/phonebook.c | 24 ++++++++++++++----------
src/sim.c | 29 ++++++++++-------------------
src/simfs.c | 6 +++---
src/simutil.c | 6 ++----
src/sms.c | 9 +++------
src/smsutil.c | 21 +++++++--------------
src/stk.c | 10 +++++++---
src/stkutil.c | 39 ++++++++++++---------------------------
src/ussd.c | 10 +++++-----
src/voicecall.c | 7 ++-----
unit/test-sms.c | 21 +++++++--------------
24 files changed, 104 insertions(+), 170 deletions(-)
--
1.9.1
4 years, 11 months
[PATCH] Radio-setting: Add GSM and UMTS band
by Samrat Guha Niyogi
From: Antara Borwankar <antara.borwankar(a)gmail.com>
To add GSM band and UMTS band to persitent data
---
src/radio-settings.c | 107 +++++++++++++++++++++++++++++++++++----------------
1 file changed, 73 insertions(+), 34 deletions(-)
diff --git a/src/radio-settings.c b/src/radio-settings.c
index 7bbd811..4ef0181 100644
--- a/src/radio-settings.c
+++ b/src/radio-settings.c
@@ -72,7 +72,7 @@ static const char *radio_access_mode_to_string(enum ofono_radio_access_mode m)
case OFONO_RADIO_ACCESS_MODE_LTE:
return "lte";
default:
- return "";
+ return NULL;
}
}
@@ -114,7 +114,7 @@ static const char *radio_band_gsm_to_string(enum ofono_radio_band_gsm band)
return "1900";
}
- return "";
+ return NULL;
}
static gboolean radio_band_gsm_from_string(const char *str,
@@ -160,7 +160,7 @@ static const char *radio_band_umts_to_string(enum ofono_radio_band_umts band)
return "2100";
}
- return "";
+ return NULL;
}
static gboolean radio_band_umts_from_string(const char *str,
@@ -311,6 +311,12 @@ static void radio_set_band(struct ofono_radio_settings *rs)
OFONO_RADIO_SETTINGS_INTERFACE,
"GsmBand", DBUS_TYPE_STRING,
&str_band);
+
+ if (rs->settings) {
+ g_key_file_set_integer(rs->settings, SETTINGS_GROUP,
+ "GsmBand", rs->band_gsm);
+ storage_sync(rs->imsi, SETTINGS_STORE, rs->settings);
+ }
}
if (rs->band_umts != rs->pending_band_umts) {
@@ -321,8 +327,13 @@ static void radio_set_band(struct ofono_radio_settings *rs)
OFONO_RADIO_SETTINGS_INTERFACE,
"UmtsBand", DBUS_TYPE_STRING,
&str_band);
+
+ if (rs->settings) {
+ g_key_file_set_integer(rs->settings, SETTINGS_GROUP,
+ "UmtsBand", rs->band_umts);
+ storage_sync(rs->imsi, SETTINGS_STORE, rs->settings);
+ }
}
-
}
static void radio_band_set_callback(const struct ofono_error *error,
@@ -368,6 +379,12 @@ static void radio_set_rat_mode(struct ofono_radio_settings *rs,
OFONO_RADIO_SETTINGS_INTERFACE,
"TechnologyPreference",
DBUS_TYPE_STRING, &str_mode);
+
+ if (rs->settings) {
+ g_key_file_set_integer(rs->settings, SETTINGS_GROUP,
+ "TechnologyPreference", rs->mode);
+ storage_sync(rs->imsi, SETTINGS_STORE, rs->settings);
+ }
}
static void radio_mode_set_callback(const struct ofono_error *error, void *data)
@@ -578,15 +595,7 @@ static DBusMessage *radio_set_property(DBusConnection *conn, DBusMessage *msg,
rs->pending_mode = mode;
rs->driver->set_rat_mode(rs, mode, radio_mode_set_callback, rs);
-
- if (rs->settings) {
- const char *mode_str;
- mode_str = radio_access_mode_to_string(mode);
- g_key_file_set_string(rs->settings, SETTINGS_GROUP,
- "TechnologyPreference", mode_str);
- storage_sync(rs->imsi, SETTINGS_STORE, rs->settings);
- }
-
+ /* will be saved in radiosettng on success response*/
return NULL;
} else if (g_strcmp0(property, "GsmBand") == 0) {
const char *value;
@@ -610,7 +619,7 @@ static DBusMessage *radio_set_property(DBusConnection *conn, DBusMessage *msg,
rs->driver->set_band(rs, band, rs->band_umts,
radio_band_set_callback, rs);
-
+ /* will be saved in radiosettng on success response*/
return NULL;
} else if (g_strcmp0(property, "UmtsBand") == 0) {
const char *value;
@@ -634,7 +643,7 @@ static DBusMessage *radio_set_property(DBusConnection *conn, DBusMessage *msg,
rs->driver->set_band(rs, rs->band_gsm, band,
radio_band_set_callback, rs);
-
+ /* will be saved in radiosettng on success response*/
return NULL;
} else if (g_strcmp0(property, "FastDormancy") == 0) {
dbus_bool_t value;
@@ -804,12 +813,22 @@ static void radio_mode_set_callback_at_reg(const struct ofono_error *error,
*/
ofono_radio_finish_register(rs);
}
+static void radio_band_set_callback_at_reg(const struct ofono_error *error,
+ void *data)
+{
+ if (error->type != OFONO_ERROR_TYPE_NO_ERROR)
+ DBG("Error setting radio access mode register time");
+ /*
+ * Continue with atom register even if request fail at modem
+ * ofono_radio_finish_register called by radio_mode_set_callback_at_reg
+ */
+}
static void radio_load_settings(struct ofono_radio_settings *rs,
const char *imsi)
{
GError *error;
- char *strmode;
+ gboolean issync = TRUE;
rs->settings = storage_open(imsi, SETTINGS_STORE);
@@ -820,34 +839,48 @@ static void radio_load_settings(struct ofono_radio_settings *rs,
if (rs->settings == NULL) {
DBG("radiosetting storage open failed");
rs->mode = OFONO_RADIO_ACCESS_MODE_ANY;
+ rs->band_gsm = OFONO_RADIO_BAND_GSM_ANY;
+ rs->band_umts = OFONO_RADIO_BAND_UMTS_ANY;
return;
}
rs->imsi = g_strdup(imsi);
error = NULL;
- strmode = g_key_file_get_string(rs->settings, SETTINGS_GROUP,
- "TechnologyPreference", &error);
-
- if (error) {
- g_error_free(error);
- goto setdefault;
+ rs->band_gsm = g_key_file_get_integer(rs->settings, SETTINGS_GROUP,
+ "GsmBand", &error);
+
+ if (error || radio_band_gsm_to_string(rs->band_gsm) == NULL) {
+ rs->band_gsm = OFONO_RADIO_BAND_GSM_ANY;
+ issync = FALSE;
+ g_key_file_set_integer(rs->settings, SETTINGS_GROUP,
+ "GsmBand", rs->band_gsm);
}
-
- if (radio_access_mode_from_string(strmode, &rs->mode) == FALSE) {
- DBG("Invalid rat mode in storage; Setting default");
- goto setdefault;
+
+ error = NULL;
+ rs->band_umts = g_key_file_get_integer(rs->settings, SETTINGS_GROUP,
+ "UmtsBand", &error);
+
+ if (error || radio_band_umts_to_string(rs->band_umts) == NULL) {
+ rs->band_umts = OFONO_RADIO_BAND_UMTS_ANY;
+ issync = FALSE;
+ g_key_file_set_integer(rs->settings, SETTINGS_GROUP,
+ "UmtsBand", rs->band_umts);
}
- g_free(strmode);
- return;
+ error = NULL;
+ rs->mode = g_key_file_get_integer(rs->settings, SETTINGS_GROUP,
+ "TechnologyPreference", &error);
-setdefault:
- rs->mode = OFONO_RADIO_ACCESS_MODE_ANY;
- g_key_file_set_string(rs->settings, SETTINGS_GROUP,
- "TechnologyPreference", "any");
- storage_sync(rs->imsi, SETTINGS_STORE, rs->settings);
- g_free(strmode);
+ if (error || radio_access_mode_to_string(rs->mode) == NULL) {
+ rs->mode = OFONO_RADIO_ACCESS_MODE_ANY;
+ issync = FALSE;
+ g_key_file_set_integer(rs->settings, SETTINGS_GROUP,
+ "TechnologyPreference", rs->mode);
+ }
+
+ if(issync == FALSE)
+ storage_sync(rs->imsi, SETTINGS_STORE, rs->settings);
}
void ofono_radio_settings_register(struct ofono_radio_settings *rs)
@@ -860,6 +893,12 @@ void ofono_radio_settings_register(struct ofono_radio_settings *rs)
radio_load_settings(rs, ofono_sim_get_imsi(sim));
+ if (rs->driver->set_band == NULL)
+ goto finish;
+
+ rs->driver->set_band(rs, rs->band_gsm, rs->band_umts,
+ radio_band_set_callback_at_reg, rs);
+
if (rs->driver->set_rat_mode == NULL)
goto finish;
--
1.9.1
4 years, 11 months
Re: Ublox Toby Modem
by Yorn
+ adding ofono mailinglist as it may be of interest
Point is, that I am trying to run the u-blox on ofono+connman and
had/have some questions regarding the setup.
I compiled the git version of the ofono for a freescale vf610 board with
an onboard ublox usb adapter and got quite far.
A manual setup on pppd+peer+provider+chat script gave me a clean
internet connection.
Now I want to integrate that with ofono/connman. I got ofono finding the
module, advertise it as a cellular technology to connman, but no service
is showing up.
I will go on setting up the umts high throughput profile.
So the rest of the story can be found below!
@Dragos:
without any changes, I got
lsusb:
1546:1146 U-Blox AG (which is high performance?)
online modem runs without any complains, but without any changes
root@colibri-vf:~/test# ./online-modem
Setting modem /ublox_0 online...
BR - Yorn (Jörn)
Am 20.04.2016 um 15:16 schrieb Dragos Tatulea:
> Hi Jörn,
>
> Can we take this discussion to the connman/ofono ml? Other people
> might find this useful.
>
> On 04/20/2016 03:01 PM, Jörn wrote:
>> Hi Dragos,
>>
>> I got python to work for the test scripts, this is what it gave [1]. I believe I am just a minute away ..
>>
> Good.
>
>> I got the connection up and running on a manual (old fassioned) way with pppd, chat and provider script. However I am not an expert on ofono/connman yet (but trying hard ...).
>>
>> I firstly wanted to use 2g/3g with high performance mode (as I saw your effort has been put on this point, right?). I am rather not sure, how to configure that without having a connman service.
> The AT Commands Examples [1] documents that (USB configuration section).
> You should change the mode manually. A successful set will yield the
> following ids from lsusb:
>
> 1546:1140 U-Blox AG
>
>
>> BR - Jörn
>>
>> [1]
>> root@colibri-vf:~/test# ./activate-context
>> Error activating /ublox_0/context1: org.ofono.Error.NotAttached: GPRS is not attached
>> root@colibri-vf:~/test# ./list-contexts
>> [ /ublox_0 ]
>> [ /ublox_0/context1 ]
>> Username =
>> AuthenticationMethod = chap
>> Protocol = ip
>> Name = Internet
>> Settings = { }
>> IPv6.Settings = { }
>> Active = 0
>> AccessPointName =
>> Password =
>> Type = internet
>>
>> root@colibri-vf:~/test# ./list-modems
>> [ /ublox_0 ]
>> Features = net gprs sim
>> Emergency = 0
>> Powered = 1
>> Lockdown = 0
>> Interfaces = org.ofono.NetworkRegistration org.ofono.ConnectionManager org.ofono.SimManager
>> Online = 1
>> Model = TOBY-L210
>> Revision = 09.71
>> Type = hardware
>> Serial = 352255060097262
>> Manufacturer = u-blox
>> [ org.ofono.NetworkRegistration ]
>> Status = roaming
>> Strength = 60
>> Name = Tele2 M2M (E-Plus)
>> LocationAreaCode = 0
>> Mode = auto
>> MobileCountryCode = 262
>> Technology = hspa
>> CellId = 16
>> MobileNetworkCode = 03
>> [ org.ofono.ConnectionManager ]
>> Powered = 1
>> Attached = 0
>> Bearer = none
>> RoamingAllowed = 0
>> [ org.ofono.SimManager ]
>> ServiceProviderName = Tele2 M2M
>> Retries = [pin2 = 3] [puk2 = 10] [pin = 3] [puk = 10]
>> MobileCountryCode = 240
>> FixedDialing = 0
>> SubscriberNumbers =
>> PreferredLanguages = en
>> BarredDialing = 0
>> CardIdentifier = 89462046051001005763
>> LockedPins =
>> MobileNetworkCode = 07
>> SubscriberIdentity = 240075810199181
>> Present = 1
>> PinRequired = none
>>
>>
> Hmm, not sure what the roaming state is. But it looks like it's not yet
> ready to attach the gprs context (Attached is not yet 1).
>
> Can you try running online-modem script? Maybe it will work.
>
>>
>> Am 20.04.2016 um 12:59 schrieb Dragos Tatulea:
>>> Hi Jörn,
>>>
>>> On 04/20/2016 12:02 PM, Jörn wrote:
>>>> Hi Dragos,
>>>>
>>>> thanks for your quick reply!
>>>>
>>>> What I did is the following:
>>>>
>>>> connmanctl> enable cellular
>>>> Error cellular: Already enabled <- due to the second time
>>>> cconnmanctl> technologies
>>>> /net/connman/technology/cellular
>>>> Name = Cellular
>>>> Type = cellular
>>>> Powered = True
>>>> Connected = False
>>>> Tethering = False
>>>> /net/connman/technology/ethernet
>>>> Name = Wired
>>>> Type = ethernet
>>>> Powered = True
>>>> Connected = True
>>>> Tethering = False
>>>> connmanctl> services
>>>> *AO Wired ethernet_00142d4ac28f_cable
>>>>
>>>> Is there something else to activate?
>>>>
>>>> I am actually trying to transfer the python test scripts to my embedded system, but there is no python3 available on open embedded, and so I do not have dbus access from there :(.
>>>>
>>> The python scripts are really useful. Especially to investigate the state
>>> of oFono. See list-modems and list-contexts.
>>>
>>>> I am not sure, what a context is...
>>>>
>>> A context is oFono's concept of a "connection to internet" :). For 2/3G there
>>> are 3 states to enable the internet connection:
>>> * enable the modem (done by connman in your case)
>>> * register to the network (might be done by connman, list-modems will
>>> help you debug that)
>>> * activate context (sometimes done by connman, list-contexts will
>>> tell you the state of the context)
>>>
>>>
>>>> BR - Jörn
>>>>
>>>>
>>>> Am 20.04.2016 um 11:20 schrieb Dragos Tatulea:
>>>>> Hi Jörn,
>>>>>
>>>>> On 04/20/2016 09:44 AM, Jörn wrote:
>>>>>> Hi Dragos
>>>>>>
>>>>>> I saw, you wrote some code for the toby ublox modem on ofono.
>>>>>> I am actually setting up an embedded system using that modem and got some issues with the latest ofono git and connman.
>>>>>>
>>>>>> The ofono deamon seem to recognize the modem and connman shows the cellular technologie but there is no service shown on connman.
>>>>>>
>>>>> Are you using LTE or 2/3G? If 2/3G, did you activate the context? Connman
>>>>> will create a service for every activated context.
>>>>>
>>> So, are you using LTE or 2/3G? And also, which version of Toby are you
>>> using and in which mode (high throughput, fairly compatible or backward
>>> compatible). We used only high throughput mode so far.
>>>
>>> Thanks
> Once again, let's move the discussion to the mailing list please.
>
> [1] - https://www.u-blox.com/sites/default/files/AT-CommandsExamples_AppNote_(U...
>
> Thanks
4 years, 11 months
[PATCH] plugins/ril: Move GPRS atom creating to 'post_online' state
by caiwen.zhang@intel.com
From: Caiwen Zhang <caiwen.zhang(a)intel.com>
At gprs atom 'probe' state, max cid query may fail due to rild
status isn't RADIO_STATUS_ON. It causes gprs atom is removed, gprs
feature is inavailable. Move gprs atom creating to 'post_online'
state to make sure rild status is RADIO_STATUS_ON when query max
cid.
---
plugins/ril.c | 36 +++++++++++++++++-------------------
1 file changed, 17 insertions(+), 19 deletions(-)
diff --git a/plugins/ril.c b/plugins/ril.c
index ea50d76..b66664a 100644
--- a/plugins/ril.c
+++ b/plugins/ril.c
@@ -215,8 +215,6 @@ void ril_pre_sim(struct ofono_modem *modem)
void ril_post_sim(struct ofono_modem *modem)
{
struct ril_data *rd = ofono_modem_get_data(modem);
- struct ofono_gprs *gprs;
- struct ofono_gprs_context *gc;
struct ofono_message_waiting *mw;
/* TODO: this function should setup:
@@ -226,23 +224,6 @@ void ril_post_sim(struct ofono_modem *modem)
*/
ofono_sms_create(modem, rd->vendor, RILMODEM, rd->ril);
- gprs = ofono_gprs_create(modem, rd->vendor, RILMODEM, rd->ril);
- gc = ofono_gprs_context_create(modem, rd->vendor, RILMODEM, rd->ril);
-
- if (gc) {
- ofono_gprs_context_set_type(gc,
- OFONO_GPRS_CONTEXT_TYPE_INTERNET);
- ofono_gprs_add_context(gprs, gc);
- }
-
- gc = ofono_gprs_context_create(modem, rd->vendor, RILMODEM, rd->ril);
-
- if (gc) {
- ofono_gprs_context_set_type(gc,
- OFONO_GPRS_CONTEXT_TYPE_MMS);
- ofono_gprs_add_context(gprs, gc);
- }
-
mw = ofono_message_waiting_create(modem);
if (mw)
ofono_message_waiting_register(mw);
@@ -255,11 +236,28 @@ void ril_post_sim(struct ofono_modem *modem)
void ril_post_online(struct ofono_modem *modem)
{
struct ril_data *rd = ofono_modem_get_data(modem);
+ struct ofono_gprs *gprs;
+ struct ofono_gprs_context *gc;
ofono_netreg_create(modem, rd->vendor, RILMODEM, rd->ril);
ofono_ussd_create(modem, rd->vendor, RILMODEM, rd->ril);
ofono_call_settings_create(modem, rd->vendor, RILMODEM, rd->ril);
ofono_call_barring_create(modem, rd->vendor, RILMODEM, rd->ril);
+ gprs = ofono_gprs_create(modem, rd->vendor, RILMODEM, rd->ril);
+ gc = ofono_gprs_context_create(modem, rd->vendor, RILMODEM, rd->ril);
+
+ if (gc) {
+ ofono_gprs_context_set_type(gc,
+ OFONO_GPRS_CONTEXT_TYPE_INTERNET);
+ ofono_gprs_add_context(gprs, gc);
+ }
+
+ gc = ofono_gprs_context_create(modem, rd->vendor, RILMODEM, rd->ril);
+
+ if (gc) {
+ ofono_gprs_context_set_type(gc, OFONO_GPRS_CONTEXT_TYPE_MMS);
+ ofono_gprs_add_context(gprs, gc);
+ }
}
static void ril_set_online_cb(struct ril_msg *message, gpointer user_data)
--
1.9.1
4 years, 12 months
[PATCH] voicecall: fix CreateMultiparty method introspection
by John Ernberg
From: John Ernberg <john.ernberg(a)actia.se>
This caused problems with stricter dbus wrappers such as dbus-c++.
---
src/voicecall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/voicecall.c b/src/voicecall.c
index 2d15d12..bdad125 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -2165,7 +2165,7 @@ static const GDBusMethodTable manager_methods[] = {
GDBUS_ARGS({ "calls", "ao" }),
multiparty_private_chat) },
{ GDBUS_ASYNC_METHOD("CreateMultiparty",
- NULL, GDBUS_ARGS({ "calls", "o" }),
+ NULL, GDBUS_ARGS({ "calls", "ao" }),
multiparty_create) },
{ GDBUS_ASYNC_METHOD("HangupMultiparty", NULL, NULL,
multiparty_hangup) },
--
1.9.1
4 years, 12 months