public class MBusMaster extends Object implements Iterable<GenericDevice>, Sender, JSONSerializable, Closeable
DEFAULT_SEND_TRIES| Constructor and Description |
|---|
MBusMaster() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addDevice(GenericDevice device)
Deprecated.
|
void |
cancel() |
void |
clearDevices()
Deprecated.
|
void |
close() |
int |
deviceCount()
Deprecated.
|
int |
deviceIndexOf(GenericDevice d)
Deprecated.
|
void |
fromJSON(net.sf.json.JSONObject json) |
Connection |
getConnection() |
static DataBlock |
getDataBlock(Frame frame,
ValueRequestPointLocator locator)
Deprecated.
|
GenericDevice |
getDevice(int i)
Deprecated.
|
static GenericDevice |
getDevice(Iterable<GenericDevice> deviceList,
ValueRequestPointLocator locator)
Deprecated.
|
GenericDevice[] |
getDevices()
Deprecated.
|
long |
getIdleTime()
Idle time is 33 bit periods see M-Bus doc chaper 5.4
|
long |
getLastByteSended() |
long |
getResponseTimeout()
Timeout is 330 bit periods + 50ms see M-Bus doc chaper 5.4 2 times max
(256) packet size added
|
long |
getShortResponseTimeout() |
Iterator<GenericDevice> |
iterator()
Deprecated.
|
Closeable |
open() |
static MBusMaster |
readJsonStream(InputStream is) |
UserDataResponse |
readResponse(byte address) |
UserDataResponse |
readResponseBySecondary(int bcdId,
String man,
Byte version,
MBusMedium medium) |
void |
readValues(ValueRequest<?> requests) |
GenericDevice |
searchDeviceByAddress(byte address) |
GenericDevice[] |
searchDevicesByPrimaryAddress()
Search by primary address (0..250) 253 is for slave select 254 broadcast
addres to all devices
|
GenericDevice[] |
searchDevicesByPrimaryAddress(byte first,
byte last) |
Collection<GenericDevice> |
searchDevicesBySecondaryAddressing() |
boolean |
selectDevice(int bcdMaskedId,
short maskedMan,
byte maskedVersion,
byte maskedMedium) |
boolean |
selectDevice(int id,
String manufacturer,
byte version,
MBusMedium medium) |
boolean |
selectDevice(MBusResponseFramesContainer dev) |
Frame |
send(Frame frame,
int maxTries,
long timeout) |
Frame |
sendInitSlave(byte address) |
Frame |
sendRequestUserData(byte address) |
Map<GenericDevice,Frame> |
sendRequestUserData(Map<GenericDevice,MBusAddressing> devices) |
Map<GenericDevice,Frame> |
sendRequestUserData(MBusAddressing addressing)
Deprecated.
|
Frame |
sendSetNewAddress(byte address,
byte newAddress) |
int |
sendSlaveSelect(int bcdMaskedId,
short maskedMan,
byte maskedVersion,
byte maskedMedium) |
void |
setConnection(Connection conn) |
boolean |
setPrimaryAddressOfDevice(byte newAddress,
int id,
String manufacturer,
byte version,
MBusMedium medium) |
boolean |
setPrimaryAddressOfDevice(byte newAddress,
MBusResponseFramesContainer dev) |
net.sf.json.JSONObject |
toJSON(JsonSerializeType jsonSerializeType) |
Collection<GenericDevice> |
widcardSearch(int bcdMaskedId,
short bcdMaskedMan,
byte bcdMaskedVersion,
byte bcdMaskedMedium) |
void |
writeJsonStream(FileOutputStream os) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic void cancel()
@Deprecated public static GenericDevice getDevice(Iterable<GenericDevice> deviceList, ValueRequestPointLocator locator)
@Deprecated public static DataBlock getDataBlock(Frame frame, ValueRequestPointLocator locator)
public Connection getConnection()
public void writeJsonStream(FileOutputStream os) throws UnsupportedEncodingException, IOException
public long getLastByteSended()
@Deprecated public boolean addDevice(GenericDevice device)
device - public GenericDevice searchDeviceByAddress(byte address) throws InterruptedException, IOException
InterruptedExceptionIOException@Deprecated public int deviceIndexOf(GenericDevice d)
@Deprecated public void clearDevices()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException@Deprecated public int deviceCount()
@Deprecated public GenericDevice getDevice(int i)
@Deprecated public GenericDevice[] getDevices()
public long getIdleTime()
public long getResponseTimeout()
public long getShortResponseTimeout()
@Deprecated public Iterator<GenericDevice> iterator()
iterator in interface Iterable<GenericDevice>public Collection<GenericDevice> searchDevicesBySecondaryAddressing() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic GenericDevice[] searchDevicesByPrimaryAddress() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic GenericDevice[] searchDevicesByPrimaryAddress(byte first, byte last) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Frame send(Frame frame, int maxTries, long timeout) throws IOException, InterruptedException
send in interface SenderIOExceptionInterruptedException@Deprecated public Map<GenericDevice,Frame> sendRequestUserData(MBusAddressing addressing) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Frame sendInitSlave(byte address) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Frame sendSetNewAddress(byte address, byte newAddress) throws InterruptedException, IOException
InterruptedExceptionIOExceptionpublic Frame sendRequestUserData(byte address) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic Map<GenericDevice,Frame> sendRequestUserData(Map<GenericDevice,MBusAddressing> devices) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic int sendSlaveSelect(int bcdMaskedId,
short maskedMan,
byte maskedVersion,
byte maskedMedium)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic void setConnection(Connection conn)
public Closeable open() throws IOException
IOExceptionpublic Collection<GenericDevice> widcardSearch(int bcdMaskedId, short bcdMaskedMan, byte bcdMaskedVersion, byte bcdMaskedMedium) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic UserDataResponse readResponseBySecondary(int bcdId, String man, Byte version, MBusMedium medium) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic UserDataResponse readResponse(byte address) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic boolean selectDevice(int bcdMaskedId,
short maskedMan,
byte maskedVersion,
byte maskedMedium)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic boolean selectDevice(int id,
String manufacturer,
byte version,
MBusMedium medium)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic boolean setPrimaryAddressOfDevice(byte newAddress,
MBusResponseFramesContainer dev)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic boolean setPrimaryAddressOfDevice(byte newAddress,
int id,
String manufacturer,
byte version,
MBusMedium medium)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic boolean selectDevice(MBusResponseFramesContainer dev) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void readValues(ValueRequest<?> requests) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic static MBusMaster readJsonStream(InputStream is) throws IOException
IOExceptionpublic void fromJSON(net.sf.json.JSONObject json)
fromJSON in interface JSONSerializablepublic net.sf.json.JSONObject toJSON(JsonSerializeType jsonSerializeType)
toJSON in interface JSONSerializableCopyright © 2009–2016 MBus4J. All rights reserved.