BowlerKernel
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
com.neuronrobotics.sdk.network.BowlerTCPClient Class Reference
Inheritance diagram for com.neuronrobotics.sdk.network.BowlerTCPClient:
Inheritance graph
[legend]
Collaboration diagram for com.neuronrobotics.sdk.network.BowlerTCPClient:
Collaboration graph
[legend]

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)
 
- Public Member Functions inherited from com.neuronrobotics.sdk.common.BowlerAbstractConnection
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< RpcEncapsulationgetRpcList (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 Public Member Functions inherited from com.neuronrobotics.sdk.common.BowlerAbstractConnection
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

- Protected Member Functions inherited from com.neuronrobotics.sdk.common.BowlerAbstractConnection
BowlerDatagram fireSyncOnReceive (BowlerDatagram datagram)
 
void fireAsyncOnResponse (BowlerDatagram datagram)
 
void waitForConnectioToBeReady ()
 

Detailed Description

The Class BowlerTCPClient.

Definition at line 37 of file BowlerTCPClient.java.

Constructor & Destructor Documentation

◆ BowlerTCPClient() [1/3]

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.

Here is the call graph for this function:

◆ BowlerTCPClient() [2/3]

com.neuronrobotics.sdk.network.BowlerTCPClient.BowlerTCPClient ( String  addr,
int  port 
) throws Exception

◆ BowlerTCPClient() [3/3]

com.neuronrobotics.sdk.network.BowlerTCPClient.BowlerTCPClient ( InetAddress  addr,
int  port 
) throws Exception

Instantiates a new bowler tcp client.

Parameters
addrthe addr
portthe port
Exceptions
Exceptionthe exception

Definition at line 98 of file BowlerTCPClient.java.

References com.neuronrobotics.sdk.network.BowlerTCPClient.port.

Member Function Documentation

◆ connect()

boolean com.neuronrobotics.sdk.network.BowlerTCPClient.connect ( )

◆ disconnect()

void com.neuronrobotics.sdk.network.BowlerTCPClient.disconnect ( )

◆ getAvailableSockets()

static ArrayList<InetAddress> com.neuronrobotics.sdk.network.BowlerTCPClient.getAvailableSockets ( )
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

Returns
list of devices that responded

Definition at line 194 of file BowlerTCPClient.java.

References com.neuronrobotics.sdk.network.UDPBowlerConnection.disconnect(), and com.neuronrobotics.sdk.network.UDPBowlerConnection.getAllAddresses().

Here is the call graph for this function:

◆ getReconnectRetry()

int com.neuronrobotics.sdk.network.BowlerTCPClient.getReconnectRetry ( )

Gets the reconnect retry.

Returns
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().

◆ reconnect()

boolean com.neuronrobotics.sdk.network.BowlerTCPClient.reconnect ( )

◆ setReconnectRetry()

void com.neuronrobotics.sdk.network.BowlerTCPClient.setReconnectRetry ( int  reconnectRetry)

Sets the reconnect retry.

Parameters
reconnectRetrythe new reconnect retry

Definition at line 264 of file BowlerTCPClient.java.

References com.neuronrobotics.sdk.network.BowlerTCPClient.reconnectRetry.

◆ setTCPAddress()

void com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPAddress ( InetAddress  addr)

Sets the TCP address.

Parameters
addrthe 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().

◆ setTCPPort()

void com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPPort ( int  port) throws IOException

Sets the TCP port.

Parameters
portthe new TCP port
Exceptions
IOExceptionSignals 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.

Here is the call graph for this function:

◆ setTCPSocket()

void com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPSocket ( Socket  sock)

◆ waitingForConnection()

boolean com.neuronrobotics.sdk.network.BowlerTCPClient.waitingForConnection ( )

Attempt to re-establish a connection. Return if the attempt was successful.

Returns
true, if successful Attempt to re-establish a connection. Return if the attempt was successful.
true, if successful

Reimplemented from com.neuronrobotics.sdk.common.BowlerAbstractConnection.

Definition at line 245 of file BowlerTCPClient.java.

Member Data Documentation

◆ port

int com.neuronrobotics.sdk.network.BowlerTCPClient.port
private

◆ reconnectRetry

int com.neuronrobotics.sdk.network.BowlerTCPClient.reconnectRetry = 5
private

◆ sleepTime

int com.neuronrobotics.sdk.network.BowlerTCPClient.sleepTime = 5000
private

The sleep time.

Definition at line 40 of file BowlerTCPClient.java.

Referenced by com.neuronrobotics.sdk.network.BowlerTCPClient.BowlerTCPClient().

◆ tcpAddr

InetAddress com.neuronrobotics.sdk.network.BowlerTCPClient.tcpAddr =null
private

◆ tcpSock

Socket com.neuronrobotics.sdk.network.BowlerTCPClient.tcpSock = null
private

The documentation for this class was generated from the following file: