-
Notifications
You must be signed in to change notification settings - Fork 261
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
Structured TOTP watch face #369
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Aggregates all the data necessary for TOTP generation.
Generates a compound initializer for the given TOTP parameters. Lessens repetition and allows functional definitions of TOTP records.
The data definitions are much shorter and easier to read now.
Computes the size of the array of TOTP records. The compiler will likely evaluate it at compile time.
Selects the appropriate TOTP data structure given the TOTP watch face state.
Using the new structured TOTP record data structure allows the TOTP watch face to statically and implicitly compute the total number of defined TOTP records. Users can now simply add new keys and records in the designated area and the watch face will compile and automatically use them with no need to maintain a separate array size variable. Less chance of mistakes.
The TOTP watch face now keeps track of each key separately. There is no need to compute offsets at runtime.
Update the copyrights to include full name attribution to all who contributed to this watch face, including myself. Also add an SPDX license identifier header comment to the files. https://spdx.org/licenses/MIT.html
cc7df99
to
1c0050c
Compare
This allows the user to easily copy the base32 encoded secrets into the TOTP record initializers. They will be decoded once at runtime when the face is being set up by the movement framework. Also rename the array of TOTP records to credentials. Much better.
It now generates the string literal from the preprocessor token. Even warns the user if the string is too long!
Shorter and far more expressive.
461f5a5
to
238709e
Compare
Makes for cleaner symbols.
matheusmoreira
added a commit
to matheusmoreira/sensor-watch
that referenced
this pull request
Mar 5, 2024
Aggregates the TOTP credentials into a data structure, making it easier to define and use the credentials. Also incorporate backwards movement code from another branch. Co-authored-by: Max Zettlmeißl <max@zettlmeissl.de> Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> GitHub-Pull-Request: joeycastillo#369 GitHub-Related-Pull-Request: joeycastillo#356
matheusmoreira
added a commit
to matheusmoreira/sensor-watch
that referenced
this pull request
Mar 5, 2024
Aggregates the TOTP credentials into a data structure, making it easier to define and use the credentials. Also incorporate backwards movement code from another branch. Co-authored-by: Max Zettlmeißl <max@zettlmeissl.de> Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> GitHub-Pull-Request: joeycastillo#369 GitHub-Related-Pull-Request: joeycastillo#356
matheusmoreira
added a commit
to matheusmoreira/sensor-watch
that referenced
this pull request
Mar 5, 2024
Aggregates the TOTP credentials into a data structure, making it easier to define and use the credentials. Also incorporate backwards movement code from another branch. Co-authored-by: Max Zettlmeißl <max@zettlmeissl.de> Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> GitHub-Pull-Request: joeycastillo#369 GitHub-Related-Pull-Request: joeycastillo#356
matheusmoreira
added a commit
to matheusmoreira/sensor-watch
that referenced
this pull request
Mar 5, 2024
Aggregates the TOTP credentials into a data structure, making it easier to define and use the credentials. Also incorporate backwards movement code from another branch. Co-authored-by: Max Zettlmeißl <max@zettlmeissl.de> Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> GitHub-Pull-Request: joeycastillo#369 GitHub-Related-Pull-Request: joeycastillo#356
matheusmoreira
added a commit
to matheusmoreira/sensor-watch
that referenced
this pull request
Mar 5, 2024
Aggregates the TOTP credentials into a data structure, making it easier to define and use the credentials. Also incorporate backwards movement code from another branch. Co-authored-by: Max Zettlmeißl <max@zettlmeissl.de> Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> GitHub-Pull-Request: joeycastillo#369 GitHub-Related-Pull-Request: joeycastillo#356
Seems to be working well on real hardware. No issues so far. |
matheusmoreira
added a commit
to matheusmoreira/sensor-watch
that referenced
this pull request
Mar 8, 2024
Aggregates the TOTP credentials into a data structure, making it easier to define and use the credentials. Also incorporate backwards movement code from another branch. Co-authored-by: Max Zettlmeißl <max@zettlmeissl.de> Tested-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> Tested-on-hardware-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> GitHub-Pull-Request: joeycastillo#369 GitHub-Related-Pull-Request: joeycastillo#356
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improves the standard TOTP watch face by making it easier to define new secrets. Aggregating the TOTP data into a structure allows simple and functional definition of new instances with an initializer generator macro. This also makes the size and offset variables superfluous and so they are removed.