summaryrefslogtreecommitdiff
path: root/src/rust/uci/mod.rs
diff options
context:
space:
mode:
authorziyiw <ziyiw@google.com>2022-03-31 23:01:22 +0000
committerziyiw <ziyiw@google.com>2022-03-31 23:09:14 +0000
commit10fd6cd3630149e239d30c5696885f0daf55e7ca (patch)
treeea0fb0aa107c2d89e3a7cb0d9896317b2f19a7b0 /src/rust/uci/mod.rs
parentf630fe65e4a36fec05cd345537e806d08e356994 (diff)
downloaduwb-10fd6cd3630149e239d30c5696885f0daf55e7ca.tar.gz
Handle error for invalid input.
Handle the invalid input for creating Uci packet. It should not be panicked. Test: manual Bug: 202531943 Change-Id: Icf0c28de2891b042476157d1bf01300831bc6114
Diffstat (limited to 'src/rust/uci/mod.rs')
-rw-r--r--src/rust/uci/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rust/uci/mod.rs b/src/rust/uci/mod.rs
index d083d44..3dd5307 100644
--- a/src/rust/uci/mod.rs
+++ b/src/rust/uci/mod.rs
@@ -247,7 +247,7 @@ impl<T: EventManager> Driver<T> {
JNICommand::UciGetDeviceInfo => GetDeviceInfoCmdBuilder {}.build().into(),
JNICommand::UciGetCapsInfo => GetCapsInfoCmdBuilder {}.build().into(),
JNICommand::UciSessionInit(session_id, session_type) => {
- uci_hmsgs::build_session_init_cmd(session_id, session_type).build().into()
+ uci_hmsgs::build_session_init_cmd(session_id, session_type)?.build().into()
}
JNICommand::UciSessionDeinit(session_id) => {
SessionDeinitCmdBuilder { session_id }.build().into()
@@ -279,7 +279,7 @@ impl<T: EventManager> Driver<T> {
.build()
.into(),
JNICommand::UciSetCountryCode { ref code } => {
- uci_hmsgs::build_set_country_code_cmd(code).build().into()
+ uci_hmsgs::build_set_country_code_cmd(code)?.build().into()
}
JNICommand::UciSetAppConfig { session_id, no_of_params, ref app_configs, .. } => {
uci_hmsgs::build_set_app_config_cmd(session_id, no_of_params, app_configs)?
@@ -295,7 +295,7 @@ impl<T: EventManager> Driver<T> {
uci_hmsgs::build_uci_vendor_cmd_packet(gid, oid, payload)?
}
JNICommand::UciDeviceReset { reset_config } => {
- uci_hmsgs::build_device_reset_cmd(reset_config).build().into()
+ uci_hmsgs::build_device_reset_cmd(reset_config)?.build().into()
}
JNICommand::Disable(_graceful) => {
self.adaptation.hal_close().await?;