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

Public Member Functions

boolean isAvailable () throws InvalidConnectionException
 
void addConnectionEventListener (final IDeviceConnectionEventListener l)
 
void removeConnectionEventListener (IDeviceConnectionEventListener l)
 
void setConnection (BowlerAbstractConnection connection)
 
boolean connect () throws InvalidConnectionException
 
void disconnect ()
 
BowlerAbstractConnection getConnection ()
 
void setAddress (MACAddress address)
 
MACAddress getAddress ()
 
BowlerDatagram send (BowlerAbstractCommand command) throws NoConnectionAvailableException, InvalidResponseException
 
BowlerDatagram send (BowlerAbstractCommand command, int retry) throws NoConnectionAvailableException, InvalidResponseException
 
Object[] send (String namespace, BowlerMethod method, String rpcString, Object[] arguments, int retry) throws DeviceConnectionException
 
Object[] send (String namespace, BowlerMethod method, String rpcString, Object[] arguments) throws DeviceConnectionException
 
boolean ping ()
 
boolean ping (boolean switchParser)
 
ArrayList< ByteListgetRevisions ()
 
ArrayList< String > getNamespaces ()
 
boolean hasNamespace (String string)
 
void startHeartBeat ()
 
void startHeartBeat (long msHeartBeatTime)
 
void stopHeartBeat ()
 
void setThreadedUpstreamPackets (boolean up)
 
ArrayList< RpcEncapsulationgetRpcList (String namespace)
 
void loadRpcList ()
 
void onAllResponse (BowlerDatagram data)
 
boolean isKeepAlive ()
 
void setKeepAlive (boolean keepAlive)
 
long getLastPacketTime ()
 
void setLastPacketTime (long lastPacketTime)
 
String getScriptingName ()
 
void setScriptingName (String scriptingName)
 
ArrayList< IDeviceConnectionEventListenergetDisconnectListeners ()
 
- Public Member Functions inherited from com.neuronrobotics.sdk.common.IBowlerDatagramListener
void onAsyncResponse (BowlerDatagram data)
 

Protected Member Functions

void fireDisconnectEvent ()
 
void fireConnectEvent ()
 

Private Attributes

boolean keepAlive = true
 
boolean disconnecting = false
 
long lastPacketTime =0
 
BowlerAbstractConnection connection =null
 
MACAddress address = new MACAddress(MACAddress.BROADCAST)
 
ArrayList< IDeviceConnectionEventListenerdisconnectListeners = new ArrayList<IDeviceConnectionEventListener> ()
 
String scriptingName = "device"
 

Detailed Description

AbstractDevices are used to model devices that are connected to the Bowler network. AbstractDevice implementations should encapsulate command generation and provide higher-level actions to users.

Author
rbreznak

Definition at line 47 of file BowlerAbstractDevice.java.

Member Function Documentation

◆ addConnectionEventListener()

void com.neuronrobotics.sdk.common.BowlerAbstractDevice.addConnectionEventListener ( final IDeviceConnectionEventListener  l)

◆ connect()

boolean com.neuronrobotics.sdk.common.BowlerAbstractDevice.connect ( ) throws InvalidConnectionException

◆ disconnect()

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

◆ fireConnectEvent()

void com.neuronrobotics.sdk.common.BowlerAbstractDevice.fireConnectEvent ( )
protected

◆ fireDisconnectEvent()

void com.neuronrobotics.sdk.common.BowlerAbstractDevice.fireDisconnectEvent ( )
protected

◆ getAddress()

MACAddress com.neuronrobotics.sdk.common.BowlerAbstractDevice.getAddress ( )

◆ getConnection()

BowlerAbstractConnection com.neuronrobotics.sdk.common.BowlerAbstractDevice.getConnection ( )

◆ getDisconnectListeners()

ArrayList<IDeviceConnectionEventListener> com.neuronrobotics.sdk.common.BowlerAbstractDevice.getDisconnectListeners ( )

◆ getLastPacketTime()

long com.neuronrobotics.sdk.common.BowlerAbstractDevice.getLastPacketTime ( )

Gets the last packet time.

Returns
the last packet time

Definition at line 467 of file BowlerAbstractDevice.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.lastPacketTime.

◆ getNamespaces()

ArrayList<String> com.neuronrobotics.sdk.common.BowlerAbstractDevice.getNamespaces ( )

◆ getRevisions()

ArrayList<ByteList> com.neuronrobotics.sdk.common.BowlerAbstractDevice.getRevisions ( )

◆ getRpcList()

ArrayList<RpcEncapsulation> com.neuronrobotics.sdk.common.BowlerAbstractDevice.getRpcList ( String  namespace)

◆ getScriptingName()

String com.neuronrobotics.sdk.common.BowlerAbstractDevice.getScriptingName ( )

Gets the scripting name.

Returns
the scripting name

Reimplemented in com.neuronrobotics.sdk.common.DMDevice.

Definition at line 487 of file BowlerAbstractDevice.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.scriptingName.

Referenced by com.neuronrobotics.bowlerstudio.creature.MobileBaseCadManager._generateStls(), com.neuronrobotics.sdk.common.DeviceManager.addConnectionBAD(), com.neuronrobotics.sdk.addons.kinematics.AbstractKinematicsNR.checkVector(), com.neuronrobotics.bowlerstudio.creature.MobileBaseCadManager.generateBody(), com.neuronrobotics.bowlerstudio.creature.MobileBaseCadManager.generateStls(), com.neuronrobotics.sdk.addons.kinematics.MobileBase.getEmbedableXml(), com.neuronrobotics.bowlerstudio.creature.MobileBaseCadManager.getIgenerateBed(), com.neuronrobotics.sdk.addons.kinematics.parallel.ParallelGroup.getTipOffsetFromThisLinkInLimb(), com.neuronrobotics.sdk.addons.kinematics.LinkFactory.LinkFactory(), com.neuronrobotics.bowlerstudio.sequence.TimeSequence.loadMobileBase(), com.neuronrobotics.sdk.addons.kinematics.MobileBase.makeLimbTag(), com.neuronrobotics.bowlerstudio.BowlerKernel.processReturnedObjects(), com.neuronrobotics.bowlerstudio.creature.MobileBaseCadManager.run(), com.neuronrobotics.bowlerstudio.creature.MobileBaseCadManager.scriptFromFileInfo(), com.neuronrobotics.bowlerstudio.creature.MobileBaseLoader.setDefaultDhParameterKinematics(), com.neuronrobotics.bowlerstudio.creature.MobileBaseLoader.setGitWalkingEngine(), com.neuronrobotics.sdk.addons.kinematics.DHParameterKinematics.setGlobalToFiducialTransform(), com.neuronrobotics.sdk.addons.kinematics.MobileBase.setMassKg(), com.neuronrobotics.bowlerstudio.creature.MobileBaseCadManager.setMobileBase(), com.neuronrobotics.sdk.addons.kinematics.parallel.ParallelGroup.setupReferencedLimbStartup(), and com.neuronrobotics.bowlerstudio.creature.MobileBaseCadManager.updateBase().

◆ hasNamespace()

boolean com.neuronrobotics.sdk.common.BowlerAbstractDevice.hasNamespace ( String  string)

◆ isAvailable()

boolean com.neuronrobotics.sdk.common.BowlerAbstractDevice.isAvailable ( ) throws InvalidConnectionException

Determines if the device is available.

Returns
true if the device is avaiable, false if it is not
Exceptions
InvalidConnectionExceptionthe invalid connection exception

Reimplemented in com.neuronrobotics.imageprovider.AbstractImageProvider, com.neuronrobotics.sdk.pid.VirtualGenericPIDDevice, com.neuronrobotics.sdk.genericdevice.GenericDevice, com.neuronrobotics.sdk.dyio.DyIO, com.neuronrobotics.sdk.common.NonBowlerDevice, and com.neuronrobotics.sdk.common.DMDevice.

Definition at line 76 of file BowlerAbstractDevice.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.disconnecting, com.neuronrobotics.sdk.common.BowlerAbstractDevice.getConnection(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.isConnected().

Referenced by com.neuronrobotics.sdk.common.DeviceManager.addConnectionBAD(), com.neuronrobotics.sdk.bootloader.NRBootLoader.connect(), com.neuronrobotics.sdk.common.BowlerAbstractDevice.connect(), com.neuronrobotics.sdk.common.device.server.BowlerAbstractDeviceServer.connect(), com.neuronrobotics.sdk.bowlercam.device.BowlerCamDevice.getBlobs(), com.neuronrobotics.sdk.bowlercam.device.BowlerCamDevice.getHighSpeedImage(), com.neuronrobotics.sdk.bowlercam.device.BowlerCamDevice.getImageServerURL(), com.neuronrobotics.sdk.namespace.bcs.pid.AbstractPidNamespaceImp.isAvailable(), com.neuronrobotics.sdk.bowlercam.device.BowlerCamDevice.highSpeedAutoCapture.run(), and com.neuronrobotics.sdk.bowlercam.device.BowlerCamDevice.startHighSpeedAutoCapture().

Here is the call graph for this function:

◆ isKeepAlive()

boolean com.neuronrobotics.sdk.common.BowlerAbstractDevice.isKeepAlive ( )

Checks if is keep alive.

Returns
true, if is keep alive

Definition at line 448 of file BowlerAbstractDevice.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.keepAlive.

◆ loadRpcList()

void com.neuronrobotics.sdk.common.BowlerAbstractDevice.loadRpcList ( )

Loads all the Requests for the RPC's from all namespaces.

Definition at line 425 of file BowlerAbstractDevice.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.getNamespaces(), and com.neuronrobotics.sdk.common.BowlerAbstractDevice.getRpcList().

Here is the call graph for this function:

◆ onAllResponse()

void com.neuronrobotics.sdk.common.BowlerAbstractDevice.onAllResponse ( BowlerDatagram  data)

◆ ping() [1/2]

boolean com.neuronrobotics.sdk.common.BowlerAbstractDevice.ping ( )

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

Returns
the device's address

Definition at line 322 of file BowlerAbstractDevice.java.

Referenced by com.neuronrobotics.sdk.common.DeviceManager.addConnection(), com.neuronrobotics.sdk.ui.ConnectionDialog.getBowlerDevice(), com.neuronrobotics.sdk.serial.SerialConnection.getConnectionByMacAddress(), and com.neuronrobotics.sdk.bootloader.NRBoot.NRBoot().

◆ ping() [2/2]

boolean com.neuronrobotics.sdk.common.BowlerAbstractDevice.ping ( boolean  switchParser)

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

Parameters
switchParserthe switch parser
Returns
the device's address

Definition at line 333 of file BowlerAbstractDevice.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.connection, com.neuronrobotics.sdk.common.BowlerAbstractDevice.getAddress(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.ping().

Here is the call graph for this function:

◆ removeConnectionEventListener()

void com.neuronrobotics.sdk.common.BowlerAbstractDevice.removeConnectionEventListener ( IDeviceConnectionEventListener  l)

Removes the connection event listener.

Parameters
lthe l

Definition at line 138 of file BowlerAbstractDevice.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.getDisconnectListeners().

Here is the call graph for this function:

◆ send() [1/4]

BowlerDatagram com.neuronrobotics.sdk.common.BowlerAbstractDevice.send ( BowlerAbstractCommand  command) throws NoConnectionAvailableException, InvalidResponseException

Send a command to the connection.

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

Reimplemented in com.neuronrobotics.sdk.pid.VirtualGenericPIDDevice.

Definition at line 265 of file BowlerAbstractDevice.java.

Referenced by com.neuronrobotics.sdk.namespace.bcs.pid.LegacyPidNamespaceImp.ConfigurePDVelovityController(), com.neuronrobotics.sdk.namespace.bcs.pid.LegacyPidNamespaceImp.ConfigurePIDController(), com.neuronrobotics.sdk.bootloader.NRBootLoader.erase(), com.neuronrobotics.sdk.namespace.bcs.pid.LegacyPidNamespaceImp.GetAllPIDPosition(), com.neuronrobotics.sdk.bowlercam.device.BowlerCamDevice.getBlobs(), com.neuronrobotics.sdk.bootloader.NRBootLoader.getBootloaderID(), com.neuronrobotics.sdk.bowlercam.device.BowlerCamDevice.getImageServerURL(), com.neuronrobotics.sdk.namespace.bcs.pid.LegacyPidNamespaceImp.getPIDChannelCount(), com.neuronrobotics.sdk.namespace.bcs.pid.LegacyPidNamespaceImp.getPIDConfiguration(), com.neuronrobotics.sdk.namespace.bcs.pid.LegacyPidNamespaceImp.GetPIDPosition(), com.neuronrobotics.sdk.common.BowlerAbstractDevice.getRevisions(), com.neuronrobotics.sdk.namespace.bcs.pid.LegacyPidNamespaceImp.killAllPidGroups(), com.neuronrobotics.sdk.namespace.bcs.pid.LegacyPidNamespaceImp.ResetPIDChannel(), com.neuronrobotics.sdk.namespace.bcs.pid.PidNamespaceImp.send(), com.neuronrobotics.sdk.common.BowlerAbstractDevice.send(), com.neuronrobotics.sdk.namespace.bcs.pid.LegacyPidNamespaceImp.SetAllPIDSetPoint(), com.neuronrobotics.sdk.namespace.bcs.pid.LegacyPidNamespaceImp.SetPDVelocity(), com.neuronrobotics.sdk.namespace.bcs.pid.LegacyPidNamespaceImp.SetPIDSetPoint(), com.neuronrobotics.sdk.bowlercam.device.BowlerCamDevice.updateFilter(), com.neuronrobotics.sdk.bowlercam.device.BowlerCamDevice.updateImage(), and com.neuronrobotics.sdk.bootloader.NRBootLoader.write().

◆ send() [2/4]

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

Send a command to the connection.

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

Definition at line 278 of file BowlerAbstractDevice.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.connection, com.neuronrobotics.sdk.common.BowlerAbstractDevice.getAddress(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.send().

Here is the call graph for this function:

◆ send() [3/4]

Object [] com.neuronrobotics.sdk.common.BowlerAbstractDevice.send ( String  namespace,
BowlerMethod  method,
String  rpcString,
Object[]  arguments 
) 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
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.
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

Reimplemented in com.neuronrobotics.sdk.dyio.DyIO.

Definition at line 312 of file BowlerAbstractDevice.java.

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

Here is the call graph for this function:

◆ send() [4/4]

Object [] com.neuronrobotics.sdk.common.BowlerAbstractDevice.send ( 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
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 296 of file BowlerAbstractDevice.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.connection, com.neuronrobotics.sdk.common.BowlerAbstractDevice.getAddress(), and com.neuronrobotics.sdk.common.BowlerAbstractConnection.send().

Here is the call graph for this function:

◆ setAddress()

void com.neuronrobotics.sdk.common.BowlerAbstractDevice.setAddress ( MACAddress  address)

◆ setConnection()

void com.neuronrobotics.sdk.common.BowlerAbstractDevice.setConnection ( BowlerAbstractConnection  connection)

◆ setKeepAlive()

void com.neuronrobotics.sdk.common.BowlerAbstractDevice.setKeepAlive ( boolean  keepAlive)

Sets the keep alive.

Parameters
keepAlivethe new keep alive

Definition at line 457 of file BowlerAbstractDevice.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.keepAlive.

◆ setLastPacketTime()

void com.neuronrobotics.sdk.common.BowlerAbstractDevice.setLastPacketTime ( long  lastPacketTime)

Sets the last packet time.

Parameters
lastPacketTimethe new last packet time

Definition at line 477 of file BowlerAbstractDevice.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.lastPacketTime.

◆ setScriptingName()

void com.neuronrobotics.sdk.common.BowlerAbstractDevice.setScriptingName ( String  scriptingName)

◆ setThreadedUpstreamPackets()

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

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

Parameters
upthe new threaded upstream packets

Definition at line 406 of file BowlerAbstractDevice.java.

References com.neuronrobotics.sdk.common.BowlerAbstractDevice.connection, and com.neuronrobotics.sdk.common.BowlerAbstractConnection.setThreadedUpstreamPackets().

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

Here is the call graph for this function:

◆ startHeartBeat() [1/2]

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

◆ startHeartBeat() [2/2]

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

Start heart beat.

Parameters
msHeartBeatTimethe ms heart beat time

Reimplemented in com.neuronrobotics.sdk.dyio.DyIO.

Definition at line 389 of file BowlerAbstractDevice.java.

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

Here is the call graph for this function:

◆ stopHeartBeat()

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

Member Data Documentation

◆ address

MACAddress com.neuronrobotics.sdk.common.BowlerAbstractDevice.address = new MACAddress(MACAddress.BROADCAST)
private

◆ connection

BowlerAbstractConnection com.neuronrobotics.sdk.common.BowlerAbstractDevice.connection =null
private

◆ disconnecting

boolean com.neuronrobotics.sdk.common.BowlerAbstractDevice.disconnecting = false
private

The disconnecting.

Definition at line 53 of file BowlerAbstractDevice.java.

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

◆ disconnectListeners

ArrayList<IDeviceConnectionEventListener> com.neuronrobotics.sdk.common.BowlerAbstractDevice.disconnectListeners = new ArrayList<IDeviceConnectionEventListener> ()
private

The disconnect listeners.

Definition at line 64 of file BowlerAbstractDevice.java.

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

◆ keepAlive

boolean com.neuronrobotics.sdk.common.BowlerAbstractDevice.keepAlive = true
private

◆ lastPacketTime

long com.neuronrobotics.sdk.common.BowlerAbstractDevice.lastPacketTime =0
private

◆ scriptingName

String com.neuronrobotics.sdk.common.BowlerAbstractDevice.scriptingName = "device"
private

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