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

Bad attribute index #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -542,7 +542,7 @@ final byte[] getProfileGenericData(final int selector,
.getValue();
for (Object row : getBuffer()) {
java.util.Date tm;
Object tmp = ((Object[]) row)[0];
Object tmp = ((Object[]) row)[this.getSortObjectDataIndex()];
if (tmp instanceof GXDateTime) {
tm = ((GXDateTime) tmp).getValue();
} else {
Expand Down Expand Up @@ -697,8 +697,18 @@ public final void setValue(final GXDLMSSettings settings,
obj = gurux.dlms.GXDLMSClient.createObject(type);
obj.setLogicalName(ln);
}
addCaptureObject(obj, ((Number) tmp[2]).intValue(),
((Number) tmp[3]).intValue());
int attributeIndex = ((Number) tmp[2]).intValue();
int dataIndex = ((Number) tmp[3]).intValue();
if (tmp[2] instanceof Byte) {
byte bValue = (Byte)tmp[2];
attributeIndex = bValue & 0xFF;
}
if (tmp[3] instanceof Byte) {
byte bValue = (Byte)tmp[3];
dataIndex = bValue & 0xFF;
}

this.addCaptureObject(obj, attributeIndex, dataIndex);
}
}
} else if (e.getIndex() == 4) {
Expand Down