Example #1
0
    def __init__(self):
        if _debug: MiddleMan._debug("__init__")
        Client.__init__(self)
        Server.__init__(self)

        # not connected
        self.connected = False
Example #2
0
    def __init__(self):
        if _debug: TrappedClient._debug("__init__")
        Client.__init__(self)

        # clear out some references
        self.request_sent = None
        self.confirmation_received = None
Example #3
0
    def __init__(self):
        if _debug: TrappedClient._debug("__init__")
        Client.__init__(self)

        # clear out some references
        self.request_sent = None
        self.confirmation_received = None
Example #4
0
    def __init__(self, host='', port=502, **kwargs):
        if _debug: ModbusServer._debug("__init__ host=%r port=%r %r", host, port, kwargs)
        Client.__init__(self)
        Server.__init__(self)

        # create and bind
        self.serverDirector = TCPServerDirector((host, port), **kwargs)
        bind(self, StreamToPacket(stream_to_packet), self.serverDirector)
Example #5
0
 def __init__(self, sapID=None, cid=None, sid=None):
     """A MSTP node."""
     if _debug:
         MSTPSimple._debug("__init__ sapID=%r cid=%r sid=%r", sapID, cid,
                           sid)
     MSTPSAP.__init__(self, sapID)
     Client.__init__(self, cid)
     Server.__init__(self, sid)
Example #6
0
    def request(self, pdu):
        if _debug: TrappedClient._debug("request %r", pdu)

        # a reference for checking
        self.request_sent = pdu

        # continue with regular processing
        Client.request(self, pdu)
Example #7
0
    def request(self, pdu):
        if _debug: TrappedClient._debug("request %r", pdu)

        # a reference for checking
        self.request_sent = pdu

        # continue with regular processing
        Client.request(self, pdu)
Example #8
0
    def __init__(self, **kwargs):
        """Initialize a MODBUS client."""
        if _debug: ModbusClient._debug("__init__ %r", kwargs)
        Client.__init__(self)
        Server.__init__(self)

        # create and bind the client side
        self.director = TCPClientDirector(**kwargs)
        bind(self, StreamToPacket(stream_to_packet), self.director)
Example #9
0
    def __init__(self, **terminals):
        if _debug: Switch._debug("__init__ %r", terminals)

        Client.__init__(self)
        Server.__init__(self)

        # wrap the terminals
        self.terminals = {k:Switch.TerminalWrapper(self, v) for k, v in terminals.items()}
        self.current_terminal = None
Example #10
0
    def __init__(self, **kwargs):
        """Initialize a MODBUS client."""
        if _debug: ModbusClient._debug("__init__ %r", kwargs)
        Client.__init__(self)
        Server.__init__(self)

        # create and bind the client side
        self.clientDirector = TCPClientDirector(**kwargs)
        bind(self, StreamToPacket(stream_to_packet), self.clientDirector)
Example #11
0
    def __init__(self, unitNumber=1):
        if _debug: SimpleServer._debug("__init__")
        Client.__init__(self)

        # save the unit number
        self.unitNumber = unitNumber

        # create some coils and registers
        self.coils = [False] * 10
        self.registers = [0] * 10
Example #12
0
    def __init__(self, host='', port=502, **kwargs):
        if _debug:
            ModbusServer._debug("__init__ host=%r port=%r %r", host, port,
                                kwargs)
        Client.__init__(self)
        Server.__init__(self)

        # create and bind
        self.serverDirector = TCPServerDirector((host, port), **kwargs)
        bind(self, StreamToPacket(stream_to_packet), self.serverDirector)
Example #13
0
    def __init__(self, unitNumber=1):
        if _debug: SimpleServer._debug("__init__")
        Client.__init__(self)

        # save the unit number
        self.unitNumber = unitNumber

        # create some coils and registers
        self.coils = [False] * 10
        self.registers = [0] * 10
Example #14
0
    def __init__(self, port=502, sapID=None):
        if _debug: ModbusServiceAccessPoint._debug("__init__ port=%r sapID=%r", port, sapID)
        Client.__init__(self)
        Server.__init__(self)
        ServiceAccessPoint.__init__(self, sapID)

        # create and bind the client side
        self.clientDirector = TCPClientDirector()
        bind(self, StreamToPacket(stream_to_packet), self.clientDirector)

        # create and bind the server side
        self.serverDirector = TCPServerDirector(port)
        bind(self.serverDirector, StreamToPacket(stream_to_packet), self)
Example #15
0
    def __init__(self, addr, network, cid=None, sid=None):
        if _debug: FauxMux._debug("__init__")

        Client.__init__(self, cid)
        Server.__init__(self, sid)

        # get the unicast and broadcast tuples
        self.unicast_tuple = addr.addrTuple
        self.broadcast_tuple = addr.addrBroadcastTuple

        # make an internal node and bind to it, this takes the place of
        # both the direct port and broadcast port of the real UDPMultiplexer
        self.node = IPNode(addr, network)
        bind(self, self.node)
Example #16
0
    def __init__(self, vlan):
        if _debug: SnifferNode._debug("__init__ %r", vlan)

        # save the name and give it a blank address
        self.name = "sniffer"
        self.address = Address()

        # continue with initialization
        Client.__init__(self)

        # create a promiscuous node, added to the network
        self.node = Node(self.address, vlan, promiscuous=True)
        if _debug: SnifferNode._debug("    - node: %r", self.node)

        # bind this to the node
        bind(self, self.node)
Example #17
0
    def __init__(self, name=''):
        if _debug: ClientStateMachine._debug("__init__")

        Client.__init__(self)
        StateMachine.__init__(self, name=name)
Example #18
0
 def __init__(self):
     Client.__init__(self)
     Server.__init__(self)
     ConsoleCmd.__init__(self)
Example #19
0
    def __init__(self):
        if _debug: NPDUCodec._debug("__init__")

        Client.__init__(self)
        Server.__init__(self)
Example #20
0
    def __init__(self):
        if _debug: ClientStateMachine._debug("__init__")

        Client.__init__(self)
        StateMachine.__init__(self)
Example #21
0
 def __init__(self, cid=None):
     if _debug: NullClient._debug("__init__ cid=%r", cid)
     Client.__init__(self, cid=cid)
Example #22
0
 def __init__(self, cid=None):
     if _debug: NullClient._debug("__init__ cid=%r", cid)
     Client.__init__(self, cid=cid)
Example #23
0
 def __init__(self, cid=None):
     Client.__init__(self, cid=cid)