IMSIPseudo.java: show hello world on LU

This commit is contained in:
Oliver Smith 2020-02-21 10:06:14 +01:00
parent c6a2ba99d0
commit e28705aff5
1 changed files with 11 additions and 3 deletions

View File

@ -16,9 +16,8 @@ public class IMSIPseudo extends Applet implements ToolkitInterface, ToolkitConst
// which has a limited number of write cycles.
private byte helloMenuItem;
static byte[] welcomeMsg = new byte[] { 'W', 'e', 'l', 'c', 'o', 'm', 'e', ' ',
't', 'o', ' ', 'T', 'o', 'o', 'r', 'C',
'a', 'm', 'p', ' ', '2', '0', '1', '2' };
static byte[] welcomeMsg = new byte[] { 'H', 'e', 'l', 'l', 'o', ',', ' ',
'W', 'o', 'r', 'l', 'd', '!' };
static byte[] menuItemText = new byte[] { 'I', 'M', 'S', 'I', ' ', 'P', 's', 'e', 'u', 'd', 'o', 'n', 'y', 'm',
'i', 'z', 'a', 't', 'i', 'o', 'n'};
@ -30,12 +29,14 @@ public class IMSIPseudo extends Applet implements ToolkitInterface, ToolkitConst
// Define the applet Menu Entry
helloMenuItem = reg.initMenuEntry(menuItemText, (short)0, (short)menuItemText.length,
PRO_CMD_SELECT_ITEM, false, (byte)0, (short)0);
reg.setEvent(EVENT_EVENT_DOWNLOAD_LOCATION_STATUS);
}
// This method is called by the card when the applet is installed. You must
// instantiate your applet and register it here.
public static void install(byte[] bArray, short bOffset, byte bLength) {
IMSIPseudo applet = new IMSIPseudo();
applet.register();
}
@ -58,6 +59,13 @@ public class IMSIPseudo extends Applet implements ToolkitInterface, ToolkitConst
showHello();
}
}
if (event == EVENT_EVENT_DOWNLOAD_LOCATION_STATUS) {
/* TODO: count the location updates done with the same
* pseudo IMSI, and warn the user if it becomes too
* high */
showHello();
}
}
private void showHello() {