droid 4: special handling for SMSes

Droid 4	 modem is "special" (aka broken) so and getting incoming SMSes
to work is quite tricky. This should get it right.
This commit is contained in:
Pavel Machek 2020-09-15 15:23:13 +02:00 committed by Denis Kenzior
parent 25fd00588a
commit cb79f71ffe
1 changed files with 13 additions and 3 deletions

View File

@ -464,7 +464,8 @@ static void at_cmt_notify(GAtResult *result, gpointer user_data)
decode_hex_own_buf(hexpdu, -1, &pdu_len, 0, pdu); decode_hex_own_buf(hexpdu, -1, &pdu_len, 0, pdu);
ofono_sms_deliver_notify(sms, pdu, pdu_len, tpdu_len); ofono_sms_deliver_notify(sms, pdu, pdu_len, tpdu_len);
if (data->vendor != OFONO_VENDOR_SIMCOM) if (data->vendor != OFONO_VENDOR_SIMCOM &&
data->vendor != OFONO_VENDOR_DROID)
at_ack_delivery(sms); at_ack_delivery(sms);
return; return;
@ -847,6 +848,7 @@ static gboolean build_cnmi_string(char *buf, int *cnmi_opts,
case OFONO_VENDOR_SIMCOM: case OFONO_VENDOR_SIMCOM:
case OFONO_VENDOR_QUECTEL: case OFONO_VENDOR_QUECTEL:
case OFONO_VENDOR_QUECTEL_EC2X: case OFONO_VENDOR_QUECTEL_EC2X:
case OFONO_VENDOR_DROID:
/* MSM devices advertise support for mode 2, but return an /* MSM devices advertise support for mode 2, but return an
* error if we attempt to actually use it. */ * error if we attempt to actually use it. */
mode = "1"; mode = "1";
@ -860,9 +862,15 @@ static gboolean build_cnmi_string(char *buf, int *cnmi_opts,
if (!append_cnmi_element(buf, &len, cnmi_opts[0], mode, FALSE)) if (!append_cnmi_element(buf, &len, cnmi_opts[0], mode, FALSE))
return FALSE; return FALSE;
mode = "21";
if (!data->cnma_enabled)
mode = "1";
if (data->vendor == OFONO_VENDOR_DROID)
mode = "2";
/* Prefer to deliver SMS via +CMT if CNMA is supported */ /* Prefer to deliver SMS via +CMT if CNMA is supported */
if (!append_cnmi_element(buf, &len, cnmi_opts[1], if (!append_cnmi_element(buf, &len, cnmi_opts[1], mode, FALSE))
data->cnma_enabled ? "21" : "1", FALSE))
return FALSE; return FALSE;
switch (data->vendor) { switch (data->vendor) {
@ -1292,6 +1300,8 @@ static void at_csms_query_cb(gboolean ok, GAtResult *result,
goto out; goto out;
switch (data->vendor) { switch (data->vendor) {
case OFONO_VENDOR_DROID:
break;
case OFONO_VENDOR_QUECTEL_SERIAL: case OFONO_VENDOR_QUECTEL_SERIAL:
g_at_result_iter_next_number(&iter, &status_min); g_at_result_iter_next_number(&iter, &status_min);
g_at_result_iter_next_number(&iter, &status_max); g_at_result_iter_next_number(&iter, &status_max);