From a6d9336c1a5d45a0c143a6ddb55381c900b135ef Mon Sep 17 00:00:00 2001 From: jan iversen Date: Tue, 5 Mar 2024 11:43:14 +0100 Subject: [PATCH] try 8. --- pymodbus/framer/tls_framer.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pymodbus/framer/tls_framer.py b/pymodbus/framer/tls_framer.py index fd5763986f..49de7970c3 100644 --- a/pymodbus/framer/tls_framer.py +++ b/pymodbus/framer/tls_framer.py @@ -83,10 +83,7 @@ def buildPacket(self, message): packet = struct.pack(TLS_FRAME_HEADER, message.function_code) packet += data - if message.function_code: - _data_new = message.function_code.to_bytes() - else: - _data_new = b'\x00' + _data_new = message.function_code.to_bytes(1,'big') + data # _data_new = message.function_code.to_bytes() + data # _packet_new = self.message_encoder.encode(data_new, message.slave_id, message.transaction_id) # assert packet == packet_new, "TLS FRAMER BuildPacket failed!"