开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜