Hi Yang,
> -static void sim_efust_read_cb(int ok, int length, int record,
> +static void sim_efsst_read_cb(int ok, int length, int record,
> const unsigned char *data,
> int record_length, void *userdata)
> {
> @@ -1057,6 +1059,27 @@ static void sim_efust_read_cb(int ok, int length, int
> record,
> if (!ok)
> goto out;
>
> + if (length < 2) {
> + ofono_error("EFsst shall contain at least two bytes");
> + goto out;
> + }
> +
> + sim->efsst = g_memdup(data, length);
> + sim->efsst_length = length;
> +
> +out:
> + sim_retrieve_imsi(sim);
> +}
> +
> +static void sim_efust_read_cb(int ok, int length, int record,
> + const unsigned char *data,
> + int record_length, void *userdata)
> +{
> + struct ofono_sim *sim = userdata;
> +
> + if (!ok)
> + goto error;
> +
> if (length < 1) {
> ofono_error("EFust shall contain at least one byte");
> goto out;
> @@ -1073,6 +1096,12 @@ static void sim_efust_read_cb(int ok, int length, int
> record,
>
> out:
> sim_retrieve_imsi(sim);
> + return;
> +
> +error:
> + ofono_sim_read(sim, SIM_EFSST_FILEID,
> + OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
> + sim_efsst_read_cb, sim);
> }
That is really not how it works. If the file ID is the same then you
need some other information to determine whether this is a phase 3 or a
phase 2 SIM. Look at how EFecc reading in voicecall.c is done. In
other words, this function needs to make an intelligent decision whether
this is EFsst or EFust.
In your case the only heuristic we have is EFphase, which is mandatory
for all Phase 2 SIMs (and absent in all Phase 3 SIMs).
Regards,
-Denis
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono