Class HexRecord
java.lang.Object
jmri.jmrix.can.cbus.swing.bootloader.HexRecord
Class to encapsulate a hex record as used by Microchip tools.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected intprotected intprotected byte[](package private) static final byte(package private) static final byteprotected intprotected int(package private) static final intprotected int(package private) static final byteprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intGet 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) voidRead the data bytes.protected voidsetLineNo(int l) Set the line number where the record was found in the file.
-
Field Details
-
EXT_ADDR
- See Also:
-
TYPE_DATA
- See Also:
-
END
- See Also:
-
MAX_LEN
- See Also:
-
len
-
addrh
-
addrl
-
address
-
type
-
checksum
-
valid
-
data
-
lineNo
-
-
Constructor Details
-
HexRecord
public HexRecord()Create an empty record with unprogrammed data and invalid status. -
HexRecord
Read a new record from a file.- Parameters:
f- hex file to read from- Throws:
IOException- from underlying read operations
-
-
Method Details
-
setLineNo
Set the line number where the record was found in the file.- Parameters:
l- the line number
-
getData
Get the data array from a hex record.- Returns:
- the data
-
getData
Get a data element from a hex record.- Parameters:
i- index of the element to get- Returns:
- the data
-
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
-
readData
Read the data bytes.- Parameters:
f- Input hex file- Throws:
IOException- from underlying read operations
-