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, wait
forEach, spliterator
public 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
InterruptedException
IOException
@Deprecated public int deviceIndexOf(GenericDevice d)
@Deprecated public void clearDevices()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
@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
IOException
InterruptedException
public GenericDevice[] searchDevicesByPrimaryAddress() throws IOException, InterruptedException
IOException
InterruptedException
public GenericDevice[] searchDevicesByPrimaryAddress(byte first, byte last) throws IOException, InterruptedException
IOException
InterruptedException
public Frame send(Frame frame, int maxTries, long timeout) throws IOException, InterruptedException
send
in interface Sender
IOException
InterruptedException
@Deprecated public Map<GenericDevice,Frame> sendRequestUserData(MBusAddressing addressing) throws IOException, InterruptedException
IOException
InterruptedException
public Frame sendInitSlave(byte address) throws IOException, InterruptedException
IOException
InterruptedException
public Frame sendSetNewAddress(byte address, byte newAddress) throws InterruptedException, IOException
InterruptedException
IOException
public Frame sendRequestUserData(byte address) throws IOException, InterruptedException
IOException
InterruptedException
public Map<GenericDevice,Frame> sendRequestUserData(Map<GenericDevice,MBusAddressing> devices) throws IOException, InterruptedException
IOException
InterruptedException
public int sendSlaveSelect(int bcdMaskedId, short maskedMan, byte maskedVersion, byte maskedMedium) throws IOException, InterruptedException
IOException
InterruptedException
public void setConnection(Connection conn)
public Closeable open() throws IOException
IOException
public Collection<GenericDevice> widcardSearch(int bcdMaskedId, short bcdMaskedMan, byte bcdMaskedVersion, byte bcdMaskedMedium) throws IOException, InterruptedException
IOException
InterruptedException
public UserDataResponse readResponseBySecondary(int bcdId, String man, Byte version, MBusMedium medium) throws IOException, InterruptedException
IOException
InterruptedException
public UserDataResponse readResponse(byte address) throws IOException, InterruptedException
IOException
InterruptedException
public boolean selectDevice(int bcdMaskedId, short maskedMan, byte maskedVersion, byte maskedMedium) throws IOException, InterruptedException
IOException
InterruptedException
public boolean selectDevice(int id, String manufacturer, byte version, MBusMedium medium) throws IOException, InterruptedException
IOException
InterruptedException
public boolean setPrimaryAddressOfDevice(byte newAddress, MBusResponseFramesContainer dev) throws IOException, InterruptedException
IOException
InterruptedException
public boolean setPrimaryAddressOfDevice(byte newAddress, int id, String manufacturer, byte version, MBusMedium medium) throws IOException, InterruptedException
IOException
InterruptedException
public boolean selectDevice(MBusResponseFramesContainer dev) throws IOException, InterruptedException
IOException
InterruptedException
public void readValues(ValueRequest<?> requests) throws IOException, InterruptedException
IOException
InterruptedException
public static MBusMaster readJsonStream(InputStream is) throws IOException
IOException
public void fromJSON(net.sf.json.JSONObject json)
fromJSON
in interface JSONSerializable
public net.sf.json.JSONObject toJSON(JsonSerializeType jsonSerializeType)
toJSON
in interface JSONSerializable
Copyright © 2009–2016 MBus4J. All rights reserved.