spp.py 文件源码

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

项目:CodeLabs 作者: TheIoTLearningInitiative 项目源码 文件源码
def bluetoothConnection():
    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
    bus = dbus.SystemBus()
    obj = bus.get_object(BUS_NAME, "/org/bluez")
    profile_manager = dbus.Interface(obj, "org.bluez.ProfileManager1")
    profile_path = "/foo/bar/profile"
    auto_connect = {"AutoConnect": False}
    profile_uuid = "1101"
    profile = Profile(bus, profile_path)
    profile_manager.RegisterProfile(profile_path, profile_uuid, auto_connect)
    mainloop = GObject.MainLoop()
    try:
        mainloop.run()
    except (KeyboardInterrupt, SystemExit):
        closeThreads()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号