[PATH] Add native Bluetooth support for Windows platforms

Dirk Hohndel dirk at hohndel.org
Sat Aug 15 09:31:28 PDT 2015


On Sat, Aug 15, 2015 at 04:15:54PM +0300, Claudiu Olteanu wrote:
> >
> > Can you explain this a bit more? Should we not prefer the deviceLabel IF
> > we can get it?
> 
> When I created that patch I thought that it would be better to use only
> the device address to identify if the device is already in the list. This is
> due the fact that currently the pattern of the deviceLabel is
> *$deviceName ($deviceAddress) $pairingStatus *. There are moments
> when the device name is missing and moments when the pairing status is
> different.
> Now if I think more clearer if we don't update the devices state it would
> lead
> to some inconsistent states.
> 
> Probably it would be a better idea to clear the list with the discovered
> devices
> when a new device lookup is initiated. In this way we will show only the
> devices
> that are in range during the last scanning.

Yes, I think that's the way to go.

> If you agree with this I can send you another patch.

Please.

> > b) did you write all this from scratch or was this inspired by some
> > existing BT code for Windows from some other project? This is a
> > non-trivial chunk of code in an area I'm not very familiar with...
> > (and just to avoid email communication issues - no, I'm not doubting that
> > you wrote this code... I just want to make sure that if there is a source
> > we should credit that we do).
> >
> 
> The code is written from scratch but I used two sources of inspiration:
> - for the implementation of our custom serial callbacks I looked over the
> Native bluetooth communication sample created by Jef
> - for the device lookup I looked over a sample[1] provided by Microsoft
> Corporation
> to demonstrate how to use Winsock 2.2 Api and RFCOMM protocol

OK, this code is available under the MS-LPL (Microsoft Limited Public
License).  I assume that you didn't do any "cut and paste" but that you
read the code and then reimplemented it based on the logic you understood
from studying the code? I'm not a lawyer but from my reading of the
license that is perfectly fine (and in many ways the intention of that
code). If you did cut and paste the code then we need to rewrite things as
the MS-LPL is not GPL compatible.

> I didn't know where I should mention them :) . While Jef is probably already
> mentioned for his help I am not sure if Microsoft should be mentioned when
> you get inspiration from one of their samples.

Absolutely. Whenever you either copy code or learn from code it is
important to give credit.

So in each commit message where you commit code that uses existing code
either as inspiration (or for better understanding of API use) you should
give credit.

> Also you should know that our custom serial implementation is based on the
> native serial implementation provided by Jef (the design). I thought that
> it is
> obvious but I just wanted to be clear :).

Yes, that is obvious and was discussed back then. It's the MSFT code that
I want to make sure we give proper credit to.

Can you redo the commits and mention that you looked at this sample code
in order to understand the use of the API? Something like this:

"This code was written with the help of the sample code documenting the
relevant APIs provided by Microsoft Corporation at 
https://code.msdn.microsoft.com/windowsdesktop/Bluetooth-Connection-e3263296
which is under the MS-LPL. No code from the samples was copied and the
code in this commit is covered by the GPL and not the MS-LPL"

Thanks

/D


More information about the subsurface mailing list