Skip to content
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

gattlib_adapter_scan_enable() must be called first for gattlib_connect() to work. #287

Open
tvonderhaar opened this issue Nov 13, 2024 · 0 comments

Comments

@tvonderhaar
Copy link

I have modified the Owon multimeter program "owonb35.c" from:

https://github.com/DeanCording/owonb35

to work with the current gattlib version (0.7.2). The original code could connect to the device without doing a scan first by supplying the known device address to "gattlib_connect()". The original code "owonb35.c" was written 6 years ago and it appears gattlib has changed significantly since then. All the gattlib examples that work connect through the "gattlib_adapter_scan_enable() " call back.

The error returned from "gattlib_connect()" is "invalid parameter" when no scan is performed first. If a scan is performed first than no error occurs. Must a scan be performed before calling "gattlib_connect()" or is there a bug in the current gattlib library?

Also, the "owonb35.c" code attempts a scan retry every 2 seconds if a scan fails. It calls "gattlib_adapter_scan_disable()" before calling "gattlib_adapter_scan_enable()" on retries. On the second retry scan "gattlib_adapter_scan_disable()" fails with the unknown gattlib error code "0X1000C524". Is this also a bug?

There is no documentation I can find describing the overall architecture of gattlib. Some documentation describing what functions must be called before others can be called would be useful(ex. "gattlib_adapter_open()" needs to be called before before calling "gattlib_adapter_scan_disable()".) The sphinx and doxygen docs contain very minimal information.

Thanks,
Tom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant