Skip to content

Commit

Permalink
Treat exception codes as valid responses (pymodbus-dev#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
christiansandberg authored Oct 17, 2021
1 parent 52037bf commit 69cfefe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymodbus/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _validate_response(self, request, response, exp_resp_len):
return False

mbap = self.client.framer.decode_data(response)
if mbap.get('unit') != request.unit_id or mbap.get('fcode') != request.function_code:
if mbap.get('unit') != request.unit_id or mbap.get('fcode') & 0x7F != request.function_code:
return False

if 'length' in mbap and exp_resp_len:
Expand Down

0 comments on commit 69cfefe

Please sign in to comment.