|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.microedition.midlet.MIDlet
org.openuat.apps.j2me.OpenUATmidlet
public class OpenUATmidlet
This MIDlet demonstrates four out-of-band peer verification: visual, audio, madlib, slowcodec.
| Field Summary | |
|---|---|
protected javax.microedition.lcdui.Image |
audio
|
protected byte[] |
authKey
The key resulting from the message exchange during the authentication process |
protected javax.microedition.lcdui.Command |
back
Chosen by the user to indicate the verification outcome in manual verification cases |
protected javax.microedition.lcdui.Gauge |
bluetoothProgressGauge
|
protected javax.microedition.lcdui.Image |
buttoncancel
|
protected javax.microedition.lcdui.Image |
buttonok
|
protected javax.microedition.lcdui.Command |
decreaseVolume
|
protected javax.microedition.lcdui.List |
dev_list
screen that shows what Bluetooth devices have been found |
protected javax.microedition.lcdui.Display |
display
|
protected javax.microedition.lcdui.Image |
error
|
protected javax.microedition.lcdui.Command |
exit
|
protected javax.microedition.lcdui.Form |
failure_form
|
protected javax.microedition.lcdui.Command |
failureCmd
|
protected javax.microedition.lcdui.List |
home_screen
Initial screen with options |
protected javax.microedition.lcdui.Command |
increaseVolume
|
protected boolean |
initiator
Tells whether this device initiated the set-up or not. |
protected javax.microedition.lcdui.Command |
log
|
protected javax.microedition.lcdui.Displayable |
logScreen
|
protected javax.microedition.lcdui.Image |
madlib
|
protected BluetoothPeerManager |
peerManager
|
protected javax.microedition.lcdui.Image |
print
|
protected ProgressScreen |
progressScreen
|
protected javax.microedition.lcdui.Image |
replay
|
protected BluetoothRFCOMMServer |
rfcommServer
|
protected javax.microedition.lcdui.Image |
running
|
protected javax.microedition.lcdui.Image |
search
|
protected javax.microedition.lcdui.Image |
secure
|
protected javax.microedition.lcdui.List |
serv_list
The list of Bluetooth services offered by a device |
protected java.util.Vector |
services
Discovered Bluetooth services |
static javax.bluetooth.UUID |
serviceUUID
|
protected javax.microedition.lcdui.Image |
slowcodec
|
long |
startTime
starting of verification time |
long |
startTimeMadLib
|
protected javax.microedition.lcdui.Form |
success_form
The result of the verification method |
protected javax.microedition.lcdui.Command |
successCmd
|
protected javax.microedition.lcdui.Image |
vCard
|
protected javax.microedition.lcdui.List |
verify_method
displays the available verification methods: visual, audio, madlib, slowcodec |
protected javax.microedition.lcdui.Image |
visual
|
int |
volume
Play volume, how loud the phone should play the tunes |
| Fields inherited from interface org.openuat.util.BluetoothPeerManager.PeerEventsListener |
|---|
DEVICE_NOT_REACHABLE, SEARCH_ABORTED, SEARCH_COMPLETE, SEARCH_FAILED |
| Constructor Summary | |
|---|---|
OpenUATmidlet()
|
|
| Method Summary | |
|---|---|
void |
AuthenticationFailure(java.lang.Object sender,
java.lang.Object remote,
java.lang.Exception e,
java.lang.String msg)
Upon authentication failure, an exception might have been thrown and a message might have been created. |
void |
AuthenticationProgress(java.lang.Object sender,
java.lang.Object remote,
int cur,
int max,
java.lang.String msg)
This event is raised during the authentication protocol to indicate progress. |
boolean |
AuthenticationStarted(java.lang.Object sender,
java.lang.Object remote)
This event is raised when the authentication protocol is started, to indicate that further events might follow. |
void |
AuthenticationSuccess(java.lang.Object sender,
java.lang.Object remote,
java.lang.Object result)
Upon successful authentication, the established shared key can be used with the remote host. |
void |
commandAction(javax.microedition.lcdui.Command com,
javax.microedition.lcdui.Displayable dis)
|
protected void |
connectTo(java.lang.String connectionURL)
Starts the connection and authentication process to the given Bluetooth address. |
protected void |
connectTo(java.lang.String btAdd,
int channel)
Starts the connection and authentication process to the given Bluetooth address. |
void |
destroyApp(boolean unconditional)
|
void |
do_alert_gauge(java.lang.String title,
java.lang.String msg,
java.lang.String img,
int max_time)
Display an alert which uses a progress bar. |
void |
do_alert(java.lang.String msg,
int time_out)
Display an alert to inform the user. |
javax.microedition.lcdui.Command |
getBack()
|
javax.microedition.lcdui.Command |
getFailure()
|
javax.microedition.lcdui.List |
getHomeScreen()
|
javax.microedition.lcdui.Command |
getSuccessCmd()
|
void |
informSuccess(boolean success)
Displays a screen to the user telling whether the exchanged key was successfully verified. |
protected void |
initGui()
|
void |
inquiryCompleted(java.util.Vector newDevices)
Called when the Bluetooth device inquire has finished. |
void |
pauseApp()
|
void |
serviceSearchCompleted(javax.bluetooth.RemoteDevice remoteDevice,
java.util.Vector serv,
int errorReason)
Called when the Bluetooth service search for the selected device has completed. |
void |
startApp()
|
| Methods inherited from class javax.microedition.midlet.MIDlet |
|---|
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final javax.bluetooth.UUID serviceUUID
protected byte[] authKey
protected javax.microedition.lcdui.Image search
protected javax.microedition.lcdui.Image vCard
protected javax.microedition.lcdui.Image print
protected javax.microedition.lcdui.Image visual
protected javax.microedition.lcdui.Image audio
protected javax.microedition.lcdui.Image slowcodec
protected javax.microedition.lcdui.Image madlib
protected javax.microedition.lcdui.Image running
protected javax.microedition.lcdui.Image buttonok
protected javax.microedition.lcdui.Image buttoncancel
protected javax.microedition.lcdui.Image replay
protected javax.microedition.lcdui.Image secure
protected javax.microedition.lcdui.Image error
protected javax.microedition.lcdui.List home_screen
protected javax.microedition.lcdui.List dev_list
protected javax.microedition.lcdui.List serv_list
protected javax.microedition.lcdui.List verify_method
protected javax.microedition.lcdui.Form success_form
protected javax.microedition.lcdui.Form failure_form
protected javax.microedition.lcdui.Displayable logScreen
protected javax.microedition.lcdui.Command back
protected javax.microedition.lcdui.Command exit
protected javax.microedition.lcdui.Command log
protected javax.microedition.lcdui.Command successCmd
protected javax.microedition.lcdui.Command failureCmd
protected javax.microedition.lcdui.Command increaseVolume
protected javax.microedition.lcdui.Command decreaseVolume
protected javax.microedition.lcdui.Display display
protected BluetoothRFCOMMServer rfcommServer
protected BluetoothPeerManager peerManager
protected java.util.Vector services
public int volume
protected javax.microedition.lcdui.Gauge bluetoothProgressGauge
protected ProgressScreen progressScreen
protected boolean initiator
public long startTime
public long startTimeMadLib
| Constructor Detail |
|---|
public OpenUATmidlet()
| Method Detail |
|---|
protected void initGui()
public void startApp()
startApp in class javax.microedition.midlet.MIDlet
public void commandAction(javax.microedition.lcdui.Command com,
javax.microedition.lcdui.Displayable dis)
commandAction in interface javax.microedition.lcdui.CommandListener
protected void connectTo(java.lang.String btAdd,
int channel)
btAdd - The MAC address to which to connect via Bluetoothchannel - The channel number to which to connect to (and on which the OpenUAT service is running on the remote device)protected void connectTo(java.lang.String connectionURL)
btAdd -
public void do_alert(java.lang.String msg,
int time_out)
msg - time_out -
public void do_alert_gauge(java.lang.String title,
java.lang.String msg,
java.lang.String img,
int max_time)
title - The title of the alert.msg - The message to be displayedimg - Image to be shown on the gaugemax_time - The maximum steps time on the gauge.public void pauseApp()
pauseApp in class javax.microedition.midlet.MIDletpublic void destroyApp(boolean unconditional)
destroyApp in class javax.microedition.midlet.MIDletpublic void inquiryCompleted(java.util.Vector newDevices)
inquiryCompleted in interface BluetoothPeerManager.PeerEventsListenernewDevices - This vector contains the list of new devices that
have been discovered since the last inquiry
completed. If no new devices have been found
during this inquiry, the vector is empty. Elements
of the vector are of type RemoteDevice.to get a list of devices
discovered so far.
public void AuthenticationFailure(java.lang.Object sender,
java.lang.Object remote,
java.lang.Exception e,
java.lang.String msg)
AuthenticationProgressHandler
AuthenticationFailure in interface AuthenticationProgressHandlersender - The object which sent this event.e - Reason for the failue, can be null.msg - Reaseon for the failue, can be null
public void AuthenticationProgress(java.lang.Object sender,
java.lang.Object remote,
int cur,
int max,
java.lang.String msg)
AuthenticationProgressHandler
AuthenticationProgress in interface AuthenticationProgressHandlersender - The object which sent this event.remote - The remote end with which the authentication is performed.cur - The current stage in the authentication.max - The maximum number of stages.msg - If not null, a message describing the last successful stage.
public boolean AuthenticationStarted(java.lang.Object sender,
java.lang.Object remote)
AuthenticationProgressHandler
AuthenticationStarted in interface AuthenticationProgressHandlersender - The object which sent this event.remote - The remote end with which the authentication is performed.
Depends on the sender of the event.
public void AuthenticationSuccess(java.lang.Object sender,
java.lang.Object remote,
java.lang.Object result)
AuthenticationProgressHandler
AuthenticationSuccess in interface AuthenticationProgressHandlersender - The object which sent this event.remote - The remote end with which the authentication is performed.
Depends on the sender of the event.result - The result, if any, of the successful authentication. This can
e.g. be a shared key or a set of keys or can even be null if the authentication
event is enough to signal successful authentication.
public void serviceSearchCompleted(javax.bluetooth.RemoteDevice remoteDevice,
java.util.Vector serv,
int errorReason)
serviceSearchCompleted in interface BluetoothPeerManager.PeerEventsListenerremoteDevice - The remote device for which new services have
been searched for.serv - The list of services of the remote device. Elements
of the vector are of type ServiceRecord. If no
services were found, then this vector is empty and
the parameter errorReason is set. However, note that
this vector may also be empty when no error occurred
but when the other device simply offers no services
that were searched for.errorReason - 0 indicates successful completion of service
search (either returning a list of matching
services or an empty list if there are none),
1 indicates the remote device was not reachable,
2 that the service search ended with an error
from the Bluetooth stack, and
3 that the search was canceled prematurely by
another thread.public void informSuccess(boolean success)
success - public javax.microedition.lcdui.List getHomeScreen()
public javax.microedition.lcdui.Command getBack()
public javax.microedition.lcdui.Command getFailure()
public javax.microedition.lcdui.Command getSuccessCmd()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||