# idea about Bluetooth version 4 development for all BSD communities



## sidetone (Feb 22, 2018)

The BSD community, not only FreeBSD, should look into supporting Bluetooth version 4 drivers. Bluetooth version 4 dongles are backward compatible with devices using previous Bluetooth versions, and they are inexpensive. It's not worth wasting time on Bluetooth version 2 and 3 dongle drivers.

The state of Bluetooth sourcecode in FreeBSD CURRENT is at https://svnweb.freebsd.org/base/head/usr.bin/bluetooth/ . This may take years, but eventually it would be nice.

I've heard for a while that OpenBSD dropped Bluetooth version 1, because of complexities, and picking up on Version 4, which has improvements over previous versions, would be a better use of resources.


----------



## Snurg (Feb 22, 2018)

Current standard is Bluetooth 5.0.
It is very complex. The standard document consists of 2822 pages.

A good "short" introduction into current Bluetooth is the NIST Guide to Bluetooth Security.
It includes a good overview of the security issues of Bluetooth versions up to 4.2, and at the end of the document are plenty of interesting links.

I guess implementing this would necessitate a major donation from a big player, who would have interest in this being implemented.
Maybe something could be taken from Android.
Google has made that component completely open source.
And then it depends on whether this is possible with the stuff being Apache 2.0 licensed.


----------



## sidetone (Feb 23, 2018)

I didn't realize 5.0 came out. Version 4.0 would be practical as one that takes care of device versions 1 through 4. I see 5.0 in the future, but I'd like to see 4.0 as something that allows everyone to have easy access to it as inexpensive, and backward compatible.

https://www.bluetooth.com/~/media/files/specification/bluetooth-5-faq.ashx?la=en tells about the backward compatibility of Bluetooth 5. For Low Energy Bluetooth, Version 5 is only compatible with Bluetooth 4. Other Bluetooth devices starting at Version 1.1 will be compatible with a Bluetooth version 5 dongle.


----------



## sidetone (Feb 23, 2018)

I was thinking that there be a Bluetooth Version 4 driver for a dongle that supports all devices from versions 1 through 4. Then a Bluetooth driver split off and be for all Low Energy Bluetooth, including version 5. The end result would be two Bluetooth drivers a low energy driver, and a traditional driver, where both cover few dongle versions, but devices of all versions. Then these two drivers might have to work together on the same infrastructure, if one dongle is compatible with both types of Bluetooth protocols.


----------



## Oko (Feb 24, 2018)

sidetone said:


> The BSD community, not only FreeBSD, should look into supporting Bluetooth version 4 drivers.


OpenBSD had a support for Bluetooth technology but it was removed in part because it is super insecure technology and in part because nobody wanted to maintain it.

https://marc.info/?l=openbsd-misc&m=143766062911950&w=2

I wage $100 that OpenBSD will never again have a Bluetooth support.


----------



## Snurg (Feb 24, 2018)

Oko: This is the official reasoning for removing it:


> ... hackathon tradition of deleting a lotcode that most people probably never even knew existed. Say goodbye to ,,, bluetooth. Of these,you may possibly miss bluetooth support. Unfortunately, the current code doesn't work and isn't structured properly to encourage much future development.


Meanwhile, BlueZ supports 4.2 and probably will support 5.0 soon. But it is LGPL, so...


----------



## sidetone (Feb 24, 2018)

There were lots of flaws in Bluetooth 1 and 2. I said that OpenBSD dropped Bluetooth 1, because of complexities. (I was aware all Bluetooth support was dropped from it too). 4 is supposed to be better. I think OpenBSD will never have versions 1 through 3 again, but I'm not sure about 4, 5 or future versions. Even so, there are other OS'es that could use it.

I wouldn't mind a LGPL Bluetooth driver in ports, until if a BSD like one comes along.


----------



## sidetone (Feb 27, 2018)

Bluetooth Low Energy (BLE), which is only available for Bluetooth 4 and 5, is worked on in current:
https://svnweb.freebsd.org/base/head/usr.sbin/bluetooth/
https://svnweb.freebsd.org/base/head/sys/netgraph/bluetooth/

I remember Bluetooth 4 being backward compatible with drivers down to version 1. Bluetooth 5 is reverse compatible down to 1.1 (https://www.bluetooth.com/~/media/files/specification/bluetooth-5-faq.ashx?la=en), but there is already a 1.1 driver. I read (not through official sources) that version 1.2 on are more secure. 2.1 has device pairing that 2.0 doesn't have. Perhaps the 1.1 driver should be left as is. Traditional data rate drivers from Bluetooth 4 and 5 dongles should be for reverse compatibility of devices 2.1 on.

Aside from the existing drivers that are for up to 1.2, there should be two generic drivers: one for Bluetooth LE, and one for reverse compatibility for traditional data rate protocols from versions newer than 4 to be backward compatible down to 2.1.


----------



## Snurg (Mar 3, 2018)

sidetone said:


> ...  is worked on in current:


 Are you sure that more than exchanging the license was changed?
Shouldn't we vote for removal instead, like in OpenBSD?


----------



## sidetone (Mar 3, 2018)

Snurg said:


> Are you sure that more than exchanging the license was changed?


Snurg, I'm not sure. It does look like what you said.


Snurg said:


> Shouldn't we vote for removal instead, like in OpenBSD?


I wouldn't complain if all Bluetooth before 2.0 were removed, which is all there is. Bluetooth before 2.0 is obsolete anyway. I'd like to see devices compatible with Bluetooth 2.1 that use device pairing and on, from Bluetooth 4 and 5 dongles. Who knows, soon enough everyone will sell keyboards and other devices with Bluetooth 4.0 and on.


----------



## sidetone (Mar 4, 2018)

Possibly merged to stable, https://svnweb.freebsd.org/base/stable/11/usr.sbin/bluetooth/, and https://svnweb.freebsd.org/base/stable/11/sys/netgraph/bluetooth/, but I'm not sure. Most is 19 months old, and some is 3 months old.


----------



## Snurg (Mar 4, 2018)

sidetone, I wish you were right. But, take a look at the sources below here, and click "Blame"... you will be less happy.


----------

