mirror of
https://github.com/sailfishos/ofono
synced 2025-11-27 04:51:06 +08:00
Compare commits
69 Commits
mer/1.28+g
...
1.29+git3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81ad45dfd9 | ||
|
|
0e27cf811b | ||
|
|
5ec5081b7d | ||
|
|
d2cae30a03 | ||
|
|
e0ea7b54c6 | ||
|
|
01c5e7fc1a | ||
|
|
291530d291 | ||
|
|
108611ef72 | ||
|
|
a3c9fc793c | ||
|
|
03491c78e7 | ||
|
|
c534b7e9b0 | ||
|
|
35e7cd19e6 | ||
|
|
2ed8b1bb7f | ||
|
|
8f65b01f4c | ||
|
|
1aa2ac5e67 | ||
|
|
cb8a13433f | ||
|
|
ee1c34cd7f | ||
|
|
2b89f6d488 | ||
|
|
32b886d89d | ||
|
|
a9a3e024e1 | ||
|
|
8c432e5426 | ||
|
|
fc26876503 | ||
|
|
7461d52b10 | ||
|
|
9e2fd992b5 | ||
|
|
1295539515 | ||
|
|
65aa5aab14 | ||
|
|
8da2178a96 | ||
|
|
181c74b1a9 | ||
|
|
a30ef13844 | ||
|
|
ec85e50ab4 | ||
|
|
1cedb9d750 | ||
|
|
a412839f45 | ||
|
|
86af7cd7c9 | ||
|
|
050332577c | ||
|
|
339814e429 | ||
|
|
278d7236c9 | ||
|
|
15a9ea2977 | ||
|
|
9910ab1693 | ||
|
|
d5a3613fd4 | ||
|
|
d337893b39 | ||
|
|
9ef41fdc2f | ||
|
|
c779a8b19d | ||
|
|
81c7f886cb | ||
|
|
4adac31b51 | ||
|
|
31bebd7ecf | ||
|
|
f1965b1e2b | ||
|
|
fed8c5b171 | ||
|
|
5e1f159ad1 | ||
|
|
972aea87e8 | ||
|
|
f4df805783 | ||
|
|
1066668a4b | ||
|
|
c5029eafcf | ||
|
|
6ce1e081a4 | ||
|
|
91435c39ed | ||
|
|
531afae6b2 | ||
|
|
1c8a577a4b | ||
|
|
bd175869f4 | ||
|
|
bcb08afc50 | ||
|
|
eb8bfb57e9 | ||
|
|
871eab499c | ||
|
|
dae12e74a4 | ||
|
|
9f486aa91a | ||
|
|
b015849e98 | ||
|
|
6c77fa2ddd | ||
|
|
09bd3cc5ac | ||
|
|
1758eb3b2a | ||
|
|
faae02c2f4 | ||
|
|
d2abaa7776 | ||
|
|
78e83f877c |
@@ -1,3 +1,9 @@
|
||||
ver 1.29:
|
||||
Fix issue with QMI and SIM initialized notification.
|
||||
Add support for multiple PDP contexts and xmm7xxx modems.
|
||||
Add support for handling Dual SIM Single Active feature
|
||||
Add support for SIM PIN caching feature.
|
||||
|
||||
ver 1.28:
|
||||
Fix issue with SIM initialization and Gemalto modems.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
AC_PREREQ(2.60)
|
||||
AC_INIT(ofono, 1.28)
|
||||
AC_INIT(ofono, 1.29)
|
||||
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
@@ -205,3 +205,15 @@ Properties boolean Present [readonly]
|
||||
|
||||
Contains the SIM's ImsPrivateIdentity, read from the
|
||||
ISIM.
|
||||
|
||||
uint32 CardSlotCount [readonly, experimental]
|
||||
|
||||
Contains the count of number of SIM card slots available.
|
||||
|
||||
uint32 ActiveCardSlot [readwrite, experimental]
|
||||
|
||||
Contains the index of the currently active SIM card slot
|
||||
for dual SIM single active mode.
|
||||
|
||||
This property will range from 1 (default) to
|
||||
CardSlotCount (max) value.
|
||||
|
||||
@@ -455,7 +455,6 @@ 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,
|
||||
|
||||
@@ -1559,12 +1559,12 @@ static void creg_notify(GAtResult *result, gpointer user_data)
|
||||
option_query_tech_cb, tq, g_free) > 0)
|
||||
return;
|
||||
break;
|
||||
case OFONO_VENDOR_GEMALTO:
|
||||
if (g_at_chat_send(nd->chat, "AT^SMONI",
|
||||
smoni_prefix,
|
||||
gemalto_query_tech_cb, tq, g_free) > 0)
|
||||
return;
|
||||
break;
|
||||
case OFONO_VENDOR_GEMALTO:
|
||||
if (g_at_chat_send(nd->chat, "AT^SMONI",
|
||||
smoni_prefix,
|
||||
gemalto_query_tech_cb, tq, g_free) > 0)
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
g_free(tq);
|
||||
@@ -1655,8 +1655,11 @@ static ofono_bool_t build_cmer_string(char *buf, int *cmer_opts,
|
||||
DBG("");
|
||||
|
||||
switch (nd->vendor) {
|
||||
case OFONO_VENDOR_UBLOX_TOBY_L2:
|
||||
/* UBX-13002752 R33: TOBY L2 doesn't support mode 2 and 3 */
|
||||
case OFONO_VENDOR_UBLOX:
|
||||
/* For all u-blox models, mode 3 is equivalent to mode 1;
|
||||
* since some models do not support setting modes 2 nor 3
|
||||
* (see UBX-13002752), we prefer mode 1 for all models.
|
||||
*/
|
||||
mode = "1";
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -75,6 +75,7 @@ static const char *cuad_prefix[] = { "+CUAD:", NULL };
|
||||
static const char *ccho_prefix[] = { "+CCHO:", NULL };
|
||||
static const char *crla_prefix[] = { "+CRLA:", NULL };
|
||||
static const char *cgla_prefix[] = { "+CGLA:", NULL };
|
||||
static const char *xcmscsc_prefix[] = { "+XCMSCSC:", NULL};
|
||||
static const char *none_prefix[] = { NULL };
|
||||
|
||||
static void append_file_path(char *buf, const unsigned char *path,
|
||||
@@ -1160,6 +1161,7 @@ static void at_pin_retries_query(struct ofono_sim *sim,
|
||||
DBG("");
|
||||
|
||||
switch (sd->vendor) {
|
||||
case OFONO_VENDOR_XMM:
|
||||
case OFONO_VENDOR_IFX:
|
||||
if (g_at_chat_send(sd->chat, "AT+XPINCNT", xpincnt_prefix,
|
||||
xpincnt_cb, cbd, g_free) > 0)
|
||||
@@ -1221,7 +1223,6 @@ 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;
|
||||
@@ -1921,6 +1922,83 @@ static void at_logical_access(struct ofono_sim *sim, int session_id,
|
||||
CALLBACK_WITH_FAILURE(cb, NULL, 0, data);
|
||||
}
|
||||
|
||||
static void xcmscsc_query_cb(gboolean ok, GAtResult *result, gpointer user)
|
||||
{
|
||||
struct ofono_sim *sim = user;
|
||||
struct sim_data *sd = ofono_sim_get_data(sim);
|
||||
GAtResultIter iter;
|
||||
int active_slot;
|
||||
|
||||
if (!ok)
|
||||
goto done;
|
||||
|
||||
g_at_result_iter_init(&iter, result);
|
||||
|
||||
if (!g_at_result_iter_next(&iter, "+XCMSCSC:"))
|
||||
goto done;
|
||||
|
||||
g_at_result_iter_skip_next(&iter);
|
||||
g_at_result_iter_skip_next(&iter);
|
||||
|
||||
g_at_result_iter_next_number(&iter, &active_slot);
|
||||
|
||||
/* set active SIM slot */
|
||||
ofono_sim_set_active_card_slot(sim, active_slot + 1);
|
||||
|
||||
done:
|
||||
/* Query supported <fac>s */
|
||||
g_at_chat_send(sd->chat, "AT+CLCK=?", clck_prefix,
|
||||
at_clck_query_cb, sim, NULL);
|
||||
}
|
||||
|
||||
static void at_xcmscsc_test_cb(gboolean ok, GAtResult *result, gpointer user)
|
||||
{
|
||||
struct ofono_sim *sim = user;
|
||||
struct sim_data *sd = ofono_sim_get_data(sim);
|
||||
GAtResultIter iter;
|
||||
int card_slot_count;
|
||||
|
||||
if (!ok)
|
||||
goto done;
|
||||
|
||||
g_at_result_iter_init(&iter, result);
|
||||
|
||||
if (!g_at_result_iter_next(&iter, "+XCMSCSC:"))
|
||||
goto done;
|
||||
|
||||
g_at_result_iter_skip_next(&iter);
|
||||
g_at_result_iter_skip_next(&iter);
|
||||
|
||||
if (!g_at_result_iter_open_list(&iter))
|
||||
goto done;
|
||||
|
||||
g_at_result_iter_skip_next(&iter);
|
||||
|
||||
if (!g_at_result_iter_next_number(&iter, &card_slot_count))
|
||||
goto done;
|
||||
|
||||
/* Set num slots */
|
||||
ofono_sim_set_card_slot_count(sim, card_slot_count + 1);
|
||||
|
||||
/*
|
||||
* enable reporting of MSIM remap status information
|
||||
* and enable automatic acceptance of MSIM Remap
|
||||
* acknowledgement
|
||||
*/
|
||||
g_at_chat_send(sd->chat, "AT+XCMSRS=2", none_prefix,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
/* Query active card slot */
|
||||
g_at_chat_send(sd->chat, "AT+XCMSCSC?", xcmscsc_prefix,
|
||||
xcmscsc_query_cb, sim, NULL);
|
||||
return;
|
||||
|
||||
done:
|
||||
/* Query supported <fac>s */
|
||||
g_at_chat_send(sd->chat, "AT+CLCK=?", clck_prefix,
|
||||
at_clck_query_cb, sim, NULL);
|
||||
}
|
||||
|
||||
static int at_sim_probe(struct ofono_sim *sim, unsigned int vendor,
|
||||
void *data)
|
||||
{
|
||||
@@ -1939,6 +2017,10 @@ static int at_sim_probe(struct ofono_sim *sim, unsigned int vendor,
|
||||
if (at_clck_cpwd_fac[i])
|
||||
sd->passwd_type_mask |= (1 << i);
|
||||
|
||||
if (sd->vendor == OFONO_VENDOR_XMM)
|
||||
return g_at_chat_send(sd->chat, "AT+XCMSCSC=?", xcmscsc_prefix,
|
||||
at_xcmscsc_test_cb, sim, NULL) ? 0 : -1;
|
||||
|
||||
/* Query supported <fac>s */
|
||||
return g_at_chat_send(sd->chat, "AT+CLCK=?", clck_prefix,
|
||||
at_clck_query_cb, sim, NULL) ? 0 : -1;
|
||||
@@ -1958,6 +2040,46 @@ static void at_sim_remove(struct ofono_sim *sim)
|
||||
g_free(sd);
|
||||
}
|
||||
|
||||
static void xcmscsc_cb(gboolean ok, GAtResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
ofono_sim_set_active_card_slot_cb_t cb = cbd->cb;
|
||||
struct ofono_error error;
|
||||
|
||||
decode_at_error(&error, g_at_result_final_response(result));
|
||||
|
||||
if (cb)
|
||||
cb(&error, cbd->data);
|
||||
}
|
||||
|
||||
static void at_set_active_card_slot(struct ofono_sim *sim, unsigned int index,
|
||||
ofono_sim_set_active_card_slot_cb_t cb, void *data)
|
||||
{
|
||||
struct sim_data *sd = ofono_sim_get_data(sim);
|
||||
struct cb_data *cbd = cb_data_new(cb, data);
|
||||
char cmd[43];
|
||||
|
||||
if (sd->vendor != OFONO_VENDOR_XMM) {
|
||||
struct ofono_error error;
|
||||
error.type = OFONO_ERROR_TYPE_CME;
|
||||
error.error = 4;
|
||||
|
||||
cb(&error, data);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Enable single SIM mode for indicated card slot id */
|
||||
snprintf(cmd, sizeof(cmd), "AT+XCMSCSC=1,0,%u,1", index);
|
||||
|
||||
if (g_at_chat_send(sd->chat, cmd, none_prefix, xcmscsc_cb,
|
||||
cbd, g_free) > 0)
|
||||
return;
|
||||
|
||||
g_free(cbd);
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
}
|
||||
|
||||
static const struct ofono_sim_driver driver = {
|
||||
.name = "atmodem",
|
||||
.probe = at_sim_probe,
|
||||
@@ -1983,7 +2105,8 @@ static const struct ofono_sim_driver driver = {
|
||||
.session_read_binary = at_session_read_binary,
|
||||
.session_read_record = at_session_read_record,
|
||||
.session_read_info = at_session_read_info,
|
||||
.logical_access = at_logical_access
|
||||
.logical_access = at_logical_access,
|
||||
.set_active_card_slot = at_set_active_card_slot
|
||||
};
|
||||
|
||||
static const struct ofono_sim_driver driver_noef = {
|
||||
|
||||
@@ -46,7 +46,6 @@ enum ofono_vendor {
|
||||
OFONO_VENDOR_QUECTEL,
|
||||
OFONO_VENDOR_QUECTEL_M95,
|
||||
OFONO_VENDOR_UBLOX,
|
||||
OFONO_VENDOR_UBLOX_TOBY_L2,
|
||||
OFONO_VENDOR_XMM,
|
||||
OFONO_VENDOR_GEMALTO,
|
||||
};
|
||||
|
||||
@@ -260,6 +260,45 @@ error:
|
||||
failed_setup(gc, NULL, TRUE);
|
||||
}
|
||||
|
||||
static void cgdata_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_gprs_context *gc = user_data;
|
||||
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
|
||||
|
||||
DBG("ok %d", ok);
|
||||
|
||||
if (!ok) {
|
||||
ofono_error("Failed to establish session");
|
||||
failed_setup(gc, result, TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
|
||||
}
|
||||
|
||||
static const char *get_datapath(struct ofono_modem *modem,
|
||||
const char *interface)
|
||||
{
|
||||
static char datapath[256];
|
||||
char n;
|
||||
|
||||
if (!strcmp(interface,
|
||||
ofono_modem_get_string(modem, "NetworkInterface")))
|
||||
n = '0';
|
||||
else if (!strcmp(interface,
|
||||
ofono_modem_get_string(modem, "NetworkInterface2")))
|
||||
n = '1';
|
||||
else if (!strcmp(interface,
|
||||
ofono_modem_get_string(modem, "NetworkInterface3")))
|
||||
n = '2';
|
||||
else
|
||||
return NULL;
|
||||
|
||||
snprintf(datapath, sizeof(datapath), "%s%c",
|
||||
ofono_modem_get_string(modem, "DataPath"), n);
|
||||
return datapath;
|
||||
}
|
||||
|
||||
static void cgcontrdp_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_gprs_context *gc = user_data;
|
||||
@@ -269,8 +308,11 @@ static void cgcontrdp_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
|
||||
const char *laddrnetmask = NULL;
|
||||
const char *gw = NULL;
|
||||
const char *interface;
|
||||
const char *dns[3];
|
||||
const char *ctrlpath;
|
||||
const char *datapath;
|
||||
char buf[512];
|
||||
const char *interface;
|
||||
|
||||
DBG("ok %d", ok);
|
||||
|
||||
@@ -327,9 +369,10 @@ static void cgcontrdp_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
DBG("DNS2: %s\n", gcd->dns2);
|
||||
DBG("Gateway: %s\n", gcd->gateway);
|
||||
|
||||
interface = ofono_modem_get_string(modem, "NetworkInterface");
|
||||
ctrlpath = ofono_modem_get_string(modem, "CtrlPath");
|
||||
interface = ofono_gprs_context_get_interface(gc);
|
||||
datapath = get_datapath(modem, interface);
|
||||
|
||||
ofono_gprs_context_set_interface(gc, interface);
|
||||
ofono_gprs_context_set_ipv4_address(gc, gcd->address, TRUE);
|
||||
|
||||
if (gcd->netmask[0])
|
||||
@@ -340,7 +383,17 @@ static void cgcontrdp_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
|
||||
ofono_gprs_context_set_ipv4_dns_servers(gc, dns);
|
||||
|
||||
CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
|
||||
snprintf(buf, sizeof(buf), "AT+XDATACHANNEL=1,1,\"%s\",\"%s\",2,%u",
|
||||
ctrlpath, datapath, gcd->active_context);
|
||||
g_at_chat_send(gcd->chat, buf, none_prefix, NULL, NULL, NULL);
|
||||
snprintf(buf, sizeof(buf), "AT+CGDATA=\"M-RAW_IP\",%u",
|
||||
gcd->active_context);
|
||||
|
||||
if (g_at_chat_send(gcd->chat, buf, none_prefix, cgdata_cb,
|
||||
gc, NULL) > 0)
|
||||
return;
|
||||
|
||||
CALLBACK_WITH_FAILURE(gcd->cb, gcd->cb_data);
|
||||
}
|
||||
|
||||
static void ifx_read_settings(struct ofono_gprs_context *gc)
|
||||
|
||||
@@ -250,6 +250,7 @@ static void process_uim_state(struct ofono_sim *sim, uint8_t state)
|
||||
switch (state) {
|
||||
case QMI_DMS_UIM_STATE_INIT_COMPLETE:
|
||||
ofono_sim_inserted_notify(sim, TRUE);
|
||||
ofono_sim_initialized_notify(sim);
|
||||
break;
|
||||
case QMI_DMS_UIM_STATE_INIT_FAILED:
|
||||
case QMI_DMS_UIM_STATE_NOT_PRESENT:
|
||||
|
||||
@@ -524,7 +524,7 @@ static bool get_card_status(const struct qmi_uim_slot_info *slot,
|
||||
return need_retry;
|
||||
}
|
||||
|
||||
static enum get_card_status_result handle_get_card_status_result(
|
||||
static enum get_card_status_result handle_get_card_status_data(
|
||||
struct qmi_result *result, struct sim_status *sim_stat)
|
||||
{
|
||||
const void *ptr;
|
||||
@@ -533,9 +533,6 @@ static enum get_card_status_result handle_get_card_status_result(
|
||||
uint8_t i;
|
||||
enum get_card_status_result res = GET_CARD_STATUS_RESULT_ERROR;
|
||||
|
||||
if (qmi_result_set_error(result, NULL))
|
||||
goto done;
|
||||
|
||||
ptr = qmi_result_get(result, QMI_UIM_RESULT_CARD_STATUS, &len);
|
||||
if (!ptr)
|
||||
goto done;
|
||||
@@ -578,6 +575,15 @@ done:
|
||||
return res;
|
||||
}
|
||||
|
||||
static enum get_card_status_result handle_get_card_status_result(
|
||||
struct qmi_result *result, struct sim_status *sim_stat)
|
||||
{
|
||||
if (qmi_result_set_error(result, NULL))
|
||||
return GET_CARD_STATUS_RESULT_ERROR;
|
||||
|
||||
return handle_get_card_status_data(result, sim_stat);
|
||||
}
|
||||
|
||||
static gboolean query_passwd_state_retry(gpointer userdata)
|
||||
{
|
||||
struct cb_data *cbd = userdata;
|
||||
@@ -789,6 +795,34 @@ static void get_card_status_cb(struct qmi_result *result, void *user_data)
|
||||
case 0x00: /* Absent */
|
||||
case 0x02: /* Error */
|
||||
break;
|
||||
case 0x01: /* Present */
|
||||
ofono_sim_inserted_notify(sim, TRUE);
|
||||
ofono_sim_initialized_notify(sim);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void card_status_notify(struct qmi_result *result, void *user_data)
|
||||
{
|
||||
struct ofono_sim *sim = user_data;
|
||||
struct sim_data *data = ofono_sim_get_data(sim);
|
||||
struct sim_status sim_stat;
|
||||
|
||||
DBG("");
|
||||
|
||||
if (handle_get_card_status_data(result, &sim_stat) !=
|
||||
GET_CARD_STATUS_RESULT_OK) {
|
||||
data->app_type = 0; /* Unknown */
|
||||
sim_stat.card_state = 0x00; /* Absent */
|
||||
} else {
|
||||
data->app_type = sim_stat.app_type;
|
||||
}
|
||||
|
||||
switch (sim_stat.card_state) {
|
||||
case 0x00: /* Absent */
|
||||
case 0x02: /* Error */
|
||||
ofono_sim_inserted_notify(sim, FALSE);
|
||||
break;
|
||||
case 0x01: /* Present */
|
||||
ofono_sim_inserted_notify(sim, TRUE);
|
||||
break;
|
||||
@@ -810,6 +844,9 @@ static void event_registration_cb(struct qmi_result *result, void *user_data)
|
||||
goto error;
|
||||
|
||||
DBG("event mask 0x%04x", data->event_mask);
|
||||
if (data->event_mask & 0x0001)
|
||||
qmi_service_register(data->uim, QMI_UIM_GET_CARD_STATUS_EVENT,
|
||||
card_status_notify, sim, NULL);
|
||||
|
||||
if (qmi_service_send(data->uim, QMI_UIM_GET_CARD_STATUS, NULL,
|
||||
get_card_status_cb, sim, NULL) > 0)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#define QMI_UIM_EVENT_REGISTRATION 46 /* Register for indications */
|
||||
#define QMI_UIM_GET_CARD_STATUS 47 /* Get card status */
|
||||
|
||||
#define QMI_UIM_GET_CARD_STATUS_EVENT 50 /* Card status indication */
|
||||
|
||||
/* Register for indications */
|
||||
#define QMI_UIM_PARAM_EVENT_MASK 0x01 /* uint32 */
|
||||
|
||||
@@ -43,12 +43,20 @@
|
||||
static const char *none_prefix[] = { NULL };
|
||||
static const char *cgcontrdp_prefix[] = { "+CGCONTRDP:", NULL };
|
||||
static const char *uipaddr_prefix[] = { "+UIPADDR:", NULL };
|
||||
static const char *ubmconf_prefix[] = { "+UBMCONF:", NULL };
|
||||
|
||||
enum netmode {
|
||||
NETWORKING_MODE_ROUTER,
|
||||
NETWORKING_MODE_BRIDGE,
|
||||
};
|
||||
|
||||
struct gprs_context_data {
|
||||
const struct ublox_model *model;
|
||||
GAtChat *chat;
|
||||
unsigned int active_context;
|
||||
ofono_gprs_context_cb_t cb;
|
||||
void *cb_data;
|
||||
enum netmode networking_mode;
|
||||
};
|
||||
|
||||
static void uipaddr_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
@@ -227,6 +235,14 @@ static void ublox_read_settings(struct ofono_gprs_context *gc)
|
||||
{
|
||||
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
|
||||
|
||||
if (gcd->networking_mode == NETWORKING_MODE_ROUTER) {
|
||||
/* Use DHCP */
|
||||
set_gprs_context_interface(gc);
|
||||
ofono_gprs_context_set_ipv4_address(gc, NULL, 0);
|
||||
CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ublox_send_cgcontrdp(gc) < 0)
|
||||
CALLBACK_WITH_FAILURE(gcd->cb, gcd->cb_data);
|
||||
}
|
||||
@@ -461,8 +477,44 @@ static void cgev_notify(GAtResult *result, gpointer user_data)
|
||||
gcd->active_context = 0;
|
||||
}
|
||||
|
||||
static void at_ubmconf_read_cb(gboolean ok, GAtResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
struct ofono_gprs_context *gc = user_data;
|
||||
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
|
||||
GAtResultIter iter;
|
||||
int mode;
|
||||
|
||||
if (!ok)
|
||||
goto error;
|
||||
|
||||
g_at_result_iter_init(&iter, result);
|
||||
if (!g_at_result_iter_next(&iter, "+UBMCONF:"))
|
||||
goto error;
|
||||
|
||||
if (!g_at_result_iter_next_number(&iter, &mode))
|
||||
goto error;
|
||||
|
||||
switch (mode) {
|
||||
case 1:
|
||||
gcd->networking_mode = NETWORKING_MODE_ROUTER;
|
||||
break;
|
||||
case 2:
|
||||
gcd->networking_mode = NETWORKING_MODE_BRIDGE;
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
error:
|
||||
ofono_error("AT+UBMCONF? failed; assuming router mode");
|
||||
gcd->networking_mode = NETWORKING_MODE_ROUTER;
|
||||
}
|
||||
|
||||
static int ublox_gprs_context_probe(struct ofono_gprs_context *gc,
|
||||
unsigned int vendor, void *data)
|
||||
unsigned int model_id, void *data)
|
||||
{
|
||||
GAtChat *chat = data;
|
||||
struct gprs_context_data *gcd;
|
||||
@@ -473,10 +525,23 @@ static int ublox_gprs_context_probe(struct ofono_gprs_context *gc,
|
||||
if (gcd == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
gcd->model = ublox_model_from_id(model_id);
|
||||
if (!gcd->model)
|
||||
return -EINVAL;
|
||||
|
||||
gcd->chat = g_at_chat_clone(chat);
|
||||
|
||||
ofono_gprs_context_set_data(gc, gcd);
|
||||
|
||||
if (ublox_is_toby_l2(gcd->model)) {
|
||||
g_at_chat_send(chat, "AT+UBMCONF?", ubmconf_prefix,
|
||||
at_ubmconf_read_cb, gc, NULL);
|
||||
} else if (ublox_is_toby_l4(gcd->model)) {
|
||||
gcd->networking_mode = NETWORKING_MODE_ROUTER;
|
||||
} else {
|
||||
gcd->networking_mode = NETWORKING_MODE_ROUTER;
|
||||
}
|
||||
|
||||
g_at_chat_register(chat, "+CGEV:", cgev_notify, FALSE, gc, NULL);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -39,24 +39,85 @@
|
||||
|
||||
#include "ubloxmodem.h"
|
||||
|
||||
static const char *ucgdflt_prefix[] = { "+UCGDFLT:", NULL };
|
||||
static const char *none_prefix[] = { NULL };
|
||||
|
||||
struct lte_driver_data {
|
||||
GAtChat *chat;
|
||||
const struct ublox_model *model;
|
||||
struct ofono_lte_default_attach_info pending_info;
|
||||
};
|
||||
|
||||
static void ucgdflt_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
static void at_lte_set_auth_cb(gboolean ok, GAtResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
ofono_lte_cb_t cb = cbd->cb;
|
||||
struct ofono_error error;
|
||||
|
||||
DBG("ok %d", ok);
|
||||
|
||||
decode_at_error(&error, g_at_result_final_response(result));
|
||||
cb(&error, cbd->data);
|
||||
}
|
||||
|
||||
static void at_lte_set_default_attach_info_cb(gboolean ok, GAtResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
ofono_lte_cb_t cb = cbd->cb;
|
||||
void *data = cbd->data;
|
||||
struct lte_driver_data *ldd = cbd->user;
|
||||
struct ofono_error error;
|
||||
char buf[32 + OFONO_GPRS_MAX_USERNAME_LENGTH +
|
||||
OFONO_GPRS_MAX_PASSWORD_LENGTH + 1];
|
||||
enum ofono_gprs_auth_method auth_method;
|
||||
int cid;
|
||||
|
||||
if (!ok) {
|
||||
decode_at_error(&error, g_at_result_final_response(result));
|
||||
cb(&error, data);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ublox_is_toby_l2(ldd->model)) {
|
||||
/* If CGDCONT has already been used to set up cid 4 then
|
||||
* the EPS default bearer will be configured from another
|
||||
* cid (see documentation for how this is selected). Avoid
|
||||
* doing so as this assumes as much...
|
||||
*/
|
||||
cid = 4;
|
||||
} else if (ublox_is_toby_l4(ldd->model)) {
|
||||
cid = 1;
|
||||
} else {
|
||||
ofono_error("Unknown model; "
|
||||
"unable to determine EPS default bearer CID");
|
||||
goto out;
|
||||
}
|
||||
|
||||
auth_method = ldd->pending_info.auth_method;
|
||||
|
||||
/* change the authentication method if the parameters are invalid */
|
||||
if (!*ldd->pending_info.username || !*ldd->pending_info.password)
|
||||
auth_method = OFONO_GPRS_AUTH_METHOD_NONE;
|
||||
|
||||
/* In contrast to CGAUTH, all four parameters are _required_ here;
|
||||
* if auth type is NONE then username and password must be set to
|
||||
* empty strings.
|
||||
*/
|
||||
sprintf(buf, "AT+UAUTHREQ=%d,%d,\"%s\",\"%s\"",
|
||||
cid,
|
||||
at_util_gprs_auth_method_to_auth_prot(auth_method),
|
||||
ldd->pending_info.username,
|
||||
ldd->pending_info.password);
|
||||
|
||||
cbd = cb_data_ref(cbd);
|
||||
if (g_at_chat_send(ldd->chat, buf, none_prefix,
|
||||
at_lte_set_auth_cb, cbd, cb_data_unref) > 0)
|
||||
return;
|
||||
|
||||
out:
|
||||
cb_data_unref(cbd);
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
}
|
||||
|
||||
static void ublox_lte_set_default_attach_info(const struct ofono_lte *lte,
|
||||
const struct ofono_lte_default_attach_info *info,
|
||||
ofono_lte_cb_t cb, void *data)
|
||||
@@ -67,17 +128,32 @@ static void ublox_lte_set_default_attach_info(const struct ofono_lte *lte,
|
||||
|
||||
DBG("LTE config with APN: %s", info->apn);
|
||||
|
||||
if (strlen(info->apn) > 0)
|
||||
snprintf(buf, sizeof(buf), "AT+UCGDFLT=0,\"IP\",\"%s\"",
|
||||
info->apn);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "AT+UCGDFLT=0");
|
||||
cbd->user = ldd;
|
||||
memcpy(&ldd->pending_info, info, sizeof(ldd->pending_info));
|
||||
|
||||
/* We can't do much in case of failure so don't check response. */
|
||||
if (g_at_chat_send(ldd->chat, buf, ucgdflt_prefix,
|
||||
ucgdflt_cb, cbd, g_free) > 0)
|
||||
if (ublox_is_toby_l2(ldd->model)) {
|
||||
if (strlen(info->apn) > 0)
|
||||
snprintf(buf, sizeof(buf), "AT+UCGDFLT=0,%s,\"%s\"",
|
||||
at_util_gprs_proto_to_pdp_type(info->proto),
|
||||
info->apn);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "AT+UCGDFLT=0");
|
||||
|
||||
} else if (ublox_is_toby_l4(ldd->model)) {
|
||||
if (strlen(info->apn) > 0)
|
||||
snprintf(buf, sizeof(buf), "AT+CGDCONT=1,%s,\"%s\"",
|
||||
at_util_gprs_proto_to_pdp_type(info->proto),
|
||||
info->apn);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "AT+CGDCONT=1");
|
||||
}
|
||||
|
||||
if (g_at_chat_send(ldd->chat, buf, none_prefix,
|
||||
at_lte_set_default_attach_info_cb,
|
||||
cbd, cb_data_unref) > 0)
|
||||
return;
|
||||
|
||||
cb_data_unref(cbd);
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
}
|
||||
|
||||
@@ -91,7 +167,7 @@ static gboolean lte_delayed_register(gpointer user_data)
|
||||
}
|
||||
|
||||
static int ublox_lte_probe(struct ofono_lte *lte,
|
||||
unsigned int vendor, void *data)
|
||||
unsigned int model_id, void *data)
|
||||
{
|
||||
GAtChat *chat = data;
|
||||
struct lte_driver_data *ldd;
|
||||
@@ -103,6 +179,7 @@ static int ublox_lte_probe(struct ofono_lte *lte,
|
||||
return -ENOMEM;
|
||||
|
||||
ldd->chat = g_at_chat_clone(chat);
|
||||
ldd->model = ublox_model_from_id(model_id);
|
||||
|
||||
ofono_lte_set_data(lte, ldd);
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <gatchat.h>
|
||||
|
||||
@@ -33,6 +35,83 @@
|
||||
|
||||
#include "ubloxmodem.h"
|
||||
|
||||
const struct ublox_model ublox_models[] = {
|
||||
{
|
||||
.name = "SARA-G270",
|
||||
},
|
||||
/* TOBY L2 series */
|
||||
{
|
||||
.name = "TOBY-L200",
|
||||
.flags = UBLOX_F_TOBY_L2|UBLOX_F_HAVE_USBCONF,
|
||||
},
|
||||
{
|
||||
.name = "TOBY-L201",
|
||||
.flags = UBLOX_F_TOBY_L2|UBLOX_F_HAVE_USBCONF,
|
||||
},
|
||||
{
|
||||
.name = "TOBY-L210",
|
||||
.flags = UBLOX_F_TOBY_L2|UBLOX_F_HAVE_USBCONF,
|
||||
},
|
||||
{
|
||||
.name = "TOBY-L220",
|
||||
.flags = UBLOX_F_TOBY_L2|UBLOX_F_HAVE_USBCONF,
|
||||
},
|
||||
{
|
||||
.name = "TOBY-L280",
|
||||
.flags = UBLOX_F_TOBY_L2|UBLOX_F_HAVE_USBCONF,
|
||||
},
|
||||
/* TOBY L4 series */
|
||||
{
|
||||
.name = "TOBY-L4006",
|
||||
.flags = UBLOX_F_TOBY_L4,
|
||||
},
|
||||
{
|
||||
.name = "TOBY-L4106",
|
||||
.flags = UBLOX_F_TOBY_L4,
|
||||
},
|
||||
{
|
||||
.name = "TOBY-L4206",
|
||||
.flags = UBLOX_F_TOBY_L4,
|
||||
},
|
||||
{
|
||||
.name = "TOBY-L4906",
|
||||
.flags = UBLOX_F_TOBY_L4,
|
||||
},
|
||||
{ /* sentinel */ },
|
||||
};
|
||||
|
||||
const struct ublox_model *ublox_model_from_name(const char *name)
|
||||
{
|
||||
const struct ublox_model *m;
|
||||
|
||||
for (m = ublox_models; m->name; m++) {
|
||||
if (!strcmp(name, m->name))
|
||||
return m;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const struct ublox_model *ublox_model_from_id(int id)
|
||||
{
|
||||
return ublox_models + id;
|
||||
}
|
||||
|
||||
int ublox_model_to_id(const struct ublox_model *model)
|
||||
{
|
||||
return model - ublox_models;
|
||||
}
|
||||
|
||||
int ublox_is_toby_l2(const struct ublox_model *model)
|
||||
{
|
||||
return model->flags & UBLOX_F_TOBY_L2;
|
||||
}
|
||||
|
||||
int ublox_is_toby_l4(const struct ublox_model *model)
|
||||
{
|
||||
return model->flags & UBLOX_F_TOBY_L4;
|
||||
}
|
||||
|
||||
static int ubloxmodem_init(void)
|
||||
{
|
||||
ublox_gprs_context_init();
|
||||
|
||||
@@ -23,6 +23,23 @@
|
||||
|
||||
#define UBLOXMODEM "ubloxmodem"
|
||||
|
||||
enum ublox_flags {
|
||||
UBLOX_F_TOBY_L2 = (1 << 0),
|
||||
UBLOX_F_TOBY_L4 = (1 << 1),
|
||||
UBLOX_F_HAVE_USBCONF = (1 << 2),
|
||||
};
|
||||
|
||||
struct ublox_model {
|
||||
char *name;
|
||||
int flags;
|
||||
};
|
||||
|
||||
const struct ublox_model *ublox_model_from_name(const char *name);
|
||||
const struct ublox_model *ublox_model_from_id(int id);
|
||||
int ublox_model_to_id(const struct ublox_model *model);
|
||||
int ublox_is_toby_l2(const struct ublox_model *model);
|
||||
int ublox_is_toby_l4(const struct ublox_model *model);
|
||||
|
||||
extern void ublox_gprs_context_init(void);
|
||||
extern void ublox_gprs_context_exit(void);
|
||||
|
||||
|
||||
@@ -93,6 +93,8 @@ void ofono_gprs_context_set_type(struct ofono_gprs_context *gc,
|
||||
enum ofono_gprs_context_type ofono_gprs_context_get_type(
|
||||
struct ofono_gprs_context *gc);
|
||||
|
||||
const char *ofono_gprs_context_get_interface(struct ofono_gprs_context *gc);
|
||||
|
||||
void ofono_gprs_context_set_interface(struct ofono_gprs_context *gc,
|
||||
const char *interface);
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* oFono - Open Source Telephony
|
||||
*
|
||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||
* Copyright (C) 2015-2021 Jolla Ltd.
|
||||
* Copyright (C) 2015-2022 Jolla Ltd.
|
||||
*
|
||||
* 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
|
||||
@@ -138,6 +138,10 @@ typedef void (*ofono_sim_close_channel_cb_t)(const struct ofono_error *error,
|
||||
typedef void (*ofono_sim_logical_access_cb_t)(const struct ofono_error *error,
|
||||
const unsigned char *resp, unsigned int len, void *data);
|
||||
|
||||
typedef void (*ofono_sim_set_active_card_slot_cb_t)(
|
||||
const struct ofono_error *error,
|
||||
void *data);
|
||||
|
||||
struct ofono_sim_driver {
|
||||
const char *name;
|
||||
int (*probe)(struct ofono_sim *sim, unsigned int vendor, void *data);
|
||||
@@ -211,15 +215,23 @@ struct ofono_sim_driver {
|
||||
void (*logical_access)(struct ofono_sim *sim, int session_id,
|
||||
const unsigned char *pdu, unsigned int len,
|
||||
ofono_sim_logical_access_cb_t cb, void *data);
|
||||
/* Since mer/1.23+git28 */
|
||||
/* API version 1 (since 1.23+git28) */
|
||||
void (*open_channel2)(struct ofono_sim *sim, const unsigned char *aid,
|
||||
unsigned int len, ofono_sim_open_channel_cb_t cb,
|
||||
void *data);
|
||||
/* API version 2 (since 1.29+git1) */
|
||||
void (*set_active_card_slot)(struct ofono_sim *sim, unsigned int index,
|
||||
ofono_sim_set_active_card_slot_cb_t cb, void *data);
|
||||
};
|
||||
|
||||
int ofono_sim_driver_register(const struct ofono_sim_driver *d);
|
||||
void ofono_sim_driver_unregister(const struct ofono_sim_driver *d);
|
||||
|
||||
#define OFONO_SIM_DRIVER_API_VERSION 2
|
||||
#define ofono_sim_driver_register(d) /* Since 1.28+git4 */ \
|
||||
ofono_sim_driver_register_version(d, OFONO_SIM_DRIVER_API_VERSION)
|
||||
int ofono_sim_driver_register_version(const struct ofono_sim_driver *d, int v);
|
||||
|
||||
struct ofono_sim *ofono_sim_create(struct ofono_modem *modem,
|
||||
unsigned int vendor,
|
||||
const char *driver, void *data);
|
||||
@@ -229,6 +241,9 @@ void ofono_sim_remove(struct ofono_sim *sim);
|
||||
|
||||
void ofono_sim_set_data(struct ofono_sim *sim, void *data);
|
||||
void *ofono_sim_get_data(struct ofono_sim *sim);
|
||||
void ofono_sim_set_card_slot_count(struct ofono_sim *sim, unsigned int val);
|
||||
void ofono_sim_set_active_card_slot(struct ofono_sim *sim,
|
||||
unsigned int val);
|
||||
|
||||
const char *ofono_sim_get_imsi(struct ofono_sim *sim);
|
||||
const char *ofono_sim_get_mcc(struct ofono_sim *sim);
|
||||
@@ -241,8 +256,8 @@ const unsigned char *ofono_sim_get_cphs_service_table(struct ofono_sim *sim);
|
||||
|
||||
enum ofono_sim_password_type ofono_sim_get_password_type(struct ofono_sim *sim);
|
||||
|
||||
void ofono_sim_refresh_full(struct ofono_sim *sim); /* Since mer/1.24+git2 */
|
||||
enum ofono_sim_password_type ofono_sim_puk2pin( /* Since mer/1.24+git2 */
|
||||
void ofono_sim_refresh_full(struct ofono_sim *sim); /* Since 1.24+git2 */
|
||||
enum ofono_sim_password_type ofono_sim_puk2pin( /* Since 1.24+git2 */
|
||||
enum ofono_sim_password_type type);
|
||||
|
||||
unsigned int ofono_sim_add_state_watch(struct ofono_sim *sim,
|
||||
|
||||
@@ -55,7 +55,9 @@ enum ofono_access_technology {
|
||||
OFONO_ACCESS_TECHNOLOGY_UTRAN_HSDPA = 4,
|
||||
OFONO_ACCESS_TECHNOLOGY_UTRAN_HSUPA = 5,
|
||||
OFONO_ACCESS_TECHNOLOGY_UTRAN_HSDPA_HSUPA = 6,
|
||||
OFONO_ACCESS_TECHNOLOGY_EUTRAN = 7
|
||||
OFONO_ACCESS_TECHNOLOGY_EUTRAN = 7,
|
||||
OFONO_ACCESS_TECHNOLOGY_NB_IOT_M1 = 8,
|
||||
OFONO_ACCESS_TECHNOLOGY_NB_IOT_NB1 = 9
|
||||
};
|
||||
|
||||
/* 27.007 Section 6.2 */
|
||||
|
||||
@@ -115,7 +115,7 @@ static void check_model(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
if (strstr(model, "SIM800"))
|
||||
data->modem_type = SIM800;
|
||||
else if (strstr(model, "SIM900"))
|
||||
data->modem_type = SIM800;
|
||||
data->modem_type = SIM900;
|
||||
else
|
||||
data->modem_type = SIMCOM_UNKNOWN;
|
||||
}
|
||||
|
||||
@@ -42,23 +42,24 @@
|
||||
#include <ofono/lte.h>
|
||||
#include <ofono/voicecall.h>
|
||||
|
||||
#include <drivers/atmodem/atutil.h>
|
||||
#include <drivers/atmodem/vendor.h>
|
||||
|
||||
#include <drivers/ubloxmodem/ubloxmodem.h>
|
||||
|
||||
static const char *uusbconf_prefix[] = { "+UUSBCONF:", NULL };
|
||||
static const char *none_prefix[] = { NULL };
|
||||
|
||||
enum supported_models {
|
||||
SARA_G270 = 1102,
|
||||
TOBYL2_COMPATIBLE_MODE = 1141,
|
||||
TOBYL2_MEDIUM_THROUGHPUT_MODE = 1143,
|
||||
TOBYL2_HIGH_THROUGHPUT_MODE = 1146,
|
||||
enum ublox_device_flags {
|
||||
UBLOX_DEVICE_F_HIGH_THROUGHPUT_MODE = (1 << 0),
|
||||
};
|
||||
|
||||
struct ublox_data {
|
||||
GAtChat *modem;
|
||||
GAtChat *aux;
|
||||
int model_id;
|
||||
enum ofono_vendor vendor_family;
|
||||
|
||||
const struct ublox_model *model;
|
||||
int flags;
|
||||
};
|
||||
|
||||
static void ublox_debug(const char *str, void *user_data)
|
||||
@@ -144,77 +145,151 @@ static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (data->model_id == TOBYL2_HIGH_THROUGHPUT_MODE)
|
||||
/* use bridged mode until routed mode support is added */
|
||||
g_at_chat_send(data->aux, "AT+UBMCONF=2", none_prefix,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
ofono_modem_set_powered(modem, TRUE);
|
||||
}
|
||||
|
||||
static void query_usbconf_cb(gboolean ok,
|
||||
GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct ublox_data *data = ofono_modem_get_data(modem);
|
||||
GAtResultIter iter;
|
||||
int profile;
|
||||
|
||||
if (!ok) {
|
||||
ofono_error("Unable to query USB configuration");
|
||||
goto error;
|
||||
}
|
||||
|
||||
g_at_result_iter_init(&iter, result);
|
||||
|
||||
retry:
|
||||
if (!g_at_result_iter_next(&iter, "+UUSBCONF:")) {
|
||||
ofono_error("Unable to query USB configuration");
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!g_at_result_iter_next_number(&iter, &profile))
|
||||
goto retry;
|
||||
|
||||
switch (profile) {
|
||||
case 0: /* Fairly back compatible */
|
||||
case 1: /* Fairly back compatible plus audio */
|
||||
break;
|
||||
case 2: /* Low/medium throughput */
|
||||
ofono_error("Medium throughput mode not supported");
|
||||
goto error;
|
||||
case 3: /* High throughput mode */
|
||||
data->flags |= UBLOX_DEVICE_F_HIGH_THROUGHPUT_MODE;
|
||||
break;
|
||||
default:
|
||||
ofono_error("Unexpected USB profile: %d", profile);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (g_at_chat_send(data->aux, "AT+CFUN=4", none_prefix,
|
||||
cfun_enable, modem, NULL))
|
||||
return;
|
||||
|
||||
error:
|
||||
g_at_chat_unref(data->aux);
|
||||
data->aux = NULL;
|
||||
g_at_chat_unref(data->modem);
|
||||
data->modem = NULL;
|
||||
ofono_modem_set_powered(modem, FALSE);
|
||||
}
|
||||
|
||||
static void query_model_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct ublox_data *data = ofono_modem_get_data(modem);
|
||||
struct ofono_error error;
|
||||
const char *model;
|
||||
const struct ublox_model *m;
|
||||
|
||||
decode_at_error(&error, g_at_result_final_response(result));
|
||||
|
||||
if (!ok)
|
||||
goto fail;
|
||||
|
||||
if (at_util_parse_attr(result, "", &model) == FALSE) {
|
||||
ofono_error("Failed to query modem model");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
m = ublox_model_from_name(model);
|
||||
if (!m) {
|
||||
ofono_error("Unrecognized model: %s", model);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
data->model = m;
|
||||
|
||||
DBG("Model: %s", data->model->name);
|
||||
|
||||
data->vendor_family = OFONO_VENDOR_UBLOX;
|
||||
|
||||
if (data->model->flags & UBLOX_F_HAVE_USBCONF) {
|
||||
if (g_at_chat_send(data->aux, "AT+UUSBCONF?", uusbconf_prefix,
|
||||
query_usbconf_cb, modem, NULL))
|
||||
return;
|
||||
|
||||
ofono_error("Unable to query USB configuration");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (g_at_chat_send(data->aux, "AT+CFUN=4", none_prefix,
|
||||
cfun_enable, modem, NULL))
|
||||
return;
|
||||
|
||||
fail:
|
||||
g_at_chat_unref(data->aux);
|
||||
data->aux = NULL;
|
||||
g_at_chat_unref(data->modem);
|
||||
data->modem = NULL;
|
||||
ofono_modem_set_powered(modem, FALSE);
|
||||
}
|
||||
|
||||
static int ublox_enable(struct ofono_modem *modem)
|
||||
{
|
||||
struct ublox_data *data = ofono_modem_get_data(modem);
|
||||
const char *model_str = NULL;
|
||||
|
||||
DBG("%p", modem);
|
||||
|
||||
model_str = ofono_modem_get_string(modem, "Model");
|
||||
if (model_str == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* Toby L2 devices are more complex and special than previously
|
||||
* supported U-Blox devices. So they need a vendor of their own.
|
||||
data->aux = open_device(modem, "Aux", "Aux: ");
|
||||
/* If this is a serial modem then the device may be behind
|
||||
* the 'Device' attribute instead...
|
||||
*/
|
||||
data->model_id = atoi(model_str);
|
||||
|
||||
switch (data->model_id) {
|
||||
case SARA_G270:
|
||||
data->vendor_family = OFONO_VENDOR_UBLOX;
|
||||
break;
|
||||
case TOBYL2_COMPATIBLE_MODE:
|
||||
case TOBYL2_HIGH_THROUGHPUT_MODE:
|
||||
data->vendor_family = OFONO_VENDOR_UBLOX_TOBY_L2;
|
||||
break;
|
||||
case TOBYL2_MEDIUM_THROUGHPUT_MODE:
|
||||
DBG("low/medium throughtput profile unsupported");
|
||||
break;
|
||||
default:
|
||||
DBG("unknown ublox model id %d", data->model_id);
|
||||
return -EINVAL;
|
||||
if (data->aux == NULL) {
|
||||
data->aux = open_device(modem, "Device", "Aux: ");
|
||||
if (data->aux == NULL)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
data->aux = open_device(modem, "Aux", "Aux: ");
|
||||
if (data->aux == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
if (data->vendor_family == OFONO_VENDOR_UBLOX) {
|
||||
data->modem = open_device(modem, "Modem", "Modem: ");
|
||||
if (data->modem == NULL) {
|
||||
g_at_chat_unref(data->aux);
|
||||
data->aux = NULL;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
data->modem = open_device(modem, "Modem", "Modem: ");
|
||||
if (data->modem) {
|
||||
g_at_chat_set_slave(data->modem, data->aux);
|
||||
|
||||
g_at_chat_send(data->modem, "ATE0 +CMEE=1", none_prefix,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
g_at_chat_send(data->modem, "AT&C0", NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
/* The modem can take a while to wake up if just powered on. */
|
||||
g_at_chat_set_wakeup_command(data->aux, "AT\r", 1000, 11000);
|
||||
|
||||
g_at_chat_send(data->aux, "ATE0 +CMEE=1", none_prefix,
|
||||
g_at_chat_send(data->aux, "ATE0", none_prefix,
|
||||
NULL, NULL, NULL);
|
||||
g_at_chat_send(data->aux, "AT+CMEE=1", none_prefix,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
g_at_chat_send(data->aux, "AT+CFUN=4", none_prefix,
|
||||
cfun_enable, modem, NULL);
|
||||
if (g_at_chat_send(data->aux, "AT+CGMM", NULL,
|
||||
query_model_cb, modem, NULL) > 0)
|
||||
return -EINPROGRESS;
|
||||
|
||||
return -EINPROGRESS;
|
||||
g_at_chat_unref(data->aux);
|
||||
data->aux = NULL;
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static void cfun_disable(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
@@ -308,19 +383,34 @@ static void ublox_post_sim(struct ofono_modem *modem)
|
||||
struct ofono_gprs *gprs;
|
||||
struct ofono_gprs_context *gc;
|
||||
GAtChat *chat = data->modem ? data->modem : data->aux;
|
||||
const char *driver = data->model_id == TOBYL2_HIGH_THROUGHPUT_MODE ?
|
||||
"ubloxmodem" : "atmodem";
|
||||
const char *driver;
|
||||
/* Toby L2: Create same number of contexts as supported PDP contexts. */
|
||||
int ncontexts = data->model_id == TOBYL2_HIGH_THROUGHPUT_MODE ? 8 : 1;
|
||||
int ncontexts = data->flags & UBLOX_DEVICE_F_HIGH_THROUGHPUT_MODE ? 8 : 1;
|
||||
int variant;
|
||||
|
||||
DBG("%p", modem);
|
||||
|
||||
gprs = ofono_gprs_create(modem, data->vendor_family, "atmodem",
|
||||
data->aux);
|
||||
|
||||
if (ublox_is_toby_l4(data->model)) {
|
||||
driver = "ubloxmodem";
|
||||
variant = ublox_model_to_id(data->model);
|
||||
} else if (ublox_is_toby_l2(data->model)) {
|
||||
if (data->flags & UBLOX_DEVICE_F_HIGH_THROUGHPUT_MODE) {
|
||||
driver = "ubloxmodem";
|
||||
variant = ublox_model_to_id(data->model);
|
||||
} else {
|
||||
driver = "atmodem";
|
||||
variant = OFONO_VENDOR_UBLOX;
|
||||
}
|
||||
} else {
|
||||
driver = "atmodem";
|
||||
variant = OFONO_VENDOR_UBLOX;
|
||||
}
|
||||
|
||||
while (ncontexts) {
|
||||
gc = ofono_gprs_context_create(modem, data->vendor_family,
|
||||
driver, chat);
|
||||
gc = ofono_gprs_context_create(modem, variant, driver, chat);
|
||||
|
||||
if (gprs && gc)
|
||||
ofono_gprs_add_context(gprs, gc);
|
||||
@@ -328,7 +418,8 @@ static void ublox_post_sim(struct ofono_modem *modem)
|
||||
--ncontexts;
|
||||
}
|
||||
|
||||
ofono_lte_create(modem, 0, "ubloxmodem", data->aux);
|
||||
ofono_lte_create(modem,
|
||||
ublox_model_to_id(data->model), "ubloxmodem", data->aux);
|
||||
}
|
||||
|
||||
static void ublox_post_online(struct ofono_modem *modem)
|
||||
|
||||
@@ -1090,11 +1090,17 @@ static gboolean setup_ublox(struct modem_info *modem)
|
||||
* - high throughput profile : 224/1/3
|
||||
*/
|
||||
} else if (g_strcmp0(info->interface, "2/2/1") == 0) {
|
||||
if (g_strcmp0(info->number, "02") == 0)
|
||||
aux = info->devnode;
|
||||
else if (g_strcmp0(info->number, "00") == 0)
|
||||
if (!g_strcmp0(modem->model, "1010")) {
|
||||
if (g_strcmp0(info->number, "06") == 0)
|
||||
aux = info->devnode;
|
||||
} else {
|
||||
if (g_strcmp0(info->number, "02") == 0)
|
||||
aux = info->devnode;
|
||||
}
|
||||
if (g_strcmp0(info->number, "00") == 0)
|
||||
mdm = info->devnode;
|
||||
} else if (g_strcmp0(info->interface, "2/6/0") == 0 ||
|
||||
g_strcmp0(info->interface, "2/13/0") == 0 ||
|
||||
g_strcmp0(info->interface, "10/0/0") == 0 ||
|
||||
g_strcmp0(info->interface, "224/1/3") == 0) {
|
||||
net = info->devnode;
|
||||
@@ -1111,7 +1117,6 @@ static gboolean setup_ublox(struct modem_info *modem)
|
||||
|
||||
ofono_modem_set_string(modem->modem, "Aux", aux);
|
||||
ofono_modem_set_string(modem->modem, "Modem", mdm);
|
||||
ofono_modem_set_string(modem->modem, "Model", modem->model);
|
||||
ofono_modem_set_string(modem->modem, "NetworkInterface", net);
|
||||
|
||||
return TRUE;
|
||||
@@ -1179,7 +1184,7 @@ static gboolean setup_gemalto(struct modem_info* modem)
|
||||
|
||||
static gboolean setup_xmm7xxx(struct modem_info *modem)
|
||||
{
|
||||
const char *mdm = NULL, *net = NULL;
|
||||
const char *mdm = NULL, *net = NULL, *net2 = NULL, *net3 = NULL;
|
||||
GSList *list;
|
||||
|
||||
DBG("%s %s %s %s %s %s\n", modem->syspath, modem->devname,
|
||||
@@ -1199,6 +1204,10 @@ static gboolean setup_xmm7xxx(struct modem_info *modem)
|
||||
} else if (g_strcmp0(info->subsystem, "net") == 0) {
|
||||
if (g_strcmp0(info->number, "06") == 0)
|
||||
net = info->devnode;
|
||||
if (g_strcmp0(info->number, "08") == 0)
|
||||
net2 = info->devnode;
|
||||
if (g_strcmp0(info->number, "0a") == 0)
|
||||
net3 = info->devnode;
|
||||
}
|
||||
} else {
|
||||
if (g_strcmp0(info->subsystem, "tty") == 0) {
|
||||
@@ -1219,6 +1228,15 @@ static gboolean setup_xmm7xxx(struct modem_info *modem)
|
||||
ofono_modem_set_string(modem->modem, "Modem", mdm);
|
||||
ofono_modem_set_string(modem->modem, "NetworkInterface", net);
|
||||
|
||||
if (net2)
|
||||
ofono_modem_set_string(modem->modem, "NetworkInterface2", net2);
|
||||
|
||||
if (net3)
|
||||
ofono_modem_set_string(modem->modem, "NetworkInterface3", net3);
|
||||
|
||||
ofono_modem_set_string(modem->modem, "CtrlPath", "/USBCDC/0");
|
||||
ofono_modem_set_string(modem->modem, "DataPath", "/USBHS/NCM/");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1678,6 +1696,8 @@ static struct {
|
||||
{ "quectelqmi", "qcserial", "2c7c", "0121" },
|
||||
{ "quectelqmi", "qmi_wwan", "2c7c", "0125" },
|
||||
{ "quectelqmi", "qcserial", "2c7c", "0125" },
|
||||
{ "ublox", "cdc_acm", "1546", "1010" },
|
||||
{ "ublox", "cdc_ncm", "1546", "1010" },
|
||||
{ "ublox", "cdc_acm", "1546", "1102" },
|
||||
{ "ublox", "rndis_host", "1546", "1146" },
|
||||
{ "ublox", "cdc_acm", "1546", "1146" },
|
||||
|
||||
@@ -1223,7 +1223,7 @@ static void xmm7xxx_pre_sim(struct ofono_modem *modem)
|
||||
DBG("%p", modem);
|
||||
|
||||
ofono_devinfo_create(modem, OFONO_VENDOR_IFX, "atmodem", data->chat);
|
||||
data->sim = ofono_sim_create(modem, OFONO_VENDOR_IFX, "atmodem",
|
||||
data->sim = ofono_sim_create(modem, OFONO_VENDOR_XMM, "atmodem",
|
||||
data->chat);
|
||||
}
|
||||
|
||||
@@ -1269,6 +1269,7 @@ static void xmm7xxx_post_online(struct ofono_modem *modem)
|
||||
struct xmm7xxx_data *data = ofono_modem_get_data(modem);
|
||||
struct ofono_gprs *gprs;
|
||||
struct ofono_gprs_context *gc;
|
||||
const char *interface = NULL;
|
||||
|
||||
DBG("%p", modem);
|
||||
|
||||
@@ -1276,11 +1277,39 @@ static void xmm7xxx_post_online(struct ofono_modem *modem)
|
||||
|
||||
gprs = ofono_gprs_create(modem, OFONO_VENDOR_IFX, "atmodem",
|
||||
data->chat);
|
||||
|
||||
interface = ofono_modem_get_string(modem, "NetworkInterface");
|
||||
gc = ofono_gprs_context_create(modem, OFONO_VENDOR_XMM, "ifxmodem",
|
||||
data->chat);
|
||||
|
||||
if (gprs && gc)
|
||||
if (gprs && gc) {
|
||||
ofono_gprs_add_context(gprs, gc);
|
||||
ofono_gprs_context_set_interface(gc, interface);
|
||||
}
|
||||
|
||||
interface = ofono_modem_get_string(modem, "NetworkInterface2");
|
||||
|
||||
if (interface) {
|
||||
gc = ofono_gprs_context_create(modem, OFONO_VENDOR_XMM,
|
||||
"ifxmodem", data->chat);
|
||||
|
||||
if (gprs && gc) {
|
||||
ofono_gprs_add_context(gprs, gc);
|
||||
ofono_gprs_context_set_interface(gc, interface);
|
||||
}
|
||||
}
|
||||
|
||||
interface = ofono_modem_get_string(modem, "NetworkInterface3");
|
||||
|
||||
if (interface) {
|
||||
gc = ofono_gprs_context_create(modem, OFONO_VENDOR_XMM,
|
||||
"ifxmodem", data->chat);
|
||||
|
||||
if (gprs && gc) {
|
||||
ofono_gprs_add_context(gprs, gc);
|
||||
ofono_gprs_context_set_interface(gc, interface);
|
||||
}
|
||||
}
|
||||
|
||||
ofono_ims_create(modem, "xmm7modem", data->chat);
|
||||
ofono_netmon_create(modem, 0, "xmm7modem", data->chat);
|
||||
|
||||
@@ -706,8 +706,14 @@ const char *registration_tech_to_string(enum ofono_access_technology tech)
|
||||
return "hspa";
|
||||
case ACCESS_TECHNOLOGY_EUTRAN:
|
||||
return "lte";
|
||||
case ACCESS_TECHNOLOGY_NB_IOT_M1:
|
||||
return "lte-cat-m1";
|
||||
case ACCESS_TECHNOLOGY_NB_IOT_NB1:
|
||||
return "lte-cat-nb1";
|
||||
case OFONO_ACCESS_TECHNOLOGY_NONE:
|
||||
break;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -42,6 +42,10 @@
|
||||
OFONO_ACCESS_TECHNOLOGY_UTRAN_HSDPA_HSUPA /* 6 */
|
||||
#define ACCESS_TECHNOLOGY_EUTRAN \
|
||||
OFONO_ACCESS_TECHNOLOGY_EUTRAN /* 7 */
|
||||
#define ACCESS_TECHNOLOGY_NB_IOT_M1 \
|
||||
OFONO_ACCESS_TECHNOLOGY_NB_IOT_M1 /* 8 */
|
||||
#define ACCESS_TECHNOLOGY_NB_IOT_NB1 \
|
||||
OFONO_ACCESS_TECHNOLOGY_NB_IOT_NB1 /* 9 */
|
||||
|
||||
/* 27.007 Section 7.2 <stat> */
|
||||
#define NETWORK_REGISTRATION_STATUS_NOT_REGISTERED \
|
||||
|
||||
@@ -110,7 +110,6 @@ struct ipv6_settings {
|
||||
};
|
||||
|
||||
struct context_settings {
|
||||
char *interface;
|
||||
struct ipv4_settings *ipv4;
|
||||
struct ipv6_settings *ipv6;
|
||||
};
|
||||
@@ -121,6 +120,7 @@ struct ofono_gprs_context {
|
||||
ofono_bool_t inuse;
|
||||
const struct ofono_gprs_context_driver *driver;
|
||||
void *driver_data;
|
||||
char *interface;
|
||||
struct context_settings *settings;
|
||||
struct ofono_atom *atom;
|
||||
};
|
||||
@@ -361,12 +361,10 @@ static void context_settings_free(struct context_settings *settings)
|
||||
g_free(settings->ipv6);
|
||||
settings->ipv6 = NULL;
|
||||
}
|
||||
|
||||
g_free(settings->interface);
|
||||
settings->interface = NULL;
|
||||
}
|
||||
|
||||
static void context_settings_append_ipv4(struct context_settings *settings,
|
||||
const char *interface,
|
||||
DBusMessageIter *iter)
|
||||
{
|
||||
DBusMessageIter variant;
|
||||
@@ -391,7 +389,7 @@ static void context_settings_append_ipv4(struct context_settings *settings,
|
||||
goto done;
|
||||
|
||||
ofono_dbus_dict_append(&array, "Interface",
|
||||
DBUS_TYPE_STRING, &settings->interface);
|
||||
DBUS_TYPE_STRING, &interface);
|
||||
|
||||
if (settings->ipv4->proxy)
|
||||
ofono_dbus_dict_append(&array, "Proxy", DBUS_TYPE_STRING,
|
||||
@@ -433,6 +431,7 @@ done:
|
||||
}
|
||||
|
||||
static void context_settings_append_ipv4_dict(struct context_settings *settings,
|
||||
const char *interface,
|
||||
DBusMessageIter *dict)
|
||||
{
|
||||
DBusMessageIter entry;
|
||||
@@ -443,12 +442,13 @@ static void context_settings_append_ipv4_dict(struct context_settings *settings,
|
||||
|
||||
dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key);
|
||||
|
||||
context_settings_append_ipv4(settings, &entry);
|
||||
context_settings_append_ipv4(settings, interface, &entry);
|
||||
|
||||
dbus_message_iter_close_container(dict, &entry);
|
||||
}
|
||||
|
||||
static void context_settings_append_ipv6(struct context_settings *settings,
|
||||
const char *interface,
|
||||
DBusMessageIter *iter)
|
||||
{
|
||||
DBusMessageIter variant;
|
||||
@@ -472,7 +472,7 @@ static void context_settings_append_ipv6(struct context_settings *settings,
|
||||
goto done;
|
||||
|
||||
ofono_dbus_dict_append(&array, "Interface",
|
||||
DBUS_TYPE_STRING, &settings->interface);
|
||||
DBUS_TYPE_STRING, &interface);
|
||||
|
||||
if (settings->ipv6->ip)
|
||||
ofono_dbus_dict_append(&array, "Address", DBUS_TYPE_STRING,
|
||||
@@ -503,6 +503,7 @@ done:
|
||||
}
|
||||
|
||||
static void context_settings_append_ipv6_dict(struct context_settings *settings,
|
||||
const char *interface,
|
||||
DBusMessageIter *dict)
|
||||
{
|
||||
DBusMessageIter entry;
|
||||
@@ -513,13 +514,14 @@ static void context_settings_append_ipv6_dict(struct context_settings *settings,
|
||||
|
||||
dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key);
|
||||
|
||||
context_settings_append_ipv6(settings, &entry);
|
||||
context_settings_append_ipv6(settings, interface, &entry);
|
||||
|
||||
dbus_message_iter_close_container(dict, &entry);
|
||||
}
|
||||
|
||||
static void signal_settings(struct pri_context *ctx, const char *prop,
|
||||
void (*append)(struct context_settings *, DBusMessageIter *))
|
||||
void (*append)(struct context_settings *,
|
||||
const char *, DBusMessageIter *))
|
||||
|
||||
{
|
||||
DBusConnection *conn = ofono_dbus_get_connection();
|
||||
@@ -527,6 +529,7 @@ static void signal_settings(struct pri_context *ctx, const char *prop,
|
||||
DBusMessage *signal;
|
||||
DBusMessageIter iter;
|
||||
struct context_settings *settings;
|
||||
const char *interface;
|
||||
|
||||
signal = dbus_message_new_signal(path,
|
||||
OFONO_CONNECTION_CONTEXT_INTERFACE,
|
||||
@@ -538,12 +541,15 @@ static void signal_settings(struct pri_context *ctx, const char *prop,
|
||||
dbus_message_iter_init_append(signal, &iter);
|
||||
dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &prop);
|
||||
|
||||
if (ctx->context_driver)
|
||||
if (ctx->context_driver) {
|
||||
settings = ctx->context_driver->settings;
|
||||
else
|
||||
interface = ctx->context_driver->interface;
|
||||
} else {
|
||||
settings = NULL;
|
||||
interface = NULL;
|
||||
}
|
||||
|
||||
append(settings, &iter);
|
||||
append(settings, interface, &iter);
|
||||
g_dbus_send_message(conn, signal);
|
||||
}
|
||||
|
||||
@@ -781,18 +787,16 @@ static void pri_setproxy(const char *interface, const char *proxy)
|
||||
static void pri_reset_context_settings(struct pri_context *ctx)
|
||||
{
|
||||
struct context_settings *settings;
|
||||
char *interface;
|
||||
const char *interface;
|
||||
gboolean signal_ipv4;
|
||||
gboolean signal_ipv6;
|
||||
|
||||
if (ctx->context_driver == NULL)
|
||||
return;
|
||||
|
||||
interface = ctx->context_driver->interface;
|
||||
settings = ctx->context_driver->settings;
|
||||
|
||||
interface = settings->interface;
|
||||
settings->interface = NULL;
|
||||
|
||||
signal_ipv4 = settings->ipv4 != NULL;
|
||||
signal_ipv6 = settings->ipv6 != NULL;
|
||||
|
||||
@@ -809,8 +813,6 @@ static void pri_reset_context_settings(struct pri_context *ctx)
|
||||
}
|
||||
|
||||
pri_ifupdown(interface, FALSE);
|
||||
|
||||
g_free(interface);
|
||||
}
|
||||
|
||||
static void pri_update_mms_context_settings(struct pri_context *ctx)
|
||||
@@ -826,10 +828,10 @@ static void pri_update_mms_context_settings(struct pri_context *ctx)
|
||||
|
||||
DBG("proxy %s port %u", ctx->proxy_host, ctx->proxy_port);
|
||||
|
||||
pri_set_ipv4_addr(settings->interface, settings->ipv4->ip);
|
||||
pri_set_ipv4_addr(gc->interface, settings->ipv4->ip);
|
||||
|
||||
if (ctx->proxy_host)
|
||||
pri_setproxy(settings->interface, ctx->proxy_host);
|
||||
pri_setproxy(gc->interface, ctx->proxy_host);
|
||||
}
|
||||
|
||||
static gboolean pri_str_changed(const char *val, const char *newval)
|
||||
@@ -1056,6 +1058,7 @@ static void append_context_properties(struct pri_context *ctx,
|
||||
dbus_bool_t value;
|
||||
const char *strvalue;
|
||||
struct context_settings *settings;
|
||||
const char *interface;
|
||||
|
||||
ofono_dbus_dict_append(dict, "Name", DBUS_TYPE_STRING, &name);
|
||||
|
||||
@@ -1092,13 +1095,16 @@ static void append_context_properties(struct pri_context *ctx,
|
||||
DBUS_TYPE_STRING, &strvalue);
|
||||
}
|
||||
|
||||
if (ctx->context_driver)
|
||||
if (ctx->context_driver) {
|
||||
settings = ctx->context_driver->settings;
|
||||
else
|
||||
interface = ctx->context_driver->interface;
|
||||
} else {
|
||||
settings = NULL;
|
||||
interface = NULL;
|
||||
}
|
||||
|
||||
context_settings_append_ipv4_dict(settings, dict);
|
||||
context_settings_append_ipv6_dict(settings, dict);
|
||||
context_settings_append_ipv4_dict(settings, interface, dict);
|
||||
context_settings_append_ipv6_dict(settings, interface, dict);
|
||||
}
|
||||
|
||||
static DBusMessage *pri_get_properties(DBusConnection *conn,
|
||||
@@ -1147,8 +1153,8 @@ static void pri_activate_callback(const struct ofono_error *error, void *data)
|
||||
__ofono_dbus_pending_reply(&ctx->pending,
|
||||
dbus_message_new_method_return(ctx->pending));
|
||||
|
||||
if (gc->settings->interface != NULL) {
|
||||
pri_ifupdown(gc->settings->interface, TRUE);
|
||||
if (gc->interface != NULL) {
|
||||
pri_ifupdown(gc->interface, TRUE);
|
||||
|
||||
if (ctx->type == OFONO_GPRS_CONTEXT_TYPE_MMS &&
|
||||
gc->settings->ipv4)
|
||||
@@ -1241,8 +1247,8 @@ static void pri_read_settings_callback(const struct ofono_error *error,
|
||||
|
||||
pri_ctx->active = TRUE;
|
||||
|
||||
if (gc->settings->interface != NULL) {
|
||||
pri_ifupdown(gc->settings->interface, TRUE);
|
||||
if (gc->interface != NULL) {
|
||||
pri_ifupdown(gc->interface, TRUE);
|
||||
|
||||
pri_context_signal_settings(pri_ctx, gc->settings->ipv4 != NULL,
|
||||
gc->settings->ipv6 != NULL);
|
||||
@@ -1810,7 +1816,7 @@ static gboolean context_dbus_unregister(struct pri_context *ctx)
|
||||
|
||||
if (ctx->active == TRUE) {
|
||||
const char *interface =
|
||||
ctx->context_driver->settings->interface;
|
||||
ctx->context_driver->interface;
|
||||
|
||||
if (ctx->type == OFONO_GPRS_CONTEXT_TYPE_MMS)
|
||||
pri_set_ipv4_addr(interface, NULL);
|
||||
@@ -3112,6 +3118,11 @@ done:
|
||||
g_free(gc->settings);
|
||||
gc->settings = NULL;
|
||||
}
|
||||
|
||||
if (gc->interface) {
|
||||
g_free(gc->interface);
|
||||
gc->interface = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void ofono_gprs_add_context(struct ofono_gprs *gprs,
|
||||
@@ -3295,13 +3306,16 @@ enum ofono_gprs_context_type ofono_gprs_context_get_type(
|
||||
return gc->type;
|
||||
}
|
||||
|
||||
const char *ofono_gprs_context_get_interface(struct ofono_gprs_context *gc)
|
||||
{
|
||||
return gc->interface;
|
||||
}
|
||||
|
||||
void ofono_gprs_context_set_interface(struct ofono_gprs_context *gc,
|
||||
const char *interface)
|
||||
{
|
||||
struct context_settings *settings = gc->settings;
|
||||
|
||||
g_free(settings->interface);
|
||||
settings->interface = g_strdup(interface);
|
||||
g_free(gc->interface);
|
||||
gc->interface = g_strdup(interface);
|
||||
}
|
||||
|
||||
void ofono_gprs_context_set_ipv4_address(struct ofono_gprs_context *gc,
|
||||
|
||||
@@ -48,7 +48,7 @@ enum ims_reg_strategy {
|
||||
IMS_REG_DISABLED,
|
||||
IMS_REG_ENABLED,
|
||||
IMS_REG_AUTO
|
||||
#define IMS_REG_DEFAULT IMS_REG_DISABLED
|
||||
#define IMS_REG_DEFAULT IMS_REG_AUTO
|
||||
};
|
||||
|
||||
enum ims_watch_events {
|
||||
@@ -262,7 +262,8 @@ static void ims_registration_check(struct ofono_ims *ims)
|
||||
/* Any state is acceptable */
|
||||
DBG("ims is enabled, no action needed");
|
||||
return;
|
||||
case IMS_REG_AUTO:
|
||||
case IMS_REG_DEFAULT:
|
||||
/* IMS_REG_AUTO */
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1150,6 +1150,9 @@ static DBusMessage *modem_set_property(DBusConnection *conn,
|
||||
if (modem->lockdown)
|
||||
return __ofono_error_access_denied(msg);
|
||||
|
||||
if (!powered)
|
||||
__ofono_sim_clear_cached_pins(modem->sim);
|
||||
|
||||
err = set_powered(modem, powered);
|
||||
if (err < 0) {
|
||||
if (err != -EINPROGRESS)
|
||||
|
||||
@@ -428,6 +428,7 @@ const struct sim_aid *__ofono_sim_session_get_aid(
|
||||
struct ofono_sim_aid_session *session);
|
||||
|
||||
const char *__ofono_sim_get_impi(struct ofono_sim *sim);
|
||||
void __ofono_sim_clear_cached_pins(struct ofono_sim *sim);
|
||||
|
||||
#include <ofono/stk.h>
|
||||
|
||||
|
||||
254
ofono/src/sim.c
254
ofono/src/sim.c
@@ -3,7 +3,7 @@
|
||||
* oFono - Open Source Telephony
|
||||
*
|
||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||
* Copyright (C) 2015-2021 Jolla Ltd.
|
||||
* Copyright (C) 2015-2022 Jolla Ltd.
|
||||
*
|
||||
* 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
|
||||
@@ -132,6 +132,10 @@ struct ofono_sim {
|
||||
struct ofono_atom *atom;
|
||||
unsigned int hfp_watch;
|
||||
|
||||
unsigned int card_slot_count;
|
||||
unsigned int active_card_slot;
|
||||
unsigned int pending_active_card_slot;
|
||||
|
||||
GSList *aid_sessions;
|
||||
GSList *aid_list;
|
||||
char *impi;
|
||||
@@ -144,6 +148,11 @@ struct ofono_sim {
|
||||
bool wait_initialized : 1;
|
||||
};
|
||||
|
||||
struct cached_pin {
|
||||
char *id;
|
||||
char *pin;
|
||||
};
|
||||
|
||||
struct msisdn_set_request {
|
||||
struct ofono_sim *sim;
|
||||
int pending;
|
||||
@@ -175,10 +184,18 @@ static const char *const passwd_name[] = {
|
||||
[OFONO_SIM_PASSWORD_PHCORP_PUK] = "corppuk",
|
||||
};
|
||||
|
||||
#undef ofono_sim_driver_register
|
||||
struct ofono_sim_driver_data {
|
||||
struct ofono_sim_driver driver; /* Must be first */
|
||||
const struct ofono_sim_driver *d;
|
||||
};
|
||||
|
||||
static void sim_own_numbers_update(struct ofono_sim *sim);
|
||||
|
||||
static GSList *g_drivers = NULL;
|
||||
|
||||
static GSList *cached_pins = NULL;
|
||||
|
||||
static const char *sim_passwd_name(enum ofono_sim_password_type type)
|
||||
{
|
||||
return passwd_name[type];
|
||||
@@ -558,6 +575,13 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
|
||||
get_pin_retries(sim, &pin_retries_dict, &dbus_retries);
|
||||
ofono_dbus_dict_append_dict(&dict, "Retries", DBUS_TYPE_BYTE,
|
||||
&pin_retries_dict);
|
||||
|
||||
ofono_dbus_dict_append(&dict, "CardSlotCount", DBUS_TYPE_UINT32,
|
||||
&sim->card_slot_count);
|
||||
|
||||
ofono_dbus_dict_append(&dict, "ActiveCardSlot", DBUS_TYPE_UINT32,
|
||||
&sim->active_card_slot);
|
||||
|
||||
g_free(pin_retries_dict);
|
||||
g_free(dbus_retries);
|
||||
|
||||
@@ -567,6 +591,72 @@ done:
|
||||
return reply;
|
||||
}
|
||||
|
||||
static struct cached_pin *pin_cache_lookup(const char *iccid)
|
||||
{
|
||||
struct cached_pin *c;
|
||||
GSList *l;
|
||||
|
||||
if (cached_pins == NULL)
|
||||
return NULL;
|
||||
|
||||
for (l = cached_pins; l; l = l->next) {
|
||||
c = l->data;
|
||||
|
||||
if (g_strcmp0(iccid, c->id) == 0)
|
||||
return c;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void pin_cache_update(const char *iccid, const char *pin)
|
||||
{
|
||||
struct cached_pin *pin_cached = pin_cache_lookup(iccid);
|
||||
struct cached_pin *cpins;
|
||||
|
||||
if (pin_cached != NULL) {
|
||||
g_free(pin_cached->pin);
|
||||
pin_cached->pin = g_strdup(pin);
|
||||
return;
|
||||
}
|
||||
|
||||
cpins = g_new0(struct cached_pin, 1);
|
||||
|
||||
cpins->id = g_strdup(iccid);
|
||||
cpins->pin = g_strdup(pin);
|
||||
cached_pins = g_slist_prepend(cached_pins, cpins);
|
||||
}
|
||||
|
||||
static void pin_cache_remove(const char *iccid)
|
||||
{
|
||||
struct cached_pin *pin_cached = pin_cache_lookup(iccid);
|
||||
|
||||
if (pin_cached == NULL)
|
||||
return;
|
||||
|
||||
cached_pins = g_slist_remove(cached_pins, pin_cached);
|
||||
|
||||
g_free(pin_cached->pin);
|
||||
g_free(pin_cached->id);
|
||||
g_free(pin_cached);
|
||||
}
|
||||
|
||||
static void pin_cache_enter_cb(const struct ofono_error *error, void *data)
|
||||
{
|
||||
struct ofono_sim *sim = data;
|
||||
|
||||
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
|
||||
pin_cache_remove(sim->iccid);
|
||||
|
||||
__ofono_sim_recheck_pin(sim);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
sim->wait_initialized = true;
|
||||
DBG("Waiting for ofono_sim_initialized_notify");
|
||||
}
|
||||
|
||||
static void sim_pin_retries_query_cb(const struct ofono_error *error,
|
||||
int retries[OFONO_SIM_PASSWORD_INVALID],
|
||||
void *data)
|
||||
@@ -683,6 +773,36 @@ static gboolean sim_allow(DBusMessage *msg,
|
||||
OFONO_DBUS_ACCESS_INTF_SIMMGR, method, arg);
|
||||
}
|
||||
|
||||
static void sim_set_slot_callback(const struct ofono_error *error, void *data)
|
||||
{
|
||||
struct ofono_sim *sim = data;
|
||||
DBusConnection *conn = ofono_dbus_get_connection();
|
||||
const char *path = __ofono_atom_get_path(sim->atom);
|
||||
DBusMessage *reply;
|
||||
|
||||
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
|
||||
DBG("Error setting radio access mode");
|
||||
|
||||
sim->pending_active_card_slot = sim->active_card_slot;
|
||||
|
||||
reply = __ofono_error_from_error(error, sim->pending);
|
||||
__ofono_dbus_pending_reply(&sim->pending, reply);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
sim->active_card_slot = sim->pending_active_card_slot;
|
||||
|
||||
reply = dbus_message_new_method_return(sim->pending);
|
||||
__ofono_dbus_pending_reply(&sim->pending, reply);
|
||||
|
||||
ofono_dbus_signal_property_changed(conn, path,
|
||||
OFONO_SIM_MANAGER_INTERFACE,
|
||||
"ActiveCardSlot",
|
||||
DBUS_TYPE_UINT32,
|
||||
&sim->active_card_slot);
|
||||
}
|
||||
|
||||
static DBusMessage *sim_set_property(DBusConnection *conn, DBusMessage *msg,
|
||||
void *data)
|
||||
{
|
||||
@@ -753,6 +873,37 @@ error:
|
||||
|
||||
if (set_ok)
|
||||
return NULL;
|
||||
} else if (!strcmp(name, "ActiveCardSlot")) {
|
||||
dbus_uint32_t value;
|
||||
|
||||
dbus_message_iter_next(&iter);
|
||||
|
||||
if (sim->driver->set_active_card_slot == NULL)
|
||||
return __ofono_error_not_implemented(msg);
|
||||
|
||||
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT)
|
||||
return __ofono_error_invalid_args(msg);
|
||||
|
||||
dbus_message_iter_recurse(&iter, &var);
|
||||
|
||||
if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_UINT32)
|
||||
return __ofono_error_invalid_args(msg);
|
||||
|
||||
dbus_message_iter_get_basic(&var, &value);
|
||||
|
||||
if (value <= 0 || value > sim->card_slot_count)
|
||||
return __ofono_error_invalid_args(msg);
|
||||
|
||||
if (sim->active_card_slot == value)
|
||||
return dbus_message_new_method_return(msg);
|
||||
|
||||
sim->pending = dbus_message_ref(msg);
|
||||
sim->pending_active_card_slot = value;
|
||||
|
||||
sim->driver->set_active_card_slot(sim, value - 1,
|
||||
sim_set_slot_callback,
|
||||
sim);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return __ofono_error_invalid_args(msg);
|
||||
@@ -785,6 +936,11 @@ static void sim_locked_cb(struct ofono_sim *sim, gboolean locked)
|
||||
OFONO_SIM_MANAGER_INTERFACE,
|
||||
"LockedPins", DBUS_TYPE_STRING,
|
||||
&locked_pins);
|
||||
|
||||
/* Cache pin only for SIM PIN type */
|
||||
if (g_strcmp0(typestr, "pin") == 0)
|
||||
pin_cache_update(sim->iccid, pin);
|
||||
|
||||
g_strfreev(locked_pins);
|
||||
|
||||
sim_pin_retries_check(sim);
|
||||
@@ -886,6 +1042,14 @@ static DBusMessage *sim_unlock_pin(DBusConnection *conn, DBusMessage *msg,
|
||||
static void sim_change_pin_cb(const struct ofono_error *error, void *data)
|
||||
{
|
||||
struct ofono_sim *sim = data;
|
||||
const char *typestr;
|
||||
const char *old;
|
||||
const char *new;
|
||||
|
||||
dbus_message_get_args(sim->pending, NULL, DBUS_TYPE_STRING, &typestr,
|
||||
DBUS_TYPE_STRING, &old,
|
||||
DBUS_TYPE_STRING, &new,
|
||||
DBUS_TYPE_INVALID);
|
||||
|
||||
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
|
||||
__ofono_dbus_pending_reply(&sim->pending,
|
||||
@@ -896,6 +1060,10 @@ static void sim_change_pin_cb(const struct ofono_error *error, void *data)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Cache pin only for SIM PIN type */
|
||||
if (g_strcmp0(typestr, "pin") == 0)
|
||||
pin_cache_update(sim->iccid, new);
|
||||
|
||||
__ofono_dbus_pending_reply(&sim->pending,
|
||||
dbus_message_new_method_return(sim->pending));
|
||||
|
||||
@@ -950,8 +1118,14 @@ static DBusMessage *sim_change_pin(DBusConnection *conn, DBusMessage *msg,
|
||||
static void sim_enter_pin_cb(const struct ofono_error *error, void *data)
|
||||
{
|
||||
struct ofono_sim *sim = data;
|
||||
const char *typestr;
|
||||
const char *pin;
|
||||
DBusMessage *reply;
|
||||
|
||||
dbus_message_get_args(sim->pending, NULL, DBUS_TYPE_STRING, &typestr,
|
||||
DBUS_TYPE_STRING, &pin,
|
||||
DBUS_TYPE_INVALID);
|
||||
|
||||
if (error->type != OFONO_ERROR_TYPE_NO_ERROR)
|
||||
reply = __ofono_error_failed(sim->pending);
|
||||
else
|
||||
@@ -963,6 +1137,10 @@ static void sim_enter_pin_cb(const struct ofono_error *error, void *data)
|
||||
if (sim->initialized || error->type != OFONO_ERROR_TYPE_NO_ERROR)
|
||||
goto recheck;
|
||||
|
||||
/* Cache pin only for SIM PIN type */
|
||||
if (g_strcmp0(typestr, "pin") == 0)
|
||||
pin_cache_update(sim->iccid, pin);
|
||||
|
||||
if (sim->pin_type == OFONO_SIM_PASSWORD_SIM_PIN ||
|
||||
sim->pin_type == OFONO_SIM_PASSWORD_SIM_PUK) {
|
||||
sim->wait_initialized = true;
|
||||
@@ -2918,6 +3096,8 @@ void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted)
|
||||
sim->pin_retries[OFONO_SIM_PASSWORD_SIM_PIN2] = -1;
|
||||
sim->pin_retries[OFONO_SIM_PASSWORD_SIM_PUK2] = -1;
|
||||
|
||||
pin_cache_remove(sim->iccid);
|
||||
|
||||
sim_free_state(sim);
|
||||
}
|
||||
}
|
||||
@@ -3191,7 +3371,8 @@ static void sim_pin_query_cb(const struct ofono_error *error,
|
||||
struct ofono_sim *sim = data;
|
||||
DBusConnection *conn = ofono_dbus_get_connection();
|
||||
const char *path = __ofono_atom_get_path(sim->atom);
|
||||
const char *pin_name;
|
||||
struct cached_pin *cpins = pin_cache_lookup(sim->iccid);
|
||||
const char *pin_name = sim_passwd_name(pin_type);
|
||||
char **locked_pins;
|
||||
gboolean lock_changed;
|
||||
|
||||
@@ -3204,7 +3385,6 @@ static void sim_pin_query_cb(const struct ofono_error *error,
|
||||
|
||||
if (sim->pin_type != pin_type) {
|
||||
sim->pin_type = pin_type;
|
||||
pin_name = sim_passwd_name(pin_type);
|
||||
|
||||
if (pin_type != OFONO_SIM_PASSWORD_NONE &&
|
||||
password_is_pin(pin_type) == FALSE)
|
||||
@@ -3235,6 +3415,10 @@ static void sim_pin_query_cb(const struct ofono_error *error,
|
||||
&pin_name);
|
||||
}
|
||||
|
||||
if (g_strcmp0(pin_name, "pin") == 0 && cpins != NULL)
|
||||
sim->driver->send_passwd(sim, cpins->pin,
|
||||
pin_cache_enter_cb, sim);
|
||||
|
||||
switch (pin_type) {
|
||||
case OFONO_SIM_PASSWORD_NONE:
|
||||
case OFONO_SIM_PASSWORD_SIM_PIN2:
|
||||
@@ -3279,21 +3463,56 @@ void __ofono_sim_recheck_pin(struct ofono_sim *sim)
|
||||
|
||||
int ofono_sim_driver_register(const struct ofono_sim_driver *d)
|
||||
{
|
||||
DBG("driver: %p, name: %s", d, d->name);
|
||||
return ofono_sim_driver_register_version(d, 1);
|
||||
}
|
||||
|
||||
int ofono_sim_driver_register_version(const struct ofono_sim_driver *d, int v)
|
||||
{
|
||||
struct ofono_sim_driver_data *dd;
|
||||
|
||||
DBG("driver: %p, v: %d, name: %s", d, v, d->name);
|
||||
|
||||
if (d->probe == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
g_drivers = g_slist_prepend(g_drivers, (void *) d);
|
||||
/* Pad struct ofono_sim_driver with zeros if necessary */
|
||||
dd = g_new0(struct ofono_sim_driver_data, 1);
|
||||
dd->d = d;
|
||||
|
||||
switch (v) {
|
||||
case 0:
|
||||
memcpy(dd, d, G_STRUCT_OFFSET(struct ofono_sim_driver,
|
||||
open_channel2));
|
||||
break;
|
||||
case 1:
|
||||
memcpy(dd, d, G_STRUCT_OFFSET(struct ofono_sim_driver,
|
||||
set_active_card_slot));
|
||||
break;
|
||||
default:
|
||||
memcpy(dd, d, sizeof(*d));
|
||||
break;
|
||||
}
|
||||
|
||||
g_drivers = g_slist_prepend(g_drivers, dd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ofono_sim_driver_unregister(const struct ofono_sim_driver *d)
|
||||
{
|
||||
GSList *l;
|
||||
|
||||
DBG("driver: %p, name: %s", d, d->name);
|
||||
|
||||
g_drivers = g_slist_remove(g_drivers, (void *) d);
|
||||
for (l = g_drivers; l; l = l->next) {
|
||||
struct ofono_sim_driver_data *dd = l->data;
|
||||
|
||||
if (dd->d == d) {
|
||||
g_drivers = g_slist_delete_link(g_drivers, l);
|
||||
g_free(dd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void emulator_remove_handler(struct ofono_atom *atom, void *data)
|
||||
@@ -3377,6 +3596,9 @@ struct ofono_sim *ofono_sim_create(struct ofono_modem *modem,
|
||||
for (i = 0; i < OFONO_SIM_PASSWORD_INVALID; i++)
|
||||
sim->pin_retries[i] = -1;
|
||||
|
||||
sim->active_card_slot = 1;
|
||||
sim->card_slot_count = 1;
|
||||
|
||||
for (l = g_drivers; l; l = l->next) {
|
||||
const struct ofono_sim_driver *drv = l->data;
|
||||
|
||||
@@ -3475,6 +3697,14 @@ void ofono_sim_register(struct ofono_sim *sim)
|
||||
__ofono_atom_register(sim->atom, sim_unregister);
|
||||
}
|
||||
|
||||
void __ofono_sim_clear_cached_pins(struct ofono_sim *sim)
|
||||
{
|
||||
if (cached_pins == NULL)
|
||||
return;
|
||||
|
||||
pin_cache_remove(sim->iccid);
|
||||
}
|
||||
|
||||
void ofono_sim_remove(struct ofono_sim *sim)
|
||||
{
|
||||
__ofono_atom_free(sim->atom);
|
||||
@@ -3890,3 +4120,15 @@ int ofono_sim_logical_access(struct ofono_sim *sim, int session_id,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ofono_sim_set_card_slot_count(struct ofono_sim *sim, unsigned int val)
|
||||
{
|
||||
if (sim)
|
||||
sim->card_slot_count = val;
|
||||
}
|
||||
|
||||
void ofono_sim_set_active_card_slot(struct ofono_sim *sim, unsigned int val)
|
||||
{
|
||||
if (sim)
|
||||
sim->active_card_slot = val;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ import sys
|
||||
import dbus
|
||||
|
||||
if (len(sys.argv) < 2):
|
||||
print("Usage: %s [modem] <number> [hide_callerid]" % (sys.argv[0]))
|
||||
print("Usage: %s [modem] <number> [enabled|disabled|default]" % (sys.argv[0]))
|
||||
print("Last argument enables/disables callerid")
|
||||
sys.exit(1)
|
||||
|
||||
bus = dbus.SystemBus()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Name: ofono
|
||||
Summary: Open Source Telephony
|
||||
Version: 1.28
|
||||
Version: 1.29
|
||||
Release: 1
|
||||
License: GPLv2
|
||||
URL: https://github.com/sailfishos/ofono
|
||||
|
||||
Reference in New Issue
Block a user