spinel-cli.py 文件源码

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

项目:pyspinel 作者: openthread 项目源码 文件源码
def handle_property(self, line, prop_id, mixed_format='B', output=True):
        """ Helper to set property when line argument passed, get otherwise. """
        value = self.prop_get_or_set_value(prop_id, line, mixed_format)
        if not output:
            return value

        if value is None or value == "":
            print("Error")
            return None

        if line is None or line == "":
            # Only print value on PROP_VALUE_GET
            if mixed_format == '6':
                print(str(ipaddress.IPv6Address(value)))
            elif (mixed_format == 'D') or (mixed_format == 'E'):
                print(util.hexify_str(value, ''))
            elif mixed_format == 'H':
                print("%04x" % value)
            else:
                print(str(value))

        print("Done")
        return value
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号