Dynamically changing an applet's poll Interval

I’m used to setting an applet’s poll interval when it’s installed, either in the constructor or in install(). Then it just stays like that forever.

If I dynamically change (or turn off) the applet’s requested poll interval later in its lifecycle, for instance based on an APDU command, what are the design considerations? Does it require a lot of memory to “edit” the registry entry, will the change cause side effects with other applets or the ME, etc?

public void processToolkit(short event) {
.
.
ToolkitRegistry reg = ToolkitRegistry.getEntry();
reg.setPollInterval((short) 0);
.
.
}

Hi @mayhayze,

The poll interval is shared with all applets loaded on a profile. The SIM OS can negotiate only one poll interval with the terminal, so all applet inherit from that one. This is why setPollInterval() returns the actual poll interval negotiated by the OS with the terminal.

Regarding the de-registration, setPollInterval(POLL_NO_DURATION) will only stop polling if no other applet use it, it will therefore not affect other applets: you won’t receive the event anymore, but other applets still will.
Note: switching on and off the poll duration may affect the persistent memory and cause NVM wearing, as the OS has to write the NVM…

More details in section 6.7.1.3 of ETSI 102.241…

Hope this helps,
Greg

1 Like