atmodem: add support for U-Blox TOBY L2 modems

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.
This commit is contained in:
Dragos Tatulea 2016-03-14 16:50:57 +01:00 committed by Denis Kenzior
parent c0c2ae87ab
commit 6970a289c2
3 changed files with 18 additions and 5 deletions

View File

@ -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,

View File

@ -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;
* TATE link specific inband technique used to embed result codes and
* data when TA is in online 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;

View File

@ -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;