Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions core/pva/src/main/java/org/epics/pva/client/PutRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,13 @@ public void encodeRequest(final byte version, final ByteBuffer buffer) throws Ex
}
}
}
// Set bit for the field to write
changed.set(data.getIndex(field));

// Bitset to describe which field we're about to write
//final BitSet changed = new BitSet();
changed.set(data.getIndex(field));
if (field instanceof PVAStructure) {
final PVAStructure struct = (PVAStructure) field;
List<PVAData> elements = struct.get();
if(elements != null){
for(int i = 0; i < elements.size(); i++){
changed.set(data.getIndex(elements.get(i)));
}
}
else{
// Set bit for the field to write
changed.set(data.getIndex(field));
}

logger.log(Level.FINE, () -> "Updated structure elements: " + changed);

PVABitSet.encodeBitSet(changed, buffer);

// Write the updated field
Expand Down
3 changes: 1 addition & 2 deletions core/pva/src/main/java/org/epics/pva/data/PVABitSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public static void encodeBitSet(final BitSet bits, final ByteBuffer buffer)
{
final byte[] bytes = bits.toByteArray();
PVASize.encodeSize(bytes.length, buffer);
byte[] b = bits.toByteArray();
buffer.put(b);
buffer.put(bytes);
}

/** @param buffer Source buffer
Expand Down