|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sentilla.system.DriverAdapter
com.sentilla.platform.cmote.Protocol
com.sentilla.platform.cmote.ClientRadioProtocol
public class ClientRadioProtocol
Provides a protocol wrapper to the host-side communication interface. Used to send and receive from the radio firmware and provides metadata to set radio parameters.
Protocol
,
Dispatcher
Nested Class Summary | |
---|---|
static class |
ClientRadioProtocol.Receiver
Provides receiver class for the client to receive from the host server. |
static class |
ClientRadioProtocol.Sender
Provides sender class for the simulated radio. |
Field Summary |
---|
Fields inherited from class com.sentilla.system.DriverAdapter |
---|
m_nextDriver |
Constructor Summary | |
---|---|
ClientRadioProtocol()
|
Method Summary | |
---|---|
boolean |
connect(String host,
int port,
int timeout)
Connects the server at the given host and port. |
void |
disconnect()
|
boolean |
doesInstanceMatch(Object obj)
Returns true if obj is an instanceof RadioMacAddressMessage. |
static int |
getDebug()
Get debug logging level |
String |
getDriverName(int n)
Returns the strings "local" and "default". |
String |
getHost()
Server host address. |
int |
getPacketsRead()
Returns the number packets read from the server since instantiation, or the last reset. |
int |
getPacketsWritten()
Returns the number packets written to the server since instantiation, or the last reset. |
int |
getPort()
Server port. |
int |
getTimeout()
The number of seconds to wait for server communication |
boolean |
isConnected()
|
ClientRadioProtocol.Receiver |
newReceiver()
Returns a new receiver for the client application to receive from the host server. |
ClientRadioProtocol.Receiver |
newReceiver(Class<ByteBufferMessage> name)
|
ClientRadioProtocol.Sender |
newSender()
Returns a new sender for the client application to communicate with the host server. |
void |
resetPacketCounters()
Resets packact counters. |
static void |
setDebug(int level)
Set debug logging level |
void |
stackReceive(Receiver rcvr)
Needed by client applications to snoop on other client communications. |
void |
stackSend(Sender ds)
Sends a message to the host server. |
void |
startReceiving()
Start receiving mote network traffic. |
void |
stopReceiving()
Stop receiving mote network traffic. |
Methods inherited from class com.sentilla.system.DriverAdapter |
---|
getNextDriver, setNextDriver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClientRadioProtocol()
Method Detail |
---|
public boolean connect(String host, int port, int timeout) throws UnknownHostException, IOException
host
- the host addressport
- the host porttimeout
- the max number of milliseconds to wait for server communication
IOException
UnknownHostException
public void disconnect()
public boolean isConnected()
public String getHost()
public int getPort()
public int getTimeout()
public static void setDebug(int level)
public static int getDebug()
public void stackReceive(Receiver rcvr)
stackReceive
in class Protocol
rcvr
- Receiver object containing received objectProtocol
public void stackSend(Sender ds)
stackSend
in class Protocol
ds
- sender object containing the data to be sentProtocol
,
ClientRadioProtocol.Sender
,
Dispatcher
public ClientRadioProtocol.Sender newSender()
newSender
in class Protocol
ClientRadioProtocol.Sender
,
Dispatcher
public ClientRadioProtocol.Receiver newReceiver()
newReceiver
in class Protocol
Receiver
,
Dispatcher
public ClientRadioProtocol.Receiver newReceiver(Class<ByteBufferMessage> name)
public boolean doesInstanceMatch(Object obj)
doesInstanceMatch
in class Protocol
obj
- Object to match
Protocol
public String getDriverName(int n)
Drivers
class.
getDriverName
in interface Driver
getDriverName
in class DriverAdapter
n
- index of string to get
Protocol
,
Driver
,
Drivers
public void resetPacketCounters()
public int getPacketsRead()
public int getPacketsWritten()
public void startReceiving() throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public void stopReceiving() throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |