BowlerKernel
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
com.neuronrobotics.sdk.common.BowlerAbstractConnection Class Referenceabstract
Inheritance diagram for com.neuronrobotics.sdk.common.BowlerAbstractConnection:
Inheritance graph
[legend]
Collaboration diagram for com.neuronrobotics.sdk.common.BowlerAbstractConnection:
Collaboration graph
[legend]

Classes

class  PingCommand
 
class  QueueManager
 

Public Member Functions

abstract boolean connect ()
 
abstract boolean waitingForConnection ()
 
void setThreadedUpstreamPackets (boolean up)
 
BowlerDatagram sendSynchronusly (BowlerDatagram sendable)
 
synchronized BowlerDatagram sendSynchronusly (BowlerDatagram sendable, boolean switchParser)
 
void sendAsync (BowlerDatagram sendable) throws IOException
 
void disconnect ()
 
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 BowlerAbstractCommand getCommand (String namespace, BowlerMethod method, String rpcString, Object[] arguments, RpcEncapsulation rpc)
 

Protected Member Functions

BowlerDatagram fireSyncOnReceive (BowlerDatagram datagram)
 
void fireAsyncOnResponse (BowlerDatagram datagram)
 
void waitForConnectioToBeReady ()
 

Private Member Functions

void pushUp (BowlerDatagram b) throws IOException
 
void fireDisconnectEvent ()
 
void fireConnectEvent ()
 
void runHeartBeat ()
 

Private Attributes

boolean useThreadedStack =true
 
int sleepTime = 1000
 
long lastWrite = -1
 
long heartBeatTime =1000
 
int chunkSize = 64
 
BowlerDatagram response = null
 
ArrayList< IBowlerDatagramListenerlisteners = new ArrayList<IBowlerDatagramListener>()
 
ISynchronousDatagramListener syncListen = null
 
QueueManager syncQueue = null
 
QueueManager asyncQueue =null
 
boolean connected = false
 
DataInputStream dataIns
 
DataOutputStream dataOuts
 
ArrayList< NamespaceEncapsulationnamespaceList =null
 
ArrayList< String > nameSpaceStrings = null
 
boolean beater = false
 
boolean namespacesFinishedInitializing = false
 
double percentagePrint =75.0
 

Detailed Description

Connections create a bridge between a device and the SDK. Each connection is encapsulated to allow maximum reuse and system changes without the need to restart / reconfigure.

Definition at line 57 of file BowlerAbstractConnection.java.

Member Function Documentation

◆ addConnectionEventListener()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.addConnectionEventListener ( IConnectionEventListener  l)

◆ addDatagramListener()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.addDatagramListener ( IBowlerDatagramListener  listener)

◆ clearLastSyncronousResponse()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.clearLastSyncronousResponse ( )

◆ connect()

abstract boolean com.neuronrobotics.sdk.common.BowlerAbstractConnection.connect ( )
abstract

◆ disconnect()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.disconnect ( )

◆ fireAsyncOnResponse()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.fireAsyncOnResponse ( BowlerDatagram  datagram)
protected

◆ fireConnectEvent()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.fireConnectEvent ( )
private

◆ fireDisconnectEvent()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.fireDisconnectEvent ( )
private

Fire disconnect event.

Definition at line 690 of file BowlerAbstractConnection.java.

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractConnection.setConnected().

◆ fireSyncOnReceive()

BowlerDatagram com.neuronrobotics.sdk.common.BowlerAbstractConnection.fireSyncOnReceive ( BowlerDatagram  datagram)
protected

◆ getAsyncQueue()

QueueManager com.neuronrobotics.sdk.common.BowlerAbstractConnection.getAsyncQueue ( )

◆ getChunkSize()

int com.neuronrobotics.sdk.common.BowlerAbstractConnection.getChunkSize ( )

◆ getCommand()

static BowlerAbstractCommand com.neuronrobotics.sdk.common.BowlerAbstractConnection.getCommand ( String  namespace,
BowlerMethod  method,
String  rpcString,
Object[]  arguments,
RpcEncapsulation  rpc 
)
static

Gets the command.

Parameters
namespacethe namespace
methodthe method
rpcStringthe rpc string
argumentsthe arguments
rpcthe rpc
Returns
the command

Definition at line 768 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.RpcEncapsulation.getCommand().

Referenced by com.neuronrobotics.sdk.common.device.server.BowlerAbstractServer.pushAsyncPacket(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.send().

Here is the call graph for this function:

◆ getDataIns()

DataInputStream com.neuronrobotics.sdk.common.BowlerAbstractConnection.getDataIns ( ) throws NullPointerException

◆ getDataOuts()

DataOutputStream com.neuronrobotics.sdk.common.BowlerAbstractConnection.getDataOuts ( ) throws NullPointerException

◆ getLastSyncronousResponse()

BowlerDatagram com.neuronrobotics.sdk.common.BowlerAbstractConnection.getLastSyncronousResponse ( )

Return the synchronous response buffer.

Returns
the last synchronous response

Definition at line 402 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.response.

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractConnection.sendSynchronusly().

◆ getLastWrite()

long com.neuronrobotics.sdk.common.BowlerAbstractConnection.getLastWrite ( )

◆ getNamespaces()

ArrayList<String> com.neuronrobotics.sdk.common.BowlerAbstractConnection.getNamespaces ( MACAddress  addr)

◆ getPercentagePrint()

double com.neuronrobotics.sdk.common.BowlerAbstractConnection.getPercentagePrint ( )

◆ getRpcList()

ArrayList<RpcEncapsulation> com.neuronrobotics.sdk.common.BowlerAbstractConnection.getRpcList ( String  namespace,
MACAddress  addr 
)

◆ getSleepTime()

int com.neuronrobotics.sdk.common.BowlerAbstractConnection.getSleepTime ( )

◆ getSyncQueue()

QueueManager com.neuronrobotics.sdk.common.BowlerAbstractConnection.getSyncQueue ( )

◆ hasNamespace()

boolean com.neuronrobotics.sdk.common.BowlerAbstractConnection.hasNamespace ( String  string,
MACAddress  addr 
)

Check the device to see if it has the requested namespace.

Parameters
stringthe string
addrthe addr
Returns
true, if successful

Definition at line 954 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.getNamespaces(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.namespaceList.

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractDevice.hasNamespace().

Here is the call graph for this function:

◆ isBeater()

boolean com.neuronrobotics.sdk.common.BowlerAbstractConnection.isBeater ( )

◆ isConnected()

boolean com.neuronrobotics.sdk.common.BowlerAbstractConnection.isConnected ( )

Checks if is connected.

Returns
true, if is connected

Reimplemented in com.neuronrobotics.sdk.network.BowlerTCPServer.

Definition at line 386 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.connected.

Referenced by com.neuronrobotics.sdk.network.BowlerTCPClient.BowlerTCPClient(), com.neuronrobotics.sdk.common.BowlerAbstractDevice.connect(), com.neuronrobotics.sdk.javaxusb.UsbCDCSerialConnection.connect(), com.neuronrobotics.sdk.network.BowlerTCPClient.connect(), com.neuronrobotics.sdk.network.BowlerUDPServer.connect(), com.neuronrobotics.sdk.network.UDPBowlerConnection.connect(), com.neuronrobotics.sdk.serial.SerialConnection.connect(), com.neuronrobotics.sdk.wireless.bluetooth.BluetoothSerialConnection.connect(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.disconnect(), com.neuronrobotics.sdk.common.BowlerAbstractDevice.disconnect(), com.neuronrobotics.sdk.serial.SerialConnection.disconnect(), com.neuronrobotics.sdk.common.BowlerAbstractDevice.isAvailable(), com.neuronrobotics.sdk.dyio.DyIO.isAvailable(), com.neuronrobotics.sdk.genericdevice.GenericDevice.isAvailable(), com.neuronrobotics.sdk.wireless.bluetooth.BluetoothSerialConnection.recon(), com.neuronrobotics.sdk.network.BowlerTCPClient.reconnect(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.QueueManager.run(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.QueueManager.runPacketUpdate(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.sendAsync(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.sendSynchronusly(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.setConnected(), com.neuronrobotics.sdk.pid.GenericPIDDevice.setConnection(), com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPPort(), com.neuronrobotics.sdk.network.BowlerTCPClient.setTCPSocket(), and com.neuronrobotics.sdk.javaxusb.UsbCDCSerialConnection.write().

◆ isInitializedNamespaces()

boolean com.neuronrobotics.sdk.common.BowlerAbstractConnection.isInitializedNamespaces ( )

◆ isUseThreadedStack()

boolean com.neuronrobotics.sdk.common.BowlerAbstractConnection.isUseThreadedStack ( )

◆ loadPacketFromPhy()

BowlerDatagram com.neuronrobotics.sdk.common.BowlerAbstractConnection.loadPacketFromPhy ( ByteList  bytesToPacketBuffer) throws NullPointerException, IOException

Load packet from phy.

Parameters
bytesToPacketBufferthe bytes to packet buffer
Returns
the bowler datagram
Exceptions
NullPointerExceptionthe null pointer exception
IOExceptionSignals that an I/O exception has occurred.

Reimplemented in com.neuronrobotics.sdk.network.UDPBowlerConnection, com.neuronrobotics.sdk.network.BowlerUDPServer, and com.neuronrobotics.sdk.javaxusb.UsbCDCSerialConnection.

Definition at line 1487 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.dataIns, com.neuronrobotics.sdk.common.Log.error(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.getDataIns().

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractConnection.QueueManager.runPacketUpdate().

Here is the call graph for this function:

◆ locateRpc()

RpcEncapsulation com.neuronrobotics.sdk.common.BowlerAbstractConnection.locateRpc ( String  namespace,
BowlerMethod  method,
String  rpcString 
)

Locate rpc.

Parameters
namespacethe namespace
methodthe method
rpcStringthe rpc string
Returns
the rpc encapsulation

Definition at line 742 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.namespaceList.

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractConnection.parseResponse(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.send().

◆ msSinceLastSend()

long com.neuronrobotics.sdk.common.BowlerAbstractConnection.msSinceLastSend ( )

Ms since last send.

Returns
the long

Definition at line 304 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.getLastWrite().

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractConnection.runHeartBeat().

Here is the call graph for this function:

◆ onDataReceived()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.onDataReceived ( BowlerDatagram  data)

Whenever a connection has received a full datagram from its "physical" connection, it should then call onDataReceived with the datagram. This will set it to the last received data if it is synchronous and will add it to the appropriate queues to be picked up and send to the listeners.

Parameters
datathe data

Definition at line 413 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.QueueManager.addDatagram(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.getAsyncQueue(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.getSyncQueue(), com.neuronrobotics.sdk.common.Log.info(), com.neuronrobotics.sdk.common.BowlerDatagram.isSyncronous(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.response, and com.neuronrobotics.sdk.common.BowlerAbstractConnection.syncListen.

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractConnection.QueueManager.runPacketUpdate().

Here is the call graph for this function:

◆ parseResponse()

Object [] com.neuronrobotics.sdk.common.BowlerAbstractConnection.parseResponse ( String  namespace,
BowlerMethod  method,
String  rpcString,
BowlerDatagram  dg 
)

Parses the response.

Parameters
namespacethe namespace
methodthe method
rpcStringthe rpc string
dgthe dg
Returns
the object[]

Definition at line 786 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.locateRpc(), and com.neuronrobotics.sdk.common.RpcEncapsulation.parseResponse().

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractConnection.send().

Here is the call graph for this function:

◆ ping() [1/2]

boolean com.neuronrobotics.sdk.common.BowlerAbstractConnection.ping ( MACAddress  mac)

Implementation of the Bowler ping ("_png") command Sends a ping to the device returns the device's MAC address.

Parameters
macthe mac
Returns
the device's address

Definition at line 1188 of file BowlerAbstractConnection.java.

Referenced by com.neuronrobotics.sdk.network.UDPBowlerConnection.getAllAddresses(), com.neuronrobotics.sdk.common.BowlerAbstractDevice.ping(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.runHeartBeat().

◆ ping() [2/2]

boolean com.neuronrobotics.sdk.common.BowlerAbstractConnection.ping ( MACAddress  mac,
boolean  switchParser 
)

Implementation of the Bowler ping ("_png") command Sends a ping to the device returns the device's MAC address.

Parameters
macthe mac
switchParserthe switch parser
Returns
the device's address

Definition at line 1201 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.Log.error(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.send(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.startHeartBeat().

Here is the call graph for this function:

◆ pushUp()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.pushUp ( BowlerDatagram  b) throws IOException
private

◆ removeConnectionEventListener()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.removeConnectionEventListener ( IConnectionEventListener  l)

Removes the connection event listener.

Parameters
lthe l

Definition at line 681 of file BowlerAbstractConnection.java.

◆ removeDatagramListener()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.removeDatagramListener ( IBowlerDatagramListener  listener)

Remove a listener from new packet notifications.

Parameters
listenerthe listener

Definition at line 493 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.listeners.

◆ removeSynchronousDatagramListener()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.removeSynchronousDatagramListener ( ISynchronousDatagramListener  l)

Removes the synchronous datagram listener.

Parameters
lthe l

Definition at line 725 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.syncListen.

◆ runHeartBeat()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.runHeartBeat ( )
private

◆ send() [1/5]

BowlerDatagram com.neuronrobotics.sdk.common.BowlerAbstractConnection.send ( BowlerAbstractCommand  command,
MACAddress  addr 
) throws NoConnectionAvailableException, InvalidResponseException

Send a command to the connection.

Parameters
commandthe command
addrthe addr
Returns
the syncronous response
Exceptions
NoConnectionAvailableExceptionthe no connection available exception
InvalidResponseExceptionthe invalid response exception

Definition at line 1136 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.send().

Here is the call graph for this function:

◆ send() [2/5]

BowlerDatagram com.neuronrobotics.sdk.common.BowlerAbstractConnection.send ( BowlerAbstractCommand  command,
MACAddress  addr,
boolean  switchParser 
) throws NoConnectionAvailableException, InvalidResponseException

Send a command to the connection.

Parameters
commandthe command
addrthe addr
switchParserthe switch parser
Returns
the syncronous response
Exceptions
NoConnectionAvailableExceptionthe no connection available exception
InvalidResponseExceptionthe invalid response exception

Definition at line 1150 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerDatagram.getAddress(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.sendSynchronusly().

Here is the call graph for this function:

◆ send() [3/5]

BowlerDatagram com.neuronrobotics.sdk.common.BowlerAbstractConnection.send ( BowlerAbstractCommand  command,
MACAddress  addr,
int  retry 
) throws NoConnectionAvailableException, InvalidResponseException

Send a command to the connection.

Parameters
commandthe command
addrthe addr
retrythe retry
Returns
the syncronous response
Exceptions
NoConnectionAvailableExceptionthe no connection available exception
InvalidResponseExceptionthe invalid response exception

Definition at line 1077 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.send().

Here is the call graph for this function:

◆ send() [4/5]

BowlerDatagram com.neuronrobotics.sdk.common.BowlerAbstractConnection.send ( BowlerAbstractCommand  command,
MACAddress  addr,
int  retry,
boolean  switchParser 
) throws NoConnectionAvailableException, InvalidResponseException

Send a command to the connection.

Parameters
commandthe command
addrthe addr
retrythe retry
switchParserthe switch parser
Returns
the syncronous response
Exceptions
NoConnectionAvailableExceptionthe no connection available exception
InvalidResponseExceptionthe invalid response exception

Definition at line 1092 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.Log.error(), com.neuronrobotics.sdk.common.BowlerDatagram.getAddress(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.send(), and com.neuronrobotics.sdk.util.ThreadUtil.wait().

Here is the call graph for this function:

◆ send() [5/5]

Object [] com.neuronrobotics.sdk.common.BowlerAbstractConnection.send ( MACAddress  addr,
String  namespace,
BowlerMethod  method,
String  rpcString,
Object[]  arguments,
int  retry 
) throws DeviceConnectionException

This is the scripting interface to Bowler devices. THis allows a user to describe a namespace, rpc, and array or arguments to be paced into the packet based on the data types of the argument. The response in likewise unpacked into an array of objects.

Parameters
addrthe addr
namespaceThe string of the desired namespace
methodthe method
rpcStringThe string of the desired RPC
argumentsAn array of objects corresponding to the data to be stuffed into the packet.
retrythe retry
Returns
The return arguments parsed and packet into an array of arguments
Exceptions
DeviceConnectionExceptionIf the desired RPC's are not available then this will be thrown

Definition at line 808 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.Log.error(), com.neuronrobotics.sdk.common.BowlerDatagram.getAddress(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.getCommand(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.getNamespaces(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.locateRpc(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.namespaceList, and com.neuronrobotics.sdk.common.BowlerAbstractConnection.parseResponse().

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractConnection.getNamespaces(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.getRpcList(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.ping(), com.neuronrobotics.sdk.common.BowlerAbstractDevice.send(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.send(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.sendSynchronusly().

Here is the call graph for this function:

◆ sendAsync()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.sendAsync ( BowlerDatagram  sendable) throws IOException

Sends any "universal" data to the connection and returns either the syncronous response or null in the event that the connection has determined a timeout. Before sending, use clearLastSyncronousResponse() and use getLastSyncronousResponse() to get the last response since clearing.

Parameters
sendablethe sendable
Exceptions
IOExceptionSignals that an I/O exception has occurred.

Definition at line 234 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.Log.error(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.isConnected(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.write().

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractConnection.pushUp(), com.neuronrobotics.sdk.bootloader.NRBootLoader.reset(), com.neuronrobotics.sdk.common.device.server.BowlerAbstractDeviceServer.sendAsync(), com.neuronrobotics.sdk.common.device.server.BowlerAbstractDeviceServer.sendPacketWithNoResponse(), and com.neuronrobotics.sdk.common.device.server.BowlerAbstractDeviceServer.sendSyncResponse().

Here is the call graph for this function:

◆ sendSynchronusly() [1/2]

BowlerDatagram com.neuronrobotics.sdk.common.BowlerAbstractConnection.sendSynchronusly ( BowlerDatagram  sendable)

Sends any "universal" data to the connection and returns either the syncronous response or null in the event that the connection has determined a timeout. Before sending, use clearLastSyncronousResponse() and use getLastSyncronousResponse() to get the last response since clearing.

Parameters
sendablethe sendable
Returns
the bowler datagram

Definition at line 156 of file BowlerAbstractConnection.java.

Referenced by com.neuronrobotics.sdk.common.device.server.BowlerDeviceReServerNamespace.process(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.send().

◆ sendSynchronusly() [2/2]

synchronized BowlerDatagram com.neuronrobotics.sdk.common.BowlerAbstractConnection.sendSynchronusly ( BowlerDatagram  sendable,
boolean  switchParser 
)

Sends any "universal" data to the connection and returns either the syncronous response or null in the event that the connection has determined a timeout. Before sending, use clearLastSyncronousResponse() and use getLastSyncronousResponse() to get the last response since clearing.

Parameters
sendablethe sendable
switchParserthe switch parser
Returns
the bowler datagram

Definition at line 169 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.clearLastSyncronousResponse(), com.neuronrobotics.sdk.common.Log.error(), com.neuronrobotics.sdk.common.BowlerDatagram.getBytes(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.getLastSyncronousResponse(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.getPercentagePrint(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.getSleepTime(), com.neuronrobotics.sdk.common.Log.info(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.isConnected(), com.neuronrobotics.sdk.common.BowlerDatagram.isUseBowlerV4(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.isUseThreadedStack(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.QueueManager.runPacketUpdate(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.send(), com.neuronrobotics.sdk.common.BowlerDatagram.setUpstream(), com.neuronrobotics.sdk.common.BowlerDatagram.setUseBowlerV4(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.syncQueue, com.neuronrobotics.sdk.util.ThreadUtil.wait(), com.neuronrobotics.sdk.common.Log.warning(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.write().

Here is the call graph for this function:

◆ setAsyncQueue()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.setAsyncQueue ( QueueManager  asyncQueue)

Sets the async queue.

Parameters
asyncQueuethe new async queue

Definition at line 599 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.asyncQueue, and com.neuronrobotics.sdk.common.BowlerAbstractConnection.isUseThreadedStack().

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractConnection.setConnected().

Here is the call graph for this function:

◆ setBeater()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.setBeater ( boolean  beater)

◆ setChunkSize()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.setChunkSize ( int  chunkSize)

◆ setConnected()

synchronized void com.neuronrobotics.sdk.common.BowlerAbstractConnection.setConnected ( boolean  c)

Sets the connected.

Parameters
cthe new connected

Definition at line 317 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.connected, com.neuronrobotics.sdk.common.BowlerAbstractConnection.dataIns, com.neuronrobotics.sdk.common.BowlerAbstractConnection.dataOuts, com.neuronrobotics.sdk.common.BowlerAbstractConnection.disconnect(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.fireConnectEvent(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.fireDisconnectEvent(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.getAsyncQueue(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.getDataIns(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.getDataOuts(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.getSyncQueue(), com.neuronrobotics.sdk.common.Log.info(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.isConnected(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.QueueManager.kill(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.setAsyncQueue(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.setDataIns(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.setDataOuts(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.setSyncQueue().

Referenced by com.neuronrobotics.sdk.network.BowlerTCPServer.BowlerTCPServer(), com.neuronrobotics.sdk.javaxusb.UsbCDCSerialConnection.connect(), com.neuronrobotics.sdk.network.BowlerTCPClient.connect(), com.neuronrobotics.sdk.network.BowlerUDPServer.connect(), com.neuronrobotics.sdk.network.UDPBowlerConnection.connect(), com.neuronrobotics.sdk.serial.SerialConnection.connect(), com.neuronrobotics.sdk.wireless.bluetooth.BluetoothSerialConnection.connect(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.disconnect(), com.neuronrobotics.sdk.network.BowlerUDPServer.disconnect(), com.neuronrobotics.sdk.network.UDPBowlerConnection.disconnect(), com.neuronrobotics.sdk.serial.SerialConnection.disconnect(), com.neuronrobotics.sdk.wireless.bluetooth.BluetoothSerialConnection.disconnect(), and com.neuronrobotics.sdk.wireless.bluetooth.BluetoothSerialConnection.recon().

Here is the call graph for this function:

◆ setDataIns()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.setDataIns ( DataInputStream  dataIns)

◆ setDataOuts()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.setDataOuts ( DataOutputStream  dataOuts)

◆ setLastWrite()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.setLastWrite ( long  lastWrite)

◆ setPercentagePrint()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.setPercentagePrint ( double  percentagePrint)

Sets the percentage print.

Parameters
percentagePrintthe new percentage print

Definition at line 1279 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.percentagePrint.

◆ setSynchronousDatagramListener()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.setSynchronousDatagramListener ( ISynchronousDatagramListener  l)

Sets the synchronous datagram listener.

Parameters
lthe new synchronous datagram listener

Definition at line 710 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.syncListen.

Referenced by com.neuronrobotics.sdk.common.device.server.BowlerAbstractServer.addServer().

◆ setSynchronusPacketTimeoutTime()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.setSynchronusPacketTimeoutTime ( int  sleepTime)

◆ setSyncQueue()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.setSyncQueue ( QueueManager  syncQueue)

Sets the sync queue.

Parameters
syncQueuethe new sync queue

Definition at line 612 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.isUseThreadedStack(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.syncQueue.

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractConnection.setConnected().

Here is the call graph for this function:

◆ setThreadedUpstreamPackets()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.setThreadedUpstreamPackets ( boolean  up)

Tells the connection to use asynchronous packets as threads or not.

Parameters
upthe new threaded upstream packets

Definition at line 143 of file BowlerAbstractConnection.java.

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractDevice.setThreadedUpstreamPackets().

◆ setUseThreadedStack()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.setUseThreadedStack ( boolean  useThreadedStack)

Sets the use threaded stack.

Parameters
useThreadedStackthe new use threaded stack

Definition at line 1457 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.useThreadedStack.

◆ startHeartBeat() [1/2]

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.startHeartBeat ( )

◆ startHeartBeat() [2/2]

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.startHeartBeat ( long  msHeartBeatTime)

Start heart beat.

Parameters
msHeartBeatTimethe ms heart beat time

Definition at line 1233 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.heartBeatTime, and com.neuronrobotics.sdk.common.BowlerAbstractConnection.startHeartBeat().

Here is the call graph for this function:

◆ stopHeartBeat()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.stopHeartBeat ( )

Stop heart beat.

Definition at line 1243 of file BowlerAbstractConnection.java.

References com.neuronrobotics.sdk.common.BowlerAbstractConnection.setBeater().

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractDevice.stopHeartBeat().

Here is the call graph for this function:

◆ waitForConnectioToBeReady()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.waitForConnectioToBeReady ( )
protected

◆ waitingForConnection()

abstract boolean com.neuronrobotics.sdk.common.BowlerAbstractConnection.waitingForConnection ( )
abstract

◆ write()

void com.neuronrobotics.sdk.common.BowlerAbstractConnection.write ( byte[]  data) throws IOException

Member Data Documentation

◆ asyncQueue

QueueManager com.neuronrobotics.sdk.common.BowlerAbstractConnection.asyncQueue =null
private

◆ beater

boolean com.neuronrobotics.sdk.common.BowlerAbstractConnection.beater = false
private

◆ chunkSize

int com.neuronrobotics.sdk.common.BowlerAbstractConnection.chunkSize = 64
private

◆ connected

boolean com.neuronrobotics.sdk.common.BowlerAbstractConnection.connected = false
private

◆ dataIns

DataInputStream com.neuronrobotics.sdk.common.BowlerAbstractConnection.dataIns
private

◆ dataOuts

DataOutputStream com.neuronrobotics.sdk.common.BowlerAbstractConnection.dataOuts
private

◆ heartBeatTime

long com.neuronrobotics.sdk.common.BowlerAbstractConnection.heartBeatTime =1000
private

◆ lastWrite

long com.neuronrobotics.sdk.common.BowlerAbstractConnection.lastWrite = -1
private

◆ listeners

ArrayList<IBowlerDatagramListener> com.neuronrobotics.sdk.common.BowlerAbstractConnection.listeners = new ArrayList<IBowlerDatagramListener>()
private

◆ namespaceList

ArrayList<NamespaceEncapsulation> com.neuronrobotics.sdk.common.BowlerAbstractConnection.namespaceList =null
private

◆ namespacesFinishedInitializing

boolean com.neuronrobotics.sdk.common.BowlerAbstractConnection.namespacesFinishedInitializing = false
private

◆ nameSpaceStrings

ArrayList<String> com.neuronrobotics.sdk.common.BowlerAbstractConnection.nameSpaceStrings = null
private

The name space strings.

Definition at line 110 of file BowlerAbstractConnection.java.

Referenced by com.neuronrobotics.sdk.common.BowlerAbstractConnection.getNamespaces().

◆ percentagePrint

double com.neuronrobotics.sdk.common.BowlerAbstractConnection.percentagePrint =75.0
private

◆ response

BowlerDatagram com.neuronrobotics.sdk.common.BowlerAbstractConnection.response = null
private

◆ sleepTime

int com.neuronrobotics.sdk.common.BowlerAbstractConnection.sleepTime = 1000
private

◆ syncListen

ISynchronousDatagramListener com.neuronrobotics.sdk.common.BowlerAbstractConnection.syncListen = null
private

◆ syncQueue

QueueManager com.neuronrobotics.sdk.common.BowlerAbstractConnection.syncQueue = null
private

◆ useThreadedStack

boolean com.neuronrobotics.sdk.common.BowlerAbstractConnection.useThreadedStack =true
private

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