Using Bluetooth API

  • Thread starter =?iso-8859-1?Q?Ibai_Pe=F1a?=
  • Start date
?

=?iso-8859-1?Q?Ibai_Pe=F1a?=

Hi,
I´m trying to use Bluetooth API from my project to activate it.
I have read the API documentation from here, and try to get it with this code:

//Define the method
[DllImport("BthUtil.dll",CharSet=CharSet.Unicode, SetLastError=true)]
internal static extern int BthSetMode( System.UInt32 dwMode );

//Bluetooth uses
int result = BthSetMode((System.UInt32)0); //-> returns 0
int result = BthSetMode((System.UInt32)1); //-> returns 1164
int result = BthSetMode((System.UInt32)2); //-> returns 1164
int result = BthSetMode((System.UInt32)3); //-> returns 87 if param >2

1- Looking the returned values, I think that 87 is that the value is not valid. I think that 0,1 and 2 values are the enumeration values. The code that I posted executes properly, but there is no changes in the blueetooth. Where can I found info about the returned values?
In the API documentation only says:"Returns ERROR_SUCCESS on success, or an error code describing the error on failure."

2- This method is supposed to take an enumeration value, but I cant define it properly. How did I define this enumeration?

3- Has somebody succedd to set the blueetooth on from its program ?


Any help would be appreciated.
 
A

Alberto Silva

Hi Ibai,
I guess that the problem is that your device is not using the Microsoft
Bluetooth Stack, so you must use it's own SDK.
I don't know if there are already PocketPC 2003 or CE 4.2 devices with the
MS BT stack...

Alberto Silva

"Ibai Peña" <[email protected]> escreveu na mensagem
Hi,
I´m trying to use Bluetooth API from my project to activate it.
I have read the API documentation from here, and try to get it with this
code:

//Define the method
[DllImport("BthUtil.dll",CharSet=CharSet.Unicode, SetLastError=true)]
 
I

Ibai Peña

Well, thanks for your answer Alberto.

I´m a bit surprised with it. I supposed that as Bluetooth api is in the
Pocket PC 2003 SDK documentation, all Pocket PC 2003 devices would be able
to understand it. Am I wrong?

How can I know which devices are using the Microsoft Bluetooth Stack?
How can I know the bluetooth SDK to use with each device?

Thanks again,
 
A

Alberto Silva

Most of the devices with built-in bluetooth, like the ipaq, use the WidComm
stack. Devices with SocketCom cards use SocketCom stack.

For the ones that use the Widcomm stack you can either contact widcomm or
www.high-point.com

Alberto Silva
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top