#!/usr/bin/env python3 """SERIAL Client implementation """ # Standard library imports # Third party imports # None # Local application imports from device_controller.channels.client_channel import * class ClientChannelSerial(ClientChannel): buf = 1024 def __init__(self, server_host:str="localhost", server_port:int=11110, buffer_size=1024, DEBUG:bool=False): ''' :param server_host: server IP or hostname :param server_port: server port ''' #TODO: set a protocol self.protocol = None super().__init__(server_host, server_port, "SERIAL", buffer_size, DEBUG) #@override def _connect_to_server(self): pass # Close socket def close(self): self.mysock.close() #@override def _send_data(self, data_to_send:str): pass #@override def _receive_data(self)->str: data_received = self.mysock.recv(self.buf) return data_received