livemon.py 文件源码

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

项目:live-serial 作者: rosenbrockc 项目源码 文件源码
def _get_com(args):
    """Gets a list of configured COM ports for serial communication.
    """
    from liveserial.monitor import ComMonitorThread as CMT
    from multiprocessing import Queue
    dataq, errorq = Queue(), Queue()
    result = []
    msg.info("Starting setup of ports {}.".format(args["port"]), 2)
    if args["config"]:
        for port in args["port"]:
            if port.lower() != "aggregate":
                #The aggregate port name is just a shortcut so that we can plot
                #transforms between multiple sensor streams. It doesn't actually
                #represent a physical port that will be monitored.
                com = CMT.from_config(args["config"], port, dataq, errorq,
                                      args["listen"], args["sensors"])
                result.append(com)                               
    else:
        for port in args["port"]:
            com = CMT(dataq, errorq, port, args["baudrate"],
                      args["stopbits"], args["parity"], args["timeout"],
                      args["listen"], args["virtual"])
            result.append(com)
    return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号