Skip to content

Conversation

@joserebelo
Copy link
Contributor

@joserebelo joserebelo commented Jul 18, 2023

Add a simple command to get the current process.env.

This should allow us to display the firmware and hardware versions on Gadgetbridge, as well as toggle features that are only available in the Bangle.js 2 (eg. Screenshots).

Additionally, include whether the Bangle is currently programmable, as that might be require for some features that execute js directly.

Used in https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3213

@gfwilliams
Copy link
Member

Maybe we could just make the Bangle send the info automatically on connection? We should totally filter the data we send as well to just what's required - I just checked and it's 300 bytes which would really impact the connection speed.... We already send battery+force_caledar_sync on every connection so adding a little more data wouldn't be a big deal. https://github.com/espruino/BangleApps/blob/master/apps/android/boot.js#L254-L257

I also spotted that we do already handle the version info being sent in Gadgetbridge by the look of it? https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/master/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java#L522-L526

@joserebelo
Copy link
Contributor Author

Maybe we could just make the Bangle send the info automatically on connection?

I'm not used to being able to control the watch-side of the code :) this is definitely a better idea.

@joserebelo joserebelo changed the title android: Add env command to get process.env android: Send fw, hw and repl status on connection Jul 22, 2023
@joserebelo joserebelo changed the title android: Send fw, hw and repl status on connection android: Send fw and hw on connection Jul 25, 2023
@gfwilliams
Copy link
Member

Great - thanks! Please can you bump the version in the metadata and put a line in the changelog and I'll merge it?

@joserebelo
Copy link
Contributor Author

Done.

@gfwilliams one last question before merging this - I do not currently have a use for the fw version on the Gadgetbridge side, other than displaying it. Do you think it's still worth it to send on every connection, or should we just get Gadgetbridge to query the hw version on-connection, if unknown? (should only happen once, and never change).

I am not too familiar with the limitations of the original Bangle, so I'd prefer to impact it as little as possible :)

If sending on every connection is not really a concern for you, I think this is fine to merge.

@gfwilliams
Copy link
Member

Yes, I think sending it is fine - it's probably maybe 10 chars extra or something like that, so not a big deal - and it's handy for users to be able to see anyway.

@gfwilliams gfwilliams merged commit 89908d7 into espruino:master Aug 7, 2023
@joserebelo joserebelo deleted the env branch August 7, 2023 13:26
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.

3 participants