Hi Andrew,
Fix ENVELOPE implementation.
@@ -753,7 +794,7 @@ static void at_sim_envelope(struct ofono_sim *sim, int
length, ofono_sim_read_cb_t cb, void *data)
{
struct sim_data *sd = ofono_sim_get_data(sim);
- struct cb_data *cbd = cb_data_new(cb, data);
+ struct sim_cb_data *cbd = sim_cb_data_new(sd, cb, data);
char *buf = g_try_new(char, 64 + length * 2);
int len, ret;
@@ -761,12 +802,14 @@ static void at_sim_envelope(struct ofono_sim *sim,
int length, goto error;
len = sprintf(buf, "AT+CSIM=%i,A0C20000%02hhX",
- 10 + length * 2, length);
+ 12 + length * 2, length);
for (; length; length--)
len += sprintf(buf + len, "%02hhX", *command++);
- ret = g_at_chat_send(sd->chat, buf, crsm_prefix,
+ len += sprintf(buf + len, "FF");
+
+ ret = g_at_chat_send(sd->chat, buf, csim_prefix,
at_csim_envelope_cb, cbd, g_free);
I really need more detailed explanation why appending FF here is necessary.
And this really belongs in a separate patch.
g_free(buf);
@@ -785,6 +828,219 @@ error:
CALLBACK_WITH_FAILURE(cb, NULL, 0, data);
}
Regards,
-Denis