Bluetooth development in Windows
A recent project requires Bluetooth development in windows, so I will introduce the environment setup and development steps here. I installed it in XP SP2, therefore, we will only introduce the installation on this platform:
First, Visual Studio must be at least vs2005, and VC ++ 6.0 is not supported. The operating system must be at least XP SP2, and XP SP1 is not supported.;
Then we need to download the SDK, which contains the library and header files required for Bluetooth development. You can download the SDK directly from the Microsoft Official Website:
Windows Server 2003 R2 Platform sdk iso download
My link is http://www.microsoft.com/download/en/details.aspx? Id = 12675
The following is an imgfile:5.2.20.0.2075.51.platformsdk _ svr2003r2_rtm.img, About mb. After converting it into an ISO file, runSetup.exeThe installation starts:
Like installing other Windows software, it went quite well.
Run the following command to test whether the installation is successful:
Open vs2005, create a console application, and add the following statement at the beginning:
#include "Winsock2.h" #include "Ws2bth.h" #include "BluetoothAPIs.h" #pragma comment(lib, "ws2_32.lib") #pragma comment(lib, "irprops.lib")
When you click Run, an error will be prompted because the SDK has been installed but not introduced yet:
Vs2005 --> Tools --> options --> projects and solutions --> VC ++ directory, in the "show the following contents" drop-down list, select "include files" and "library files", and fill in the SDK. h file and. lib file path.
You can run the above program again ~~
Done!