int store;
int incoming;
int retries;
+ gboolean expect_sr;
gboolean cnma_enabled;
char *cnma_ack_pdu;
int cnma_ack_pdu_len;
struct ofono_sms *sms;
int store;
int index;
+ gboolean expect_sr;
};
static void at_csca_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
decode_hex_own_buf(hexpdu, -1, &pdu_len, 0, pdu);
- if (data->store == AT_UTIL_SMS_STORE_SR)
+ if (data->expect_sr)
ofono_sms_status_notify(sms, pdu, pdu_len, tpdu_len);
else
ofono_sms_deliver_notify(sms, pdu, pdu_len, tpdu_len);
}
data->store = req->store;
+ data->expect_sr = req->expect_sr;
snprintf(buf, sizeof(buf), "AT+CMGR=%d", req->index);
g_at_chat_send(data->chat, buf, none_prefix, at_cmgr_cb, NULL, NULL);
g_at_chat_send(data->chat, buf, none_prefix, at_cmgd_cb, NULL, NULL);
}
-static void at_send_cmgr_cpms(struct ofono_sms *sms, int store, int index)
+static void at_send_cmgr_cpms(struct ofono_sms *sms, int store, int index,
+ gboolean expect_sr)
{
struct sms_data *data = ofono_sms_get_data(sms);
req.sms = sms;
req.store = store;
req.index = index;
+ req.expect_sr = expect_sr;
at_cmgr_cpms_cb(TRUE, NULL, &req);
} else {
req->sms = sms;
req->store = store;
req->index = index;
+ req->expect_sr = expect_sr;
snprintf(buf, sizeof(buf), "AT+CPMS=\"%s\",\"%s\",\"%s\"",
storages[store], storages[store], incoming);
goto error;
DBG("Got a CMTI indication at %s, index: %d", storages[store], index);
- at_send_cmgr_cpms(sms, store, index);
+ at_send_cmgr_cpms(sms, store, index, FALSE);
return;
error:
&store, &index) == FALSE)
goto error;
- if (store != AT_UTIL_SMS_STORE_SR)
+ /* Some modems actually store status reports in SM, and not SR */
+ if (store != AT_UTIL_SMS_STORE_SR && store != AT_UTIL_SMS_STORE_SM &&
+ store != AT_UTIL_SMS_STORE_ME)
goto error;
DBG("Got a CDSI indication at %s, index: %d", storages[store], index);
- at_send_cmgr_cpms(sms, store, index);
+ at_send_cmgr_cpms(sms, store, index, TRUE);
return;
error: