FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Pocket PC Activar Bluetooth
Posts: 401
Joined: Thu Oct 06, 2005 10:15 PM
Activar Bluetooth
Posted: Thu Nov 12, 2009 02:13 PM
Saludos,

Alguna forma que desde FWPCC se pueda activar el bluetooth si este se encuentra apagado

Code (fw): Select all Collapse
public class BlueTooth

{

private enum BluetoothMode : int

{

Off = 0, //Turn off the Bluetooth radio.

Connectable = 1, //Turn on the Bluetooth radio, and make it connectable.

Discoverable = 2 //Turn on the Bluetooth radio, and make it both connectable and discoverable.

};

[DllImport("BthUtil.dll")]

private static extern int BthSetMode(BluetoothMode mode);

public static bool EnableBT()

{

return (BthSetMode(BluetoothMode.Connectable) == 0);

}

public static bool DisableBT()

{

return (BthSetMode(BluetoothMode.Off) == 0);

}

}
Saludos,



Pablo Alberto Vidal

/*

------------------------------------------------------

Harbour 3.2.0, Fivewin 17.02, BCC7

------------------------------------------------------

*/
Posts: 401
Joined: Thu Oct 06, 2005 10:15 PM
Funciones para Activar Bluetooth ( SOLUCIONADO )
Posted: Fri Nov 13, 2009 01:10 AM
Añadir esta libreria

echo $(VCDIR)\lib\arm\BthUtil.lib >> msvc.tmp


Este es el codigo
Code (fw): Select all Collapse
/*
Funciones para activar el Bluetooth desde FWPPC
Pablo Vidal
*/

#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
/*Enciende el Bluetooch para conectarse*/
HB_FUNC( LBTON )
{
hb_retl( (BthSetMode(1) == 0) ) ;
}

/*Enciende y activa Bluetooch en modo descubierto*/
HB_FUNC( LBTOPEN )
{
hb_retl( (BthSetMode(2) == 0) ) ;
}

/*Apaga el Bluetooth*/
HB_FUNC( LBTOFF )
{
hb_retl( (BthSetMode(0) == 0) ) ;
}
#pragma ENDDUMP
Saludos,



Pablo Alberto Vidal

/*

------------------------------------------------------

Harbour 3.2.0, Fivewin 17.02, BCC7

------------------------------------------------------

*/
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Activar Bluetooth
Posted: Fri Nov 13, 2009 07:57 AM

Pablo,

Muchas gracias! :-)

En solo unos pocos dias, ya eres un gran experto de FWPPC. Enhorabuena :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 401
Joined: Thu Oct 06, 2005 10:15 PM
Re: Activar Bluetooth
Posted: Fri Nov 13, 2009 10:13 AM

Gracias Antonio

Un Experto Noooooooo, si no que trato de buscar las solucion a los problemas,
y todo esta en la red...

Saludos,



Pablo Alberto Vidal

/*

------------------------------------------------------

Harbour 3.2.0, Fivewin 17.02, BCC7

------------------------------------------------------

*/

Continue the discussion