Bluetooth -> Winapi/32feet. Two connection from Pc to one device using Spp

830 Views Asked by At

It`s possible to establish two connections( or more) between Pc and other device? When I try to do that I have got exception: 10048 -> ex.Message = "A connect request was made on an already connected socket xxxxxxxxxxxx:0000110100001000800000805f9b34fb". If not, there is some workaround? I used 32feet libary to wrote application.

3

There are 3 best solutions below

0
On

i just connected 4 devices (spp) simultanously and transfering data periodically.

so it is definitely possible.

if one device is disconnected the other connection can't get data anymore, but i guess this is just a bug in my code.

it would be very interesting if anyone else has tried this.

0
On

This an RFCOMM limitation, not a limitation of the lower levels of the Bluetooth stack. See a workaround described in the 32feet.NET documentation https://32feet.codeplex.com/wikipage?title=General%20Bluetooth%20Data%20Connections

  • Notes

[1] The one RFCOMM connection is a protocol limitation. TCP/IP has port numbers on source and destination ends and thus can support multiple connections, RFCOMM has only the remote channel number so only can support one connection.

If you need multiple connection and are in control of the 'server' device then have the service listen on two (or more) RFCOMM channels so the client can connect to different channel numbers.

1
On

I guess its not possible. There can exist one connection between a master and slave. A master can be simultaneously connected to as much as 7 active slaves.

And most probably the other device that you are using might support only one connection. In your case it is possible to connect up to 7 device to your pc.