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

[RSDK-9887] get agent config from app #417

Merged
merged 12 commits into from
Feb 20, 2025

Conversation

mattjperez
Copy link
Member

1 of 2 PRs to getting agent config from app (this PR) and storing them in NVS (next PR).

Still cleaning things up (getting rid of unwraps, etc), but wanted to get a first review going already in case there are major design changes requested.

@mattjperez mattjperez requested a review from a team as a code owner February 18, 2025 21:51
Copy link
Member

@gvaradarajan gvaradarajan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple comments and a question (and wanted to wait for the cleanup to approve fully), but mostly LGTM

Copy link
Member

@gvaradarajan gvaradarajan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@acmorrow acmorrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just some small things, no need to post another round with changes unless you want to.

pub struct NetworkSetting {
ssid: String,
password: String,
priority: usize,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe priority is permitted to be negative, so I don't think a usize is the right type.

}

#[derive(Debug)]
pub struct AgentConfig {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a slight preference for having the struct be introduced before any impl blocks for it. Could you move this up above line 26 please?

});

let version_info = Some(VersionInfo {
agent_running: "none".to_string(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if we just don't set agent_running?

id: self.robot_credentials.robot_id.clone(),
host_info,
version_info,
subsystem_versions: Default::default(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you eliminate even namign this field in favor of ..Default::default()

impl TryFrom<&DeviceAgentConfigResponse> for AgentConfig {
type Error = AttributeError;
fn try_from(value: &DeviceAgentConfigResponse) -> Result<Self, Self::Error> {
if let Some(ref additional_networks) = value.additional_networks {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of ref, could you do value.additional_networks.as_ref() or &value.additional_networks?

@mattjperez mattjperez merged commit 751e5c9 into viamrobotics:main Feb 20, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants