def __init__(self, link=None, ro_cache=None, rw_cache=None):
        """
        Create the objects from this module and register callbacks.

        ro_cache -- Path to read-only cache (string)
        rw_cache -- Path to read-write cache (string)
        """

        # Called on disconnect, no matter the reason
        self.disconnected = Caller()
        # Called on unintentional disconnect only
        self.connection_lost = Caller()
        # Called when the first packet in a new link is received
        self.link_established = Caller()
        # Called when the user requests a connection
        self.connection_requested = Caller()
        # Called when the link is established and the TOCs (that are not
        # cached) have been downloaded
        self.connected = Caller()
        # Called if establishing of the link fails (i.e times out)
        self.connection_failed = Caller()
        # Called for every packet received
        self.packet_received = Caller()
        # Called for every packet sent
        self.packet_sent = Caller()
        # Called when the link driver updates the link quality measurement
        self.link_quality_updated = Caller()

        self.state = State.DISCONNECTED

        self.link = link
        self._toc_cache = TocCache(ro_cache=ro_cache,
                                   rw_cache=rw_cache)

        self.incoming = _IncomingPacketHandler(self)
        self.incoming.setDaemon(True)
        self.incoming.start()

        self.commander = Commander(self)
        self.high_level_commander = HighLevelCommander(self)
        self.loc = Localization(self)
        self.extpos = Extpos(self)
        self.log = Log(self)
        self.console = Console(self)
        self.param = Param(self)
        self.mem = Memory(self)
        self.platform = PlatformService(self)

        self.link_uri = ''

        # Used for retry when no reply was sent back
        self.packet_received.add_callback(self._check_for_initial_packet_cb)
        self.packet_received.add_callback(self._check_for_answers)

        self._answer_patterns = {}

        self._send_lock = Lock()

        self.connected_ts = None

        # Connect callbacks to logger
        self.disconnected.add_callback(
            lambda uri: logger.info('Callback->Disconnected from [%s]', uri))
        self.disconnected.add_callback(self._disconnected)
        self.link_established.add_callback(
            lambda uri: logger.info('Callback->Connected to [%s]', uri))
        self.connection_lost.add_callback(
            lambda uri, errmsg: logger.info(
                'Callback->Connection lost to [%s]: %s', uri, errmsg))
        self.connection_failed.add_callback(
            lambda uri, errmsg: logger.info(
                'Callback->Connected failed to [%s]: %s', uri, errmsg))
        self.connection_requested.add_callback(
            lambda uri: logger.info(
                'Callback->Connection initialized[%s]', uri))
        self.connected.add_callback(
            lambda uri: logger.info(
                'Callback->Connection setup finished [%s]', uri))
def __init__ ( self , link = None , ro_cache = None , rw_cache = None ) : self . disconnected = Caller ( ) self . connection_lost = Caller ( ) self . link_established = Caller ( ) self . connection_requested = Caller ( ) self . connected = Caller ( ) self . connection_failed = Caller ( ) self . packet_received = Caller ( ) self . packet_sent = Caller ( ) self . link_quality_updated = Caller ( ) self . state = State . DISCONNECTED self . link = link self . _toc_cache = TocCache ( ro_cache = ro_cache , rw_cache = rw_cache ) self . incoming = _IncomingPacketHandler ( self ) self . incoming . setDaemon ( True ) self . incoming . start ( ) self . commander = Commander ( self ) self . high_level_commander = HighLevelCommander ( self ) self . loc = Localization ( self ) self . extpos = Extpos ( self ) self . log = Log ( self ) self . console = Console ( self ) self . param = Param ( self ) self . mem = Memory ( self ) self . platform = PlatformService ( self ) self . link_uri = '' self . packet_received . add_callback ( self . _check_for_initial_packet_cb ) self . packet_received . add_callback ( self . _check_for_answers ) self . _answer_patterns = { } self . _send_lock = Lock ( ) self . connected_ts = None self . disconnected . add_callback ( lambda uri : logger . info ( 'Callback->Disconnected from [%s]' , uri ) ) self . disconnected . add_callback ( self . _disconnected ) self . link_established . add_callback ( lambda uri : logger . info ( 'Callback->Connected to [%s]' , uri ) ) self . connection_lost . add_callback ( lambda uri , errmsg : logger . info ( 'Callback->Connection lost to [%s]: %s' , uri , errmsg ) ) self . connection_failed . add_callback ( lambda uri , errmsg : logger . info ( 'Callback->Connected failed to [%s]: %s' , uri , errmsg ) ) self . connection_requested . add_callback ( lambda uri : logger . info ( 'Callback->Connection initialized[%s]' , uri ) ) self . connected . add_callback ( lambda uri : logger . info ( 'Callback->Connection setup finished [%s]' , uri ) )
Create the objects from this module and register callbacks.

        ro_cache -- Path to read-only cache (string)
        rw_cache -- Path to read-write cache (string)