|
When I use the icon it wants ...optical disk FILE
|
|
|
|
|
This is part of README file included in BlueZ.
Here is a part I am not sure about.
Could somebody please translate this techno-talk to plain English (talk ) ?
For a working system, certain configuration options need to be enabled:
Of course I want working system
--enable-library
Enable installation of Bluetooth library
What is the name of this library and where is it going to be installed ?
Installed by configure itself or make / make install?
By default the Bluetooth library is no longer installed.
The user interfaces or command line utilities do not
require an installed Bluetooth library anymore. This
option is provided for legacy third party applications
that still depend on the library.
When the library installation is enabled, it is a good
idea to use a separate bluez-library or libbluetooth
package for it.
Any suggestion HOW to do the above highlighted text ?
Build a NEW packages??
|
|
|
|
|
You'll probably get better results if you direct your questions to the bluez user mailing list. While people here can answer questions of a general nature, specific questions relating to a specific package are, I think, outside of the intended scope of this forum. That doesn't mean that someone with related experience won't respond just because its out of scope (though that might be the case), but those with the information you seek are more likely to be in the user-group/mailing lists for that package.
|
|
|
|
|
I agree with k5054, and have already suggested you go to the Bluez site. While I have a reasonable knowledge of Linux, configurable packages, compiling and linking etc., all your questions are specific to Bluez. And I (and I guess k5054) have no experience of this package or how it is put together.
|
|
|
|
|
I guess .NET does some things better than Linux.
Had Windows 10 talking to a Lego "brick" (EV3) using Bluetooth, USB and TCP/IP in less than an hour.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
This is a linker question.
Could somebody help me to decode this linker verbose output to find WHERE is the " linked to" option actually located.
Building target: BLUE2_LINUX_19381
Invoking: GCC C++ Linker
g++ -v -o "BLUE2_LINUX_19381" ./src/BLUE.o -lbluetooth
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.11' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'BLUE2_LINUX_19381' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccFV22zV.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o BLUE2_LINUX_19381 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. ./src/BLUE.o -lbluetooth -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
Finished building target: BLUE2_LINUX_19381
08:15:26 Build Finished. 0 errors, 1 warnings. (took 2s.946ms)
I did try this and cannot find it:
jim@jim-desktop:~$ sudo find /usr -type f -name "bluetooth.*"
[sudo] password for jim:
/usr/share/help-langpack/en_GB/ubuntu-help/bluetooth.page
/usr/share/help-langpack/cs/ubuntu-help/bluetooth.page
/usr/share/help-langpack/cs/gnome-help/bluetooth.page
/usr/share/help-langpack/en_AU/ubuntu-help/bluetooth.page
/usr/share/help-langpack/en_CA/ubuntu-help/bluetooth.page
/usr/share/man/man1/bluetooth.1.gz
/usr/share/icons/Humanity/apps/22/bluetooth.svg
/usr/share/icons/Humanity/apps/48/bluetooth.svg
/usr/share/icons/Humanity/apps/24/bluetooth.svg
/usr/share/icons/HighContrast/48x48/apps/bluetooth.png
/usr/share/icons/HighContrast/16x16/apps/bluetooth.png
/usr/share/icons/HighContrast/22x22/apps/bluetooth.png
/usr/share/icons/HighContrast/24x24/apps/bluetooth.png
/usr/share/icons/HighContrast/32x32/apps/bluetooth.png
/usr/share/icons/HighContrast/256x256/apps/bluetooth.png
/usr/share/app-install/icons/bluetooth.svg
/usr/share/help/C/ubuntu-help/bluetooth.page
/usr/share/help/C/gnome-help/bluetooth.page
/usr/share/plainbox-provider-checkbox/jobs/bluetooth.txt.in
/usr/include/bluetooth/bluetooth.h
/usr/src/linux-headers-4.15.0-45/include/net/bluetooth/bluetooth.h
/usr/src/linux-headers-4.15.0-46/include/net/bluetooth/bluetooth.h
jim@jim-desktop:~$ sudo find /usr -type f -name "bluetooth.a"
jim@jim-desktop:~$
I am trying to figure out how BlueZ is actually used , so I did purge Bluez.
There is no package "Bluez".
Before that I fully configured Bluez - and I added enable-library to the configuration.
I did not even run make make install and tested my app and it run with the -lbluetooth linker option.
It appears the "bluetooth" library was build by running BlueZ -> configure and "purge Bluez" won't delete it.
I like to prove this by deleting it manually, but need to know where it is.
There is no package "Bluez".
But my test app still compiles / links and runs.
Thanks
|
|
|
|
|
Not sure exactly what your question is, but "make clean" should purge all the generated objects. To be honest you may get better answers at The BlueZ website[^]; that's where the knowledge is likely to be.
This is the key:
g++ -v -o "BLUE2_LINUX_19381" ./src/BLUE.o -lbluetooth
A pre-linker is creating a new library object called BLUE2_LINUX_19381 , which you can see later being included in the main link process.
|
|
|
|
|
Richard,
that is my base site , however, I have not figured out if there is a "forum" for geeks like me.
All I see is "developers" access.
I'll try it again.
|
|
|
|
|
On the contact page there's link to the mailing list in the "community for the end users" section.
|
|
|
|
|
As has been explained before, -lbluetooth tells the linker to look for a library file named either libbluetooth.so or libbluetooth.a. Your find doesn't find it because -name option uses standard file globbing so -name "bluetooth.*" wont find any files that look like .../libbluetooth.a . You need to use -name "libbluetooth.*" , or -name "*bluetooth.*"
I think you said you had built and installed bluez from source. Unless you changed the installation location, it probably put the libraries under /usr/local. When you purged bluez (I'm assuming you mean the command apt-get delete --purge bluez ), that will only remove the packages installed by apt. Any packages you built and installed yourself will not be touched (unless you deliberately configured the package to overwrite the system packages).
|
|
|
|
|
Not exactly. No "apt-get".
The README instructions with BlueZ are
1. run "configure" and then
2. run "make && make install".
Their default "configure " is this:
jim@jim-desktop:/media/jim/DEV/BLUEZ/bluez-5.50$ ./configure --prefix=/usr \
> --sysconfdir=/etc \
> --localstatedir=/var \
> --enable-library \
> --disable-systemd &&
> make
I did added the "enable-library" but apparently it is not needed.
And I do not know the actual name of it , but the liker likes it.
So the /usr is the base directory and "*bluetooth*" should be there.
I'll run make && make install to verify the "BlueZ" package , again.
I'll will be adding --host= (ARM) later so I really need to know what is happening with "install library". I could end up with two "bluetooth.a" for two architectures...messy
|
|
|
|
|
using --prefix=/usr put all the generated files in /usr. If you still have your build directory, you should be able to remove everything with using make uninstall . If you've already deleted your build directory, then unpack the source again, re-run configure as you did before, then run make uninstall . Note that installing into /usr means that you've overwritten anything that apt installed previously, so you might end up with the apt thinking thinking that some of its files have gone missing. If you plan to build a cross-compilation library DO NOT USE --prefix=/usr. That will overwrite the X86 executables, libraries, etc with the ARM versions, which will lead to further pain on your part. If you still want to create a cross-compile bluez instalation, use --prefix=/usr/local/arm --sysconfdir=/usr/local/arm/etc --localstatedir=/usr/local/arm/var . Of course, you can use any path you wish in place of "/usr/local/arm", just not "/usr" or "/", as that will overwrite your X86 system files.
|
|
|
|
|
Am I correct to say that /usr is a common Linux directory ,used by other applications?
So I should be able to "insert " another directory - such as --prefix=/usr/X86 for the X86 architecture and --prefix =/usr/ARM for the ARM?
Such as you suggested using /usr/local/arm....?
What would be the advantage of inserting ../local/ ..?
I should take a look at "configure prefix".
|
|
|
|
|
There's no reason you can't use /usr/X86 and /usr/ARM, if that's your wish, its not likely to cause problems for your linux system. In general, though, its a convention, nothing more, to put user-compiled software in /usr/local. If you run .configure for most software packages they default to --prefix=/usr/local. I suggested /usr/local/arm as that fits in with the accepted convention. Ultimately, you have root permissions, and can put things where you like. The one caveat, though, is if you put things in /[bin|lib], or /usr/[bin|lib] you run the risk of a) making your system unusable due to overwriting system provided executables or libraries with incompatible version and b) having your executables and libs reverted back to OS versions when updating software. For me, I think I'd put anything new I compiled for the X86 in /usr/local, as the compiler and linker will search /usr/local/include and /usr/local/lib, without having to add -I/usr/local/include or -L/usr/local/lib to compilation commands. I think /usr/local/arm or /usr/local/pi seems a reasonable location to put the ARM versions.
|
|
|
|
|
Another thing: If you have a successful compile/link AND you're linking shared libraries (.so), you can find out which version of the library will be used using the ldd command
e.g
rpi:~$ ldd /usr/bin/find
linux-vdso.so.1 (0x7eff1000)
/usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76f53000)
libselinux.so.1 => /lib/arm-linux-gnueabihf/libselinux.so.1 (0x76f0c000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76e8d000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76d4e000)
/lib/ld-linux-armhf.so.3 (0x76f69000)
libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0x76cd5000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76cc2000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76c99000)
|
|
|
|
|
Nice , but now I know which library was build by package and thatit the one linker will use so I do not have to search for it.
|
|
|
|
|
I am beginning to wonder if Linux "Open (source) " is really beneficial.
The following code snippet just stops executing, and I get no perror.
I like to analyze the source code for "hci_inquiry" function to get some idea way it is failing.
num_rsp = hci_inquiry(dev_id, len, max_rsp, NULL, &ii, flags);
if (num_rsp < 0)
perror("Error: hci_inquiry");
.
I have found numerous versions / copies of BlueZ docs with this preamble
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2000-2001 Qualcomm Incorporated
* Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
* Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
*
*
MOST of them lack comments describing the function I am after.
My question to forum users :
Which Linux resource , in general , is most likely to be updated and best documented?
Github?
|
|
|
|
|
Vaclav_ wrote: Which Linux resource , in general , is most likely to be updated and best documented? The one that is. Seriously, the only way to find out is to look at them all. My idea of 'best' may not tally with yours.
|
|
|
|
|
|
This is not a question , just sort of FYI if anybody cares.
Instead of futzing with crosscomplier I have decided to build a local bluetooth application.
I have purged "bluez" from my X86 system.
I have left the "-lbluetooth" linker option intact.
I can compile / link and run the app and get expected errors from accessing basic stuff - such as
dev_id = hci_get_route(NULL); if (dev_id < 0) {
perror("Bluetooth device not found"); }
Next I'll be reinstalling / configuring / make / make install "bluez" , again.
In theory that should get rid of most of the errors without touching the "-lbluetooth" option.
|
|
|
|
|
The following TEST snippet works just fine, however, since the "hci_inquiry" itself generate the expected perror why does the code continues to run and not exiting AFTER "hci_inquiry"?
It does exits AFTER the last test of num_rsp, as expected.
num_rsp = hci_inquiry(dev_id, len, max_rsp, NULL, &ii, flags);
if( num_rsp < 0 ) perror("Error: hci_inquiry");
if( num_rsp < 0 ) perror(NULL);
Here is the expected output:
Error: hci_inquiry: No such device
No such device
hci_inquiry: No such device
|
|
|
|
|
|
Sorry ,but how does that answer my question about exiting after perror?
I do not see anything indicating it should exit.
|
|
|
|
|
Take another look, it tells you exactly what perror does in the description: Quote: The perror() function produces a message on standard error describing
the last error encountered during a call to a system or library
function.
|
|
|
|
|
After reading this resource www.bluez.org I am trying to figure out how or if it is possible to control implementation of “libbluetooth-dev” on selected architecture.
The “bluez” README suggest some options, but after downloading and scanning thru “configure” file itself I am not sure where to find “configure” dependency on underlying architecture.
The “configure” is several hundred pages long and to be honest - I am little lost where to start.
I also checked this http://www.linuxfromscratch.org/blfs/view/8.3/general/bluez.html but it did not help me.
Any suggestion to accomplish the task will be appreciated.
PS
At present I hesitate to download the “configure” file here – it is too big.
Cheers
Vaclav
Addendum
I think this will answer my question
Cross Compiling BlueZ Bluetooth tools for ARM - BeyondLogic[^]
wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.18.tar.xz
tar -xJf bluez-5.18.tar.xz
cd bluez-5.18
./configure --host=arm-linux-gnueabi --prefix= PKG_CONFIG_PATH=/usr/arm-linux-gnueabi/lib/pkgconfig --disable-systemd --disable-udev --disable-cups --disable-obex --enable-library
make
make install DESTDIR=/usr/arm-linux-gnueabi
make install DESTDIR=/home/export/rootfs
modified 6-Mar-19 18:17pm.
|
|
|
|