Bluetooth API calls (not using Sockets)

C

cmartin64x

Hi,

I am trying to make this simple code work but I have no success doing
so:

BLUETOOTH_DEVICE_SEARCH_PARAMS btsp = { sizeof(btsp) };
BLUETOOTH_DEVICE_INFO btdi = { sizeof(btdi) };

btsp.fReturnAuthenticated = TRUE;
btsp.fReturnRemembered = TRUE;
btsp.cTimeoutMultiplier = 40;
btsp.fReturnUnknown = TRUE;
btsp.fReturnConnected = TRUE;
btsp.fIssueInquiry = TRUE;

hFind = BluetoothFindFirstDevice( &btsp, &btdi );

GetLastError(...);....


When I call GetLastError; It tells me that => "1722 The RPC server
is
unavailable."


I am developping with SDK SP1 under Windows XP SP1 with Visual Studio
.NET. My bluetooth interface is an IOGEAR (USB). ( I tried with
Belkin
USB interface as well and it did not work). I have installed
q323183_wxp_sp2_x86_enu.exe which resolved some problems but I still
cannot see the Bluetooth device around the computer.

Although, if I use the "Explore my Bluetooth place" I do find my
bluetooth device (2 of them actually).

Any advice ???
 
A

Antti Keskinen

Hello !

Although you're not using Windows Sockets, try including all WSA2 headers
(standard and Bluetooth ones), then calling WSAStartup properly before
attempting to use Bluetooth.

There's a small tidy undocumented section somewhere stating that Bluetooth
cannot be used without dows Sockets. But I think it was left out of the
actual docs.

If that doesn't help, try looking for Bluetooth radio devices. It's much
alike, but with BluetoothFindFirstRadio instead.

Calling WSAStartup should clear the RPC server error.

-Antti Keskinen


cmartin64x said:
Hi,

I am trying to make this simple code work but I have no success doing
so:

BLUETOOTH_DEVICE_SEARCH_PARAMS btsp = { sizeof(btsp) };
BLUETOOTH_DEVICE_INFO btdi = { sizeof(btdi) };

btsp.fReturnAuthenticated = TRUE;
btsp.fReturnRemembered = TRUE;
btsp.cTimeoutMultiplier = 40;
btsp.fReturnUnknown = TRUE;
btsp.fReturnConnected = TRUE;
btsp.fIssueInquiry = TRUE;

hFind = BluetoothFindFirstDevice( &btsp, &btdi );

GetLastError(...);....


When I call GetLastError; It tells me that => "1722 The RPC server
is
unavailable."


I am developping with SDK SP1 under Windows XP SP1 with Visual Studio
NET. My bluetooth interface is an IOGEAR (USB). ( I tried with
Belkin
USB interface as well and it did not work). I have installed
q323183_wxp_sp2_x86_enu.exe which resolved some problems but I still
cannot see the Bluetooth device around the computer.

Although, if I use the "Explore my Bluetooth place" I do find my
bluetooth device (2 of them actually).

Any advice ???
 

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

Similar Threads


Top