client_channel_usb.py 1009 Bytes
#!/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 ClientChannelUSB(ClientChannel):
    
    buf = 1024
    
    
    def __init__(self, server_host:str="localhost", server_port:int=11110, buffer_size=1024, DEBUG=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, "USB", 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