BowlerKernel
|
Public Member Functions | |
BowlerTCPClient () | |
BowlerTCPClient (String addr, int port) throws Exception | |
BowlerTCPClient (InetAddress addr, int port) throws Exception | |
void | setTCPAddress (InetAddress addr) |
void | setTCPPort (int port) throws IOException |
void | setTCPSocket (Socket sock) |
boolean | connect () |
void | disconnect () |
boolean | reconnect () |
boolean | waitingForConnection () |
int | getReconnectRetry () |
void | setReconnectRetry (int reconnectRetry) |
![]() | |
void | setThreadedUpstreamPackets (boolean up) |
BowlerDatagram | sendSynchronusly (BowlerDatagram sendable) |
synchronized BowlerDatagram | sendSynchronusly (BowlerDatagram sendable, boolean switchParser) |
void | sendAsync (BowlerDatagram sendable) throws IOException |
void | setSynchronusPacketTimeoutTime (int sleepTime) |
int | getSleepTime () |
long | msSinceLastSend () |
synchronized void | setConnected (boolean c) |
boolean | isConnected () |
void | clearLastSyncronousResponse () |
BowlerDatagram | getLastSyncronousResponse () |
void | onDataReceived (BowlerDatagram data) |
void | addDatagramListener (IBowlerDatagramListener listener) |
void | removeDatagramListener (IBowlerDatagramListener listener) |
void | setDataIns (DataInputStream dataIns) |
DataInputStream | getDataIns () throws NullPointerException |
void | setDataOuts (DataOutputStream dataOuts) |
DataOutputStream | getDataOuts () throws NullPointerException |
void | setChunkSize (int chunkSize) |
int | getChunkSize () |
void | setAsyncQueue (QueueManager asyncQueue) |
void | setSyncQueue (QueueManager syncQueue) |
QueueManager | getAsyncQueue () |
QueueManager | getSyncQueue () |
void | addConnectionEventListener (IConnectionEventListener l) |
void | removeConnectionEventListener (IConnectionEventListener l) |
void | setSynchronousDatagramListener (ISynchronousDatagramListener l) |
void | removeSynchronousDatagramListener (ISynchronousDatagramListener l) |
RpcEncapsulation | locateRpc (String namespace, BowlerMethod method, String rpcString) |
Object[] | parseResponse (String namespace, BowlerMethod method, String rpcString, BowlerDatagram dg) |
Object[] | send (MACAddress addr, String namespace, BowlerMethod method, String rpcString, Object[] arguments, int retry) throws DeviceConnectionException |
boolean | isInitializedNamespaces () |
ArrayList< String > | getNamespaces (MACAddress addr) |
boolean | hasNamespace (String string, MACAddress addr) |
ArrayList< RpcEncapsulation > | getRpcList (String namespace, MACAddress addr) |
BowlerDatagram | send (BowlerAbstractCommand command, MACAddress addr, int retry) throws NoConnectionAvailableException, InvalidResponseException |
BowlerDatagram | send (BowlerAbstractCommand command, MACAddress addr, int retry, boolean switchParser) throws NoConnectionAvailableException, InvalidResponseException |
BowlerDatagram | send (BowlerAbstractCommand command, MACAddress addr) throws NoConnectionAvailableException, InvalidResponseException |
BowlerDatagram | send (BowlerAbstractCommand command, MACAddress addr, boolean switchParser) throws NoConnectionAvailableException, InvalidResponseException |
boolean | ping (MACAddress mac) |
boolean | ping (MACAddress mac, boolean switchParser) |
void | startHeartBeat () |
void | startHeartBeat (long msHeartBeatTime) |
void | stopHeartBeat () |
double | getPercentagePrint () |
void | setPercentagePrint (double percentagePrint) |
long | getLastWrite () |
void | setLastWrite (long lastWrite) |
boolean | isUseThreadedStack () |
void | setUseThreadedStack (boolean useThreadedStack) |
boolean | isBeater () |
void | setBeater (boolean beater) |
BowlerDatagram | loadPacketFromPhy (ByteList bytesToPacketBuffer) throws NullPointerException, IOException |
void | write (byte[] data) throws IOException |
Static Public Member Functions | |
static ArrayList< InetAddress > | getAvailableSockets () |
![]() | |
static BowlerAbstractCommand | getCommand (String namespace, BowlerMethod method, String rpcString, Object[] arguments, RpcEncapsulation rpc) |
Private Attributes | |
int | sleepTime = 5000 |
int | reconnectRetry = 5 |
Socket | tcpSock = null |
InetAddress | tcpAddr =null |
int | port |
Additional Inherited Members | |
![]() | |
BowlerDatagram | fireSyncOnReceive (BowlerDatagram datagram) |
void | fireAsyncOnResponse (BowlerDatagram datagram) |
void | waitForConnectioToBeReady () |
The Class BowlerTCPClient.
Definition at line 37 of file BowlerTCPClient.java.
com.neuronrobotics.sdk.network.BowlerTCPClient.BowlerTCPClient | ( | ) |
Instantiates a new bowler tcp client.
Definition at line 59 of file BowlerTCPClient.java.
References com.neuronrobotics.sdk.common.BowlerAbstractConnection.setSynchronusPacketTimeoutTime(), and com.neuronrobotics.sdk.network.BowlerTCPClient.sleepTime.
com.neuronrobotics.sdk.network.BowlerTCPClient.BowlerTCPClient | ( | String | addr, |
int | port | ||
) | throws Exception |
Instantiates a new bowler tcp client.
addr | the addr |
port | the port |
Exception | the exception |
Definition at line 70 of file BowlerTCPClient.java.
References com.neuronrobotics.sdk.common.Log.error(), com.neuronrobotics.sdk.common.Log.info(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.isConnected(), com.neuronrobotics.sdk.network.BowlerTCPClient.port, com.neuronrobotics.sdk.common.BowlerAbstractConnection.setSynchronusPacketTimeoutTime(), com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPAddress(), com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPSocket(), and com.neuronrobotics.sdk.network.BowlerTCPClient.sleepTime.
com.neuronrobotics.sdk.network.BowlerTCPClient.BowlerTCPClient | ( | InetAddress | addr, |
int | port | ||
) | throws Exception |
Instantiates a new bowler tcp client.
addr | the addr |
port | the port |
Exception | the exception |
Definition at line 98 of file BowlerTCPClient.java.
References com.neuronrobotics.sdk.network.BowlerTCPClient.port.
boolean com.neuronrobotics.sdk.network.BowlerTCPClient.connect | ( | ) |
Attempt to establish a connection. Return if the attempt was successful.
Reimplemented from com.neuronrobotics.sdk.common.BowlerAbstractConnection.
Definition at line 149 of file BowlerTCPClient.java.
References com.neuronrobotics.sdk.common.BowlerAbstractConnection.isConnected(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.setConnected(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.setDataIns(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.setDataOuts(), and com.neuronrobotics.sdk.network.BowlerTCPClient.tcpSock.
Referenced by com.neuronrobotics.sdk.network.BowlerTCPClient.reconnect(), and com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPSocket().
void com.neuronrobotics.sdk.network.BowlerTCPClient.disconnect | ( | ) |
Disconnect and deactive the current connection.
Reimplemented from com.neuronrobotics.sdk.common.BowlerAbstractConnection.
Definition at line 169 of file BowlerTCPClient.java.
References com.neuronrobotics.sdk.common.BowlerAbstractConnection.getDataIns(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.setDataIns(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.setDataOuts(), com.neuronrobotics.sdk.network.BowlerTCPClient.tcpSock, and com.neuronrobotics.sdk.common.Log.warning().
Referenced by com.neuronrobotics.sdk.network.BowlerTCPClient.reconnect().
|
static |
This will broadcast out 1 packet on UDP socket 1865. It will wait for devices to respond and makes a list of the availible TCP sockets
Definition at line 194 of file BowlerTCPClient.java.
References com.neuronrobotics.sdk.network.UDPBowlerConnection.disconnect(), and com.neuronrobotics.sdk.network.UDPBowlerConnection.getAllAddresses().
int com.neuronrobotics.sdk.network.BowlerTCPClient.getReconnectRetry | ( | ) |
Gets the reconnect retry.
Definition at line 255 of file BowlerTCPClient.java.
References com.neuronrobotics.sdk.network.BowlerTCPClient.reconnectRetry.
Referenced by com.neuronrobotics.sdk.network.BowlerTCPClient.reconnect().
boolean com.neuronrobotics.sdk.network.BowlerTCPClient.reconnect | ( | ) |
Reconnect.
Definition at line 219 of file BowlerTCPClient.java.
References com.neuronrobotics.sdk.network.BowlerTCPClient.connect(), com.neuronrobotics.sdk.network.BowlerTCPClient.disconnect(), com.neuronrobotics.sdk.common.Log.error(), com.neuronrobotics.sdk.network.BowlerTCPClient.getReconnectRetry(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.getSleepTime(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.isConnected(), com.neuronrobotics.sdk.network.BowlerTCPClient.port, com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPSocket(), com.neuronrobotics.sdk.network.BowlerTCPClient.tcpAddr, com.neuronrobotics.sdk.util.ThreadUtil.wait(), and com.neuronrobotics.sdk.common.Log.warning().
void com.neuronrobotics.sdk.network.BowlerTCPClient.setReconnectRetry | ( | int | reconnectRetry | ) |
Sets the reconnect retry.
reconnectRetry | the new reconnect retry |
Definition at line 264 of file BowlerTCPClient.java.
References com.neuronrobotics.sdk.network.BowlerTCPClient.reconnectRetry.
void com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPAddress | ( | InetAddress | addr | ) |
Sets the TCP address.
addr | the new TCP address |
Definition at line 107 of file BowlerTCPClient.java.
References com.neuronrobotics.sdk.network.BowlerTCPClient.tcpAddr.
Referenced by com.neuronrobotics.sdk.network.BowlerTCPClient.BowlerTCPClient().
void com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPPort | ( | int | port | ) | throws IOException |
Sets the TCP port.
port | the new TCP port |
IOException | Signals that an I/O exception has occurred. |
Definition at line 117 of file BowlerTCPClient.java.
References com.neuronrobotics.sdk.common.BowlerAbstractConnection.isConnected(), com.neuronrobotics.sdk.network.BowlerTCPClient.port, com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPSocket(), and com.neuronrobotics.sdk.network.BowlerTCPClient.tcpAddr.
void com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPSocket | ( | Socket | sock | ) |
Sets the TCP socket.
sock | the new TCP socket |
Definition at line 130 of file BowlerTCPClient.java.
References com.neuronrobotics.sdk.network.BowlerTCPClient.connect(), com.neuronrobotics.sdk.common.Log.info(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.isConnected(), and com.neuronrobotics.sdk.network.BowlerTCPClient.tcpSock.
Referenced by com.neuronrobotics.sdk.network.BowlerTCPClient.BowlerTCPClient(), com.neuronrobotics.sdk.network.BowlerTCPClient.reconnect(), and com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPPort().
boolean com.neuronrobotics.sdk.network.BowlerTCPClient.waitingForConnection | ( | ) |
Attempt to re-establish a connection. Return if the attempt was successful.
Reimplemented from com.neuronrobotics.sdk.common.BowlerAbstractConnection.
Definition at line 245 of file BowlerTCPClient.java.
|
private |
The port.
Definition at line 53 of file BowlerTCPClient.java.
Referenced by com.neuronrobotics.sdk.network.BowlerTCPClient.BowlerTCPClient(), com.neuronrobotics.sdk.network.BowlerTCPClient.reconnect(), and com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPPort().
|
private |
The reconnect retry.
Definition at line 43 of file BowlerTCPClient.java.
Referenced by com.neuronrobotics.sdk.network.BowlerTCPClient.getReconnectRetry(), and com.neuronrobotics.sdk.network.BowlerTCPClient.setReconnectRetry().
|
private |
The sleep time.
Definition at line 40 of file BowlerTCPClient.java.
Referenced by com.neuronrobotics.sdk.network.BowlerTCPClient.BowlerTCPClient().
|
private |
The tcp addr.
Definition at line 49 of file BowlerTCPClient.java.
Referenced by com.neuronrobotics.sdk.network.BowlerTCPClient.reconnect(), com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPAddress(), and com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPPort().
|
private |
The tcp sock.
Definition at line 46 of file BowlerTCPClient.java.
Referenced by com.neuronrobotics.sdk.network.BowlerTCPClient.connect(), com.neuronrobotics.sdk.network.BowlerTCPClient.disconnect(), and com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPSocket().