¿API de Bluetooth en Windows/. Net?


Estoy en el proceso de escribir un escáner Bluetooth que localiza e identifica dispositivos móviles en la vecindad local. ¿Es esto algo que puedo lograr usando C#, o necesito desplegarme en las API de C/C++? Mi aplicación está dirigida a Windows XP y Vista. Los consejos son apreciados.

Gracias!

Author: cjkarr, 2008-09-28

5 answers

Un problema con Bluetooth en el PC es que hay varias pilas BT en uso y nunca se puede saber cuál está disponible en una máquina determinada. Los más comunes son Widcomm (ahora Broadcom) y Microsoft (apareció en XP, tal vez uno de los service packs). Sin embargo, algunos proveedores de hardware BT empaquetan BlueSoleil y algunos usan Toshiba. La mayoría de los dongles funcionarán con la pila de MS, por lo que las bibliotecas de.NET que he visto tienden a usar eso.

Cada una de las pilas tiene una forma totalmente diferente de hacer la parte de descubrimiento donde busca dispositivos cercanos y consulta sus servicios.

Si tuviera que elegir un enfoque hoy, probablemente haría el descubrimiento en C++ y agregaría una interfaz para. NET.

El 32feet.net las cosas funcionaban bastante bien cuando las probé, pero no eran compatibles con la pila Widcomm.

 25
Author: Andrew Queisser,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-09-28 02:08:48

También está Peter Foot 32feet.net

Http://inthehand.com/content/32feet.aspx

He jugado con esto cuando era v1.5 y funcionó bien.

 15
Author: Kyle,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-09-28 01:01:01

Mike Petrichenko tiene un buen marco BT. Funciona con BlueSoleil, Widcomm, Toshiba y Microsoft.

Ahora se llama Biblioteca de Comunicaciones Inalámbricas y funciona con Bluetooth 802.11 e infrarrojos. Mike nombró a la compañía Soft Service Company y vende licencias no comerciales y comerciales con y sin código fuente en precios que oscilan entre $100 y $2050.

 7
Author: Guge,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-04-13 01:37:30

Las únicas API de BlueTooth administradas a las que pude encontrar referencia son aquí.

 3
Author: Erik Forbes,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-09-28 00:53:11

La mejor manera de conocer los dispositivos bluetooth y enviar archivos al dispositivo bluetooth desde su PC es usar ese código.

    public void ExecuteCommandSync(object command)
    {
        try
        {
            // create the ProcessStartInfo using "cmd" as the program to be run,
            // and "/c " as the parameters.
            // Incidentally, /c tells cmd that we want it to execute the command that follows,
            // and then exit.
            System.Diagnostics.ProcessStartInfo procStartInfo =
                new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command);

            // The following commands are needed to redirect the standard output.
            // This means that it will be redirected to the Process.StandardOutput StreamReader.
            procStartInfo.RedirectStandardOutput = true;
            procStartInfo.UseShellExecute = false;
            // Do not create the black window.
            procStartInfo.CreateNoWindow = true;

            // Now we create a process, assign its ProcessStartInfo and start it
            System.Diagnostics.Process proc = new System.Diagnostics.Process();
            proc.StartInfo = procStartInfo;
            proc.Start();

            // Get the output into a string
            string result = proc.StandardOutput.ReadToEnd();
            // Display the command output.
            Console.WriteLine(result);
        }
        catch (Exception objException)
        {
            // Log the exception
            MessageBox.Show(objException.Message);
        }
    }

Puede llamar a este método como

                          string command = "fsquirt";
                          ExecuteCommandSync(command);

Entonces, aparece BluetoothFileTransferWizard y puede elegir dispositivo disponible y enviar archivo para enviar ese dispositivo. Si no quieres usar de esa manera, prueba 32feet.net.uk. Eso fue genial para el desarrollo de bluetooth para C # y VB.NET.

 -9
Author: AT07,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-03-16 07:21:44