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

Build issues on MacOS caused in upstream dependency (fako1024/gatt) #2

Open
drj-e opened this issue Mar 14, 2022 · 13 comments · Fixed by #3
Open

Build issues on MacOS caused in upstream dependency (fako1024/gatt) #2

drj-e opened this issue Mar 14, 2022 · 13 comments · Fixed by #3
Assignees
Labels
bug Something isn't working

Comments

@drj-e
Copy link

drj-e commented Mar 14, 2022

Hi,
i wanted to play with my scale from felicita with your code. But i get this error:
pkg/felicita/felicita.go:38:3: undefined: gatt.LnxMaxConnections
pkg/felicita/felicita.go:39:3: undefined: gatt.LnxDeviceID (exit status 2)

I looked into your gatt module and could not find the variables LnxMaxConnections.

I am new to go language.

How can i fix my errors?

Thank You.

@fako1024
Copy link
Owner

Hi,

but sure it does (it's not a variable, it's a function): https://github.com/fako1024/gatt/blob/v1.0.0/option_linux.go#L27

Without further information I can't really say what the issue is, I'd need to know your setup and what exactly you tried to do that lead to the above error.

Cheers!

@drj-e
Copy link
Author

drj-e commented Mar 15, 2022 via email

@fako1024
Copy link
Owner

fako1024 commented Mar 15, 2022

That's probably the caveat here, since I never tried it on MacOS. I took over the gatt package a while ago from the initial maintainers after it went dead and got it to work on linux again (took only some minor fiddling), but since I don't use Mac I didn't even get the chance to look into that part of the code. I'll give it a shot and try to at least figure out the compilation issue using Docker (because tbh it shouldn't even hit the _linux files when compiling on Darwin, so this error message is at least confusing), but even if I get that to work I can't at all guarantee that the whole bluetooth stack will be accessible / working, so you'd be on your own regarding that. But I'll be more than happy to take PRs...

@fako1024 fako1024 self-assigned this Mar 15, 2022
@fako1024 fako1024 added the bug Something isn't working label Mar 15, 2022
@fako1024 fako1024 changed the title i get this error Build issues on MacOS caused in upstream dependency (fako1024/gatt) Mar 16, 2022
@drj-e
Copy link
Author

drj-e commented Mar 16, 2022 via email

@drj-e
Copy link
Author

drj-e commented Mar 16, 2022 via email

@fako1024 fako1024 linked a pull request Mar 17, 2022 that will close this issue
@fako1024 fako1024 reopened this Mar 17, 2022
@fako1024
Copy link
Owner

First of all: The build on MacOS should be fixed now on master and with the new tag / release v1.0.1, so you should be able to give the examples a go without running into build issues at least.

As for your question: Unfortunately there's no official (or semi-official) documentation on the byte format, so I had to reverse engineer most of it. AFAIK bytes 12 and 13 are unused / reserved (at least I couldn't identify any usage for it). There's a few people that interfaced with the scale in the scope of different projects (e.g. https://github.com/nrontsis/OhMyShot/blob/main/OhMyShot!/Hardware/felicita_interface.swift), but they don't seem to access those fields either, so at least the data doesn't hold anything critical and probably can safely be ignored.

Let me know if your build succeeds with the newest release please (and, if you like, if you can successfully access the scale under MacOS).

@drj-e
Copy link
Author

drj-e commented Mar 17, 2022 via email

@fako1024
Copy link
Owner

Your post is missing all the output, can you please add it? If the result is the same then you're maybe not on the current master branch (because the issue is fixed as per the build pipeline, I even added Darwin / MacOS specific tests). Can you please also outline the exact steps you have taken? What is the output of go build ./... from the main repository path right after a fresh git lone of the repository?

@drj-e
Copy link
Author

drj-e commented Mar 17, 2022 via email

@fako1024
Copy link
Owner

Thanks, those details helped a lot. I'll investigate asap, unfortunately GitHub is currently degraded (https://www.githubstatus.com/) and I can't even run any workflows to test... 😭 - I'll keep you posted.

@drj-e
Copy link
Author

drj-e commented Mar 17, 2022 via email

@fako1024
Copy link
Owner

No worries, and thanks for the support. I'll try to get my hands on a MacBook in the next days to actually try to connect to my Felicita scale and properly test it. In the meantime maybe you could give it another try on the current master branch, I've added a few more upstream changes that should hopefully fix the crashes. Might still not connect to the actual scale, but at least build properly now. Thanks a lot!

@drj-e
Copy link
Author

drj-e commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants