ofono fails to compile on gcc-6.3
by Pavel Machek
Hi!
I'm getting this:
CC drivers/rilmodem/network-registration.o
drivers/rilmodem/network-registration.c:40:32: error: unknown option
after ‘#pragma GCC diagnostic’ kind [-Werror=pragmas]
#pragma GCC diagnostic ignored "-Wrestrict"
cc1: error: unrecognized command line option ‘-Wno-format-truncation’
[-Werror]
cc1: all warnings being treated as errors
I commented out #pragma, and this allows compilation to
continue... until I hit same issue in
drivers/rilmodem/call-forwarding.c:41:32:
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
2 years
commit d37c22be20c83cf370638a9bad243bc5219c5509
by Giacinto Cifelli
Dear Denis, Marcel,
was it necessary to remove entirely the NEED_THREADS flag?
I was going to use it in the Gemalto driver, to speed up the device
recognition, because for some modules it is hit and miss.
But only as an optional feature, because in some systems it might be
missing.
Also, for some high-speed modems which take long to boot, there is a
potential critical race in the recognition that the use threads can solve
easily. The alternative is to increase the internal timers a lot.
I likely need to add a new flag for it.
Best Regards,
Giacinto
2 years, 4 months
[PATCH] sms: allow sms send for EUTRAN sms only state
by Anirudh Gargi
Patch to be considered, if support for EUTRAN SMS states accepted.
SMS registered flag while sending sms to consider the new EUTRAN
registered status also.
---
src/sms.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/sms.c b/src/sms.c
index b86158e..c604e05 100644
--- a/src/sms.c
+++ b/src/sms.c
@@ -782,6 +782,8 @@ static void netreg_status_watch(int status, int lac, int ci, int tech,
switch (status) {
case NETWORK_REGISTRATION_STATUS_REGISTERED:
case NETWORK_REGISTRATION_STATUS_ROAMING:
+ case NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN:
+ case NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN:
sms->registered = TRUE;
break;
default:
--
2.7.4
2 years, 4 months
[PATCH] network: add support eutran sms only states
by Anirudh Gargi
EUTRAN SMS states mapped to registered and roaming respectively.
For the new CREG status (9/10) of CREG, it can be map to a new Dbus
CSFB property.
Added clarity in API doc for voice calling in case of lte.
---
doc/network-api.txt | 4 +++-
src/common.c | 4 ++++
src/common.h | 19 +++++++++++++------
3 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/doc/network-api.txt b/doc/network-api.txt
index 83a2bc0..9c367c7 100644
--- a/doc/network-api.txt
+++ b/doc/network-api.txt
@@ -77,7 +77,9 @@ Properties string Mode [readonly]
string Status [readonly]
- The current registration status of a modem.
+ The current registration status of a modem. In case
+ technology is 'lte', 'registered' and 'roaming' may
+ not necessarily mean voice calling available.
The possible values are:
"unregistered" Not registered to any network
diff --git a/src/common.c b/src/common.c
index 3ccaf7c..0db412a 100644
--- a/src/common.c
+++ b/src/common.c
@@ -669,6 +669,10 @@ const char *registration_status_to_string(int status)
return "unknown";
case NETWORK_REGISTRATION_STATUS_ROAMING:
return "roaming";
+ case NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN:
+ return "registered";
+ case NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN:
+ return "roaming";
}
return "";
diff --git a/src/common.h b/src/common.h
index 1b6b01d..f7bd3cb 100644
--- a/src/common.h
+++ b/src/common.h
@@ -37,12 +37,19 @@ enum access_technology {
/* 27.007 Section 7.2 <stat> */
enum network_registration_status {
- NETWORK_REGISTRATION_STATUS_NOT_REGISTERED = 0,
- NETWORK_REGISTRATION_STATUS_REGISTERED = 1,
- NETWORK_REGISTRATION_STATUS_SEARCHING = 2,
- NETWORK_REGISTRATION_STATUS_DENIED = 3,
- NETWORK_REGISTRATION_STATUS_UNKNOWN = 4,
- NETWORK_REGISTRATION_STATUS_ROAMING = 5,
+ NETWORK_REGISTRATION_STATUS_NOT_REGISTERED = 0,
+ NETWORK_REGISTRATION_STATUS_REGISTERED = 1,
+ NETWORK_REGISTRATION_STATUS_SEARCHING = 2,
+ NETWORK_REGISTRATION_STATUS_DENIED = 3,
+ NETWORK_REGISTRATION_STATUS_UNKNOWN = 4,
+ NETWORK_REGISTRATION_STATUS_ROAMING = 5,
+ NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN = 6,
+ NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN = 7,
+ /*
+ * Add along with new CSFB Dbus property.
+ NETWORK_REGISTRATION_STATUS_REGISTERED_NO_CSFB_EUTRAN = 9,
+ NETWORK_REGISTRATION_STATUS_ROAMING_NO_CSFB_EUTRAN = 10,
+ */
};
/* 27.007 Section 7.3 <stat> */
--
2.7.4
2 years, 4 months
status
by Giacinto Cifelli
Hi Denis, Marcel,
so far you have accepted minor adjustments here and there, rejected the
gemaltomodem/location-reporting, gave very useful comments on the
gemaltomodem/voicecall atom. On top of it, I have some homework to find out
which call of the option linux kernel is blocking for 30/60 seconds.
For the gemaltomodem/gprs-context, it is not clear how to proceed. Would
you kindly give some suggestion other than "these modules don't exist in my
world"?
Also, I would like to know where do we stand with the following, on which I
have seen no commments at all:
from the 23.09.2018:
atmodem/gprs: added LTE and NR indicators - absolutely needed to handle
IMC stacks
atmodem/gprs: added autoattach handling - needed to avoid ofono
self-destruction
atmodem/gprs: initial Gemalto vendor - on top of the previous ones
from the 25.09.2018:
4 patches for the OFONO_GPRS_AUTH_METHOD_NONE.
Here I need to know if you are willing to do it or not. The initial answer
was permissive, but then I have the impression you changed your mind.
Thank you,
best regards,
Giacinto
2 years, 5 months
[PATCH] atmodem/gprs: added LTE and NR indicators
by Giacinto Cifelli
According to the 27.007 CGREG (both as URC and command) is no longer
sufficient to determine the registration state.
New indicators: CEREG for LTE, C5GREG for NR/5G are introduced.
In practice, legacy modems have CGREG, LTE-only modems have CEREG, and
several others have both.
With NR the picture will become even larger.
The handling of these indicators is not straighforward, because each
will report the status in its own access technology. So we might have
CGREG=4 but CEREG=1. Therefore they must be checked together.
Particularly troublesome is the case of the URC. In case of hand-over,
for example for a CSFB call, a common case is to have '+CEREG: 4'
followed by '+CGREG: 1'. The first URC must be discarded, and this is
done checking the technology reported by 'AT+COPS?' after the URC is
received, in case the status is different from 1 or 5 (to be done:
add the check for other roaming states for NR once the first modems are
available). Note that according to the 27.007 CREG does not apply to PS
networks, so it cannot be reliably used.
If COPS does not report a technology or reports the same technology,
we take the indicator.
Similar handling for AT+CGREG?, AT+CEREG?, AT+C5GREG? : we take the
best result.
An initial verification for the presence of any of these indicators is
required. Also how many of them are available is needed information.
---
drivers/atmodem/gprs.c | 420 +++++++++++++++++++++++++++++++++++------
1 file changed, 364 insertions(+), 56 deletions(-)
diff --git a/drivers/atmodem/gprs.c b/drivers/atmodem/gprs.c
index df37d05f..6e01738a 100644
--- a/drivers/atmodem/gprs.c
+++ b/drivers/atmodem/gprs.c
@@ -4,6 +4,7 @@
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
* Copyright (C) 2010 ST-Ericsson AB.
+ * Copyright (C) 2018 Gemalto M2M
*
* 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
@@ -35,6 +36,7 @@
#include <ofono/log.h>
#include <ofono/modem.h>
#include <ofono/gprs.h>
+#include <common.h>
#include "gatchat.h"
#include "gatresult.h"
@@ -43,6 +45,8 @@
#include "vendor.h"
static const char *cgreg_prefix[] = { "+CGREG:", NULL };
+static const char *cereg_prefix[] = { "+CEREG:", NULL };
+static const char *c5greg_prefix[] = { "+C5GREG:", NULL };
static const char *cgdcont_prefix[] = { "+CGDCONT:", NULL };
static const char *none_prefix[] = { NULL };
@@ -51,7 +55,22 @@ struct gprs_data {
unsigned int vendor;
unsigned int last_auto_context_id;
gboolean telit_try_reattach;
+ gboolean has_cgreg;
+ gboolean has_cereg;
+ gboolean has_c5greg;
+ gboolean nb_inds;
int attached;
+ int cgreg_status;
+ int cereg_status;
+ int c5greg_status;
+};
+
+struct netreg_info {
+ struct ofono_gprs *gprs;
+ struct gprs_data *gd;
+ const char *ind;
+ int status;
+ int bearer;
};
static void at_cgatt_cb(gboolean ok, GAtResult *result, gpointer user_data)
@@ -92,21 +111,101 @@ static void at_cgreg_cb(gboolean ok, GAtResult *result, gpointer user_data)
struct ofono_error error;
int status;
struct gprs_data *gd = cbd->user;
+ gboolean last = !(gd->has_cereg || gd->has_c5greg);
decode_at_error(&error, g_at_result_final_response(result));
if (!ok) {
- cb(&error, -1, cbd->data);
- return;
+ status = -1;
+ goto end;
}
if (at_util_parse_reg(result, "+CGREG:", NULL, &status,
NULL, NULL, NULL, gd->vendor) == FALSE) {
- CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
- return;
+ error.type = OFONO_ERROR_TYPE_FAILURE;
+ error.error = 0;
+ status = -1;
+ goto end;
+ }
+
+end:
+ gd->cgreg_status = status;
+
+ if (last)
+ cb(&error, status, cbd->data);
+}
+
+static void at_cereg_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_gprs_status_cb_t cb = cbd->cb;
+ struct ofono_error error;
+ int status;
+ struct gprs_data *gd = cbd->user;
+ gboolean last = !gd->has_c5greg;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ if (!ok) {
+ status = -1;
+ goto end;
+ }
+
+ if (at_util_parse_reg(result, "+CEREG:", NULL, &status,
+ NULL, NULL, NULL, gd->vendor) == FALSE) {
+ error.type = OFONO_ERROR_TYPE_FAILURE;
+ error.error = 0;
+ status = -1;
+ goto end;
+ }
+
+end:
+ gd->cereg_status = status;
+
+ if (last) {
+
+ if (gd->cgreg_status == NETWORK_REGISTRATION_STATUS_DENIED ||
+ gd->cgreg_status == NETWORK_REGISTRATION_STATUS_REGISTERED)
+ cb(&error, gd->cgreg_status, cbd->data);
+ else
+ cb(&error, status, cbd->data);
}
+}
- cb(&error, status, cbd->data);
+static void at_c5greg_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_gprs_status_cb_t cb = cbd->cb;
+ struct ofono_error error;
+ int status;
+ struct gprs_data *gd = cbd->user;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ if (!ok) {
+ status = -1;
+ goto end;
+ }
+
+ if (at_util_parse_reg(result, "+C5GREG:", NULL, &status,
+ NULL, NULL, NULL, gd->vendor) == FALSE) {
+ error.type = OFONO_ERROR_TYPE_FAILURE;
+ error.error = 0;
+ status = -1;
+ goto end;
+ }
+
+end:
+ gd->c5greg_status = status;
+
+ if (gd->cgreg_status == NETWORK_REGISTRATION_STATUS_DENIED ||
+ gd->cgreg_status == NETWORK_REGISTRATION_STATUS_REGISTERED)
+ cb(&error, gd->cgreg_status, cbd->data);
+ else if (gd->cereg_status == NETWORK_REGISTRATION_STATUS_DENIED ||
+ gd->cereg_status == NETWORK_REGISTRATION_STATUS_REGISTERED)
+ cb(&error, gd->cereg_status, cbd->data);
+ else
+ cb(&error, status, cbd->data);
}
static void at_gprs_registration_status(struct ofono_gprs *gprs,
@@ -114,9 +213,6 @@ static void at_gprs_registration_status(struct ofono_gprs *gprs,
void *data)
{
struct gprs_data *gd = ofono_gprs_get_data(gprs);
- struct cb_data *cbd = cb_data_new(cb, data);
-
- cbd->user = gd;
switch (gd->vendor) {
case OFONO_VENDOR_GOBI:
@@ -137,13 +233,51 @@ static void at_gprs_registration_status(struct ofono_gprs *gprs,
break;
}
- if (g_at_chat_send(gd->chat, "AT+CGREG?", cgreg_prefix,
- at_cgreg_cb, cbd, g_free) > 0)
- return;
+ /*
+ * this is long: send all indicators, compare at the end if one reports
+ * attached and use it, otherwise report status for last indicator
+ * tested (higher technology).
+ * Note: AT+CGATT? is not good because doesn't tell us if we are roaming
+ */
+ if (gd->has_cgreg) {
+ struct cb_data *cbd = cb_data_new(cb, data);
+ cbd->user = gd;
+ gd->cgreg_status = -1; /* preset in case of fail of the at send */
+
+ /* g_at_chat_send fails only if g_new_try fails, so we stop */
+ if (g_at_chat_send(gd->chat, "AT+CGREG?", cgreg_prefix,
+ at_cgreg_cb, cbd, g_free) == 0) {
+ g_free(cbd);
+ CALLBACK_WITH_FAILURE(cb, -1, data);
+ return;
+ }
+ }
- g_free(cbd);
+ if (gd->has_cereg) {
+ struct cb_data *cbd = cb_data_new(cb, data);
+ cbd->user = gd;
+ gd->cereg_status = -1;
- CALLBACK_WITH_FAILURE(cb, -1, data);
+ if (g_at_chat_send(gd->chat, "AT+CEREG?", cereg_prefix,
+ at_cereg_cb, cbd, g_free) == 0) {
+ g_free(cbd);
+ CALLBACK_WITH_FAILURE(cb, -1, data);
+ return;
+ }
+ }
+
+ if (gd->has_c5greg) {
+ struct cb_data *cbd = cb_data_new(cb, data);
+ cbd->user = gd;
+ gd->c5greg_status = -1;
+
+ if (g_at_chat_send(gd->chat, "AT+C5GREG?", c5greg_prefix,
+ at_c5greg_cb, cbd, g_free) == 0) {
+ g_free(cbd);
+ CALLBACK_WITH_FAILURE(cb, -1, data);
+ return;
+ }
+ }
}
static void at_cgdcont_read_cb(gboolean ok, GAtResult *result,
@@ -188,14 +322,100 @@ static void at_cgdcont_read_cb(gboolean ok, GAtResult *result,
activated_cid);
}
+static int cops_cb(gboolean ok, GAtResult *result)
+{
+ GAtResultIter iter;
+ int format, tech = -1;
+
+ if (!ok)
+ goto error;
+
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "+COPS:"))
+ goto error;
+
+ g_at_result_iter_skip_next(&iter); /* mode: automatic, manual, ... */
+
+ if (!g_at_result_iter_next_number(&iter, &format))
+ goto error;
+
+ g_at_result_iter_skip_next(&iter); /* operator name or code */
+
+ if (!g_at_result_iter_next_number(&iter, &tech))
+ tech = -1; /* make sure it has not been set to something */
+error:
+ return tech;
+}
+
+
+static void netreg_notify_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct netreg_info *nri = user_data;
+ int cops_tech = cops_cb(ok, result);
+
+ if (cops_tech == -1) { /* take the indicator status */
+ ofono_gprs_status_notify(nri->gprs, nri->status);
+ return;
+ }
+
+ /*
+ * values taken from the 3GPP 27.007 rel.15
+ * matching enum access_technology in common.h up to 7.
+ */
+ if (g_str_equal(nri->ind,"CGREG") && (cops_tech < 7 || cops_tech == 8))
+ ofono_gprs_status_notify(nri->gprs, nri->status);
+ else if (g_str_equal(nri->ind,"CEREG") && (cops_tech == 7 ||
+ cops_tech == 9 || cops_tech == 12))
+ ofono_gprs_status_notify(nri->gprs, nri->status);
+ else if (g_str_equal(nri->ind,"C5GREG") && (cops_tech == 10 ||
+ cops_tech == 11 || cops_tech == 13))
+ ofono_gprs_status_notify(nri->gprs, nri->status);
+ /* all other cases ignored: indicator not for current AcT */
+}
+
+static void netreg_notify(struct ofono_gprs *gprs, const char* ind, int status,
+ int bearer)
+{
+ struct gprs_data *gd = ofono_gprs_get_data(gprs);
+ struct netreg_info *nri;
+
+ if (status == NETWORK_REGISTRATION_STATUS_DENIED ||
+ status == NETWORK_REGISTRATION_STATUS_REGISTERED ||
+ status == NETWORK_REGISTRATION_STATUS_ROAMING ||
+ gd->nb_inds == 1) {
+ /* accept this status and process */
+ ofono_gprs_status_notify(gprs, status);
+
+ if (bearer != -1)
+ ofono_gprs_bearer_notify(gprs, bearer);
+
+ return;
+ }
+
+ /*
+ * in this case nb_inds>1 && status not listed above
+ * we check AT+COPS? for a second opinion.
+ */
+
+ nri = g_new0(struct netreg_info, 1);
+ nri->gprs = gprs;
+ nri->gd = gd;
+ nri->ind = ind;
+ nri->status = status;
+ nri->bearer = bearer;
+ g_at_chat_send(gd->chat, "AT+COPS?", none_prefix, netreg_notify_cb,
+ nri, g_free);
+}
+
static void cgreg_notify(GAtResult *result, gpointer user_data)
{
struct ofono_gprs *gprs = user_data;
- int status;
struct gprs_data *gd = ofono_gprs_get_data(gprs);
+ int status, bearer;
- if (at_util_parse_reg_unsolicited(result, "+CGREG:", &status,
- NULL, NULL, NULL, gd->vendor) == FALSE)
+ if (!at_util_parse_reg_unsolicited(result, "+CGREG:", &status,
+ NULL, NULL, &bearer, gd->vendor) == FALSE)
return;
/*
@@ -220,7 +440,33 @@ static void cgreg_notify(GAtResult *result, gpointer user_data)
gd->telit_try_reattach = FALSE;
}
- ofono_gprs_status_notify(gprs, status);
+ netreg_notify(gprs, "CGREG", status, bearer);
+}
+
+static void cereg_notify(GAtResult *result, gpointer user_data)
+{
+ struct ofono_gprs *gprs = user_data;
+ struct gprs_data *gd = ofono_gprs_get_data(gprs);
+ int status, bearer;
+
+ if (!at_util_parse_reg_unsolicited(result, "+CEREG:", &status,
+ NULL, NULL, &bearer, gd->vendor) == FALSE)
+ return;
+
+ netreg_notify(gprs, "CEREG", status, bearer);
+}
+
+static void c5greg_notify(GAtResult *result, gpointer user_data)
+{
+ struct ofono_gprs *gprs = user_data;
+ struct gprs_data *gd = ofono_gprs_get_data(gprs);
+ int status, bearer;
+
+ if (!at_util_parse_reg_unsolicited(result, "+C5GREG:", &status,
+ NULL, NULL, &bearer, gd->vendor) == FALSE)
+ return;
+
+ netreg_notify(gprs, "C5GREG", status, bearer);
}
static void cgev_notify(GAtResult *result, gpointer user_data)
@@ -439,14 +685,37 @@ static void cpsb_notify(GAtResult *result, gpointer user_data)
ofono_gprs_bearer_notify(gprs, bearer);
}
-static void gprs_initialized(gboolean ok, GAtResult *result, gpointer user_data)
+static void gprs_initialized(struct ofono_gprs *gprs)
{
- struct ofono_gprs *gprs = user_data;
struct gprs_data *gd = ofono_gprs_get_data(gprs);
+ g_at_chat_send(gd->chat, "AT+CGAUTO=0", none_prefix, NULL, NULL,
+ NULL);
+
+ switch (gd->vendor) {
+ case OFONO_VENDOR_MBM:
+ /* Ericsson MBM and ST-E modems don't support AT+CGEREP=2,1 */
+ g_at_chat_send(gd->chat, "AT+CGEREP=1,0", none_prefix,
+ NULL, NULL, NULL);
+ break;
+ case OFONO_VENDOR_NOKIA:
+ /* Nokia data cards don't support AT+CGEREP=1,0 either */
+ g_at_chat_send(gd->chat, "AT+CGEREP=1", none_prefix,
+ NULL, NULL, NULL);
+ break;
+ default:
+ g_at_chat_send(gd->chat, "AT+CGEREP=2,1", none_prefix,
+ NULL, NULL, NULL);
+ break;
+ }
+
g_at_chat_register(gd->chat, "+CGEV:", cgev_notify, FALSE, gprs, NULL);
- g_at_chat_register(gd->chat, "+CGREG:", cgreg_notify,
- FALSE, gprs, NULL);
+ g_at_chat_register(gd->chat, "+CGREG:", cgreg_notify, FALSE, gprs,
+ NULL);
+ g_at_chat_register(gd->chat, "+CEREG:", cereg_notify, FALSE, gprs,
+ NULL);
+ g_at_chat_register(gd->chat, "+C5GREG:", c5greg_notify, FALSE, gprs,
+ NULL);
switch (gd->vendor) {
case OFONO_VENDOR_HUAWEI:
@@ -489,16 +758,33 @@ static void gprs_initialized(gboolean ok, GAtResult *result, gpointer user_data)
ofono_gprs_register(gprs);
}
-static void at_cgreg_test_cb(gboolean ok, GAtResult *result,
+static void set_indreg(struct gprs_data *gd, const char *ind, gboolean present)
+{
+ if (g_str_equal(ind,"CGREG"))
+ gd->has_cgreg = present;
+
+ if (g_str_equal(ind,"CEREG"))
+ gd->has_cereg = present;
+
+ if (g_str_equal(ind,"C5GREG"))
+ gd->has_c5greg = present;
+
+}
+
+static void at_indreg_test_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
- struct ofono_gprs *gprs = user_data;
+ struct cb_data *cbd = user_data;
+ struct ofono_gprs *gprs = cbd->cb;
+ const char *ind=cbd->data;
+ const char *last=cbd->user;
+
struct gprs_data *gd = ofono_gprs_get_data(gprs);
gint range[2];
GAtResultIter iter;
int cgreg1 = 0;
int cgreg2 = 0;
- const char *cmd;
+ char buf[32];
if (!ok)
goto error;
@@ -506,7 +792,8 @@ static void at_cgreg_test_cb(gboolean ok, GAtResult *result,
g_at_result_iter_init(&iter, result);
retry:
- if (!g_at_result_iter_next(&iter, "+CGREG:"))
+ sprintf(buf,"+%s:",ind);
+ if (!g_at_result_iter_next(&iter, buf))
goto error;
if (!g_at_result_iter_open_list(&iter))
@@ -521,45 +808,69 @@ retry:
g_at_result_iter_close_list(&iter);
- if (cgreg2)
- cmd = "AT+CGREG=2";
- else if (cgreg1)
- cmd = "AT+CGREG=1";
- else
+ if (cgreg1) {
+ sprintf(buf,"AT+%s=1", ind);
+ } else if (cgreg2) {
+ sprintf(buf,"AT+%s=2", ind);
+ } else
goto error;
- g_at_chat_send(gd->chat, cmd, none_prefix, NULL, NULL, NULL);
- g_at_chat_send(gd->chat, "AT+CGAUTO=0", none_prefix, NULL, NULL, NULL);
-
- switch (gd->vendor) {
- case OFONO_VENDOR_MBM:
- /* Ericsson MBM and ST-E modems don't support AT+CGEREP=2,1 */
- g_at_chat_send(gd->chat, "AT+CGEREP=1,0", none_prefix,
- gprs_initialized, gprs, NULL);
- break;
- case OFONO_VENDOR_NOKIA:
- /* Nokia data cards don't support AT+CGEREP=1,0 either */
- g_at_chat_send(gd->chat, "AT+CGEREP=1", none_prefix,
- gprs_initialized, gprs, NULL);
- break;
- default:
- g_at_chat_send(gd->chat, "AT+CGEREP=2,1", none_prefix,
- gprs_initialized, gprs, NULL);
- break;
- }
+ set_indreg(gd, ind,TRUE);
+ g_at_chat_send(gd->chat, buf, none_prefix, NULL, NULL, NULL);
+ if (last)
+ goto endcheck;
return;
error:
- ofono_info("GPRS not supported on this device");
- ofono_gprs_remove(gprs);
+ set_indreg(gd, ind,FALSE);
+ if (!last)
+ return;
+
+endcheck:
+ if (gd->has_cgreg)
+ gd->nb_inds++;
+ if (gd->has_cereg)
+ gd->nb_inds++;
+ if (gd->has_c5greg)
+ gd->nb_inds++;
+
+ if (gd->nb_inds == 0) {
+ ofono_info("GPRS not supported on this device");
+ ofono_gprs_remove(gprs);
+ return;
+ }
+
+ gprs_initialized(gprs);
+}
+
+static void test_and_set_regstatus(struct ofono_gprs *gprs) {
+ struct gprs_data *gd = ofono_gprs_get_data(gprs);
+ struct cb_data *cbd_cg = cb_data_new(gprs, "CGREG");
+ struct cb_data *cbd_ce = cb_data_new(gprs, "CEREG");
+ struct cb_data *cbd_c5g = cb_data_new(gprs, "C5GREG");
+
+ cbd_c5g->user="last";
+
+ /*
+ * modules can support one to all of the network registration indicators
+ *
+ * ofono will execute the next commands and related callbacks in order
+ * therefore it is possible to verify all result on the last one.
+ */
+
+ g_at_chat_send(gd->chat, "AT+CGREG=?", cgreg_prefix,
+ at_indreg_test_cb, cbd_cg, g_free);
+ g_at_chat_send(gd->chat, "AT+CEREG=?", cereg_prefix,
+ at_indreg_test_cb, cbd_ce, g_free);
+ g_at_chat_send(gd->chat, "AT+C5GREG=?", c5greg_prefix,
+ at_indreg_test_cb, cbd_c5g, g_free);
}
static void at_cgdcont_test_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct ofono_gprs *gprs = user_data;
- struct gprs_data *gd = ofono_gprs_get_data(gprs);
GAtResultIter iter;
int min, max;
const char *pdp_type;
@@ -600,10 +911,7 @@ static void at_cgdcont_test_cb(gboolean ok, GAtResult *result,
goto error;
ofono_gprs_set_cid_range(gprs, min, max);
-
- g_at_chat_send(gd->chat, "AT+CGREG=?", cgreg_prefix,
- at_cgreg_test_cb, gprs, NULL);
-
+ test_and_set_regstatus(gprs);
return;
error:
--
2.17.1
2 years, 5 months
[PATCH] atmodem/gprs: added autoattach handling
by Giacinto Cifelli
In case of LTE modem, attaching manually is normally unneeded.
Forcing a detach (in case of gprs-context activation failure) is
actually a mistake, also because this will also trigger a technology
reselection and a possible invalid state, especially for LTE-only
modems.
This simple patch adds a flag to skip the AT+CGATT=x command.
The flag is to be set by vendor-specific options.
By default the behavior remains unchanged.
---
drivers/atmodem/gprs.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/atmodem/gprs.c b/drivers/atmodem/gprs.c
index 6e01738a..fc0d8aa3 100644
--- a/drivers/atmodem/gprs.c
+++ b/drivers/atmodem/gprs.c
@@ -59,6 +59,7 @@ struct gprs_data {
gboolean has_cereg;
gboolean has_c5greg;
gboolean nb_inds;
+ gboolean auto_attach; /* for LTE modems & co */
int attached;
int cgreg_status;
int cereg_status;
@@ -88,9 +89,15 @@ static void at_gprs_set_attached(struct ofono_gprs *gprs, int attached,
ofono_gprs_cb_t cb, void *data)
{
struct gprs_data *gd = ofono_gprs_get_data(gprs);
- struct cb_data *cbd = cb_data_new(cb, data);
+ struct cb_data *cbd;
char buf[64];
+ if (gd->auto_attach) {
+ CALLBACK_WITH_SUCCESS(cb, data);
+ return;
+ }
+
+ cbd = cb_data_new(cb, data);
snprintf(buf, sizeof(buf), "AT+CGATT=%i", attached ? 1 : 0);
if (g_at_chat_send(gd->chat, buf, none_prefix,
--
2.17.1
2 years, 5 months
[PATCH] sms: add regional support for 2 languages
by Nandini Rebello
Adding support for Bengali and Gujrati for GSM 7bit SMS.
More languages to follow on similar style soon.
---
doc/messagemanager-api.txt | 2 +
src/sms.c | 8 +
src/smsutil.c | 4 +-
src/smsutil.h | 2 +
src/util.c | 454 ++++++++++++++++++++++++++++++++++++++++++++-
src/util.h | 2 +
6 files changed, 468 insertions(+), 4 deletions(-)
diff --git a/doc/messagemanager-api.txt b/doc/messagemanager-api.txt
index 43c4d07..8d85a1b 100644
--- a/doc/messagemanager-api.txt
+++ b/doc/messagemanager-api.txt
@@ -104,6 +104,8 @@ Properties string ServiceCenterAddress
"turkish" - Turkish alphabet
"spanish" - Spanish alphabet
"portuguese" - Portuguese alphabet
+ "bengali" - Bengali alphabet
+ "gujarati" - Gujarati alphabet
The standard, language-specific alphabets are defined
in 3GPP TS23.038, Annex A. By default, oFono uses
diff --git a/src/sms.c b/src/sms.c
index b86158e..a7c005e 100644
--- a/src/sms.c
+++ b/src/sms.c
@@ -170,6 +170,10 @@ static const char *sms_alphabet_to_string(enum sms_alphabet alphabet)
return "spanish";
case SMS_ALPHABET_PORTUGUESE:
return "portuguese";
+ case SMS_ALPHABET_BENGALI:
+ return "bengali";
+ case SMS_ALPHABET_GUJARATI:
+ return "gujarati";
case SMS_ALPHABET_DEFAULT:
return "default";
}
@@ -188,6 +192,10 @@ static gboolean sms_alphabet_from_string(const char *str,
*alphabet = SMS_ALPHABET_SPANISH;
else if (g_str_equal(str, "portuguese"))
*alphabet = SMS_ALPHABET_PORTUGUESE;
+ else if (g_str_equal(str, "bengali"))
+ *alphabet = SMS_ALPHABET_BENGALI;
+ else if (g_str_equal(str, "gujarati"))
+ *alphabet = SMS_ALPHABET_GUJARATI;
else
return FALSE;
diff --git a/src/smsutil.c b/src/smsutil.c
index 24dcfaa..dfa838d 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -2280,10 +2280,10 @@ char *sms_decode_text(GSList *sms_list)
* If language is not defined in 3GPP TS 23.038,
* implementations are instructed to ignore it
*/
- if (locking_shift > SMS_ALPHABET_PORTUGUESE)
+ if (locking_shift > SMS_ALPHABET_GUJARATI)
locking_shift = GSM_DIALECT_DEFAULT;
- if (single_shift > SMS_ALPHABET_PORTUGUESE)
+ if (single_shift > SMS_ALPHABET_GUJARATI)
single_shift = GSM_DIALECT_DEFAULT;
converted = convert_gsm_to_utf8_with_lang(buf, written,
diff --git a/src/smsutil.h b/src/smsutil.h
index f293350..3f585cb 100644
--- a/src/smsutil.h
+++ b/src/smsutil.h
@@ -159,6 +159,8 @@ enum sms_alphabet {
SMS_ALPHABET_TURKISH,
SMS_ALPHABET_SPANISH,
SMS_ALPHABET_PORTUGUESE,
+ SMS_ALPHABET_BENGALI,
+ SMS_ALPHABET_GUJARATI,
};
enum sms_mwi_type {
diff --git a/src/util.c b/src/util.c
index df9d4f0..2f01cec 100644
--- a/src/util.c
+++ b/src/util.c
@@ -288,6 +288,324 @@ static const struct codepoint por_ext_unicode[] = {
{ 0x20AC, 0x1B65 }
};
+/* Appendix A.2.4. in 3GPP TS23.038 V.8.2.0 */
+static const struct codepoint ben_ext_gsm[] = {
+ { 0x00, 0x0040 },
+ { 0x01, 0x00A3 },
+ { 0x02, 0x0024 },
+ { 0x03, 0x00A5 },
+ { 0x04, 0x00BF },
+ { 0x05, 0x0022 },
+ { 0x06, 0x00A4 },
+ { 0x07, 0x0025 },
+ { 0x08, 0x0026 },
+ { 0x09, 0x0027 },
+ { 0x0A, 0x000C }, /* See NOTE 3 */
+ { 0x0B, 0x002A },
+ { 0x0C, 0x002B },
+ { 0x0E, 0x002D },
+ { 0x0F, 0x002F },
+ { 0x10, 0X003C },
+ { 0x11, 0X003D },
+ { 0x12, 0X003E },
+ { 0x13, 0X00A1 },
+ { 0x14, 0X005E },
+ { 0x15, 0X00A1 },
+ { 0x16, 0X005F },
+ { 0x17, 0X0023 },
+ { 0x18, 0X002A },
+ { 0x19, 0X09E6 },
+ { 0x1A, 0X09E7 },
+ { 0x1B, 0X0020 }, /* See NOTE 1 */
+ { 0x1C, 0X09E8 },
+ { 0x1D, 0X09E9 },
+ { 0x1E, 0X09EA },
+ { 0x1F, 0X09EB },
+ { 0x20, 0x09EC },
+ { 0x21, 0x09ED },
+ { 0x22, 0x09EE },
+ { 0x23, 0x09EF },
+ { 0x24, 0x09DF },
+ { 0x25, 0x09E0 },
+ { 0x26, 0x09E1 },
+ { 0x27, 0x09E2 },
+ { 0x28, 0x007B },
+ { 0x29, 0x007D },
+ { 0x2A, 0x09E3 },
+ { 0x2B, 0x09F2 },
+ { 0x2C, 0x09F3 },
+ { 0x2D, 0x09F4 },
+ { 0x2E, 0x09F5 },
+ { 0x2F, 0x005C },
+ { 0x30, 0x09F6 },
+ { 0x31, 0x09F7 },
+ { 0x32, 0x09F8 },
+ { 0x33, 0x09F9 },
+ { 0x34, 0x09FA },
+ { 0x3C, 0x005B },
+ { 0x3D, 0x007E },
+ { 0x3E, 0x005D },
+ { 0x40, 0x007C },
+ { 0x41, 0x0041 },
+ { 0x42, 0x0042 },
+ { 0x43, 0x0043 },
+ { 0x44, 0x0044 },
+ { 0x45, 0x0045 },
+ { 0x46, 0x0046 },
+ { 0x47, 0x0047 },
+ { 0x48, 0x0048 },
+ { 0x49, 0x0049 },
+ { 0x4A, 0x004A },
+ { 0x4B, 0x004B },
+ { 0x4C, 0x004C },
+ { 0x4D, 0x004D },
+ { 0x4E, 0x004E },
+ { 0x4F, 0x004F },
+ { 0x50, 0x0050 },
+ { 0x51, 0x0051 },
+ { 0x52, 0x0052 },
+ { 0x53, 0x0053 },
+ { 0x54, 0x0054 },
+ { 0x55, 0x0055 },
+ { 0x56, 0x0056 },
+ { 0x57, 0x0057 },
+ { 0x58, 0x0058 },
+ { 0x59, 0x0059 },
+ { 0x5A, 0x005A },
+ { 0x65, 0x20AC }
+};
+
+static const struct codepoint ben_ext_unicode[] = {
+ { 0x0022, 0x1B05 },
+ { 0X0023, 0x1B17 },
+ { 0x0024, 0x1B02 },
+ { 0x0025, 0x1B07 },
+ { 0x0026, 0x1B08 },
+ { 0x0027, 0x1B09 },
+ { 0x002A, 0x1B0B },
+ { 0X002A, 0x1B18 },
+ { 0x002B, 0x1B0C },
+ { 0x002D, 0x1B0E },
+ { 0x002F, 0x1B0F },
+ { 0X003C, 0x1B10 },
+ { 0X003D, 0x1B11 },
+ { 0X003E, 0x1B12 },
+ { 0x0040, 0x1B00 },
+ { 0x0041, 0x1B41 },
+ { 0x0042, 0x1B42 },
+ { 0x0043, 0x1B43 },
+ { 0x0044, 0x1B44 },
+ { 0x0045, 0x1B45 },
+ { 0x0046, 0x1B46 },
+ { 0x0047, 0x1B47 },
+ { 0x0048, 0x1B48 },
+ { 0x0049, 0x1B49 },
+ { 0x004A, 0x1B4A },
+ { 0x004B, 0x1B4B },
+ { 0x004C, 0x1B4C },
+ { 0x004D, 0x1B4D },
+ { 0x004E, 0x1B4E },
+ { 0x004F, 0x1B4F },
+ { 0x0050, 0x1B50 },
+ { 0x0051, 0x1B51 },
+ { 0x0052, 0x1B52 },
+ { 0x0053, 0x1B53 },
+ { 0x0054, 0x1B54 },
+ { 0x0055, 0x1B55 },
+ { 0x0056, 0x1B56 },
+ { 0x0057, 0x1B57 },
+ { 0x0058, 0x1B58 },
+ { 0x0059, 0x1B59 },
+ { 0x005A, 0x1B5A },
+ { 0x005B, 0x1B3C },
+ { 0x005C, 0x1B2F },
+ { 0x005D, 0x1B3E },
+ { 0X005E, 0x1B14 },
+ { 0X005F, 0x1B16 },
+ { 0x007B, 0x1B28 },
+ { 0x007C, 0x1B40 },
+ { 0x007D, 0x1B29 },
+ { 0x007E, 0x1B3D },
+ { 0X00A1, 0x1B13 },
+ { 0X00A1, 0x1B15 },
+ { 0x00A3, 0x1B01 },
+ { 0x00A4, 0x1B06 },
+ { 0x00A5, 0x1B03 },
+ { 0x00BF, 0x1B04 },
+ { 0x09DF, 0x1B24 },
+ { 0x09E0, 0x1B25 },
+ { 0x09E1, 0x1B26 },
+ { 0x09E2, 0x1B27 },
+ { 0x09E3, 0x1B2A },
+ { 0X09E6, 0x1B19 },
+ { 0X09E7, 0x1B1A },
+ { 0X09E8, 0x1B1C },
+ { 0X09E9, 0x1B1D },
+ { 0X09EA, 0x1B1E },
+ { 0X09EB, 0x1B1F },
+ { 0x09EC, 0x1B20 },
+ { 0x09ED, 0x1B21 },
+ { 0x09EE, 0x1B22 },
+ { 0x09EF, 0x1B23 },
+ { 0x09F2, 0x1B2B },
+ { 0x09F3, 0x1B2C },
+ { 0x09F4, 0x1B2D },
+ { 0x09F5, 0x1B2E },
+ { 0x09F6, 0x1B30 },
+ { 0x09F7, 0x1B31 },
+ { 0x09F8, 0x1B32 },
+ { 0x09F9, 0x1B33 },
+ { 0x09FA, 0x1B34 },
+ { 0x20AC, 0x1B65 }
+};
+
+/* Appendix A.2.5. in 3GPP TS23.038 V.8.2.0 */
+static const struct codepoint guj_ext_gsm[] = {
+ { 0x00, 0x0040 },
+ { 0x01, 0x00A3 },
+ { 0x02, 0x0024 },
+ { 0x03, 0x00A5 },
+ { 0x04, 0x00BF },
+ { 0x05, 0x0022 },
+ { 0x06, 0x00A4 },
+ { 0x07, 0x0025 },
+ { 0x08, 0x0026 },
+ { 0x09, 0x0027 },
+ { 0x0A, 0x000C }, /* See NOTE 3 */
+ { 0x0B, 0x002A },
+ { 0x0C, 0x002B },
+ { 0x0E, 0x002D },
+ { 0x0F, 0x002F },
+ { 0x10, 0x003C },
+ { 0x11, 0x003D },
+ { 0x12, 0x003E },
+ { 0x13, 0x00A1 },
+ { 0x14, 0x005E },
+ { 0x15, 0x00A1 },
+ { 0x16, 0x005F },
+ { 0x17, 0x0023 },
+ { 0x18, 0x002A },
+ { 0x19, 0x0964 },
+ { 0x1A, 0x0965 },
+ { 0x1B, 0x0020 }, /* See NOTE 1 */
+ { 0x1C, 0x0AE6 },
+ { 0x1D, 0x0AE7 },
+ { 0x1E, 0x0AE8 },
+ { 0x1F, 0x0AE9 },
+ { 0x20, 0x0AEA },
+ { 0x21, 0x0AEB },
+ { 0x22, 0x0AEC },
+ { 0x23, 0x0AED },
+ { 0x24, 0x0AEE },
+ { 0x25, 0x0AEF },
+ { 0x28, 0x007B },
+ { 0x29, 0x007D },
+ { 0x2F, 0x005C },
+ { 0x3C, 0x005B },
+ { 0x3D, 0x007E },
+ { 0x3E, 0x005D },
+ { 0x40, 0x007C },
+ { 0x41, 0x0041 },
+ { 0x42, 0x0042 },
+ { 0x43, 0x0043 },
+ { 0x44, 0x0044 },
+ { 0x45, 0x0045 },
+ { 0x46, 0x0046 },
+ { 0x47, 0x0047 },
+ { 0x48, 0x0048 },
+ { 0x49, 0x0049 },
+ { 0x4A, 0x004A },
+ { 0x4B, 0x004B },
+ { 0x4C, 0x004C },
+ { 0x4D, 0x004D },
+ { 0x4E, 0x004E },
+ { 0x4F, 0x004F },
+ { 0x50, 0x0050 },
+ { 0x51, 0x0051 },
+ { 0x52, 0x0052 },
+ { 0x53, 0x0053 },
+ { 0x54, 0x0054 },
+ { 0x55, 0x0055 },
+ { 0x56, 0x0056 },
+ { 0x57, 0x0057 },
+ { 0x58, 0x0058 },
+ { 0x59, 0x0059 },
+ { 0x5A, 0x005A },
+ { 0x65, 0x20AC }
+};
+
+static const struct codepoint guj_ext_unicode[] = {
+ { 0x0022, 0x1B05 },
+ { 0x0023, 0x1B17 },
+ { 0x0024, 0x1B02 },
+ { 0x0025, 0x1B07 },
+ { 0x0026, 0x1B08 },
+ { 0x0027, 0x1B09 },
+ { 0x002A, 0x1B0B },
+ { 0x002A, 0x1B18 },
+ { 0x002B, 0x1B0C },
+ { 0x002D, 0x1B0E },
+ { 0x002F, 0x1B0F },
+ { 0x003C, 0x1B10 },
+ { 0x003D, 0x1B11 },
+ { 0x003E, 0x1B12 },
+ { 0x0040, 0x1B00 },
+ { 0x0041, 0x1B41 },
+ { 0x0042, 0x1B42 },
+ { 0x0043, 0x1B43 },
+ { 0x0044, 0x1B44 },
+ { 0x0045, 0x1B45 },
+ { 0x0046, 0x1B46 },
+ { 0x0047, 0x1B47 },
+ { 0x0048, 0x1B48 },
+ { 0x0049, 0x1B49 },
+ { 0x004A, 0x1B4A },
+ { 0x004B, 0x1B4B },
+ { 0x004C, 0x1B4C },
+ { 0x004D, 0x1B4D },
+ { 0x004E, 0x1B4E },
+ { 0x004F, 0x1B4F },
+ { 0x0050, 0x1B50 },
+ { 0x0051, 0x1B51 },
+ { 0x0052, 0x1B52 },
+ { 0x0053, 0x1B53 },
+ { 0x0054, 0x1B54 },
+ { 0x0055, 0x1B55 },
+ { 0x0056, 0x1B56 },
+ { 0x0057, 0x1B57 },
+ { 0x0058, 0x1B58 },
+ { 0x0059, 0x1B59 },
+ { 0x005A, 0x1B5A },
+ { 0x005B, 0x1B3C },
+ { 0x005C, 0x1B2F },
+ { 0x005D, 0x1B3E },
+ { 0x005E, 0x1B14 },
+ { 0x005F, 0x1B16 },
+ { 0x007B, 0x1B28 },
+ { 0x007C, 0x1B40 },
+ { 0x007D, 0x1B29 },
+ { 0x007E, 0x1B3D },
+ { 0x00A1, 0x1B13 },
+ { 0x00A1, 0x1B15 },
+ { 0x00A3, 0x1B01 },
+ { 0x00A4, 0x1B06 },
+ { 0x00A5, 0x1B03 },
+ { 0x00BF, 0x1B04 },
+ { 0x0964, 0x1B19 },
+ { 0x0965, 0x1B1A },
+ { 0x0AE6, 0x1B1C },
+ { 0x0AE7, 0x1B1D },
+ { 0x0AE8, 0x1B1E },
+ { 0x0AE9, 0x1B1F },
+ { 0x0AEA, 0x1B20 },
+ { 0x0AEB, 0x1B21 },
+ { 0x0AEC, 0x1B22 },
+ { 0x0AED, 0x1B23 },
+ { 0x0AEE, 0x1B24 },
+ { 0x0AEF, 0x1B25 },
+ { 0x20AC, 0x1B65 }
+};
+
/* Used for conversion of GSM to Unicode */
static const unsigned short def_gsm[] = {
0x0040, 0x00A3, 0x0024, 0x00A5, 0x00E8, 0x00E9, 0x00F9, 0x00EC,
@@ -454,6 +772,112 @@ static const struct codepoint por_unicode[] = {
{ 0x00FC, 0x7E }, { 0x0394, 0x10 }, { 0x20AC, 0x18 }, { 0x221E, 0x15 }
};
+/* Appendix A.3.4 in 3GPP TS23.038 */
+static const unsigned short ben_gsm[] = {
+ 0x0981, 0x0982, 0x0983, 0x0985, 0x0986, 0x0987, 0x0988, 0x0989,
+ 0x098A, 0x098B, 0x000A, 0x098C, 0x0020, 0x000D, 0x0020, 0x098F,
+ 0x0990, 0x0020, 0x0020, 0x0993, 0x0994, 0x0995, 0x0996, 0x0997,
+ 0x0998, 0x0999, 0x099A, 0x00A0, 0x099B, 0x099C, 0x099D, 0x099E,
+ 0x0020, 0x0021, 0x099F, 0x09A0, 0x09A1, 0x09A2, 0x09A3, 0x09A4,
+ 0x0029, 0x0028, 0x09A5, 0x09A6, 0x002C, 0x09A7, 0x002E, 0x09A8,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
+ 0x0038, 0x0039, 0x003A, 0x003B, 0x0020, 0x09AA, 0x09AB, 0x003F,
+ 0x09AC, 0x09AD, 0x09AE, 0x09AF, 0x09B0, 0x0020, 0x09B2, 0x0020,
+ 0x0020, 0x0020, 0x09B6, 0x09B7, 0x09B8, 0x09B9, 0x09BC, 0x09BD,
+ 0x09BE, 0x09BF, 0x09C0, 0x09C1, 0x09C2, 0x09C3, 0x09C4, 0x0020,
+ 0x0020, 0x09C7, 0x09C8, 0x0020, 0x0020, 0x09CB, 0x09CC, 0x09CD,
+ 0x09CE, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
+ 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007A, 0x09D7, 0x09DC, 0x09DD, 0x09F0, 0x09F1
+};
+
+static const struct codepoint ben_unicode[] = {
+ { 0x000A, 0x0A }, { 0x000D, 0x0D }, { 0x0020, 0x20 }, { 0x0021, 0x21 },
+ { 0x0028, 0x29 }, { 0x0029, 0x28 }, { 0x002C, 0x2C }, { 0x002E, 0x2E },
+ { 0x0030, 0x30 }, { 0x0031, 0x31 }, { 0x0032, 0x32 }, { 0x0033, 0x33 },
+ { 0x0034, 0x34 }, { 0x0035, 0x35 }, { 0x0036, 0x36 }, { 0x0037, 0x37 },
+ { 0x0038, 0x38 }, { 0x0039, 0x39 }, { 0x003A, 0x3A }, { 0x003B, 0x3B },
+ { 0x003F, 0x3F }, { 0x0061, 0x61 }, { 0x0062, 0x62 }, { 0x0063, 0x63 },
+ { 0x0064, 0x64 }, { 0x0065, 0x65 }, { 0x0066, 0x66 }, { 0x0067, 0x67 },
+ { 0x0068, 0x68 }, { 0x0069, 0x69 }, { 0x006A, 0x6A }, { 0x006B, 0x6B },
+ { 0x006C, 0x6C }, { 0x006D, 0x6D }, { 0x006E, 0x6E }, { 0x006F, 0x6F },
+ { 0x0070, 0x70 }, { 0x0071, 0x71 }, { 0x0072, 0x72 }, { 0x0073, 0x73 },
+ { 0x0074, 0x74 }, { 0x0075, 0x75 }, { 0x0076, 0x76 }, { 0x0077, 0x77 },
+ { 0x0078, 0x78 }, { 0x0079, 0x79 }, { 0x007A, 0x7A }, { 0x00A0, 0x20 },
+ { 0x0981, 0x00 }, { 0x0982, 0x01 }, { 0x0983, 0x02 }, { 0x0985, 0x03 },
+ { 0x0986, 0x04 }, { 0x0987, 0x05 }, { 0x0988, 0x06 }, { 0x0989, 0x07 },
+ { 0x098A, 0x08 }, { 0x098B, 0x09 }, { 0x098C, 0x0B }, { 0x098F, 0x0F },
+ { 0x0990, 0x10 }, { 0x0993, 0x13 }, { 0x0994, 0x14 }, { 0x0995, 0x15 },
+ { 0x0996, 0x16 }, { 0x0997, 0x17 }, { 0x0998, 0x18 }, { 0x0999, 0x19 },
+ { 0x099A, 0x1A }, { 0x099B, 0x1C }, { 0x099C, 0x1D }, { 0x099D, 0x1E },
+ { 0x099E, 0x1F }, { 0x099F, 0x22 }, { 0x09A0, 0x23 }, { 0x09A1, 0x24 },
+ { 0x09A2, 0x25 }, { 0x09A3, 0x26 }, { 0x09A4, 0x27 }, { 0x09A5, 0x2A },
+ { 0x09A6, 0x2B }, { 0x09A7, 0x2D }, { 0x09A8, 0x2F }, { 0x09AA, 0x3D },
+ { 0x09AB, 0x3E }, { 0x09AC, 0x40 }, { 0x09AD, 0x41 }, { 0x09AE, 0x42 },
+ { 0x09AF, 0x43 }, { 0x09B0, 0x44 }, { 0x09B2, 0x46 }, { 0x09B6, 0x4A },
+ { 0x09B7, 0x4B }, { 0x09B8, 0x4C }, { 0x09B9, 0x4D }, { 0x09BC, 0x4E },
+ { 0x09BD, 0x4F }, { 0x09BE, 0x50 }, { 0x09BF, 0x51 }, { 0x09C0, 0x52 },
+ { 0x09C1, 0x53 }, { 0x09C2, 0x54 }, { 0x09C3, 0x55 }, { 0x09C4, 0x56 },
+ { 0x09C7, 0x59 }, { 0x09C8, 0x5A }, { 0x09CB, 0x5D }, { 0x09CC, 0x5E },
+ { 0x09CD, 0x5F }, { 0x09CE, 0x60 }, { 0x09D7, 0x7B }, { 0x09DC, 0x7C },
+ { 0x09DD, 0x7D }, { 0x09F0, 0x7E }, { 0x09F1, 0x7F }
+};
+
+/* Appendix A.3.5 in 3GPP TS23.038 */
+static const unsigned short guj_gsm[] = {
+ 0x0A81, 0x0A82, 0x0A83, 0x0A85, 0x0A86, 0x0A87, 0x0A88, 0x0A89,
+ 0x0A8A, 0x0A8B, 0x000A, 0x0A8C, 0x0A8D, 0x000D, 0x0020, 0x0A8F,
+ 0x0A90, 0x0A91, 0x0020, 0x0A93, 0x0A94, 0x0A95, 0x0A96, 0x0A97,
+ 0x0A98, 0x0A99, 0x0A9A, 0x00A0, 0x0A9B, 0x0A9C, 0x0A9D, 0x0A9E,
+ 0x0020, 0x0021, 0x0A9F, 0x0AA0, 0x0AA1, 0x0AA2, 0x0AA3, 0x0AA4,
+ 0x0029, 0x0028, 0x0AA5, 0x0AA6, 0x002C, 0x0AA7, 0x002E, 0x0AA8,
+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
+ 0x0038, 0x0039, 0x003A, 0x003B, 0x0020, 0x0AAA, 0x0AAB, 0x003F,
+ 0x0AAC, 0x0AAD, 0x0AAE, 0x0AAF, 0x0AB0, 0x0020, 0x0AB2, 0x0AB3,
+ 0x0020, 0x0AB5, 0x0AB6, 0x0AB7, 0x0AB8, 0x0AB9, 0x0ABC, 0x0ABD,
+ 0x0ABE, 0x0ABF, 0x0AC0, 0x0AC1, 0x0AC2, 0x0AC3, 0x0AC4, 0x0AC5,
+ 0x0020, 0x0AC7, 0x0AC8, 0x0AC9, 0x0020, 0x0ACB, 0x0ACC, 0x0ACD,
+ 0x0AD0, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,
+ 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F,
+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
+ 0x0078, 0x0079, 0x007A, 0x0AE0, 0x0AE1, 0x0AE2, 0x0AE3, 0x0AF1
+};
+
+static const struct codepoint guj_unicode[] = {
+ { 0x000A, 0x0A }, { 0x000D, 0x0D }, { 0x0020, 0x20 }, { 0x0021, 0x21 },
+ { 0x0028, 0x29 }, { 0x0029, 0x28 }, { 0x002C, 0x2C }, { 0x002E, 0x2E },
+ { 0x0030, 0x30 }, { 0x0031, 0x31 }, { 0x0032, 0x32 }, { 0x0033, 0x33 },
+ { 0x0034, 0x34 }, { 0x0035, 0x35 }, { 0x0036, 0x36 }, { 0x0037, 0x37 },
+ { 0x0038, 0x38 }, { 0x0039, 0x39 }, { 0x003A, 0x3A }, { 0x003B, 0x3B },
+ { 0x003F, 0x3F }, { 0x0061, 0x61 }, { 0x0062, 0x62 }, { 0x0063, 0x63 },
+ { 0x0064, 0x64 }, { 0x0065, 0x65 }, { 0x0066, 0x66 }, { 0x0067, 0x67 },
+ { 0x0068, 0x68 }, { 0x0069, 0x69 }, { 0x006A, 0x6A }, { 0x006B, 0x6B },
+ { 0x006C, 0x6C }, { 0x006D, 0x6D }, { 0x006E, 0x6E }, { 0x006F, 0x6F },
+ { 0x0070, 0x70 }, { 0x0071, 0x71 }, { 0x0072, 0x72 }, { 0x0073, 0x73 },
+ { 0x0074, 0x74 }, { 0x0075, 0x75 }, { 0x0076, 0x76 }, { 0x0077, 0x77 },
+ { 0x0078, 0x78 }, { 0x0079, 0x79 }, { 0x007A, 0x7A }, { 0x00A0, 0x20 },
+ { 0x0A81, 0x00 }, { 0x0A82, 0x01 }, { 0x0A83, 0x02 }, { 0x0A85, 0x03 },
+ { 0x0A86, 0x04 }, { 0x0A87, 0x05 }, { 0x0A88, 0x06 }, { 0x0A89, 0x07 },
+ { 0x0A8A, 0x08 }, { 0x0A8B, 0x09 }, { 0x0A8C, 0x0B }, { 0x0A8D, 0x0C },
+ { 0x0A8F, 0x0F }, { 0x0A90, 0x10 }, { 0x0A91, 0x11 }, { 0x0A93, 0x13 },
+ { 0x0A94, 0x14 }, { 0x0A95, 0x15 }, { 0x0A96, 0x16 }, { 0x0A97, 0x17 },
+ { 0x0A98, 0x18 }, { 0x0A99, 0x19 }, { 0x0A9A, 0x1A }, { 0x0A9B, 0x1C },
+ { 0x0A9C, 0x1D }, { 0x0A9D, 0x1E }, { 0x0A9E, 0x1F }, { 0x0A9F, 0x22 },
+ { 0x0AA0, 0x23 }, { 0x0AA1, 0x24 }, { 0x0AA2, 0x25 }, { 0x0AA3, 0x26 },
+ { 0x0AA4, 0x27 }, { 0x0AA5, 0x2A }, { 0x0AA6, 0x2B }, { 0x0AA7, 0x2D },
+ { 0x0AA8, 0x2F }, { 0x0AAA, 0x3D }, { 0x0AAB, 0x3E }, { 0x0AAC, 0x40 },
+ { 0x0AAD, 0x41 }, { 0x0AAE, 0x42 }, { 0x0AAF, 0x43 }, { 0x0AB0, 0x44 },
+ { 0x0AB2, 0x46 }, { 0x0AB3, 0x47 }, { 0x0AB5, 0x49 }, { 0x0AB6, 0x4A },
+ { 0x0AB7, 0x4B }, { 0x0AB8, 0x4C }, { 0x0AB9, 0x4D }, { 0x0ABC, 0x4E },
+ { 0x0ABD, 0x4F }, { 0x0ABE, 0x50 }, { 0x0ABF, 0x51 }, { 0x0AC0, 0x52 },
+ { 0x0AC1, 0x53 }, { 0x0AC2, 0x54 }, { 0x0AC3, 0x55 }, { 0x0AC4, 0x56 },
+ { 0x0AC5, 0x57 }, { 0x0AC7, 0x59 }, { 0x0AC8, 0x5A }, { 0x0AC9, 0x5B },
+ { 0x0ACB, 0x5D }, { 0x0ACC, 0x5E }, { 0x0ACD, 0x5F }, { 0x0AD0, 0x60 },
+ { 0x0AE0, 0x7B }, { 0x0AE1, 0x7C }, { 0x0AE2, 0x7D }, { 0x0AE3, 0x7E },
+ { 0x0AF1, 0x7F }
+};
+
static int compare_codepoints(const void *a, const void *b)
{
const struct codepoint *ca = (const struct codepoint *) a;
@@ -523,7 +947,19 @@ static gboolean populate_locking_shift(struct conversion_table *t,
t->locking_u = por_unicode;
t->locking_len_u = TABLE_SIZE(por_unicode);
return TRUE;
- }
+
+ case GSM_DIALECT_BENGALI:
+ t->locking_g = ben_gsm;
+ t->locking_u = ben_unicode;
+ t->locking_len_u = TABLE_SIZE(ben_unicode);
+ return TRUE;
+
+ case GSM_DIALECT_GUJARATI:
+ t->locking_g = guj_gsm;
+ t->locking_u = guj_unicode;
+ t->locking_len_u = TABLE_SIZE(guj_unicode);
+ return TRUE;
+ }
return FALSE;
}
@@ -559,7 +995,21 @@ static gboolean populate_single_shift(struct conversion_table *t,
t->single_u = por_ext_unicode;
t->single_len_u = TABLE_SIZE(por_ext_unicode);
return TRUE;
- }
+
+ case GSM_DIALECT_BENGALI:
+ t->single_g = ben_ext_gsm;
+ t->single_len_g = TABLE_SIZE(ben_ext_gsm);
+ t->single_u = ben_ext_unicode;
+ t->single_len_u = TABLE_SIZE(ben_ext_unicode);
+ return TRUE;
+
+ case GSM_DIALECT_GUJARATI:
+ t->single_g = guj_ext_gsm;
+ t->single_len_g = TABLE_SIZE(guj_ext_gsm);
+ t->single_u = guj_ext_unicode;
+ t->single_len_u = TABLE_SIZE(guj_ext_unicode);
+ return TRUE;
+ }
return FALSE;
}
diff --git a/src/util.h b/src/util.h
index 092b4b5..193eb8b 100644
--- a/src/util.h
+++ b/src/util.h
@@ -24,6 +24,8 @@ enum gsm_dialect {
GSM_DIALECT_TURKISH,
GSM_DIALECT_SPANISH,
GSM_DIALECT_PORTUGUESE,
+ GSM_DIALECT_BENGALI,
+ GSM_DIALECT_GUJARATI,
};
char *convert_gsm_to_utf8(const unsigned char *text, long len, long *items_read,
--
2.7.4
2 years, 5 months
[PATCH] Move debug print to more useful place
by Pavel Machek
Move debug print to more useful place in setup_gobi().
index ff5d41af..a4b18488 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -233,10 +233,11 @@ static gboolean setup_gobi(struct modem_info *modem)
}
}
+ DBG("qmi=%s net=%s mdm=%s gps=%s diag=%s", qmi, net, mdm, gps, diag);
+
if (qmi == NULL || mdm == NULL || net == NULL)
return FALSE;
- DBG("qmi=%s net=%s mdm=%s gps=%s diag=%s", qmi, net, mdm, gps, diag);
ofono_modem_set_string(modem->modem, "Device", qmi);
ofono_modem_set_string(modem->modem, "Modem", mdm);
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
2 years, 5 months
[PATCH] Fix typo in location-reporting-api.txt.
by Pavel Machek
Fix typo in location-reporting-api.txt.
diff --git a/doc/location-reporting-api.txt b/doc/location-reporting-api.txt
index 21e346d4..ff0a35dc 100644
--- a/doc/location-reporting-api.txt
+++ b/doc/location-reporting-api.txt
@@ -13,7 +13,7 @@ Methods dict GetProperties()
filedescriptor Request()
Asks to turn ON the NMEA stream and supplies the
- gps device file descriptor. The external cliend should
+ gps device file descriptor. The external client should
use the file descriptor to receive the NMEA data.
Possible Errors: [service].Error.InProgress
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
2 years, 5 months