Class CbusNodeParameterManager
- java.lang.Object
-
- jmri.jmrix.can.cbus.node.CbusNodeParameterManager
-
public class CbusNodeParameterManager extends java.lang.Object
Class to represent a Processing of CAN Frames for a CbusNode.
-
-
Constructor Summary
Constructors Constructor Description CbusNodeParameterManager(CbusBasicNodeWithManagers node)
Create a new CbusNodeCanListener
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
clearParameters()
java.lang.String
getNodeTypeString()
Get the Node Typeint
getOutstandingParams()
Get Number of outstanding unknown Parameters to be fetched from a CbusNodeint
getParameter(int index)
Get a Single Parameter valuejava.lang.String
getParameterHexString()
Get the Parameter String in Hex Byte Formatint[]
getParameters()
Get array of All parametersboolean
isFwEqualOrNewer(int major, int minor, int beta)
Check if current node firmware is equal to or newer than provided version Note that CBUS firmware start with beta builds, followed by a release with the beta build set to 0, e.g.: major.minor Beta 1 major.minor Beta 2 ...void
requestEventTot()
void
requestParam(int param)
Request a single Parameter from a Physical Nodeprotected void
sendRequestNextParam()
Send a request for the next unknown parameter to the physical nodevoid
setParameter(int index, int newval)
Set a Single Node Parameter.void
setParameters(int[] newparams)
Set Node Parameters.
-
-
-
Constructor Detail
-
CbusNodeParameterManager
public CbusNodeParameterManager(CbusBasicNodeWithManagers node)
Create a new CbusNodeCanListener- Parameters:
node
- The Node
-
-
Method Detail
-
setParameters
public void setParameters(int[] newparams)
Set Node Parameters.Para 0 Number of parameters
Para 1 The manufacturer ID
Para 2 Minor code version as an alphabetic character (ASCII)
Para 3 Manufacturer module identifier as a HEX numeric
Para 4 Number of supported events as a HEX numeric
Para 5 Number of Event Variables per event as a HEX numeric
Para 6 Number of supported Node Variables as a HEX numeric
Para 7 Major version
Para 8 Node flags
Para 9 Processor type
Para 10 Bus type
Para 11-14 load address, 4 bytes
Para 15-18 CPU manufacturer's id as read from the chip config space, 4 bytes
Para 19 CPU manufacturer code
Para 20 Beta revision (numeric), or 0 if release
- Parameters:
newparams
- set the node parameters
-
setParameter
public void setParameter(int index, int newval)
Set a Single Node Parameter. Parameter array should be initialised before calling. Notifies PropertyChangeListener "PARAMETER"- Parameters:
index
- Parameter Index,newval
- New Parameter Value, 0-255
-
getOutstandingParams
public int getOutstandingParams()
Get Number of outstanding unknown Parameters to be fetched from a CbusNode- Returns:
- Number of outstanding Parameters, else 8
-
getParameter
public int getParameter(int index)
Get a Single Parameter valueeg. for param. array [3,1,2,3] index 2 returns 2
Para 0 Number of parameters
Para 1 The manufacturer ID
Para 2 Minor code version as an alphabetic character (ASCII)
Para 3 Manufacturer module identifier as a HEX numeric
Para 4 Number of supported events as a HEX numeric
Para 5 Number of Event Variables per event as a HEX numeric
Para 6 Number of supported Node Variables as a HEX numeric
Para 7 Major version
Para 8 Node flags
Para 9 Processor type
Para 10 Bus type
Para 11-14 load address, 4 bytes
Para 15-18 CPU manufacturer's id as read from the chip config space, 4 bytes
Para 19 CPU manufacturer code
Para 20 Beta revision (numeric), or 0 if release
- Parameters:
index
- of which parameter, 0 gives the total parameters- Returns:
- Full Parameter value for a particular index, -1 if unknown
-
getParameters
public int[] getParameters()
Get array of All parameters- Returns:
- Full Parameter array, index 0 is total parameters
-
getParameterHexString
public java.lang.String getParameterHexString()
Get the Parameter String in Hex Byte Formateg. for param. array [3,1,2,3] returns "010203"
- Returns:
- Full Parameter String WITHOUT leading number of parameters
-
clearParameters
protected void clearParameters()
-
getNodeTypeString
public java.lang.String getNodeTypeString()
Get the Node Type- Returns:
- eg. MERG Command Station CANCMD Firmware 4d Node 65534
-
requestEventTot
public void requestEventTot()
-
requestParam
public void requestParam(int param)
Request a single Parameter from a Physical NodeWill not send the request if there are existing active timers. Starts Parameter timeout
- Parameters:
param
- Parameter Index Number, Index 0 is total parameters
-
isFwEqualOrNewer
public boolean isFwEqualOrNewer(int major, int minor, int beta)
Check if current node firmware is equal to or newer than provided version Note that CBUS firmware start with beta builds, followed by a release with the beta build set to 0, e.g.: major.minor Beta 1 major.minor Beta 2 ... major.minor Beta x major.minor Beta 0- Parameters:
major
- New FW major versionminor
- New FW minor versionbeta
- New FW beta build number- Returns:
- true if current node firmware is equal to or newer than provided version
-
sendRequestNextParam
protected void sendRequestNextParam()
Send a request for the next unknown parameter to the physical node
-
-