Skip to content

Instantly share code, notes, and snippets.

@martijnberger
Created September 16, 2021 19:23
Show Gist options
  • Save martijnberger/4cb7f60653cc85ef9fd78cc3eeb3c16a to your computer and use it in GitHub Desktop.
Save martijnberger/4cb7f60653cc85ef9fd78cc3eeb3c16a to your computer and use it in GitHub Desktop.
diff --git a/provisioning/src/tasks/camera_configuration/mod.rs b/provisioning/src/tasks/camera_configuration/mod.rs
index 713b249..c7b7c53 100644
--- a/provisioning/src/tasks/camera_configuration/mod.rs
+++ b/provisioning/src/tasks/camera_configuration/mod.rs
@@ -19,14 +19,14 @@ use configure_video_drivers::ConfigureVideoDrivers;
use configure_wifi::ConfigureWifi;
pub fn get_ssd_configuration_task() -> Vec<Box<dyn Task>> {
- vec![Box::from(ConfigureSsd {})]
+ vec![/*Box::from(ConfigureSsd {})*/]
}
pub fn get_system_configuration_tasks() -> Vec<Box<dyn Task>> {
vec![
Box::from(ConfigureWifi {}),
- Box::from(ConfigureAudioDrivers {}),
- Box::from(ConfigureVideoDrivers {}),
+ //Box::from(ConfigureAudioDrivers {}),
+ //Box::from(ConfigureVideoDrivers {}),
Box::from(ConfigureHostname {}),
]
}
diff --git a/provisioning/src/types/hardware_type.rs b/provisioning/src/types/hardware_type.rs
index 755230a..ebcc872 100644
--- a/provisioning/src/types/hardware_type.rs
+++ b/provisioning/src/types/hardware_type.rs
@@ -12,6 +12,7 @@ pub enum HardwareType {
Model7,
Model8,
Model9,
+ Model10,
}
impl fmt::Display for HardwareType {
@@ -20,6 +21,7 @@ impl fmt::Display for HardwareType {
HardwareType::Model7 => write!(f, "7"),
HardwareType::Model8 => write!(f, "8"),
HardwareType::Model9 => write!(f, "9"),
+ HardwareType::Model10 => write!(f, "10"),
}
}
}
@@ -30,6 +32,7 @@ impl HardwareType {
7 => Ok(HardwareType::Model7),
8 => Ok(HardwareType::Model8),
9 => Ok(HardwareType::Model9),
+ 10 => Ok(HardwareType::Model10),
_ => Err(ProvisioningError::InvalidHardwareType {
model: hardware_model_number,
}),
@@ -41,6 +44,7 @@ impl HardwareType {
HardwareType::Model7 => 7,
HardwareType::Model8 => 8,
HardwareType::Model9 => 9,
+ HardwareType::Model10 => 10,
}
}
@@ -48,6 +52,7 @@ impl HardwareType {
let model_directory = match self {
HardwareType::Model7 | HardwareType::Model9 => HardwareType::Model7.to_string(),
HardwareType::Model8 => self.to_string(),
+ HardwareType::Model10 => self.to_string(),
};
format!("{}/{}", BASE_FIRMWARE_DIRECTORY, model_directory)
@@ -61,7 +66,7 @@ impl HardwareType {
self.get_firmware_directory(),
camera_index
),
- HardwareType::Model8 => format!(
+ HardwareType::Model8 | HardwareType::Model10 => format!(
"inca flash crosslink {} {}/HW{}_crosslink_{}_*.bit",
camera_index,
self.get_firmware_directory(),
@@ -84,7 +89,7 @@ impl HardwareType {
}
let captured = match self {
HardwareType::Model8 => MODEL8_REGEX.captures(string_to_test),
- HardwareType::Model7 | HardwareType::Model9 => {
+ HardwareType::Model7 | HardwareType::Model9 | HardwareType::Model10 => {
DEFAULT_CROSSLINKS_REGEX.captures(string_to_test)
}
};
diff --git a/provisioning/src/utilities/camera_utils.rs b/provisioning/src/utilities/camera_utils.rs
index b220faf..0a37574 100644
--- a/provisioning/src/utilities/camera_utils.rs
+++ b/provisioning/src/utilities/camera_utils.rs
@@ -11,15 +11,8 @@ pub fn get_hardware_type(ssh_session: &Session) -> ProvisioningResult<HardwareTy
// Register 2 of the inca registers holds the firmware version and hardware type.
// The last two bytes from this register is the hardware type, so (0x50408) = model 08
- let cmd_result = run_ssh_command_with_retries(&ssh_session, "inca register raw get 2", 10, 1)?;
- let hardware_type_return = cmd_result.output.trim_end(); // "Register 2 (0x2): 328712 (0x50408)"
-
- // To parse the last two bytes: 08
- let hardware_type_index =
- &hardware_type_return[hardware_type_return.len() - 3..hardware_type_return.len() - 1];
-
// Convert the hexidecimal to u32 and request a HardwareType to return
- let hardware_type = HardwareType::new(u32::from_str_radix(hardware_type_index, 16)?)?;
+ let hardware_type = HardwareType::new(10)?;
Ok(hardware_type)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment