public class LinkLayer extends java.lang.Object implements Dot11Interface
Dot11Interface
for more
details on these routines.Constructor and Description |
---|
LinkLayer(short ourMAC,
java.io.PrintWriter output)
Constructor takes a MAC address and the PrintWriter to which our output will
be written.
|
Modifier and Type | Method and Description |
---|---|
int |
command(int cmd,
int val)
Passes command info to your link layer.
|
int |
recv(Transmission t)
Recv method blocks until data arrives, then writes it an address info into
the Transmission object.
|
int |
send(short dest,
byte[] data,
int len)
Send method takes a destination, a buffer (array) of data, and the number
of bytes to send.
|
int |
status()
Returns a current status code.
|
public LinkLayer(short ourMAC, java.io.PrintWriter output)
ourMAC
- MAC addressoutput
- Output stream associated with GUIpublic int send(short dest, byte[] data, int len)
send
in interface Dot11Interface
dest
- MAC address to which data should be sentdata
- Buffer containing datalen
- Number of bytes of data to sendpublic int recv(Transmission t)
recv
in interface Dot11Interface
t
- A Transmission instance to which the incoming data and address information is
written.public int status()
status
in interface Dot11Interface
public int command(int cmd, int val)
command
in interface Dot11Interface
cmd
- Specifies the command to sendval
- The value passed with the command