Class FirmwarePage


  • public final class FirmwarePage
    extends java.lang.Object
    This class represents a page of firmware that can be written to the device.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int PAGE_SIZE
      The required size of a page byte array.
    • Constructor Summary

      Constructors 
      Constructor Description
      FirmwarePage​(int address, byte[] data)
      Constructor, creates a new page and calculates the correct checksum.
      FirmwarePage​(int address, byte[] data, byte checksum)
      Constructor, creates a new page.
    • Field Detail

      • PAGE_SIZE

        public static final int PAGE_SIZE
        The required size of a page byte array.
        See Also:
        Constant Field Values
    • Constructor Detail

      • FirmwarePage

        public FirmwarePage​(int address,
                            byte[] data)
        Constructor, creates a new page and calculates the correct checksum.
        Parameters:
        address - Address of the page.
        data - Data in the page.
      • FirmwarePage

        public FirmwarePage​(int address,
                            byte[] data,
                            byte checksum)
        Constructor, creates a new page.
        Parameters:
        address - Address of the page.
        data - Data in the page.
        checksum - Checksum of the page.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • recalculateChecksum

        public void recalculateChecksum()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getAddress

        public int getAddress()
        Returns:
        the address
      • setAddress

        public void setAddress​(int address)
        Parameters:
        address - the address to set
      • getData

        public byte[] getData()
        Returns:
        the data
      • setData

        public void setData​(byte[] data)
        Parameters:
        data - the data to set
      • getChecksum

        public byte getChecksum()
        Returns:
        the checksum
      • setChecksum

        public void setChecksum​(byte checksum)
        Parameters:
        checksum - the checksum to set