V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
clrss
V2EX  ›  Swift

怎么设定蓝牙 Link Policy

  •  
  •   clrss · Dec 3, 2020 · 2099 views
    This topic created in 1975 days ago, the information mentioned may be changed or developed.
    上文:

    Catalina 以来有个 bluetoothd CPU 占用高的问题, 看来苹果一时半会是不会修了.

    stackexchange com / questions / 377853 里给出了一个 workaround: 用 Bluetooth Explorer 关掉 Link Policy - Sniff Mode.

    正文:

    每次设备重连 Sniff Mode 都会被重设, GUI 操作太繁琐, 最好有个命令行程序方便执行 (然后可配合 launchd iokit.matching).

    搜到两个库看起来有用: PureSwift/Bluetooth 和 PureSwift/BluetoothDarwin

    没搞过苹果开发, 依样画葫芦写代码实在搞不定. 求一个专业人士.
    2 replies    2021-03-03 20:37:17 +08:00
    sunbreak
        1
    sunbreak  
       Dec 4, 2020
    用 Swift 写 CLI 也是可以的: https://github.com/apple/swift-argument-parser
    clrss
        2
    clrss  
    OP
       Mar 3, 2021
    根据上面 StackExchange 中最新的回答, 使用 BT 3.x 的设备才会碰到这个问题, 使用 BT 4+的就没问题
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2160 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 00:52 · PVG 08:52 · LAX 17:52 · JFK 20:52
    ♥ Do have faith in what you're doing.