Bluetooth broadcasting

百般思念 提交于 2019-12-31 10:35:08

问题


I want to broadcast data from one device using Bluetooth to numerous nearby devices. Now, I know Bluetooth broadcasting exists, but is it possible using Android's existing API? If not, are there any other 3rd party APIs available out there which are capable of it?

Another question regarding Bluetooth broadcasting: Can you start listening to an ongoing broadcast and receive data from it, even if you weren't listening since the broadcast has started? For example, let device A be the broadcaster, and he broadcasts the following data over the course of 5 seconds:

1 2 3 4 5 6 7 8 9 10

Device B received data throughout the entire broadcast, so he received:

1 2 3 4 5 6 7 8 9 10

Device C received started listening only after 2 seconds, while device A was broadcasting 5. Will he receive the rest (5 6 7 8 9 10) as expected?


回答1:


As packets are not acknowledged during a Bluetooth broadcast, there is no distinction for the master (sender) between a slave node (receiver) that appears later in a broadcast and a slave node that was there from the beginning and didn't receive any packet.

So, yes, the Device C will receive the new packets of data from 5 and up if all general conditions for a bluetooth link are met.



来源:https://stackoverflow.com/questions/13674102/bluetooth-broadcasting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!