Files
Solax/myenv/lib/python3.12/site-packages/pymodbus/framer/tls.py
2024-09-13 09:46:28 +02:00

21 lines
492 B
Python

"""Modbus TLS frame implementation."""
from __future__ import annotations
from pymodbus.framer.base import FramerBase
class FramerTLS(FramerBase):
"""Modbus TLS frame type.
[ Function Code] [ Data ]
1b Nb
"""
def decode(self, data: bytes) -> tuple[int, int, int, bytes]:
"""Decode ADU."""
return len(data), 0, 0, data
def encode(self, pdu: bytes, _device_id: int, _tid: int) -> bytes:
"""Encode ADU."""
return pdu