use of org.openmuc.framework.driver.dlms.settings.ChannelAddress in project OpenMUC by isc-konstanz.
the class WriteHandle method createSetParamsFor.
private static List<SetParameter> createSetParamsFor(List<ChannelValueContainer> writeList) throws ConnectionException {
List<SetParameter> setParams = new ArrayList<>(writeList.size());
for (ChannelValueContainer channelContainer : writeList) {
try {
ChannelAddress channelAddress = new ChannelAddress(channelContainer.getChannelAddress());
Type type = channelAddress.getType();
if (type == null) {
String msg = MessageFormat.format("Can not set attribute with address {0} where the type is unknown.", channelAddress);
throw new ConnectionException(msg);
}
DataObject newValue = createDoFor(channelContainer, type);
AttributeAddress address = channelAddress.getAttributeAddress();
SetParameter setParameter = new SetParameter(address, newValue);
setParams.add(setParameter);
} catch (ArgumentSyntaxException e) {
throw new ConnectionException(e);
}
}
return setParams;
}
use of org.openmuc.framework.driver.dlms.settings.ChannelAddress in project OpenMUC by isc-konstanz.
the class ReadHandle method createAttributeAddresFor.
private List<AttributeAddress> createAttributeAddresFor(List<ChannelRecordContainer> readList) throws ConnectionException {
List<AttributeAddress> getParams = new ArrayList<>(readList.size());
for (ChannelRecordContainer recordContainer : readList) {
try {
ChannelAddress channelAddress = new ChannelAddress(recordContainer.getChannelAddress());
getParams.add(channelAddress.getAttributeAddress());
} catch (ArgumentSyntaxException e) {
throw new ConnectionException(e);
}
}
return getParams;
}
Aggregations