public class CppGUIAdapter extends java.lang.Object implements GUIClientInterface
GUIClientInterface
for full descriptions of these routines.Constructor and Description |
---|
CppGUIAdapter() |
Modifier and Type | Method and Description |
---|---|
short[] |
getDefaultAddrs()
Returns an array of MAC addresses to be associated with the send buttons
in the GUI.
|
int |
initializeLinkLayer(short MACaddr)
Create an instance of the 802.11~ layer and set up the output streams.
|
byte[] |
pollForStreamOutput()
Called periodically by the GUI client to see if the 802.11~ layer has produced any
output that should be displayed in the client's text window.
|
int |
sendCommand(int command,
int value)
The GUI calls this when the user asks to pass command info to the 802.11~ layer.
|
int |
sendOutgoingData(short dest,
byte[] payload)
Called by the GUI client when data is to be sent.
|
byte[] |
watchForIncomingData()
This is a wrapper around 802_recv that watches for incoming packets, then
prepends the srcAddr to the incoming data and returns it as a Java byte
array.
|
public short[] getDefaultAddrs()
getDefaultAddrs
in interface GUIClientInterface
public int initializeLinkLayer(short MACaddr)
GUIClientInterface
initializeLinkLayer
in interface GUIClientInterface
MACaddr
- The 802.11~ MAC address of this host.public byte[] watchForIncomingData()
watchForIncomingData
in interface GUIClientInterface
public int sendOutgoingData(short dest, byte[] payload)
GUIClientInterface
sendOutgoingData
in interface GUIClientInterface
dest
- MAC address of destination machinepayload
- Data to be sentpublic byte[] pollForStreamOutput()
GUIClientInterface
pollForStreamOutput
in interface GUIClientInterface
public int sendCommand(int command, int value)
GUIClientInterface
sendCommand
in interface GUIClientInterface
command
- Specifies the command to sendvalue
- The value passed with the command