0 Replies
      Latest reply on Feb 7, 2020 6:56 AM by opsb
      opsb Level 1 Level 1 (0 points)

        I've been attempting to integrate the Contour Next glucose meter using corebluetooth.

        I found this blog post http://www.cocoasteam.com/?p=566 and accompanying github repo which looked very promising and followed the same approach. I made some good progress and I'm now able to discover the device and sync new readings from it.

        I'm now stuck though. I want to fetch the historical records from the device and while I'm able to issue the command and get a response indicating that the request was handled I'm not able to actually receive the results from the device. It seems that I need to receive indications from the device but the corebluetooth API has a limitation that prevents me from doing so:


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

        (from https://developer.apple.com/documentation/corebluetooth/cbperipheral/1518949-setnotifyvalue 1)


        Unfortunately the Contour Next allows both notifications and indications for blood glucose measurements which means that I'm not able to request the indications.


        I did consider that perhaps indications weren't necessary but looking at an android implementation it does appear that they are after all https://github.com/jamorham/xDrip-plus/blob/master/app/src/main/java/com/eveningoutpost/dexdrip/Services/BluetoothGlucoseMeter.java#L227


        So it seems that if I want to to integrate the Contour Next I need to find an alternative to corebluetooth (it doesn't look like corebluetooth is open source). Does anyone know of an alternative library or perhaps some way to work around the issue with corebluetooth?