def start(self, experiment): """ Start Device on server. Streaming will start once the device is connected. If it is already, operational, streaming will commence immediately. """ experiment.server.websocket.write_message(message(command=self.connect_command, address=self.address)) experiment.server.websocket.write_message(message(command=self.start_command, address=self.address, interval=self.interval))
def on_connected(self, fut): super().on_connected(fut) self.websocket.write_message(message(command="discover_bluetooth")) sys.stdout.flush() tornado.ioloop.IOLoop.current().add_timeout(time.time()+15.0,callback=self.stop)