Hi Denis,
On 18 March 2010 00:01, Denis Kenzior <denkenz(a)gmail.com> wrote:
> Implement optional polling. Polling is mandatory according to
the
> specification but on most hardware it will me impractical because
> there will be vendor specific unsolicited notifications that can be
> used instead. Modem plugins need to handle them.
> ---
So I've been going back and forth on this one and my opinion is we should not
do the poll in the core. The modem has to do it anyway, so let the modem do
it and tell us when it happens. Most vendors provide unsolicited notifications
for SIM Toolkit events anyway. Let us treat it the same way as voicecalls.
The standard does not define any unsolicited responses for call state
notifications, yet in practice all modem vendors provide this.
I'm fine with that, but note that we will lose the ability to have STK
working out of the box on a AT compliant modem or emulator, this would
be useful even just during the early development. The spec
specifically says the ME that supports STK needs to poll and with what
interval.
Keep this code around and let us re-examine this decision if we ever need to
implement POLLING ON / POLLING OFF / POLLING INTERVAL commands. Based on all
the vendor specific docs I have these are intercepted by the modem and we never
see them anyway.
> include/sim.h | 21 ++++++-
> src/sim.c | 197
> ++++++++++++++++++++++++++++++++++++++++++++++++++------- 2 files
changed,
> 195 insertions(+), 23 deletions(-)
>
> diff --git a/include/sim.h b/include/sim.h
> index 6ff29f7..fdfe2e8 100644
> --- a/include/sim.h
> +++ b/include/sim.h
> @@ -106,6 +106,8 @@ typedef void (*ofono_sim_lock_unlock_cb_t)(const struct
> ofono_error *error, typedef void (*ofono_sim_locked_cb_t)(const struct
> ofono_error *error, int locked, void *data);
>
> +typedef void (*ofono_sim_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);
> @@ -152,6 +154,12 @@ struct ofono_sim_driver {
> void (*envelope)(struct ofono_sim *sim, int length,
> const guint8 *command,
> ofono_sim_read_cb_t cb, void *data);
> + void (*status)(struct ofono_sim *sim, ofono_sim_cb_t cb, void *data);
> + void (*fetch)(struct ofono_sim *sim, int length,
> + ofono_sim_read_cb_t cb, void *data);
So three things here: First the STK details should be moved to a separate atom
since they are highly vendor specific.
Second, why are we bothering with fetch, can't we simply use
ofono_sim_proactive_command_notify to send us the apdu directly?
Yes, good idea. Do we want to still call
ofono_sim_proactive_command_notify from atmodem/sim.c or will we just
count on modem driver to do that?
I noticed that we also need to cancel all commands already sent to
GAtChat when we conclude that STATUS timed out and am not sure where
to do this cancellation.
Regards