def serial_send(ser: serial.Serial, data: bytes = None, read_echo: bool = False) -> None:
"""
Sends data through the serial interface and optionally reads echo.
:param ser: Serial port instance.
:param data: Data to be sent as bytes.
:param read_echo: Flag to determine if the echo should be read.
"""
ChatGPT4 will happily assist in this e.g.