[PATCH] Add native Bluetooth support for Windows platforms

Claudiu Olteanu olteanu.vasilica.claudiu at gmail.com
Tue Aug 18 14:57:20 PDT 2015


Hi there,

As I promised, I created a new set of patches. You can find it
attached to this e-mail.

Here is a list with the changes I did after the feedback:
- initialized the internal variables (patch 06)
- moved the *WSACleanup* call from patch 06 to patch 12
- removed the implementation of my internal *getLastError* and started
using *qt_error_string* (patch 11)
- used *WSAAddressToStringW* instead of *WSAAddressToStringA* (patch 11)
- avoided some code duplication (patches 14, 15, 17)

I hope that I covered all of Thiago's suggestions.

You should know that I didn't call *WSACleanup* if the
*WSAStartup* failed because this call was already made in the
*BtDeviceSelectionDialog* destructor and I didn't know exactly
how I should handle this elegantly :).

Also I didn't remove the call of strdup method from
*qtserialbluetooth::qt_serial_open *because the
*WSAStringToAddressA* method is expecting to receive
LPSTR {aka char*} parameter while I have the address
represented as const char*.

I tried as well to replace the WSAStringToAddressA with
WSAStringToAddressW but I had to represent the
address as a wchar_t* and and when I wanted to use
mbstowcs_s for conversion (from const char* to wchar_t*)
the compiler couldn't find the declaration to the method
(even though I included the stdlib header). After some
failed attempts I gave up :).

Cheers,
Claudiu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Cleanup-Bluetooth-local-device-and-the-discovery-age.patch
Type: text/x-patch
Size: 1106 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0018.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Check-the-last-error-when-the-BTH-device-scanning-is.patch
Type: text/x-patch
Size: 1234 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0019.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Clear-the-BTH-discovered-devices-list-on-each-search.patch
Type: text/x-patch
Size: 3588 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0020.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Reimplement-pairingFinished-method.patch
Type: text/x-patch
Size: 5408 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0021.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Add-set_timeout-callback-for-Bluetooth-custom-serial.patch
Type: text/x-patch
Size: 1578 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0022.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-Add-skeleton-for-Bluetooth-custom-serial-implementat.patch
Type: text/x-patch
Size: 13726 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0023.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-Add-implementation-for-BTH-custom-serial-open-method.patch
Type: text/x-patch
Size: 2356 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0024.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-Add-implementation-for-BTH-custom-serial-close-metho.patch
Type: text/x-patch
Size: 901 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0025.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-Add-implementation-for-BTH-custom-serial-read-method.patch
Type: text/x-patch
Size: 1255 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0026.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-Add-implementation-for-BTH-custom-serial-write-metho.patch
Type: text/x-patch
Size: 1234 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0027.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0011-Add-implementation-for-our-custom-BTH-device-discove.patch
Type: text/x-patch
Size: 5228 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0028.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0012-Initialize-WinSock-and-hide-the-information-about-th.patch
Type: text/x-patch
Size: 1865 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0029.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0013-Wait-for-BTH-device-discovery-thread-to-finish-on-st.patch
Type: text/x-patch
Size: 1795 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0030.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0014-Add-implementation-for-add-remote-Bluetooth-device-h.patch
Type: text/x-patch
Size: 2052 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0031.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0018-Use-the-address-of-the-BTH-device-if-its-name-is-emp.patch
Type: text/x-patch
Size: 1472 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0032.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0017-Add-implementation-for-device-discovery-agent-initia.patch
Type: text/x-patch
Size: 2035 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0033.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0016-Get-a-pretty-print-message-when-a-device-discovery-e.patch
Type: text/x-patch
Size: 1088 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0034.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0015-Add-implementation-for-BTH-device-item-selection-on-.patch
Type: text/x-patch
Size: 2796 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150819/331ccaac/attachment-0035.bin>


More information about the subsurface mailing list