|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSecureChipHandler
public class SecureChipHandler
SecureChipHandler is responsible for communication with the Nokia NFC payment and ticketing cover.
Field Summary | |
---|---|
private java.lang.String |
ALERT_PIN_ERROR_PIN_MISMATCH
|
private java.lang.String |
ALERT_PIN_QUERY
|
private java.lang.String |
ALERT_PIN_RECEIVED
|
private java.lang.String |
ALERT_PIN_TITLE
|
private javax.microedition.lcdui.Command |
backCmd
|
private byte[] |
buf
|
private java.lang.String |
BUSY_CORRECT_PIN
|
private java.lang.String |
CMD_BACK
|
private java.lang.String |
CMD_OK
|
boolean |
connected
|
com.nokia.nfc.sc.SecureChipConnection |
coverConnection
|
private byte[] |
empty
|
private java.lang.String |
ERROR_PIN_MISMATCH
|
private java.lang.String |
ERROR_PIN_RESET_TIMEOUT
|
private java.lang.String |
ERROR_PIN_TIMEOUT
|
private java.lang.String |
ERROR_SC_BUSY
|
private boolean |
mifareWrite
|
private java.lang.String |
MODE_CHANGE
|
private java.lang.String |
MODE_CHANGE_SUCCESS
|
private javax.microedition.lcdui.Command |
okCmd
|
private java.lang.String |
pin
|
private javax.microedition.lcdui.Alert |
pinAlert
|
private javax.microedition.lcdui.TextBox |
pinEntry
|
boolean |
pinOk
|
private TicketingSystemMIDlet |
ts
|
Constructor Summary | |
---|---|
SecureChipHandler(TicketingSystemMIDlet ts)
The SecureChipHandler creates the PIN alert and connects to the cover |
Method Summary | |
---|---|
private void |
askForPin(java.lang.String text)
Query the user for PIN to change the communication mode |
void |
changeMode(com.nokia.nfc.sc.SCCMode mode)
changes the communication mode of the cover |
void |
commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable d)
Performs actions based on the commands |
void |
connectToCover()
Connects to the cover |
void |
handleEvent(com.nokia.nfc.sc.SecureChipEvent e)
Handles events sent from the cover |
private java.lang.String |
mapResult(int responseCode)
Maps the given code to a error string. |
private boolean |
pinEnabled()
Controls of PIN is enabled |
void |
readMifare()
Creates a MifareWriter If PIN is not ok, the user will be queried for the PIN |
private void |
resetTicket()
Sets the buffer that the ticket is copied into all (byte) 0x00 |
void |
updateForm(java.lang.String parameter,
java.lang.String value)
Updates the error form with data |
void |
writeMifare(byte[] data)
Creats a MifareWriter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.lang.String ALERT_PIN_TITLE
private final java.lang.String ALERT_PIN_RECEIVED
private final java.lang.String ALERT_PIN_QUERY
private final java.lang.String ALERT_PIN_ERROR_PIN_MISMATCH
private final java.lang.String BUSY_CORRECT_PIN
private final java.lang.String CMD_OK
private final java.lang.String CMD_BACK
private final java.lang.String MODE_CHANGE
private final java.lang.String MODE_CHANGE_SUCCESS
private final java.lang.String ERROR_PIN_MISMATCH
private final java.lang.String ERROR_PIN_TIMEOUT
private final java.lang.String ERROR_PIN_RESET_TIMEOUT
private final java.lang.String ERROR_SC_BUSY
private byte[] buf
private boolean mifareWrite
private javax.microedition.lcdui.Alert pinAlert
private javax.microedition.lcdui.TextBox pinEntry
private javax.microedition.lcdui.Command okCmd
private javax.microedition.lcdui.Command backCmd
public com.nokia.nfc.sc.SecureChipConnection coverConnection
public boolean connected
public boolean pinOk
private java.lang.String pin
private TicketingSystemMIDlet ts
private byte[] empty
Constructor Detail |
---|
public SecureChipHandler(TicketingSystemMIDlet ts)
ts
- The MIDlet.Method Detail |
---|
public void handleEvent(com.nokia.nfc.sc.SecureChipEvent e)
handleEvent
in interface com.nokia.nfc.sc.SecureChipListener
e
- the SecureChipEvent sent from the coverSecureChipEvent
public void changeMode(com.nokia.nfc.sc.SCCMode mode)
mode
- The new communication modeSecureChipConnection
private void askForPin(java.lang.String text)
text
- The querypublic void updateForm(java.lang.String parameter, java.lang.String value)
parameter
- The parameter to tracevalue
- The value of the parameterprivate java.lang.String mapResult(int responseCode)
The
- code to be mappedpublic void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
commandAction
in interface javax.microedition.lcdui.CommandListener
c
- The commandd
- The displayablepublic void writeMifare(byte[] data)
data
- The ticketpublic void readMifare()
private boolean pinEnabled()
public void connectToCover()
private void resetTicket()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |