String deviceName = name.substring(0, separatorPos);
String attributeName = name.substring(separatorPos + 1);
DeviceProxy proxy = getDeviceProxy(deviceName);
DeviceAttribute attribute = getDeviceAttribute(proxy, attributeName);
AttributeInfo info = getAttributeInfo(proxy, attributeName);
// Report.
// Readable / writable.
boolean readable;
boolean writeable;
switch (info.writable.value()) {
case AttrWriteType._READ:
readable = true;
writeable = false;
break;
case AttrWriteType._READ_WITH_WRITE:
case AttrWriteType._READ_WRITE:
readable = true;
writeable = true;
break;
case AttrWriteType._WRITE:
readable = false;
writeable = true;
break;
default:
// Normally impossible.
throw new SalsaDeviceException("Unknown write type for the device " + name + ".");
}
report.setReadable(readable);
report.setWriteable(writeable);
// Data and data format.
try {
TangoAttribute tangoAttribute = new TangoAttribute(name);
String format = null;
try {
AttributeProxy attributeProxy = tangoAttribute.getAttributeProxy();
if (attributeProxy != null) {
AttributeInfo attributeInfo = attributeProxy.get_info();
if (attributeInfo != null) {
format = attributeInfo.format;
}
}
}