Hi, I try to connect up to 7 devides at the same time. With build in BlueTooth and with external D-LINK DBT-122 are up to 7 connetions possible. But I have to use a external USB-BlueTooth-Stick Class1. The BlueTooth devices I connected to uses the SPP via RFCOMM.
In my code I build up the connection by the following code:
// Create an IOBluetoothSDPUUID object for the chat service UUID sppServiceUUID = [IOBluetoothSDPUUID uuid16:kBluetoothSDPUUID16ServiceClassSerialPort]; IOBluetoothDeviceSelectorController * deviceSelector = [IOBluetoothDeviceSelectorController deviceSelector]; ... // Run the sheet [deviceSelector beginSheetModalForWindow:judgeWindow modalDelegate:self didEndSelector:@selector(selectorDidEnd:returnCode:contextInfo:) contextInfo:connection]; ... // Finds the service record that describes the service (UUID) we are looking for: IOBluetoothSDPServiceRecord * sppServiceRecord = [_device getServiceRecordForUUID:mSppServiceUUID];
UInt8 rfcommChannelID; if ( [sppServiceRecord getRFCOMMChannelID:&rfcommChannelID] != kIOReturnSuccess ) ... // To connect we need a device to connect and an RFCOMM channel ID to open on the device: hier fest eine 1! IOReturn success = [_device openRFCOMMChannel:rfcommChannelID channel:&_channel]; if (!(success == kIOReturnSuccess)) ...
But with some external USB-BlueTooth-Sticks there is only one connection possible.
What I shall do to build up more than one connection?
Thanks. :) Uwe
|