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

It is not required to keep a valid password #6

Open
samuelfmlourenco opened this issue Dec 1, 2024 · 0 comments
Open

It is not required to keep a valid password #6

samuelfmlourenco opened this issue Dec 1, 2024 · 0 comments
Assignees
Labels
invalid This doesn't seem right

Comments

@samuelfmlourenco
Copy link
Member

samuelfmlourenco commented Dec 1, 2024

Currently, the last valid password (when inserted by the user) is kept by the variable "validPassword", and used when a password change is not required. However, the MCP2210 already provides a mechanism that allows the previous password to be kept without having to know about it. Basically, MCP2210::writeNVChipSettings() can accept an empty string as a password, and the MCP2210 itself will preserve the previous password by using that. In the datasheet, see table 3-1, note 1, which states the following:

When the password does not need to change, this field must be filled with 0 (it applies to (byte index 19 to 26).

An empty password string is internally treated as a series of eight zeros (because MCP2210::hidTransfer() pads the command data with zeros), which satisfies the requisites above. Therefore, "validPassword" is not needed and should even be removed.

@samuelfmlourenco samuelfmlourenco added the invalid This doesn't seem right label Dec 1, 2024
@samuelfmlourenco samuelfmlourenco self-assigned this Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant