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 int
address
protected int
addrh
protected int
addrl
protected int
checksum
protected byte[]
data
(package private) static byte
END
(package private) static byte
EXT_ADDR
protected int
len
protected int
lineNo
(package private) static int
MAX_LEN
protected int
type
(package private) static byte
TYPE_DATA
protected boolean
valid
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
getAddress()
Get current address from a hex record.protected byte[]
getData()
Get the data array from a hex record.protected byte
getData(int i)
Get a data element from a hex record.(package private) void
readData(HexFile f)
Read the data bytes.protected void
setLineNo(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
-
-