|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cmpware.gdb.RSP
public class RSP
This class implements a basic GDB Remote Serial Protocol (RSP) interface. See the GDB documentation for more information on this protocol.
Copyright (c) 2007 Cmpware, Inc. All Rights Reserved.
| Field Summary | |
|---|---|
static java.lang.String |
copyright
Copyright string |
static boolean |
DEBUG
The debug flag |
protected java.io.InputStream |
in
The input stream for the socket |
protected java.io.OutputStream |
out
The input stream for the socket |
protected java.net.Socket |
socket
The socket |
| Constructor Summary | |
|---|---|
RSP()
|
|
| Method Summary | |
|---|---|
java.lang.String |
checksum(java.lang.String s)
This method returns the two byte hexadecimal checksum based on the input string. |
int |
connect(java.lang.String server,
int port)
This method connects to the GDB compatible server. |
void |
disconnect()
This method disconnects from the server. |
boolean |
isError(java.lang.String s)
This method returns true if the string representing a packet is an error string. |
boolean |
isOk(java.lang.String s)
This method returns true if the string representing a packet is a 'OK' string. |
boolean |
isPacket(java.lang.String s)
This method returns true if the string is a complete packet and false otherwise. |
static void |
main(java.lang.String[] args)
This main program is used for testing. |
java.lang.String |
recv()
This method receives a string from the target. |
java.lang.String |
recvPacket()
This method receives a complete packet. |
void |
send(java.lang.String s)
This method sends raw data over the socket connection. |
void |
sendPacket(java.lang.String s)
This method sends a gdb server commands. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEBUG
public static final java.lang.String copyright
protected java.net.Socket socket
protected java.io.InputStream in
protected java.io.OutputStream out
| Constructor Detail |
|---|
public RSP()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
public int connect(java.lang.String server,
int port)
server - the server name.port - the server port.
public void sendPacket(java.lang.String s)
throws java.io.IOException
s - The command to be sent.
an - IOException is thrown if the write could not complete.
java.io.IOException
public java.lang.String recvPacket()
throws java.io.IOException
java.io.IOException - this method throws an IOException
if there are errors reading the socket.
public void send(java.lang.String s)
throws java.io.IOException
s - The data to be sent.
an - IOException is thrown if the write could not complete.
java.io.IOException
public java.lang.String recv()
throws java.io.IOException
an - IOException is thrown if the socket read
could not complete.
java.io.IOExceptionpublic void disconnect()
public boolean isPacket(java.lang.String s)
s - The packet.
public boolean isOk(java.lang.String s)
s - The packet.
public boolean isError(java.lang.String s)
s - The packet.
public java.lang.String checksum(java.lang.String s)
s - the input string
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||