简体   繁体   中英

How to clear cache on Android or iOS to read a BLE characteristic?

A very strange thing happens on Android and iOS : when you want to "read" a BLE characteristic, it doesn't always issue a "read" to the connected device. It seems to read into a cache and return the value if there were no notification in between.

I have noticed that because I am making a step counter device and if I do the following :

  • connect to device
  • subscribe to step count notification
  • make 100 steps
  • disconnect
  • make 15 more steps with my device
  • connect and make a read
  • I will read 100 instead of 115
  • I make one more step and receive a notification. The count I receive is 116

on Windows (PC) when I do a read, there is this option BluetoothCacheMode . Is there such an option on Android or iOS ?

实际上,默认情况下,缓存是在固件中完成的

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM