xirb.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:xideco 作者: MrYsLab 项目源码 文件源码
def run_raspberry_bridge(self):
        # self.pi.set_mode(11, pigpio.INPUT)
        # cb1 = self.pi.callback(11, pigpio.EITHER_EDGE, self.cbf)
        while True:
            if self.last_problem:
                self.report_problem()
            # noinspection PyBroadException
            try:
                z = self.subscriber.recv_multipart(zmq.NOBLOCK)

                self.payload = umsgpack.unpackb(z[1])

                command = self.payload['command']
                if command in self.command_dict:
                    self.command_dict[command]()
                else:
                    print("can't execute unknown command'")
                    # time.sleep(.001)
            except KeyboardInterrupt:
                self.cleanup()
                sys.exit(0)
            except zmq.error.Again:
                time.sleep(.001)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号