aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/device.rs19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/device.rs b/src/device.rs
index 3b6cf46..960f698 100644
--- a/src/device.rs
+++ b/src/device.rs
@@ -69,8 +69,23 @@ impl Nitrokey {
command_id: CommandId,
data: &[u8],
) -> Result<[u8; 53], CommandStatus> {
- let _ = (command_id, data);
- Err(CommandStatus::UnknownCommand)
+ let _ = data;
+ match command_id {
+ CommandId::GetStatus => {
+ let mut data = [0u8; 53];
+ data[0] = 1; // firmware_version_st.minor
+ data[1] = 0; // firmware_version_st.major
+ data[2] = 0; // card_serial[0]
+ data[3] = 0; // card_serial[1]
+ data[4] = 0; // card_serial[2]
+ data[5] = 0; // card_serial[3]
+ data[6] = 0; // numlock
+ data[7] = 0; // capslock
+ data[8] = 0; // enable_user_password
+ data[9] = 0; // delete_user_password
+ Ok(data)
+ }
+ }
}
}