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

Add protocol 6 Time class #267

Merged
merged 6 commits into from
Feb 27, 2023
Merged

Add protocol 6 Time class #267

merged 6 commits into from
Feb 27, 2023

Conversation

synthead
Copy link
Owner

@synthead synthead commented Feb 27, 2023

Closes #257!

This PR adds Protocol6::Time, the Time class used for the Motorola Beepwear Pro!

This one was a bit tricky: this watch's protocol cares a lot about time zones. In the other protocols, there are "time zone names," which typically presents itself as PDT, UTC, etc., but it can be any three-character label you'd like. Other than that, the time zone is not considered when actually setting the time on the watch.

In protocol 6 for the Beepwear Pro, when you set the time, you also set the time zone. When the time zone is in daylight savings, the non-DST zone is still used, and the hour is literally advanced by one in time data. There is also the ability to enable FLEXtime, which will set your time for you from the FLEX network, and it can also set the time zone and adjust for daylight savings automatically, if you wish.

When FLEXtime is enabled, the year, month, day, day of week, hour, minute, and second values are all set to zero. With the automatic DST adjustment on, the date format value increases by 8. My guess is that Timex and Motorola repurposed the unused bit in this value for this feature.

Protocol 6 also uses a unique character set, so this was added in this PR to make Time behave correctly. I added all the characters that were able to be selected when setting the time zone name manually.

@synthead synthead self-assigned this Feb 27, 2023
@synthead synthead added enhancement New feature or request protocol 6 Specific to protocol 6 labels Feb 27, 2023
@synthead synthead marked this pull request as ready for review February 27, 2023 02:10
@synthead synthead merged commit 018a28c into main Feb 27, 2023
@synthead synthead deleted the add-protocol-6-time branch February 27, 2023 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request protocol 6 Specific to protocol 6
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Time Of Day settings for protocol 6
1 participant