bluezutils.py 文件源码

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

项目:BMW-RPi-iBUS 作者: KLUSEK 项目源码 文件源码
def show_adapter_info():
    bus = dbus.SystemBus()
    om = dbus.Interface(bus.get_object(SERVICE_NAME, "/"), "org.freedesktop.DBus.ObjectManager")
    objects = om.GetManagedObjects()
    for path, interfaces in objects.iteritems():
        if ADAPTER_INTERFACE not in interfaces:
            continue

        print(" [ %s ]" % (path))
        props = interfaces[ADAPTER_INTERFACE]

        for (key, value) in props.items():
            if (key == "Class"):
                print("    %s = 0x%06x" % (key, value))
            elif (key == "UUIDs"):
                continue                
            else:
                print("    %s = %s" % (key, value))
        print()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号