Class SimCANBoard
java.lang.Object
com.tccc.kos.ext.freestyle.sim.can.board.SimCANBoard
This represents a single board on the simulated CAN bus.
- Version:
- 2023-12-17
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSimCANBoard
(CANSimulator sim, String type, int instanceId, int serialNum) Create a new base CAN board -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Activate the board.void
add
(SimCANSubNode node) Register a node with the board.int
int
getModel()
getName()
int
int
getSim()
getSubNode
(int subNodeId) Get the sub node for the specified subNodeId.getSuperPumpSubNode
(int group) Returns the super pump subNode on this board given the group number.getType()
boolean
byte[]
Return the contents of the named file for the board.int
readSDOInt
(int index, int subIndex) Process SDO read.Return the contents of the named file for the board.void
reset()
Reset the board.void
setNodeId
(int nodeId) void
Switch the node to operational mode.toString()
void
writeBytes
(String name, byte[] bytes) Write the specified bytes to a file with the specified name for the board.void
writeSDOInt
(int index, int subIndex, int data) Process SDO write.void
Write the specified string to a file with the specified name for the board.
-
Field Details
-
FILE_BOOTLOADER_VERSION
- See Also:
-
FILE_APPLICATION_VERSION
- See Also:
-
-
Constructor Details
-
SimCANBoard
Create a new base CAN board- Parameters:
type
- the board type
-
-
Method Details
-
add
Register a node with the board.- Parameters:
node
- the node to register
-
getSubNode
Get the sub node for the specified subNodeId.- Parameters:
subNodeId
- the sub-node to return- Returns:
- the matching sub-node or null
-
setOperational
public void setOperational()Switch the node to operational mode. -
activate
public void activate()Activate the board. -
reset
public void reset()Reset the board. -
getSuperPumpSubNode
Returns the super pump subNode on this board given the group number. This is in support of dynamically defined super pumps. The board must define a super pump with the corresponding group in order to support dynamic super pumps.- Parameters:
group
- superpump group number (starting at 1)
-
writeSDOInt
public void writeSDOInt(int index, int subIndex, int data) Process SDO write. This is called from the simulator in response to an operation from the target. All writes are ints but the client code will mask the data to the specified size before calling this. -
readSDOInt
public int readSDOInt(int index, int subIndex) Process SDO read. This is called from the simulator in response to an operation from the target. All reads return int data. -
readBytes
Return the contents of the named file for the board. If persistence isn't available, the file doesn't exist, or there is an error, return the def value.- Parameters:
name
- name of the filedef
- default value to return if file can't be read
-
readStr
Return the contents of the named file for the board. If persistence isn't available, the file doesn't exist, or there is an error, return the def value.- Parameters:
name
- name of the filedef
- default value to return if file can't be read
-
writeBytes
Write the specified bytes to a file with the specified name for the board. If persistence isn't available the file will not be written. If bytes is null then the file will be deleted.- Parameters:
name
- name of the filebytes
- the bytes to write or null to delete
-
writeStr
Write the specified string to a file with the specified name for the board. If persistence isn't available the file will not be written. If str is null then the file will be deleted.- Parameters:
name
- name of the filestr
- the string to write or null to delete
-
toString
-
getType
-
getModel
-
getInstanceId
public int getInstanceId() -
getSerialNum
public int getSerialNum() -
getHexSerialNum
-
getNodeId
public int getNodeId() -
setNodeId
public void setNodeId(int nodeId) -
isPreOperational
public boolean isPreOperational() -
getSim
-
getName
-
getDiagAddress
public int getDiagAddress()
-