org.avineas.comli.impl
Constructor and Description |
---|
MasterImpl(Channel channel,
long timeout)
Create a COMLI master part from a channel and a response timeout
|
Modifier and Type | Method and Description |
---|---|
byte[] |
request(int destination,
byte type,
int startAddress,
int size)
Request data from a slave.
|
void |
setTries(int tries)
Set the number of times a message is tried to be sent before
it is said to be failed.
|
boolean |
transfer(int destination,
byte type,
int startAddress,
byte[] contents,
int offset,
int size)
Perform a data transfer to a slave node.
|
public MasterImpl(Channel channel, long timeout)
channel
- The channel to communicate overtimeout
- The time out for responses, in ms.public boolean transfer(int destination, byte type, int startAddress, byte[] contents, int offset, int size)
transfer
in interface Master
destination
- The slave this message is meant fortype
- The transfer typestartAddress
- The start addresscontents
- The contents of the addressesoffset
- The offset in the buffer to start the data transfersize
- The size of the buffer to sendpublic byte[] request(int destination, byte type, int startAddress, int size)
public void setTries(int tries)
tries
- The number of tries, defaults to 3