Ejemplo n.º 1
0
def main():
    """This runs the protocol on port 11000"""
    factory = InputServiceFactory()

    factory.protocol = InputServiceProtocol
    reactor.listenTCP(11000, factory)

    input = InputSimulator(100, factory)

    reactor.callLater(0.0, input.loop)
    reactor.run()
Ejemplo n.º 2
0
def main():
    """This runs the protocol on port 11000"""
    factory = InputServiceFactory()

    factory.protocol = InputServiceProtocol
    reactor.listenTCP(11000,factory)

    input = InputSimulator(100, factory)

    reactor.callLater(0.0, input.loop)
    reactor.run()
Ejemplo n.º 3
0
def main():

    (options, args) = parseArgs()

    factory = InputServiceFactory()
    factory.protocol = InputServiceProtocol
    reactor.listenTCP(11000,factory)

    wiiSender = WiiSender(factory, loopFreq=options.loopFreq)

    moteDetector = MoteDetector(numToConnect=1, detectedCallback=wiiSender.newMote, getAlreadyConnectedIdsCallback=wiiSender.getAlreadyConnectedIds);
    moteDetector.keepFirstConnection=True
    moteDetector.startInThread()

    wiiSender.setMoteDetector(moteDetector)

    reactor.callLater(0.0, wiiSender.loop)

    reactor.run()
Ejemplo n.º 4
0
def main():

    (options, args) = parseArgs()

    factory = InputServiceFactory()
    factory.protocol = InputServiceProtocol
    reactor.listenTCP(11000, factory)

    wiiSender = WiiSender(factory, loopFreq=options.loopFreq)

    moteDetector = MoteDetector(
        numToConnect=1,
        detectedCallback=wiiSender.newMote,
        getAlreadyConnectedIdsCallback=wiiSender.getAlreadyConnectedIds,
    )
    moteDetector.keepFirstConnection = True
    moteDetector.startInThread()

    wiiSender.setMoteDetector(moteDetector)

    reactor.callLater(0.0, wiiSender.loop)

    reactor.run()