Activar Bluetooth

Activar Bluetooth

Postby pablovidal » Thu Nov 12, 2009 2:13 pm

Saludos,

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

Code: Select all  Expand view
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
------------------------------------------------------
*/
User avatar
pablovidal
 
Posts: 401
Joined: Thu Oct 06, 2005 10:15 pm
Location: Republica Dominicana

Funciones para Activar Bluetooth ( SOLUCIONADO )

Postby pablovidal » Fri Nov 13, 2009 1:10 am

Añadir esta libreria
echo $(VCDIR)\lib\arm\BthUtil.lib >> msvc.tmp


Este es el codigo
Code: Select all  Expand view

/*
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
------------------------------------------------------
*/
User avatar
pablovidal
 
Posts: 401
Joined: Thu Oct 06, 2005 10:15 pm
Location: Republica Dominicana

Re: Activar Bluetooth

Postby Antonio Linares » Fri Nov 13, 2009 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41286
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Activar Bluetooth

Postby pablovidal » 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
------------------------------------------------------
*/
User avatar
pablovidal
 
Posts: 401
Joined: Thu Oct 06, 2005 10:15 pm
Location: Republica Dominicana


Return to FiveWin para Pocket PC

Who is online

Users browsing this forum: No registered users and 5 guests