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

android - Handle GPS events from Gadgetbridge instead of connection events #2534

Merged
merged 10 commits into from May 24, 2023

Conversation

halemmerich
Copy link
Collaborator

I had a go at using the GPS events from GadgetBridge as soon as they arrive. This removes the need to handle connection events and fixes GPS not working if for some reason (e.g. config) GadgetBridge never sends an GPS event or stops sending them.

@halemmerich halemmerich marked this pull request as ready for review February 19, 2023 20:01
@halemmerich halemmerich marked this pull request as draft February 23, 2023 18:15
@halemmerich
Copy link
Collaborator Author

There seems to be a condition, where GB GPS stays active sending GPS positions, but the bangle side stops reacting, will have look at that before merging. Disconnecting from GB fixed it, so not that easy to diagnose. Logcat showed the Bangle not reacting at all which is a bit strange since I currently have some prints in there.
@gfwilliams Is it possible to send commands through GB to the connected Bangle? Maybe attach a debugger to GB?

@gfwilliams
Copy link
Member

Very strange... It is possible to send commands via Android intents - or yes you could debug and then call the relevant functions in BanglejsSupport.

Another option is you could ask it to use a custom App Loader which you could then add the ability to send/receive data into.

@halemmerich
Copy link
Collaborator Author

Should be fixed in https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3132. I'm waiting and testing until that is merged before marking this as ready.

@halemmerich
Copy link
Collaborator Author

I have now used this successfully for a few days of hiking. With the current nightly version of GB containing
https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3132 I could not get it to break using the metal box method.

@halemmerich halemmerich marked this pull request as ready for review May 24, 2023 07:08
@gfwilliams
Copy link
Member

That's great - thanks! I've just pushed a new Gadgetbridge version to the play store which has your PR in it, so this should be good now.

@gfwilliams gfwilliams merged commit d958969 into espruino:master May 24, 2023
1 check passed
@halemmerich halemmerich deleted the gbgps branch May 24, 2023 16:47
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

Successfully merging this pull request may close these issues.

None yet

2 participants