The Raspberry Pi 3 model B has inbuilt Bluetooth, using BlueZ stack. I want to know in which language the stack is written, Python or C?
-
As Adam observes different components of a software stack can be implemented in different languages, but with most OS's including linux, for anything to do with hardware the lowest level(s) are going to be in C and asm. – goldilocks♦ Jul 11 '16 at 18:21
The source code is written in C. Look at the BlueZ download site, and follow the links to the source code on github
Source code is also available in the GIT repositories at kernel.org.
The GIT repositories on kernel.org contain the source files. Taking one at random, i.e., a/src/gatt-database.c b/src/gatt-database.c, you can see that it is written in C.
Like @greenonline says, Bluez is written in C, but the newer code base allows for interactions with Bluez through their DBus API
. Much of the example code is written in Python
and is a bit more accessible than the C code.
If you look in the test/
folder of the GIT Repo lots of the examples are written in Python (The executable files don't have the .py extension, but are just python scripts). Overall documentation is very sparse, but I've found that folder is a decent starting place for interacting with Bluez. Just keep in mind that you will need to run bluetoothd
with the -E
to use the DBus API as it's still experimental, you will also need to compile with the experimental code enabled.
Linux and GNU are both open source.
This means that the source code is freely available.
Go to the Raspbian repository and look at the source code for any package in which you are interested.