The MaskWriteRegisterResponse function does not return a response. In the MaskWriteRegisterResponse class there are several errors, as follows:
1. The comment preceding constructor is for a different class.
2. In following constructor code, the argument in the setOrMaskValue should be ormask.
/**
* Constructs a new <tt>WriteSingleRegisterResponse</tt>
* instance.
*
* @param reference the offset of the register written.
* @param value the value of the register.
*/
public MaskWriteRegisterResponse(int reference, int andmask, int ormask) {
super();
setReference(reference);
setAndMaskValue(andmask);
setOrMaskValue(andmask);
setDataLength(6);
}//constructor
3. The setOrMaskValue method sets the wrong variable; should be ormask = value;
/**
* Sets the Or_Mask value that has been returned in the
* response message.
* <p>
* @param value the returned Or_Mask.
*/
private void setOrMaskValue(int value) {
andmask = value;
}//setRegisterValue
I've verified that this problem does not exist in j2mod.