Situation
- existing microcontroller with bluetooth interface and running program
- running Windows program for communication with the microcontroller (in over 100 versions in productive use), as reference
- must transfer the Windows program to an Android tablet
So far
- basics for B4A
- study of various forum contributions
- simple program in B4A for receiving bluetooth messages from the microcontroller
- using AsyncStreams; NOT in prefix mode, Detection of a complete message by scanning for LF (line feed), works.
- display of received message in stream New_Data event, works
Question
I am looking for a way from the stream New_Data event to "distribute" the received messages further to various displays, etc. Of course I can create a "case" in the
Stream New_Data event a "case" and then call various SUBs. But the problem is, that sometimes I have to wait for the answers of the microcontroller. It can take 100 ... 200 mSec until the answer arrives. Attempts with wait for ... were not really successful. I would prefer to trigger my own events, which would then be evaluated by the rest of the program. In the Windows program I use my own messages for this.
I don't expect a ready solution, but I am grateful for any hint.
- existing microcontroller with bluetooth interface and running program
- running Windows program for communication with the microcontroller (in over 100 versions in productive use), as reference
- must transfer the Windows program to an Android tablet
So far
- basics for B4A
- study of various forum contributions
- simple program in B4A for receiving bluetooth messages from the microcontroller
- using AsyncStreams; NOT in prefix mode, Detection of a complete message by scanning for LF (line feed), works.
- display of received message in stream New_Data event, works
Question
I am looking for a way from the stream New_Data event to "distribute" the received messages further to various displays, etc. Of course I can create a "case" in the
Stream New_Data event a "case" and then call various SUBs. But the problem is, that sometimes I have to wait for the answers of the microcontroller. It can take 100 ... 200 mSec until the answer arrives. Attempts with wait for ... were not really successful. I would prefer to trigger my own events, which would then be evaluated by the rest of the program. In the Windows program I use my own messages for this.
I don't expect a ready solution, but I am grateful for any hint.