Package com.scriptel.proscript
Class FirmwarePage
- java.lang.Object
-
- com.scriptel.proscript.FirmwarePage
-
public final class FirmwarePage extends java.lang.ObjectThis class represents a page of firmware that can be written to the device.
-
-
Field Summary
Fields Modifier and Type Field Description static intPAGE_SIZEThe 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)intgetAddress()bytegetChecksum()byte[]getData()inthashCode()voidrecalculateChecksum()voidsetAddress(int address)voidsetChecksum(byte checksum)voidsetData(byte[] data)java.lang.StringtoString()
-
-
-
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:
equalsin classjava.lang.Object
-
recalculateChecksum
public void recalculateChecksum()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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
-
-