M
Maxim
Hello, everyone!
I'm trying to create a simple test app to connect PDA to Desktop through
bluetooth. But I cannot accomplish even this simple thing.
First, I tried to use 32feet.net bluetooth component. But
BluetoothRadio.PrimaryRadio returns null. Also BluetoothRadio.IsSupported
returns false.
Then I tried to discover bluetooth device (desktop computer) using WinCE
native calls. Following is my code for this:
// Get Winsock-related data
WSADATA wsd;
WSAStartup (MAKEWORD(1,0), &wsd);
// Specify search parameters
WSAQUERYSET wsaq;
ZeroMemory(&wsaq, sizeof(wsaq));
wsaq.dwSize = sizeof(wsaq);
wsaq.dwNameSpace = NS_BTH;
wsaq.lpcsaBuffer = NULL;
// Start look up
HANDLE hLookup;
int iRet = WSALookupServiceBegin (&wsaq, LUP_CONTAINERS, &hLookup);
// Enumerate devices that were scanned
// Configure a WSAQUERYSET structure to store device data returned by
WSALookupServiceNext
CHAR buf[4096];
LPWSAQUERYSET pwsaResults = (LPWSAQUERYSET) buf;
ZeroMemory(pwsaResults, sizeof(WSAQUERYSET));
pwsaResults->dwSize = sizeof(WSAQUERYSET);
pwsaResults->dwNameSpace = NS_BTH;
pwsaResults->lpBlob = NULL;
DWORD dwSize = sizeof(buf);
iRet = WSALookupServiceNext (hLookup, LUP_RETURN_NAME | LUP_RETURN_ADDR,
&dwSize, pwsaResults);
After last call I get SOCKET_ERROR, and WSAGetLastError() returns error code
WSANETDOWN.
I've tried to restart both systems (Desktop & PDA) - nothing helps.
I saw several comments about protocol stack. That it must be compatible with
microsoft standard. Not sure what it really means.
In the test I used the folowing devices:
PDA:
hp iPAQ PPC h4100 series, Model H4150
with Microsoft Pocket PC Version 4.20.0 (Build 13252)
Desktop:
USB Bluetooth ORIENT B303
WinXP SP2
BlueSoleil 1.6.1.4 Release 050606, Stack version 05.04.05.20050408
Need to say that I've established PDA-Desktop bluetooth connection using
ActiveSync. It works fine.
Could anybody help me. Any advices/suggestions/links are very appreciated.
Thanks in advance
I'm trying to create a simple test app to connect PDA to Desktop through
bluetooth. But I cannot accomplish even this simple thing.
First, I tried to use 32feet.net bluetooth component. But
BluetoothRadio.PrimaryRadio returns null. Also BluetoothRadio.IsSupported
returns false.
Then I tried to discover bluetooth device (desktop computer) using WinCE
native calls. Following is my code for this:
// Get Winsock-related data
WSADATA wsd;
WSAStartup (MAKEWORD(1,0), &wsd);
// Specify search parameters
WSAQUERYSET wsaq;
ZeroMemory(&wsaq, sizeof(wsaq));
wsaq.dwSize = sizeof(wsaq);
wsaq.dwNameSpace = NS_BTH;
wsaq.lpcsaBuffer = NULL;
// Start look up
HANDLE hLookup;
int iRet = WSALookupServiceBegin (&wsaq, LUP_CONTAINERS, &hLookup);
// Enumerate devices that were scanned
// Configure a WSAQUERYSET structure to store device data returned by
WSALookupServiceNext
CHAR buf[4096];
LPWSAQUERYSET pwsaResults = (LPWSAQUERYSET) buf;
ZeroMemory(pwsaResults, sizeof(WSAQUERYSET));
pwsaResults->dwSize = sizeof(WSAQUERYSET);
pwsaResults->dwNameSpace = NS_BTH;
pwsaResults->lpBlob = NULL;
DWORD dwSize = sizeof(buf);
iRet = WSALookupServiceNext (hLookup, LUP_RETURN_NAME | LUP_RETURN_ADDR,
&dwSize, pwsaResults);
After last call I get SOCKET_ERROR, and WSAGetLastError() returns error code
WSANETDOWN.
I've tried to restart both systems (Desktop & PDA) - nothing helps.
I saw several comments about protocol stack. That it must be compatible with
microsoft standard. Not sure what it really means.
In the test I used the folowing devices:
PDA:
hp iPAQ PPC h4100 series, Model H4150
with Microsoft Pocket PC Version 4.20.0 (Build 13252)
Desktop:
USB Bluetooth ORIENT B303
WinXP SP2
BlueSoleil 1.6.1.4 Release 050606, Stack version 05.04.05.20050408
Need to say that I've established PDA-Desktop bluetooth connection using
ActiveSync. It works fine.
Could anybody help me. Any advices/suggestions/links are very appreciated.
Thanks in advance