09-18-2013 05:26 AM
I'm trying to connect to the sample SPP chat application from my desktop and something goes wrong .
What I do is the following:
1. Run the sample app and open an SPP server (it shows that it is waiting for a connection).
2. Call the winsock connect function with the right device address, GUID, protocol family and port set to zero... (I get the device address after succesfully paring with the device).
3. Try to send some text to the application...
Well, the problem is that I always fail in step 2....
WSAGetLastError returns error code 10060, which means that I've reached timout or failed connecting for some other reason...
Can anybody tell me what am I doing wrong?
In general, anyone can post an example of how to communicate between some desktop application and a BB device using BT?
09-22-2013 02:35 AM
Here is the code snippet...
memset(&socket_addr, 0, sizeof(socket_addr));
socket_addr.addressFamily = AF_BTH;
socket_addr.btAddr = Devices[DeviceIdx].Address; // the device address is correct (I checked it manually).
socket_addr.serviceClassId = ServiceGuid; // this is actually the GUID used by the sample BT chat application...
// and here I get err == SOCKET_ERROR....
err = WSAGetLastError(); // error code is 10060.