i am having some conceptual troubles with bluetooth and android. As i have been researching, bluetooth permits up to 7 slaves devices connected each other to the same master device building a piconet network. Also BT permits a Master device act as a Slave device for another piconet, building a scatternet network, where all devices could be connected between each other using an upper protocol.
My questions are about Bluetooth behaviour and Android.
1) How can you know in Android that your device is acting as a master or a slave, or is a master acting as an slave for another piconet, or is slave connected to two masters forming a scatternet?
2) Bluetooth only lets 7 active slaves per master, previously selected during the Inquiry scan, and up to 255 slave devices on "park" mode (synchronized listening the master but not active). How can you connect to this "park" devices? Only if one of the active ones disconnect because a broken link for instance so one "park" can connect?
3) Can you configure on Android (or BlueZ through Android) the device to work on different modes as "sniff" or "hold" for power consumptions purposes?
4) Does Android API gives the possibility of broadcas开发者_运维技巧ting to all slaves of the same piconet? If it does, i hope it gives the possibility of sending custom data information.
Thank you very much in advance for your time helping me.
To add - there is one more possibility for scatternet - a Device acting as slave in more than one piconet.
1) How can you know in Android that your device is acting as a master or a slave, or is a master acting as an slave for another piconet, or is slave connected to two masters forming a scatternet?
you cannot - I don't think there is a public API - and the idea is that for applications it should not matter.
2) Bluetooth only lets 7 active slaves per master, previously selected during the Inquiry scan, and up to 255 slave devices on "park" mode (synchronized listening the master but not active). How can you connect to this "park" devices? Only if one of the active ones disconnect because a broken link for instance so one "park" can connect?
Basically - Bluetooth can connect and be in active connection with upto 7 devices, an active device can then be put in park mode and it can have a large number of device (more than 255 also) in park modes, so device moves to park from the connected - active state and vice versa. But again at any one point you can have only 7 active devices So the master device can manage a large number of devices by keeping (unto 7 ) active and rest parked and keep switching them between active and parked modes.
Having said all this - don't use park mode any more - its deprecated in the Bluetooth spec and also prone to many interoperability problems.
3) Can you configure on Android (or BlueZ through Android) the device to work on different modes as "sniff" or "hold" for power consumptions purposes?
Nothing at the application API exists for this - But typically devices switch to sniff on inactivity (controlled by the underlying bluetooth stack's policy management algorithm). Again Hold is rarely used - Sinff is the best mode typically used for power saving in Bluetooth.
4) Does Android API gives the possibility of broadcasting to all slaves of the same piconet? If it does, i hope it gives the possibility of sending custom data information.
There is again no APIs for broadcast - But yes with Bluetooth it is possible to broadcast to all active and even parked devices. Yes it can also send custom data.
But unfortunately there are no APIs for developers to exploit and use a lot of these functionalities provided by the Bluetooth technology.
Beddernet for Android, open-source framework that allows you communicate with a large number of devices.
Take a look on this, maybe can be helpful on your situation.
https://code.google.com/p/beddernet/
精彩评论