ModbusResponse updateResponseWithHeader ( ModbusResponse response , boolean ignoreFunctionCode ) { // transfer header data response . setHeadless ( isHeadless ( ) ) ; if ( ! isHeadless ( ) ) { response . setTransactionID ( getTransactionID ( ) ) ; response . setProtocolID ( getProtocolID ( ) ) ; } else { response . setHeadless ( ) ; } response . setUnitID ( getUnitID ( ) ) ; if ( ! ignoreFunctionCode ) { response . setFunctionCode ( getFunctionCode ( ) ) ; } return response ; }
Updates the response with the header information to match the request