如何使用 swift 的核心蓝牙访问指示

How to access indications with swift's core bluetooth

我一直在尝试使用我已经 运行 的核心蓝牙将 Contour Next 血糖仪集成到似乎阻止我接收血糖指示的核心蓝牙限制中。

If the specified characteristic’s configuration allows both notifications and indications, calling this method enables notifications only.

(来源:https://developer.apple.com/documentation/corebluetooth/cbperipheral/1518949-setnotifyvalue

不幸的是,Contour Next 实际上允许通知和指示血糖测量特性。因此,虽然我能够(通过通知)成功接收到新的测量值,但似乎没有任何方法可以(通过指示)接收历史测量值。

您可以在 https://github.com/jamorham/xDrip-plus/blob/master/app/src/main/java/com/eveningoutpost/dexdrip/Services/BluetoothGlucoseMeter.java#L227 看到 android 的集成,它可以针对该血糖测量特征启用通知和指示。

是否有一些方法可以解决核心蓝牙的这一限制,或者是否有另一种方法可以与不使用核心蓝牙的蓝牙集成?

@paulw 是正确的,问题实际上根本不在于指示。事实证明,我使用的命令没有按预期工作("Request all" 命令没有工作,但 "Request all records from first to last" 工作)。