Android -- Bluetooth Read Write Problem?
While testing and analyzing code of Bluetooth Chat, I have questions about my own program.
a) My program sends a command to another bluetooth device. (I can handle it using sample code provided)
b) It then receives a response to my previous command.
c) Based on the response received, my device sends another command.
d) It then receives a response to my command.
and the same procedure continues ...
My question is , in Bluetooth Chat program there is a handler which receives a response. How can I make sure to receive first response and the开发者_StackOverflow社区n used that to send another command ... and then receive a response again based on second command, using that same handler.
My question is , in Bluetooth Chat program there is a handler which receives a response. How can I make sure to receive first response and then used that to send another command ... and then receive a response again based on second command, using that same handler.
How about using a state machine?
精彩评论