I'm coding an app with Master-Slave design for Bluetooth on Android. Master in piconet can have up to 7 active slaves. I've read Android Bluetooth dev guide and BluetoothSocket.java
source code, however there is no maximum number of slaves mentioned. So I tried to accept more than 7 slaves in the following code:
private void startServerSocket(String name) {
BluetoothServerSocket serverSocket = null;
try {
serverSocket = mAdapter.listenUsingInsecureRfcommWithServiceRecord(macMap.get(name), uuidMap.get(name));
for (int i = 0; i < 8; i++) {
BluetoothSocket socket = null;
Log.d(TAG, i + " waitting for " + name + " to accpet...");
socket = serverSocket.accept();
Log.d(TAG, i + " " + name + " accepted");
// corresponding slave thread on master side
MasterSocketThread mst = new MasterSocketThread(socket, socket.getRemoteDevice().getName());
mst.start();
// register slave thread to master manager
mCallback.registerSocketThread(mst);
}
serverSocket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
As a result at 8th iteration I get this exception from accept()
method:
android io.IOException: Connection failure, wrong signal size: 27763
My question is whether it's related to Bluetooth standard(7 active slaves) or there is another occurence that I am not aware of?