aegidius20
Member
I have a B4A app that periodically reads services/characteristics from an Arduino backend using ReadData and a DataAvailable event routine. (not using notify)
Occasionally in response to UI activity the app goes to WriteData some writable characteristics. The write almost always fails unless it's timed to be well out of the way of the DataAvailable events (or I turn the reads off).
So I can get round it (not tried yet) by queueing up the write(s) until the read(s) are complete. That's OK, but some questions arise:
1. Is this expected behaviour or a bug?
2. Is there any way of finding out when the DataAvailable events from a given ReadData have finished? (I know I can always read specific services and keep track that way)
Occasionally in response to UI activity the app goes to WriteData some writable characteristics. The write almost always fails unless it's timed to be well out of the way of the DataAvailable events (or I turn the reads off).
So I can get round it (not tried yet) by queueing up the write(s) until the read(s) are complete. That's OK, but some questions arise:
1. Is this expected behaviour or a bug?
2. Is there any way of finding out when the DataAvailable events from a given ReadData have finished? (I know I can always read specific services and keep track that way)