Class HexRecord

java.lang.Object
jmri.jmrix.can.cbus.swing.bootloader.HexRecord

public class HexRecord extends Object
Class to encapsulate a hex record as used by Microchip tools.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
    protected int
     
    protected int
     
    protected int
     
    protected byte[]
     
    (package private) static final byte
     
    (package private) static final byte
     
    protected int
     
    protected int
     
    (package private) static final int
     
    protected int
     
    (package private) static final byte
     
    protected boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create an empty record with unprogrammed data and invalid status.
    Read a new record from a file.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected int
    Get current address from a hex record.
    protected byte[]
    Get the data array from a hex record.
    protected byte
    getData(int i)
    Get a data element from a hex record.
    (package private) void
    Read the data bytes.
    protected void
    setLineNo(int l)
    Set the line number where the record was found in the file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • HexRecord

      public HexRecord()
      Create an empty record with unprogrammed data and invalid status.
    • HexRecord

      public HexRecord(HexFile f) throws IOException
      Read a new record from a file.
      Parameters:
      f - hex file to read from
      Throws:
      IOException - from underlying read operations
  • Method Details

    • 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
    • readData

      void readData(HexFile f) throws IOException
      Read the data bytes.
      Parameters:
      f - Input hex file
      Throws:
      IOException - from underlying read operations