use super::{Command, Response};
use {Adapter, Algorithm, CommandType, Session, SessionError};
pub fn device_info<A: Adapter>(
session: &mut Session<A>,
) -> Result<DeviceInfoResponse, SessionError> {
session.send_command(DeviceInfoCommand {})
}
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct DeviceInfoCommand {}
impl Command for DeviceInfoCommand {
type ResponseType = DeviceInfoResponse;
}
#[derive(Serialize, Deserialize, Debug)]
pub struct DeviceInfoResponse {
pub major_version: u8,
pub minor_version: u8,
pub build_version: u8,
pub serial_number: u32,
pub log_store_capacity: u8,
pub log_store_used: u8,
pub algorithms: Vec<Algorithm>,
}
impl Response for DeviceInfoResponse {
const COMMAND_TYPE: CommandType = CommandType::DeviceInfo;
}