-
Notifications
You must be signed in to change notification settings - Fork 12
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
[RSDK-9887] get agent config from app #417
Conversation
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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.
micro-rdk/src/common/config.rs
Outdated
pub struct NetworkSetting { | ||
ssid: String, | ||
password: String, | ||
priority: usize, |
There was a problem hiding this comment.
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.
micro-rdk/src/common/config.rs
Outdated
} | ||
|
||
#[derive(Debug)] | ||
pub struct AgentConfig { |
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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
?
micro-rdk/src/common/app_client.rs
Outdated
id: self.robot_credentials.robot_id.clone(), | ||
host_info, | ||
version_info, | ||
subsystem_versions: Default::default(), |
There was a problem hiding this comment.
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()
micro-rdk/src/common/config.rs
Outdated
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 { |
There was a problem hiding this comment.
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
?
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.