Is there possible for communicate between piconet to another piconet
In my previous question posted in how to communicate with mobile devices using bluetooth i开发者_运维百科n j2me have asked question based on bluetooth. I got i some ideas for implementing client server communication. Now i am here to ask question based on communication between piconet to another piconet. Is it possible? Master device has to communicate with the slave in a piconet as well as to the master and slave to another piconet by slave of its own piconet.
Can anyone please give me some guideline and articles for my problem.
please help me..
Thankx in advance
In Bluetooth, the master initiates communications with a slave. At the baseband level the master polls the slave. However, at the application (API) level, that is abstracted away allowing both the master to send to the slave and the slave to send to the master.
The situation you describe is a scatternet. The Bluetooth specification allows for a scatternet to occur. The Bluetooth stack you are using may impose restrictions on whether a scatternet is allowed and, more generally, what master/slave configurations are allowed (e.g., the number of concurrent slaves allowed).
You'll find that, when interacting with some devices, a role switch is requested to prevent scatternets. For example, a remote device (master) may initiate a connection with a cell phone (slave); once the connection is established, the cell phone requests a role switch, becoming the master. This allows the phone to remain the master in all connections and prevents scatternets from forming. Depending on the API, this role switch may be completely transparent to your application. You won't know it happened without an air trace from a protocol analyzer. You will notice a performance hit, as the slave cannot transmit as often as the master can (since the slave does not "drive" the connection).
JSR-82 does not allow you to request a role switch, per se. If you look at ServiceRecord.getConnectionURL(int, boolean)
, you see that you can require that your device be the master (by passing true
) or you can allow master or slave mode (by passing false
).
The Bluetooth specification (available here) is a good place to start to understand how piconets and scatternets work. You should refer to the JSR-82 documentation and, if possible, your stack's documentation to get a better feel for some of the stack-specific limitations that may be present.
精彩评论