Pseudocode:
-
Use a FIFO Queue or Priority Queue depends upon your business logic
-
insert all the characteristics you want to read
-
call your requestCharacteristics method so that it can start consuming your Queue
-
from your
onCharacteristicsRead
call see if the size of the queue is greater than Zero requests one more.. be sure topeek()
from here -
now on your requestCharacteristics method do the
poll()
and request BLE GATT for characteristics.