From: Dragos Tatulea <dragos@endocode.com>
To: ofono@ofono.org
Subject: [PATCH 04/11] atmodem: add support for U-Blox TOBY L2 modems
Date: Mon, 14 Mar 2016 16:50:57 +0100 [thread overview]
Message-ID: <1457970664-20782-5-git-send-email-dragos@endocode.com> (raw)
In-Reply-To: <1457970664-20782-1-git-send-email-dragos@endocode.com>
[-- Attachment #1: Type: text/plain, Size: 3427 bytes --]
Besides exceptions below, act like normal U-Blox devices.
gprs-context: don't set auth for TOBY L2. U-Blox Toby L2
doesn't support PAP/CHAP APN auth method.
atmodem: TOBY L2 supports only CMER mode 1. Also chaged original
mode variable to ind, which is a more appropriate name.
mode is what is being set first.
---
drivers/atmodem/gprs.c | 1 +
drivers/atmodem/network-registration.c | 21 ++++++++++++++++-----
drivers/atmodem/sim.c | 1 +
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/drivers/atmodem/gprs.c b/drivers/atmodem/gprs.c
index 0165253..4505477 100644
--- a/drivers/atmodem/gprs.c
+++ b/drivers/atmodem/gprs.c
@@ -351,6 +351,7 @@ static void gprs_initialized(gboolean ok, GAtResult *result, gpointer user_data)
FALSE, gprs, NULL);
break;
case OFONO_VENDOR_UBLOX:
+ case OFONO_VENDOR_UBLOX_TOBY_L2:
g_at_chat_register(gd->chat, "+UREG:", ublox_ureg_notify,
FALSE, gprs, NULL);
g_at_chat_send(gd->chat, "AT+UREG=1", none_prefix,
diff --git a/drivers/atmodem/network-registration.c b/drivers/atmodem/network-registration.c
index 7cfd6b2..c2df0ce 100644
--- a/drivers/atmodem/network-registration.c
+++ b/drivers/atmodem/network-registration.c
@@ -1580,17 +1580,28 @@ static inline ofono_bool_t append_cmer_element(char *buf, int *len, int cap,
static ofono_bool_t build_cmer_string(char *buf, int *cmer_opts,
struct netreg_data *nd)
{
- const char *mode;
+ const char *ind;
int len = sprintf(buf, "AT+CMER=");
+ const char *mode;
DBG("");
+ switch (nd->vendor) {
+ case OFONO_VENDOR_UBLOX_TOBY_L2:
+ /* UBX-13002752 R33: TOBY L2 doesn't support mode 2 and 3 */
+ mode = "1";
+ break;
+ default:
+ mode = "3";
+ break;
+ }
+
/*
* Forward unsolicited result codes directly to the TE;
* TA‑TE link specific inband technique used to embed result codes and
* data when TA is in on‑line data mode
*/
- if (!append_cmer_element(buf, &len, cmer_opts[0], "3", FALSE))
+ if (!append_cmer_element(buf, &len, cmer_opts[0], mode, FALSE))
return FALSE;
/* No keypad event reporting */
@@ -1607,14 +1618,14 @@ static ofono_bool_t build_cmer_string(char *buf, int *cmer_opts,
* Telit does not support mode 1.
* All indicator events shall be directed from TA to TE.
*/
- mode = "2";
+ ind = "2";
break;
default:
/*
* Only those indicator events, which are not caused by +CIND
* shall be indicated by the TA to the TE.
*/
- mode = "1";
+ ind = "1";
break;
}
@@ -1623,7 +1634,7 @@ static ofono_bool_t build_cmer_string(char *buf, int *cmer_opts,
* <ind> indicates the indicator order number (as specified for +CIND)
* and <value> is the new value of indicator.
*/
- if (!append_cmer_element(buf, &len, cmer_opts[3], mode, TRUE))
+ if (!append_cmer_element(buf, &len, cmer_opts[3], ind, TRUE))
return FALSE;
return TRUE;
diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index d6a0dcf..081d342 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -1120,6 +1120,7 @@ static void at_pin_retries_query(struct ofono_sim *sim,
return;
break;
case OFONO_VENDOR_UBLOX:
+ case OFONO_VENDOR_UBLOX_TOBY_L2:
if (g_at_chat_send(sd->chat, "AT+UPINCNT", upincnt_prefix,
upincnt_cb, cbd, g_free) > 0)
return;
--
2.5.0
next prev parent reply other threads:[~2016-03-14 15:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-14 15:50 [PATCH v1 00/11] Support for U-Blox Toby L2 modems Dragos Tatulea
2016-03-14 15:50 ` [PATCH 01/11] plugins/udevng: support different interface strings to detect TOBY series Dragos Tatulea
2016-03-16 18:00 ` Denis Kenzior
2016-03-14 15:50 ` [PATCH 02/11] plugins/ublox: allow enabling of TOBY L2 modems Dragos Tatulea
2016-03-16 18:12 ` Denis Kenzior
2016-03-14 15:50 ` [PATCH 03/11] plugins/ublox: use vendor from structure instead of fixed Dragos Tatulea
2016-03-16 18:20 ` Denis Kenzior
2016-03-14 15:50 ` Dragos Tatulea [this message]
2016-03-16 18:20 ` [PATCH 04/11] atmodem: add support for U-Blox TOBY L2 modems Denis Kenzior
2016-03-14 15:50 ` [PATCH 05/11] plugins/ublox: give names to model ids Dragos Tatulea
2016-03-16 18:22 ` Denis Kenzior
2016-03-14 15:50 ` [PATCH 06/11] ubloxmodem: add Toby L2 gprs context driver Dragos Tatulea
2016-03-16 23:25 ` Denis Kenzior
2016-03-17 10:33 ` Dragos Tatulea
2016-03-17 14:26 ` Denis Kenzior
2016-03-14 15:51 ` [PATCH 07/11] plugins/ublox: enable ubloxmodem driver when possible Dragos Tatulea
2016-03-14 15:51 ` [PATCH 08/11] plugins/ublox: support more internet contexts Dragos Tatulea
2016-03-14 15:51 ` [PATCH 09/11] ubloxmodem: support authentication Dragos Tatulea
2016-03-14 15:51 ` [PATCH 10/11] plugins/ublox: read network mode Dragos Tatulea
2016-03-14 15:51 ` [PATCH 11/11] ubloxmodem: add routed mode support Dragos Tatulea
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457970664-20782-5-git-send-email-dragos@endocode.com \
--to=dragos@endocode.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox