locked
BluetoothCacheMode.Cached? How does this property work?

    Question

  • i'm working on a windows store app that's targeting Bluetooth 4.0.

    i have a call similar to this

     GattReadResult readResult = await bodySensorLocationCharacteristics[0].ReadValueAsync()

    i noticed that there isn an overload for the ReadValueAsync() that takes in a (BluetoothCacheMode value.

    where can i find documentation on  (BluetoothCacheMode.Cached)?  when is this setting to be used?

    We have custom board that has 32 bytes of data that are being returned, and the call to read the characteristic is currently taking about 3 seconds to return.    i was wondering if the cache property may be of help.

    Monday, October 28, 2013 3:16 AM

Answers

All replies

  • Documentation is at: http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.bluetooth.bluetoothcachemode.aspx

    That value controls if the value should be retrieved from the local system cache (if available) or if it should always be requested from the device. If your data is likely to be consistent then retrieving it from cache would be helpful. If it's likely to change frequently then you wouldn't want cached data.

    --Rob

    Monday, October 28, 2013 11:00 PM
    Moderator
  • Thanks Rob.  if i'm reading a characteristic, how does windows maintain the cache?  it's not clear to me when how this value would be set.

    every example I see online does uses the non cached value, and the data apps appear to update with new values from time to time (i.e. heartrate example).  However, with our custom device, if I used the Cached call, I never get any update values.  So it's not clear to me what's happening here.

    Tuesday, October 29, 2013 12:56 AM
  • I don't have an offhand answer, other than that cached values won't update unless the cache is invalidated. I don't know offhand how that works.

    I see you've broken your followup question off to another thread and somebody will try to take a look after the weekend. That said, for devices questions you'll likely need to open a support case.

    Saturday, November 2, 2013 2:01 AM
    Moderator
  • Thanks Rob.
    Saturday, November 2, 2013 3:06 PM