-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use this library for Bluetooth intermediate communication #56
Comments
This library provides the required interfaces to interact with Linux bluez bluetooth stack using DBus. There are some usage samples here: or take a look at other projects utilizing bluez-dbus: |
I see that these codes depend on dbus-java-core, but the java version I use is 8. It seems that there is no 3. x version of dbus-java-core for me to reference. What should I do |
The latest currently available release in maven central is 0.1.4 which uses dbus-java 3.3 and is still compatible with Java 8. But anyways, I would highly recommend to stop using ancient no longer supported Java versions as they may contain bugs and/or security issues which will not be fixed. |
Okay, I'll try |
My Bluetooth device can't find any service after it is connected, but the mobile phone debugging tool can connect normally and see the corresponding uuid. Why? Can you help me see it? Thank you
|
selectedDevice.getGattServices().size() = 0 |
Please check if bluez/dbus is seeing the device and the services it provides correctly. If you cannot see anything in d-feet or blueman, you will never see it when using bluez-dbus. |
Do you see it when using d-feet? |
I execute the program on nanopi. There is no operation interface and I can't use d-feet. Is there any other way |
This can also be done using dbus-send if you know the correct pathes.
This should list all known pathes. The connected device should look like: |
|
Is this result normal |
This is the regular output. When you connect to the device C0:BF:19:42:74:BF there should be more data including the gatt services. |
The output is the same after the connection |
Did you 'pair' the devices?
Which defines a GATT service. If you get this, you will also be able to access it using bluez-dbus. |
I don't see the GATT service, no pair. The devices I connect to don't need to be paired. They can be connected directly. The mobile phone Bluetooth debugging tool (nRF Connect) can connect to this device normally and send and receive data |
I know that this is usually not required when using BLE, but with bluez you have to: From bluez documentation regard 'pair' method: This method will connect to the remote device, |
There will be errors when pair in the code
|
I can successfully operate pair directly in Linux, but I still can't see the gatt service you said by using the previous command to view the data. It's painful |
I didn't invent bluez - but it is the bluetooth implementation used on Linux. I can't help you with your specific problem, because I don't know what device you want to use and I'm pretty sure that I also don't have the same device for testing. |
Thank you very much for your patience. I have determined that it is a hardware problem. Now I can successfully obtain the gatt service |
How to use this library for Bluetooth intermediate communication
I have little contact with this area at ordinary times. I need this content in my recent work. I don't see any communication related code in the code. Could you please give me some advice? Thank you very much.
The text was updated successfully, but these errors were encountered: