i am trying to code an application with android and bluetooth. As a summary, and as something i think is well documented on internet, bluetooth 2.1 (i couldnt find information for 3.0 and 4.0) only supports 7 active devices in the same piconet, and up to 255 in parked mode (not connected and discovered through Inquiry scan, buy sync listening for broadcast packets). I couldn't find information for 3.0 and 4.0 specifications if they continue with this limitation of 7 active members.
There are tons of questions which answers are not easy to find about bluetooth. I hope somebody can help me with the next issue.
How can you communicate with a device in parked mode in Android through RFCOMM? If only 7 devices can be active with open socket connection (paged & connected), how can you make all devices being able to communicate between each other through the master device?
To make things a little bit clear, we can imagine that i am trying to create a communication app between all devices in a piconet, where all users near the master can enter the 'chat'. But to make all of them chat, you need all devices (connected and parked) 'connected' through RFCOMM, so they can exchange information using sockets.
But if only 7 can communicate and can open an active socket, how could be the strategy? How can i make all of them communicate between each other, so all devices can receiv开发者_开发知识库e the same information to talk through the chat?
thank you very much in advance.
The number of active and parked devices remain the same with Bluetooth 3.0 also, Bluetooth 4.0 is a little different since it has 2 modes - Bluetooth 4.0 adds a new radio mechanism to Bluetooth called Bluetooth Low Energy, so there are devices that can do dual mode , i.e the classic Bluetooth (2.1, 3.0 functions) and the new Low Energy functions, Some devices will be Low energy function only and some will be dual mode being able to do both Low Energy mode and classic bluetooth.
The Classic Bluetooth capabilities remain mostly the same in 4.0 also, the Low Energy is a completely new option, The Low Energy option (radio) cannot communicate with the classic option. (Unless it is dual mode having both classic and low energy options)
Now the above theory was important because in case of low energy there are no active devices restrictions, theoretically you have have hundreds of thousands of devices (assuming they talk at non overlapping intervals) connected. (Unlike Classic where the limit was 7), In Low Energy there are no special modes like Park either. Low Energy is typically for sensor devices which at some interval wake up connect send some data and go away. They are typically low bandwidth and short duration communication. This makes the low energy option attractive and wireless sensors can work off coin cell batteries for years.
Now to answer the rest of the Questions: - You cannot communicate directly with Parked devices, there is a broadcast mechanism to send (one way) data (unreliably) to parked devices, Android does not have any API support for it. In addition I will discourage usage of Park since it is a complicated procedure and prone to interoperability issues with radios of different vendors, in addition the Park mode is deprecated in the latest versions of Bluetooth.
The alternative is to un-park devices one after the other - make them active - complete the communication in active mode and then park them back. This may make your group chat application handling complicated.
Hope it helps.
精彩评论