Establishing multiple bluetooth SPPs at the same time

半城伤御伤魂 提交于 2019-12-24 12:30:33

问题


From my understanding I can only connect to a single service of a certain UUID. I looked in the properties and found that each device had it's own comport and guessed I had to be wrong. I tested multiple connections with 32feet.net and it turns out I can connect and communicate to both at the same time (and receive data).

I read Android: How do bluetooth UUIDs work? . Which mentions I need to the UUID to connect to a serial port service which I do and this is great (https://groups.google.com/forum/#!topic/android-developers/adeBD275u30) this link has the discussion.

I had been under the impression from reading various posts about not being able to connect to multiple headphones / keyboards / mice that bluetooth didn't allow you to connect to multiple services of the same UUID on Android / Iphone. Are these restrictions made by the OS / application?

After reading wikipedia / http://people.csail.mit.edu/rudolph/Teaching/Articles/PartOfBTBook.pdf that seems to be the case.

Did I just assume this a long time ago and forget that it was assumed from something non concrete?


回答1:


Device A can connect only one at a time to service S on Device B. Device A can connect to service S on Device B, C, D and E, etc at the same time.

In details a RFCOMM service listens on port number and publishes that port number in a SDP record listed by UUID. Unlike TCP/IP which uses source and destination port numbers in its packets RFCOMM only uses one port number in its packets and therefore only one connection can be active to that port number between a pair of devices.



来源:https://stackoverflow.com/questions/23282200/establishing-multiple-bluetooth-spps-at-the-same-time

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