.NET Components for Mobility

Multiple BT dongles and RADIO ON OFF inthehand 2.4

Last post 06-24-2009 5:28 AM by alanjmcf. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 06-22-2009 2:50 PM

    Multiple BT dongles and RADIO ON OFF inthehand 2.4

    Hello,

    I've been searching about how to connect multiple BT dongles to one PC.In this forum I found some old post (2006), talkig about it but I don't know how it is nowadays. Using microsoft stack I cannot use more than one at a time. Is there a any solution? Using i.e. widcomstack and microsoft? i know that using BlueZ stack in Linux it is possible, is there any solution as well as for Windows? 

     I still have problems with switching the BT Radio ON -> OFF, is there a prevision when it will be fixed? How can we contribute to the development of the project?

     

    Thanks in advance.

    César

  • 06-22-2009 3:45 PM In reply to

    Re: Multiple BT dongles and RADIO ON OFF inthehand 2.4

    In 2.4 if both the Microsoft and Widcomm stacks are installed then both will be loaded by our library and both can be used.  Call BluetoothRadio.AllRadios and check that you get two radios out.  Then one can use the BluetoothRadio.StackFactory to create BluetoothClient/-Listener instance on each stack/radio.
    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
  • 06-22-2009 4:00 PM In reply to

    Re: Multiple BT dongles and RADIO ON OFF inthehand 2.4

    Hello Alan, thanks for the quick response!

    I am gonna try to use both stacks. So, it means we can use at same time a maximum of 2 BT dongles (one for widcomm and another wih MS Stack)? Or is there a way we can use multiple MS or Widcomm stack?  

    My goal is to connect many device as possible, using the maximum number of BT dongles.

    Thanks

    César

     

  • 06-22-2009 5:33 PM In reply to

    Re: Multiple BT dongles and RADIO ON OFF inthehand 2.4

    Yup two dongles then.  The code supports multiple stacks at the same time, but I haven't had a PC with those two stacks to test on (instead testing with one real and one fake stack).

    What was the issue with turning radio off?

     

     

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
  • 06-22-2009 5:54 PM In reply to

    Re: Multiple BT dongles and RADIO ON OFF inthehand 2.4

     When you say multiple stacks, you mean I can use multiple DIFFERENT stacks or multiple instances of the same stack (Many BT dongles using MS Stacks)?

    When I start my program with the BT dongle not connected I have an exception in the folowing code: (maybe you can identify the problem)

    try {
                        Type t = Type.GetType(factoryName);
                        object tmp;
                        try {
                            tmp = Activator.CreateInstance(t);
                        } catch (System.Reflection.TargetInvocationException tiex) {
                            throw tiex.InnerException;
                        }
                        Debug.Assert(tmp != null, "Expect all failures to throw rather than return null.");
                        list.Add((BluetoothFactory)tmp); //s_factory = (BluetoothFactory)tmp;
                        if (BluetoothFactoryConfig.OneStackOnly) {
                            break;
                        }
                    } catch (PlatformNotSupportedException) {
                    } catch (Exception ex) {
                        // This isn't actually true, the factories thrown any old exception!
                        Debug.Assert(TestUtilities.IsUnderTestHarness(), string.Format(System.Globalization.CultureInfo.InvariantCulture,
                            "Unexpected exception creating factory '{0}, ex: {1}", factoryName, ex));
                    }

    Exception (StackTrace)


        at BluetoothFactory.GetStacks_inLock()  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(55)
        at BluetoothFactory.get_Factories()  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(76)
        at BluetoothFactory.get_Factory()  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(90)
        at BluetoothRadio.get_PrimaryRadio()  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothRadio.cs(58)
        at Search.controlSearch()  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\Search.cs(133)
        at ThreadHelper.ThreadStart_Context(Object state) 
        at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
        at ThreadHelper.ThreadStart() 


    Unexpected exception creating factory 'InTheHand.Net.Bluetooth.Widcomm.WidcommBluetoothFactory, ex: System.InvalidOperationException: May only be one instance of WidcommBtIf.
       em InTheHand.Net.Bluetooth.BluetoothFactory.GetStacks_inLock() na C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs:linha 45


        at BluetoothFactory.GetStacks_inLock()  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(55)
        at BluetoothFactory.get_Factories()  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(76)
        at BluetoothFactory.get_Factory()  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(90)
        at BluetoothRadio.get_PrimaryRadio()  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothRadio.cs(58)
        at Send.controlSend(Object tDbConnId)  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\Send.cs(121)
        at ThreadHelper.ThreadStart_Context(Object state) 
        at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
        at ThreadHelper.ThreadStart(Object obj) 


    Unexpected exception creating factory 'InTheHand.Net.Bluetooth.Widcomm.WidcommBluetoothFactory, ex: System.InvalidOperationException: May only be one instance of WidcommBtIf.
       em InTheHand.Net.Bluetooth.BluetoothFactory.GetStacks_inLock() na C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs:linha 45
    ---- Declarar Mensagem Detalhada ----


        at BluetoothFactory.GetStacks_inLock()  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(55)
        at BluetoothFactory.get_Factories()  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(76)
        at BluetoothFactory.get_Factory()  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothFactory.cs(90)
        at BluetoothRadio.get_PrimaryRadio()  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\InTheHand.Net.Personal\Net\Bluetooth\BluetoothRadio.cs(58)
        at Send.controlSend(Object tDbConnId)  C:\Data\Projetos\BlueGO\software\trunk\BluesysTooth\Send.cs(121)
        at ThreadHelper.ThreadStart_Context(Object state) 
        at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
        at ThreadHelper.ThreadStart(Object obj) 

    The program '[7316] BluesysTooth.vshost.exe: Managed' has exited with code 0 (0x0).

     

     

  • 06-23-2009 9:53 AM In reply to

    Re: Multiple BT dongles and RADIO ON OFF inthehand 2.4

    32feet.NET 2.4 should be able to use the MSFT and Widcomm stacks at the same time in the same program.  They each support one dongle each, thus two dongles used by the library.

    I hope to have my PC set up to test MSFT and Widcomm stack loaded by the same program in a day or so.  I'll be able to report if it works as intended then.

    On the error, that error occurs when this is the second (or later) time we tried to load the Widcomm stack.  It means the first time failed.  Its on my to-do list to stop that "odd" error the second time, but we'd still get an error. :-,)

    In that case you had zero dongle attached?  You have both stacks installed?

     

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
  • 06-23-2009 12:02 PM In reply to

    Re: Multiple BT dongles and RADIO ON OFF inthehand 2.4

    I have zero dongle and only MS stack... do you think is it possible to have many dongles using VMWare to simulare another operational system^?

     

  • 06-24-2009 5:28 AM In reply to

    Re: Multiple BT dongles and RADIO ON OFF inthehand 2.4

    Ahh right.  With only one of the supported stacks we can only support one dongle.  (Because as we know, the stacks themselves support only one dongle each).

    It will be difficult to have one program use two dongles in your case.  You'd have to run a program on the second machine (VM) and have the first program talk to it (over remoting or WCF or something) and control it remotely.  That's all possible, but! :-,)  It would be easier to buy a dongle with Widcomm stack included (I'm going to test this later to make sure it works!).

    ---------- 

    On the multiple stack at one time in 32feet.NET situation: it is Disabled in the 2.4 release version.  InTheHand.Net.Bluetooth.BluetoothFactoryConfig.OneStackOnly is set to true.  Download the source from CodePlex change it to false and recompile for multi-stack support.

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
Page 1 of 1 (8 items)
Copyright © 2001-2010 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.