public class SecondaryAddress extends java.lang.Object implements java.lang.Comparable<SecondaryAddress>
Modifier and Type | Method and Description |
---|---|
byte[] |
asByteArray()
The
SecondaryAddress as byte array. |
int |
compareTo(SecondaryAddress sa) |
boolean |
equals(java.lang.Object obj) |
Bcd |
getDeviceId()
Returns the device ID.
|
DeviceType |
getDeviceType()
Returns the device type (e.g. gas, water etc.)
|
java.lang.String |
getManufacturerId()
Get the manufacturer ID.
|
int |
getVersion()
Get the version.
|
int |
hashCode() |
boolean |
isLongHeader() |
static SecondaryAddress |
newFromLongHeader(byte[] buffer,
int offset)
Instantiate a new secondary address within a long header.
|
static SecondaryAddress |
newFromManufactureId(byte[] idNumber,
java.lang.String manufactureId,
byte version,
byte media,
boolean longHeader)
Instantiate a new secondary address for a manufacturer ID.
|
static SecondaryAddress |
newFromWMBusHeader(byte[] buffer,
int offset)
Instantiate a new secondary address within a wireless M-Bus link layer header.
|
java.lang.String |
toString() |
public static SecondaryAddress newFromLongHeader(byte[] buffer, int offset)
buffer
- the byte buffer.offset
- the offset.public static SecondaryAddress newFromWMBusHeader(byte[] buffer, int offset)
buffer
- the byte buffer.offset
- the offset.public static SecondaryAddress newFromManufactureId(byte[] idNumber, java.lang.String manufactureId, byte version, byte media, boolean longHeader) throws java.lang.NumberFormatException
idNumber
- ID number.manufactureId
- manufacturer ID.version
- the version.media
- the media.java.lang.NumberFormatException
- if the idNumber is not long enough.public byte[] asByteArray()
SecondaryAddress
as byte array.public java.lang.String getManufacturerId()
public Bcd getDeviceId()
public DeviceType getDeviceType()
public int getVersion()
public boolean isLongHeader()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(SecondaryAddress sa)
compareTo
in interface java.lang.Comparable<SecondaryAddress>