This project has moved. For the latest updates, please go here.

Multi-stack support

From version 2.5 (actually version 2.4.1) we support using the Microsoft and Widcomm stacks at the same time. This allows one program to support more than seven connections, or similar situations.

To use the multi-stack support on Windows XP, install both Microsoft and Widcomm stacks and attach their radio dongles. Then create an app.config file with your application and set the flag “oneStackOnly” to “false” — there is a sample app.config file in the assemblies folder, copy it, rename it to match you app e.g. “thisismyapp.exe.config”, and change the settings as required.

You also need a particular set-up of Widcom support, see Broadcom.

If the two stacks both load successfully, then BluetoothRadio.AllRadios should contain two items. Using new BluetoothClient() etc will always create an instance from the first radio/stack. To specifically create an instance from a particular radio/stack use the StackFactory property on BluetoothRadio. For instance:

Dim radioB As BluetoothRadio = BluetoothRadio.AllRadios(1)
Dim cli As BluetoothClient = radioB.StackFactory.CreateBluetoothClient()
Dim lsnr As BluetoothListener = _
   radioB.StackFactory.CreateBluetoothListener(BluetoothService.Wap)
If at least one of the stacks loads, but one or more fails to load then the program will continue. More diagnostics can be enabled to allow troubleshooting. Set app.config flag “reportAllErrors” to “true”. This outputs any errors on the Console and on System.Diagnostics.Trace output; since we use Trace.Fail currently, an assert dialog box will pop-up and need to be closed manually — if necessary see MSDN on “AssertUiEnabled=false” for disabling the dialog.

Internals

For details of the research and development needed to get stacks, and Widcomm specifically, to work at the same time see various posts on the blog http://32feetnetdev.wordpress.com/category/multi-stack/

Last edited Feb 13, 2013 at 10:28 AM by alanjmcf, version 9