public final class Register extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(RegisterListener l)
Add a listener to receive register updates
|
PanStamp |
getDevice()
Get the device to which this register belongs.
|
Endpoint |
getEndpoint(String name)
return the endpoint for the given name
|
List<Endpoint> |
getEndpoints()
return the endpoints defined for this register
|
int |
getId()
return the register ID
|
String |
getName()
Get the register name as defined in XML.
|
List<Parameter> |
getParameters()
Returns the parameters (if any) for this endpoint
|
byte[] |
getValue()
get the value of the register
|
boolean |
hasEndpoint(String name)
returns true if the device has an endpoint with the given name
|
boolean |
hasValue()
return true if the register has a currently known value
|
boolean |
isStandard()
return true if the register is one of the panStamp standard registers.
|
void |
removeListener(RegisterListener l)
remove a listener
|
void |
setValue(byte[] value)
set the register value and send to remote node
|
public int getId()
public String getName()
public PanStamp getDevice()
public List<Endpoint> getEndpoints()
public void addListener(RegisterListener l)
l - listener to addpublic void removeListener(RegisterListener l)
l - listener to removepublic void setValue(byte[] value)
throws NetworkException
value - the new valueNetworkException - Thrown if there is a
problem updating the registerpublic byte[] getValue()
throws me.legrange.panstamp.NoValueException
me.legrange.panstamp.NoValueException - Thrown if the register value is requested but no value is available.public boolean hasValue()
public Endpoint getEndpoint(String name) throws EndpointNotFoundException
name - The name of the endpoint neededEndpointNotFoundException - Thrown if an endpoint with that name could not be found.public boolean hasEndpoint(String name) throws NetworkException
name - Name of endpoint we're queryingNetworkException - Thrown if an error is
experiencedpublic List<Parameter> getParameters()
public boolean isStandard()
Copyright © 2015. All rights reserved.