add todo for 'subscribe'

This commit is contained in:
Rokas Puzonas 2023-03-26 15:51:25 +03:00
parent e022477ef2
commit 4905dde4c3

View File

@ -243,6 +243,7 @@ impl Ubus {
let cmd = format!("ubus listen {}", paths.join(" "));
let mut channel = self.session.channel_session().await?;
channel.exec(&cmd).await?;
// TODO: Handle error? 'channel.exit_status()', idk if neededdi
let mut line_buffer = vec![0u8; 1024];
let mut buffer_size = 0usize;
@ -273,4 +274,16 @@ impl Ubus {
}
}
}
pub async fn subscribe(self, paths: &[&str]) -> Result<()> {
if paths.len() < 1 {
bail!("At least 1 object is required")
}
let cmd = format!("ubus subscribe {}", paths.join(" "));
let mut channel = self.session.channel_session().await?;
channel.exec(&cmd).await?;
// TODO: Haven't figured out how to test subscribe event using default objects on ubus.
todo!();
}
}