protocol_ascii.py 文件源码

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

项目:pyuf 作者: uArm-Developer 项目源码 文件源码
def __init__(self, ufc, node, iomap, cmd_pend_size = 2, timeout = 1):

        self.ports = {
            'cmd_async': {'dir': 'in', 'type': 'topic', 'callback': self.cmd_async_cb},
            'cmd_sync': {'dir': 'in', 'type': 'service', 'callback': self.cmd_sync_cb},

            'report': {'dir': 'out', 'type': 'topic'},
            'status': {'dir': 'out', 'type': 'topic'}, # report lost, etc...

            'service': {'dir': 'in', 'type': 'service', 'callback': self.service_cb},

            'packet_in': {'dir': 'in', 'type': 'topic', 'callback': self.packet_in_cb},
            'packet_out': {'dir': 'out', 'type': 'topic'},
        }

        self.node = node
        self.logger = logging.getLogger('uf.' + node.replace('/', '.'))
        self.cmd_pend = {}
        self.cmd_pend_size = cmd_pend_size
        self.cmd_pend_c = threading.Condition()
        self.timeout = timeout
        self.cnt_lock = _thread.allocate_lock()
        self.cnt = 1 # no reply if cnt == 0, FIXME
        ufc.node_init(node, self.ports, iomap)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号