weliem / bluez_inc

A C library for Bluez (BLE) that hides all DBus communication. It doesn't get easier than this. This library can also be used in C++.
MIT License
84 stars 19 forks source link

Can this library work on QCS404DK board? #15

Closed IHNEL closed 7 months ago

IHNEL commented 11 months ago

I run the peripheral code on the QCS404DK board but couldn't register the advertisement as attached log below, everything is working fine on Ubuntu 22.04. The QCS404DK board also runs Linux (see the output of uname -a:

/ # uname -a Linux nf-64 4.14.117-perf #1 SMP PREEMPT Mon Jan 4 17:55:28 CST 2021 aarch64 aarch64 aarch64 GNU/Linux

2021-01-04 09:50:45:311 DEBUG [Adapter] finding adapters
2021-01-04 09:50:45:315 DEBUG [Adapter] found 1 adapter
2021-01-04 09:50:45:315 DEBUG [Main] using default_adapter '/org/bluez/hci0'
2021-01-04 09:50:45:315 DEBUG [Main] Power status = 1
2021-01-04 09:50:45:316 DEBUG [Main] Adapter name: hci0
2021-01-04 09:50:45:327 DEBUG [Application] successfully published application
2021-01-04 09:50:45:327 DEBUG [Application] successfully published local service 00001809-0000-1000-8000-00805f9b34fb
2021-01-04 09:50:45:327 DEBUG [Application] successfully published local characteristic 00002a1c-0000-1000-8000-00805f9b34fb
2021-01-04 09:50:45:328 DEBUG [Application] successfully published local descriptor 00002901-0000-1000-8000-00805f9b34fb
2021-01-04 09:50:45:328 DEBUG [Application] set value <68656c6c6f20746865726500> to <00002901-0000-1000-8000-00805f9b34fb>
2021-01-04 09:50:45:328 DEBUG [Adapter] failed to register advertisement (error 19: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Unknown method 'RegisterAdvertisement' or interface 'org.bluez.LEAdvertisingManager1'.)
2021-01-04 09:50:45:332 DEBUG [Adapter] failed to register application (error 19: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Unknown method 'RegisterApplication' or interface 'org.bluez.GattManager1'.)
weliem commented 10 months ago

It looks like you are on an old version of Bluez. Try upgrading to the latest version.

IHNEL commented 10 months ago

hi Weliem, which is the minimum Bluez version to make this library works?

weliem commented 10 months ago

it depends a bit on which functions you use. Bluez is still changing with every version and adding new features. Try Bluez 5.65 or higher