Ejemplo n.º 1
0
def main(bridge_ip):
    log.startLogging(sys.stdout)
    gateway = PhilipsHueGateway('http://nn2015.pg.devicehive.com/api', devicehive.auto.AutoFactory, bridge_ip)
    #factory to be used to organize communication channel to device
    bin_factory = devicehive.gateway.binary.BinaryFactory(gateway)
    # run gateway application
    gateway.run(bin_factory)
    reactor.run()
Ejemplo n.º 2
0
def main(adaptor):
    log.startLogging(sys.stdout)
    # gateway = I2cGateway('http://pg.devicehive.com/api/', devicehive.auto.AutoFactory)
    gateway = I2cGateway('http://ecloud.dataart.com/ecapi8', devicehive.auto.AutoFactory)
    endpoint = devicehive.gateway.i2c.I2cEndpoint(reactor, adaptor, DEVICE_INFO)
    factory = devicehive.gateway.i2c.I2cProtoFactory(gateway)
    # run gateway application
    gateway.run(endpoint, factory)
    reactor.run()
Ejemplo n.º 3
0
def main(adaptor):
    log.startLogging(sys.stdout)
    # gateway = I2cGateway('http://pg.devicehive.com/api/', devicehive.auto.AutoFactory)
    gateway = I2cGateway('http://ecloud.dataart.com/ecapi8',
                         devicehive.auto.AutoFactory)
    endpoint = devicehive.gateway.i2c.I2cEndpoint(reactor, adaptor,
                                                  DEVICE_INFO)
    factory = devicehive.gateway.i2c.I2cProtoFactory(gateway)
    # run gateway application
    gateway.run(endpoint, factory)
    reactor.run()
Ejemplo n.º 4
0
def main(host, sport, brate):
    log.startLogging(sys.stdout)
    gateway = Gateway(host, devicehive.auto.AutoFactory)
    # create endpoint and factory to be used to organize communication channel to device
    endpoint = devicehive.gateway.binary.SerialPortEndpoint(reactor, \
                                                            sport, \
                                                            baudrate = brate, \
                                                            bytesize = EIGHTBITS, \
                                                            parity = PARITY_NONE, \
                                                            stopbits = STOPBITS_ONE)
    bin_factory = devicehive.gateway.binary.BinaryFactory(gateway)
    # run gateway application
    gateway.run(endpoint, bin_factory)
    reactor.run()
Ejemplo n.º 5
0
def main(host, sport, brate):
    log.startLogging(sys.stdout)
    gateway = Gateway(host, devicehive.auto.AutoFactory)
    # create endpoint and factory to be used to organize communication channel to device
    endpoint = devicehive.gateway.binary.SerialPortEndpoint(reactor, \
                                                            sport, \
                                                            baudrate = brate, \
                                                            bytesize = EIGHTBITS, \
                                                            parity = PARITY_NONE, \
                                                            stopbits = STOPBITS_ONE)
    bin_factory = devicehive.gateway.binary.BinaryFactory(gateway)
    # run gateway application
    gateway.run(endpoint, bin_factory)
    reactor.run()