This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

OTA DFU on OSX/iOS Caching Issue

I added a way to go from a running application into DFU mode using a custom characteristic and GPRETEG. However, CoreBluetooth caches services and characteristics for each BLE device and does not discover the DFU characteristics once the device enters DFU mode.

The only way to make this work is to manually clear the cache using:

sudo defaults write /Library/Preferences/com.apple.Bluetooth CoreBluetoothCache -dict sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist

Is anyone aware of a way to disable this caching?

  • Firstly it should only cache paired devices, are you seeing caching for non-paired ones also, that's not supposed to happen.

    BTLE allows paired devices to be cached, and defines the SERVICE CHANGED indication which lets you tell the device you're paired to that you've changed.

    Or you can switch your address out for a new random one and pair all over again.

  • If by pairing you mean connecting, then yes. I need to connect to the device to write characteristics.

    Thank you very much for pointing me to Service Changed indication. I believe this will work for me.

  • Good idea to change the address.

  • Actually, now that I looked into service changed notification, it seems that it's only for bonded devices. Since I'm not doing bonding, I can't use it. It seems to be an issue with OSX that it caches services for non-bonded devices.

  • That was my question originally - I just used the word 'paired' instead of 'bonded' because clearly I'm confused about some of the BTLE terms.

    I thought that iOS/OSX was only supposed to cache services for peripherals which were bonded, but I've seen odd things too, which is why I've started randomizing my own addresses as a regular practie. You might want to ask about that on the Apple Bluetooth list and say what you're seeing, there's some helpful guys there who've struggled with every problem under the sun.

Related