Ad:
 
  • C++ Discussion Thread
  • Unsolved
  • Views: 4210
  • C++ RSS
Jan 22nd, 2008
0

Bluetooth development using platform SDK - error code 10050

Expand Post »
Hello,

I've been trying to develop a simple client/server application that uses the bluetooth USB dongles of 2 PCs using windows sockets and the bluetooth support provided in the windows platform SDK

I can create the sockets fine, but when I go to invoke "bind" or "connect", the program spits out the error code 10050 (network is down/dead), but I can't figure out where the problem is or what is causing it (everywhere on the net is very vague about this error)

Any ideas?

Thanks

I am including a portion of my code up until when the program exits

C++ Syntax (Toggle Plain Text)
  1. #include <winsock2.h>
  2. #include <ws2bth.h>
  3. #include <BluetoothAPIs.h>
  4. #include <stdlib.h>
  5. #include <stdio.h>
  6. #include <iostream>
  7. #pragma comment(lib, "ws2_32.lib")
  8. #pragma comment(lib, "irprops.lib")
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13. //Initialising winsock
  14. WSADATA data;
  15. int result;
  16. result = WSAStartup(MAKEWORD(2, 2), &data);//initializing winsock
  17. if (result!=0)
  18. {
  19. cout << "An error occured while initialising winsock, closing....";
  20. exit(result);
  21. }
  22.  
  23. SOCKET s = socket (AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);
  24. if (s == INVALID_SOCKET)
  25. {
  26. wprintf (L"Socket creation failed, error %d\n", WSAGetLastError ());
  27. return 0;
  28. }
  29.  
  30. SOCKADDR_BTH sab;
  31. memset (&sab, 0, sizeof(sab));
  32. sab.addressFamily = AF_BTH;
  33. sab.port = BT_PORT_ANY;
  34.  
  35. if (0 != bind (s, (struct sockaddr *) &sab, sizeof(SOCKADDR_BTH)))
  36. {
  37. wprintf (L"Socket bind, error %d\n", WSAGetLastError ());
  38. closesocket (s);
  39. return 0;
  40. }

The error occurs at "Socket bind, error"
I should also add that hte bluetooth usb dongles have been tested and work, and I'm running all this on windows XP with SP2, and using visual studio 2005 team suite
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Exenteth is offline Offline
1 posts
since Jan 2008
Mar 9th, 2008
0

Re: Bluetooth development using platform SDK - error code 10050

I tried the code that you posted and it worked just fine for me.

Z.K.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Z.K. is offline Offline
1 posts
since Mar 2008
Mar 11th, 2008
0

Re: Bluetooth development using platform SDK - error code 10050

Click to Expand / Collapse  Quote originally posted by Z.K. ...
I tried the code that you posted and it worked just fine for me.

Z.K.
Symptom: When attempting to verify network connectivity with a remote computer by using the Ping.exe command, you may receive a command-line error message similar to the following: Ping: transmit failed, error code 65 or PING: transmit failed, error code 10050.

Resolutions: This behavior can occur if the following conditions are true: 1) ICS is enabled; 2) a firewall software is running on the computer; 3) The ZoneLabs program is not correctly configured for ICS.

To fix the problem: 1) re-configure ZoneAlarm for ICS. 2) Remove the Zone Labs firewall software from the computer.


what i am bale to get on net and of this some think which i know.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
himanshu anand is offline Offline
4 posts
since Nov 2007
This thread is more than three months old. Perhaps start a new thread instead?
Message:
Previous Thread in C++ Forum Timeline: c++,c,java
Next Thread in C++ Forum Timeline: Need a professional eye to look at this





About Us | Contact Us | Advertise | Acceptable Use Policy
Build Custom RSS Feed


Follow us on Twitter


© 2010 DaniWeb® LLC