|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.krep.evalbench.comm.JNIConnection
public class JNIConnection
Connection to software emulation of the processor via java native interfaces.
Constructor Summary | |
---|---|
JNIConnection(String protocol,
String logFile)
Connect to software emulation. |
Method Summary | |
---|---|
void |
dispose()
Closes connection and removes locks on the involved device. |
String |
hark(int n)
Harks to incoming data. |
String |
receive(char exit)
Tries to receive a sequence of characters until an exit character is read. |
String |
receive(int n)
Tries to receive a fixed number of characters. |
LinkedList<Integer> |
receiveByte(int n)
Tries to receive a fixed number of characters. |
void |
send(byte data)
Sends data to the target. |
void |
send(byte[] data)
Sends data to the target. |
void |
send(String data)
Sends data to the target. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JNIConnection(String protocol, String logFile) throws CommunicationException
protocol
- use KEP or KReP protocollogFile
- Name of the esi file to which the communication is logged or null to disabled
logging.
CommunicationException
- thrown for any connection errors, e.g., if the software simulation is not foundMethod Detail |
---|
public void dispose()
dispose
in interface IConnection
public String hark(int n) throws CommunicationException
hark
in interface IConnection
n
- maximal number of characters to receive
CommunicationException
- when an exception occurs while receiving datapublic String receive(char exit) throws CommunicationException
receive
in interface IConnection
exit
- the exit character
CommunicationException
- when a timeout is reached before the exit character is readpublic String receive(int n) throws CommunicationException
receive
in interface IConnection
n
- the number of characters to be fetched
CommunicationException
- when a timeout is reached before the exit character is readpublic void send(String data) throws CommunicationException
send
in interface IConnection
data
- data to be sent
CommunicationException
- when an exception occurs while sending datapublic void send(byte data) throws CommunicationException
send
in interface IConnection
data
- data to be sent
CommunicationException
- when an exception occurs while sending datapublic LinkedList<Integer> receiveByte(int n) throws CommunicationException
receiveByte
in interface IConnection
n
- the number of characters to be fetched
CommunicationException
- when a timeout is reached before the exit character is readpublic void send(byte[] data) throws CommunicationException
send
in interface IConnection
data
- data to be sent
CommunicationException
- when an exception occurs while sending data
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |