BowlerKernel
|
Public Member Functions | |
byte[] | getCallingData () |
void | setOpCode (String opCode) |
String | getOpCode () |
void | setMethod (BowlerMethod method) |
BowlerMethod | getMethod () |
byte | getLength () |
BowlerDatagram | validate (BowlerDatagram data) throws InvalidResponseException |
byte[] | getBytes () |
String | toString () |
void | setData (ByteList data) |
ByteList | getCallingDataStorage () |
void | setNamespaceIndex (int namespaceIndex) |
int | getNamespaceIndex () |
Static Public Member Functions | |
static BowlerAbstractCommand | parse (BowlerDatagram data) |
Private Attributes | |
String | opCode |
BowlerMethod | method |
ByteList | data = new ByteList() |
int | namespaceIndex =0 |
This class encapsulates the generation of a Bowler RPC. Each command should represent a unique RPC.
Definition at line 42 of file BowlerAbstractCommand.java.
byte [] com.neuronrobotics.sdk.common.BowlerAbstractCommand.getBytes | ( | ) |
Gets the bytes.
Implements com.neuronrobotics.sdk.common.ISendable.
Definition at line 208 of file BowlerAbstractCommand.java.
References com.neuronrobotics.sdk.common.ByteList.add(), com.neuronrobotics.sdk.common.ByteList.getBytes(), com.neuronrobotics.sdk.common.BowlerAbstractCommand.getCallingData(), and com.neuronrobotics.sdk.common.BowlerAbstractCommand.opCode.
Referenced by com.neuronrobotics.sdk.common.BowlerAbstractCommand.toString().
byte [] com.neuronrobotics.sdk.common.BowlerAbstractCommand.getCallingData | ( | ) |
Get the data that will be used to call the RPC (i.e. parameters for the RPC). Each instance of a BAC should determine the correct method for generating this data.
Reimplemented in com.neuronrobotics.sdk.commands.bcs.io.GetValueCommand.
Definition at line 62 of file BowlerAbstractCommand.java.
References com.neuronrobotics.sdk.common.BowlerAbstractCommand.data, and com.neuronrobotics.sdk.common.ByteList.getBytes().
Referenced by com.neuronrobotics.sdk.common.BowlerAbstractCommand.getBytes(), and com.neuronrobotics.sdk.common.BowlerAbstractCommand.getLength().
ByteList com.neuronrobotics.sdk.common.BowlerAbstractCommand.getCallingDataStorage | ( | ) |
Gets the calling data storage.
Definition at line 244 of file BowlerAbstractCommand.java.
References com.neuronrobotics.sdk.common.BowlerAbstractCommand.data.
Referenced by com.neuronrobotics.sdk.commands.bcs.io.AsyncCommand.AsyncCommand(), com.neuronrobotics.sdk.common.device.server.bcs.rpc.BcsRpcArgsCommand.BcsRpcArgsCommand(), com.neuronrobotics.sdk.common.device.server.bcs.rpc.BcsRpcCommand.BcsRpcCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bowlercam.BlobCommand.BlobCommand(), com.neuronrobotics.sdk.commands.bcs.io.ConfigAsyncCommand.ConfigAsyncCommand(), com.neuronrobotics.sdk.commands.bcs.pid.DyPID.ConfigureDynamicPIDCommand.ConfigureDynamicPIDCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ConfigurePDVelocityCommand.ConfigurePDVelocityCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ConfigurePIDCommand.ConfigurePIDCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ControlAllPIDCommand.ControlAllPIDCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ControlPIDCommand.ControlPIDCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.EraseFlashCommand.EraseFlashCommand(), com.neuronrobotics.sdk.commands.bcs.core.ErrorCommand.ErrorCommand(), com.neuronrobotics.sdk.commands.bcs.io.GetChannelModeCommand.GetChannelModeCommand(), com.neuronrobotics.sdk.commands.bcs.io.GetChannelModeListCommand.GetChannelModeListCommand(), com.neuronrobotics.sdk.common.RpcEncapsulation.getCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bowlercam.ImageCommand.ImageCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bowlercam.ImageURLCommand.ImageURLCommand(), com.neuronrobotics.sdk.commands.cartesian.LinearInterpolationCommand.LinearInterpolationCommand(), com.neuronrobotics.sdk.commands.bcs.core.NamespaceCommand.NamespaceCommand(), com.neuronrobotics.sdk.commands.bcs.pid.PDVelocityCommand.PDVelocityCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.dyio.PowerCommand.PowerCommand(), com.neuronrobotics.sdk.dyio.peripherals.ServoChannel.powerOverridePacket.powerOverridePacket(), com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.ProgramSectionCommand.ProgramSectionCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.dyio.ProvisionCommand.ProvisionCommand(), com.neuronrobotics.sdk.commands.bcs.core.ReadyCommand.ReadyCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ResetPIDCommand.ResetPIDCommand(), com.neuronrobotics.sdk.commands.bcs.core.RpcArgumentsCommand.RpcArgumentsCommand(), com.neuronrobotics.sdk.commands.bcs.core.RpcCommand.RpcCommand(), com.neuronrobotics.sdk.commands.bcs.safe.SafeModeCommand.SafeModeCommand(), com.neuronrobotics.sdk.commands.bcs.io.SetAllChannelValuesCommand.SetAllChannelValuesCommand(), com.neuronrobotics.sdk.commands.bcs.io.setmode.SetChannelModeCommand.SetChannelModeCommand(), com.neuronrobotics.sdk.commands.bcs.io.SetChannelValueCommand.SetChannelValueCommand(), and com.neuronrobotics.sdk.commands.bcs.io.SetUARTBaudrateCommand.SetUARTBaudrateCommand().
byte com.neuronrobotics.sdk.common.BowlerAbstractCommand.getLength | ( | ) |
Get the total size of the command including opcode and calling data.
Definition at line 111 of file BowlerAbstractCommand.java.
References com.neuronrobotics.sdk.common.BowlerAbstractCommand.getCallingData(), and com.neuronrobotics.sdk.common.BowlerAbstractCommand.opCode.
BowlerMethod com.neuronrobotics.sdk.common.BowlerAbstractCommand.getMethod | ( | ) |
Get the method that the command will use for execution.
Definition at line 102 of file BowlerAbstractCommand.java.
References com.neuronrobotics.sdk.common.BowlerAbstractCommand.method.
int com.neuronrobotics.sdk.common.BowlerAbstractCommand.getNamespaceIndex | ( | ) |
Gets the namespace index.
Definition at line 262 of file BowlerAbstractCommand.java.
References com.neuronrobotics.sdk.common.BowlerAbstractCommand.namespaceIndex.
String com.neuronrobotics.sdk.common.BowlerAbstractCommand.getOpCode | ( | ) |
Returns the operation code.
Definition at line 84 of file BowlerAbstractCommand.java.
References com.neuronrobotics.sdk.common.BowlerAbstractCommand.opCode.
Referenced by com.neuronrobotics.sdk.commands.bcs.io.GetChannelModeCommand.validate(), and com.neuronrobotics.sdk.commands.bcs.io.GetValueCommand.validate().
|
static |
Parses the.
data | the data |
Definition at line 201 of file BowlerAbstractCommand.java.
void com.neuronrobotics.sdk.common.BowlerAbstractCommand.setData | ( | ByteList | data | ) |
Sets the data.
data | the new data |
Definition at line 235 of file BowlerAbstractCommand.java.
References com.neuronrobotics.sdk.common.BowlerAbstractCommand.data.
void com.neuronrobotics.sdk.common.BowlerAbstractCommand.setMethod | ( | BowlerMethod | method | ) |
Set the method that the command will use for execution.
method | the new method |
Definition at line 93 of file BowlerAbstractCommand.java.
References com.neuronrobotics.sdk.common.BowlerAbstractCommand.method.
Referenced by com.neuronrobotics.sdk.commands.bcs.io.AsyncCommand.AsyncCommand(), com.neuronrobotics.sdk.common.device.server.bcs.rpc.BcsRpcArgsCommand.BcsRpcArgsCommand(), com.neuronrobotics.sdk.common.device.server.bcs.rpc.BcsRpcCommand.BcsRpcCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bowlercam.BlobCommand.BlobCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.BootloaderIDCommand.BootloaderIDCommand(), com.neuronrobotics.sdk.commands.cartesian.CancelPrintCommand.CancelPrintCommand(), com.neuronrobotics.sdk.commands.bcs.io.ConfigAsyncCommand.ConfigAsyncCommand(), com.neuronrobotics.sdk.commands.bcs.pid.DyPID.ConfigureDynamicPIDCommand.ConfigureDynamicPIDCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ConfigurePDVelocityCommand.ConfigurePDVelocityCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ConfigurePIDCommand.ConfigurePIDCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ControlAllPIDCommand.ControlAllPIDCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ControlPIDCommand.ControlPIDCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.EraseFlashCommand.EraseFlashCommand(), com.neuronrobotics.sdk.commands.bcs.core.ErrorCommand.ErrorCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.dyio.GetAllChannelValuesCommand.GetAllChannelValuesCommand(), com.neuronrobotics.sdk.commands.bcs.io.GetChannelModeCommand.GetChannelModeCommand(), com.neuronrobotics.sdk.commands.bcs.io.GetChannelModeListCommand.GetChannelModeListCommand(), com.neuronrobotics.sdk.common.RpcEncapsulation.getCommand(), com.neuronrobotics.sdk.commands.bcs.io.GetDyIOChannelCountCommand.GetDyIOChannelCountCommand(), com.neuronrobotics.sdk.commands.bcs.pid.GetPIDChannelCountCommand.GetPIDChannelCountCommand(), com.neuronrobotics.sdk.commands.bcs.io.GetValueCommand.GetValueCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bowlercam.ImageCommand.ImageCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bowlercam.ImageURLCommand.ImageURLCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.dyio.InfoFirmwareRevisionCommand.InfoFirmwareRevisionCommand(), com.neuronrobotics.sdk.commands.bcs.pid.KillAllPIDCommand.KillAllPIDCommand(), com.neuronrobotics.sdk.commands.cartesian.LinearInterpolationCommand.LinearInterpolationCommand(), com.neuronrobotics.sdk.commands.bcs.core.NamespaceCommand.NamespaceCommand(), com.neuronrobotics.sdk.commands.bcs.pid.PDVelocityCommand.PDVelocityCommand(), com.neuronrobotics.sdk.commands.bcs.core.PingCommand.PingCommand(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.PingCommand.PingCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.dyio.PowerCommand.PowerCommand(), com.neuronrobotics.sdk.dyio.peripherals.ServoChannel.powerOverridePacket.powerOverridePacket(), com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.ProgramSectionCommand.ProgramSectionCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.dyio.ProvisionCommand.ProvisionCommand(), com.neuronrobotics.sdk.commands.bcs.core.ReadyCommand.ReadyCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.ResetChipCommand.ResetChipCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ResetPIDCommand.ResetPIDCommand(), com.neuronrobotics.sdk.commands.bcs.core.RpcArgumentsCommand.RpcArgumentsCommand(), com.neuronrobotics.sdk.commands.bcs.core.RpcCommand.RpcCommand(), com.neuronrobotics.sdk.commands.bcs.safe.SafeModeCommand.SafeModeCommand(), com.neuronrobotics.sdk.commands.bcs.io.SetAllChannelValuesCommand.SetAllChannelValuesCommand(), com.neuronrobotics.sdk.commands.bcs.io.setmode.SetChannelModeCommand.SetChannelModeCommand(), com.neuronrobotics.sdk.commands.bcs.io.SetChannelValueCommand.SetChannelValueCommand(), and com.neuronrobotics.sdk.commands.bcs.io.SetUARTBaudrateCommand.SetUARTBaudrateCommand().
void com.neuronrobotics.sdk.common.BowlerAbstractCommand.setNamespaceIndex | ( | int | namespaceIndex | ) |
Sets the namespace index.
namespaceIndex | the new namespace index |
Definition at line 253 of file BowlerAbstractCommand.java.
References com.neuronrobotics.sdk.common.BowlerAbstractCommand.namespaceIndex.
Referenced by com.neuronrobotics.sdk.common.RpcEncapsulation.getCommand().
void com.neuronrobotics.sdk.common.BowlerAbstractCommand.setOpCode | ( | String | opCode | ) |
Set the operation code string. To conform to the Bowler standard, the string should be 4 characters.
opCode | the RPC operation code to be implemented. |
Definition at line 71 of file BowlerAbstractCommand.java.
References com.neuronrobotics.sdk.common.BowlerAbstractCommand.opCode.
Referenced by com.neuronrobotics.sdk.commands.bcs.io.AsyncCommand.AsyncCommand(), com.neuronrobotics.sdk.common.device.server.bcs.rpc.BcsRpcArgsCommand.BcsRpcArgsCommand(), com.neuronrobotics.sdk.common.device.server.bcs.rpc.BcsRpcCommand.BcsRpcCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bowlercam.BlobCommand.BlobCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.BootloaderIDCommand.BootloaderIDCommand(), com.neuronrobotics.sdk.commands.cartesian.CancelPrintCommand.CancelPrintCommand(), com.neuronrobotics.sdk.commands.bcs.io.ConfigAsyncCommand.ConfigAsyncCommand(), com.neuronrobotics.sdk.commands.bcs.pid.DyPID.ConfigureDynamicPIDCommand.ConfigureDynamicPIDCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ConfigurePDVelocityCommand.ConfigurePDVelocityCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ConfigurePIDCommand.ConfigurePIDCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ControlAllPIDCommand.ControlAllPIDCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ControlPIDCommand.ControlPIDCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.EraseFlashCommand.EraseFlashCommand(), com.neuronrobotics.sdk.commands.bcs.core.ErrorCommand.ErrorCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.dyio.GetAllChannelValuesCommand.GetAllChannelValuesCommand(), com.neuronrobotics.sdk.commands.bcs.io.GetChannelModeCommand.GetChannelModeCommand(), com.neuronrobotics.sdk.commands.bcs.io.GetChannelModeListCommand.GetChannelModeListCommand(), com.neuronrobotics.sdk.common.RpcEncapsulation.getCommand(), com.neuronrobotics.sdk.commands.bcs.io.GetDyIOChannelCountCommand.GetDyIOChannelCountCommand(), com.neuronrobotics.sdk.commands.bcs.pid.GetPIDChannelCountCommand.GetPIDChannelCountCommand(), com.neuronrobotics.sdk.commands.bcs.io.GetValueCommand.GetValueCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bowlercam.ImageCommand.ImageCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bowlercam.ImageURLCommand.ImageURLCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.dyio.InfoFirmwareRevisionCommand.InfoFirmwareRevisionCommand(), com.neuronrobotics.sdk.commands.bcs.pid.KillAllPIDCommand.KillAllPIDCommand(), com.neuronrobotics.sdk.commands.cartesian.LinearInterpolationCommand.LinearInterpolationCommand(), com.neuronrobotics.sdk.commands.bcs.core.NamespaceCommand.NamespaceCommand(), com.neuronrobotics.sdk.commands.bcs.pid.PDVelocityCommand.PDVelocityCommand(), com.neuronrobotics.sdk.commands.bcs.core.PingCommand.PingCommand(), com.neuronrobotics.sdk.common.BowlerAbstractConnection.PingCommand.PingCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.dyio.PowerCommand.PowerCommand(), com.neuronrobotics.sdk.dyio.peripherals.ServoChannel.powerOverridePacket.powerOverridePacket(), com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.ProgramSectionCommand.ProgramSectionCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.dyio.ProvisionCommand.ProvisionCommand(), com.neuronrobotics.sdk.commands.bcs.core.ReadyCommand.ReadyCommand(), com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.ResetChipCommand.ResetChipCommand(), com.neuronrobotics.sdk.commands.bcs.pid.ResetPIDCommand.ResetPIDCommand(), com.neuronrobotics.sdk.commands.bcs.core.RpcArgumentsCommand.RpcArgumentsCommand(), com.neuronrobotics.sdk.commands.bcs.core.RpcCommand.RpcCommand(), com.neuronrobotics.sdk.commands.bcs.safe.SafeModeCommand.SafeModeCommand(), com.neuronrobotics.sdk.commands.bcs.io.SetAllChannelValuesCommand.SetAllChannelValuesCommand(), com.neuronrobotics.sdk.commands.bcs.io.setmode.SetChannelModeCommand.SetChannelModeCommand(), com.neuronrobotics.sdk.commands.bcs.io.SetChannelValueCommand.SetChannelValueCommand(), and com.neuronrobotics.sdk.commands.bcs.io.SetUARTBaudrateCommand.SetUARTBaudrateCommand().
String com.neuronrobotics.sdk.common.BowlerAbstractCommand.toString | ( | ) |
Definition at line 218 of file BowlerAbstractCommand.java.
References com.neuronrobotics.sdk.common.BowlerAbstractCommand.getBytes().
BowlerDatagram com.neuronrobotics.sdk.common.BowlerAbstractCommand.validate | ( | BowlerDatagram | data | ) | throws InvalidResponseException |
Determine if the return response was successful; throw an InvalidResponseExpection otherwise. Commands with more complicated validation should override this method and provide more specific checking.
data | the data |
InvalidResponseException | the invalid response exception |
Reimplemented in com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.ProgramSectionCommand, com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.EraseFlashCommand, com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.BootloaderIDCommand, com.neuronrobotics.sdk.commands.bcs.io.SetUARTBaudrateCommand, com.neuronrobotics.sdk.commands.bcs.io.setmode.SetChannelModeCommand, com.neuronrobotics.sdk.commands.bcs.io.SetChannelValueCommand, com.neuronrobotics.sdk.commands.bcs.io.GetValueCommand, com.neuronrobotics.sdk.commands.bcs.io.GetChannelModeCommand, and com.neuronrobotics.sdk.commands.bcs.core.NamespaceCommand.
Definition at line 123 of file BowlerAbstractCommand.java.
References com.neuronrobotics.sdk.common.BowlerAbstractCommand.data, and com.neuronrobotics.sdk.common.ByteList.getByte().
The data.
Definition at line 51 of file BowlerAbstractCommand.java.
Referenced by com.neuronrobotics.sdk.common.BowlerAbstractCommand.getCallingData(), com.neuronrobotics.sdk.common.BowlerAbstractCommand.getCallingDataStorage(), com.neuronrobotics.sdk.commands.bcs.io.SetChannelValueCommand.SetChannelValueCommand(), com.neuronrobotics.sdk.common.BowlerAbstractCommand.setData(), com.neuronrobotics.sdk.commands.bcs.core.NamespaceCommand.validate(), com.neuronrobotics.sdk.commands.bcs.io.GetChannelModeCommand.validate(), com.neuronrobotics.sdk.commands.bcs.io.GetValueCommand.validate(), com.neuronrobotics.sdk.commands.bcs.io.SetChannelValueCommand.validate(), com.neuronrobotics.sdk.commands.bcs.io.setmode.SetChannelModeCommand.validate(), com.neuronrobotics.sdk.commands.bcs.io.SetUARTBaudrateCommand.validate(), com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.BootloaderIDCommand.validate(), com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.EraseFlashCommand.validate(), com.neuronrobotics.sdk.commands.neuronrobotics.bootloader.ProgramSectionCommand.validate(), and com.neuronrobotics.sdk.common.BowlerAbstractCommand.validate().
|
private |
The method.
Definition at line 48 of file BowlerAbstractCommand.java.
Referenced by com.neuronrobotics.sdk.common.BowlerAbstractCommand.getMethod(), and com.neuronrobotics.sdk.common.BowlerAbstractCommand.setMethod().
|
private |
The namespace index.
Definition at line 54 of file BowlerAbstractCommand.java.
Referenced by com.neuronrobotics.sdk.common.BowlerAbstractCommand.getNamespaceIndex(), and com.neuronrobotics.sdk.common.BowlerAbstractCommand.setNamespaceIndex().
|
private |
The op code.
Definition at line 45 of file BowlerAbstractCommand.java.
Referenced by com.neuronrobotics.sdk.common.BowlerAbstractCommand.getBytes(), com.neuronrobotics.sdk.common.BowlerAbstractCommand.getLength(), com.neuronrobotics.sdk.common.BowlerAbstractCommand.getOpCode(), and com.neuronrobotics.sdk.common.BowlerAbstractCommand.setOpCode().