aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index cb678d7..9b9de3c 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -83,6 +83,17 @@ impl convert::TryFrom<Config> for RawConfig {
}
}
+impl From<&nitrokey_sys::NK_status> for RawConfig {
+ fn from(status: &nitrokey_sys::NK_status) -> Self {
+ Self {
+ numlock: status.config_numlock,
+ capslock: status.config_capslock,
+ scrollock: status.config_scrolllock,
+ user_password: status.otp_user_password,
+ }
+ }
+}
+
impl From<[u8; 5]> for RawConfig {
fn from(data: [u8; 5]) -> Self {
RawConfig {