bluetooth-windows-esp32-example icon indicating copy to clipboard operation
bluetooth-windows-esp32-example copied to clipboard

Initial run and LNK2019 errors

Open AmberElferink opened this issue 3 years ago • 0 comments

Thanks for the nice example on a simple Bluetooth Classic implementation.

When starting the sln in Visual Studio Community normally, and not doing anything special, it gives some linker errors. It is easily fixable by linking to the libraries in the project, but it's also a simple fix to add this at the top:

#pragma comment(lib, "Bthprops.lib")
#pragma comment(lib, "Ws2_32.lib")

I think that should clear up the errors that can be daunting for beginners.

Additionally, for complete newcomers, it would be handy to explain to install Arduino IDE to open the ino file, (or alternatively PlatformIO in Visual Studio Code). With Visual Studio Community you can open the sln file.

For just a bit I was confused as to why I only received one message on the PC side. For others with the same issue: the firmware in the ESP32 also waits to receive some data from the PC before sending the next data. So if you send a message back on the last line of the while loop in receiveMessageFromESP32 (just write sendMessageToEsp32(); to test), it will print messages repeatedly.

Thanks again for the example!

AmberElferink avatar Jan 18 '22 14:01 AmberElferink