Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RequestUtils.readProperties() The method is blocked, and there are no exception messages. #110

Open
zzj957091 opened this issue Jan 10, 2025 · 2 comments

Comments

@zzj957091
Copy link

@OverRide
public String getPointValue(RemoteDevice remoteDevice, ObjectIdentifier oid, PropertyIdentifier propertyIdentifier) throws RuntimeException {
PropertyValues pvs;
String value = "";
try {
PropertyReferences refs = new PropertyReferences();
refs.add(oid, propertyIdentifier);
pvs = RequestUtils.readProperties(localDevice, remoteDevice, refs, false, null);
log.info("pvs获取成功");
Encodable result = pvs.get(oid, propertyIdentifier);
value = result.toString();
log.info("正常获取设备点位数据:" + value);
} catch (Exception e) {
log.error("获取点位值出现异常",e);
if (propertyIdentifier.equals(PropertyIdentifier.presentValue)) {
log.error("{} {} {}: 无法获取到 {} 属性",
remoteDevice.getInstanceNumber(),
oid.getObjectType().toString(),
oid.getInstanceNumber(),
propertyIdentifier,
e);
throw new RuntimeException(remoteDevice.getInstanceNumber() + " " + oid.getObjectType().toString() + " " + oid.getInstanceNumber() + ":无法获取到" + propertyIdentifier.toString() + "属性",e);
}
}
return value;
}

**pvs = RequestUtils.readProperties(localDevice, remoteDevice, refs, false, null);** is no result 。The method is blocked,It prevents my program from continuing execution
@devaskim
Copy link

I suggested to add read timeout in #89
Unfortunately year passed, but no feedback

@kishorevenki
Copy link

kishorevenki commented Jan 14, 2025

Timeout is already existing in the form of PropertyIdentifier.APDUTimeOut.
Without setting the PropertyIdentifier.SegmentationSupported and ProeprtyIdentifier.APDUTimeout of the remote device, readProperty or equivalent message cannot be sent.
Please check whether these properties are properly set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants