Class HexRecord
- java.lang.Object
-
- jmri.jmrix.can.cbus.swing.bootloader.HexRecord
-
public class HexRecord extends java.lang.Object
Class to encapsulate a hex record as used by Microchip tools.
-
-
Field Summary
Fields Modifier and Type Field Description protected intaddressprotected intaddrhprotected intaddrlprotected intchecksumprotected byte[]data(package private) static byteEND(package private) static byteEXT_ADDRprotected intlenprotected intlineNo(package private) static intMAX_LENprotected inttype(package private) static byteTYPE_DATAprotected booleanvalid
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetAddress()Get current address from a hex record.protected byte[]getData()Get the data array from a hex record.protected bytegetData(int i)Get a data element from a hex record.(package private) voidreadData(HexFile f)Read the data bytes.protected voidsetLineNo(int l)Set the line number where the record was found in the file.
-
-
-
Field Detail
-
EXT_ADDR
static final byte EXT_ADDR
- See Also:
- Constant Field Values
-
TYPE_DATA
static final byte TYPE_DATA
- See Also:
- Constant Field Values
-
END
static final byte END
- See Also:
- Constant Field Values
-
MAX_LEN
static final int MAX_LEN
- See Also:
- Constant Field Values
-
len
protected int len
-
addrh
protected int addrh
-
addrl
protected int addrl
-
address
protected int address
-
type
protected int type
-
checksum
protected int checksum
-
valid
protected boolean valid
-
data
protected byte[] data
-
lineNo
protected int lineNo
-
-
Constructor Detail
-
HexRecord
public HexRecord()
Create an empty record with unprogrammed data and invalid status.
-
-
Method Detail
-
setLineNo
protected void setLineNo(int l)
Set the line number where the record was found in the file.- Parameters:
l- the line number
-
getData
protected byte[] getData()
Get the data array from a hex record.- Returns:
- the data
-
getData
protected byte getData(int i)
Get a data element from a hex record.- Parameters:
i- index of the element to get- Returns:
- the data
-
getAddress
protected int getAddress()
Get current address from a hex record.Returns 16 bit address from a normal hex record. Extended address records are handled elsewhere.
- Returns:
- the address
-
-