summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyush Jain <ayushjain@google.com>2023-08-03 20:05:03 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-08-03 20:05:03 +0000
commit7454d77bbfc3038a6c2102e5074f8cc312b0324b (patch)
treec667634677c87610f3d9f602b175e549b2f86d64
parent1d9ff5ba666b796be9a7c7f40d5df61b2eced7eb (diff)
parent19e9e5dcf56cf6a2b1b2da36e92c1ff4b59b0d76 (diff)
downloaduwb-7454d77bbfc3038a6c2102e5074f8cc312b0324b.tar.gz
Merge "This change is to print country code regulation error at JNI" into main am: 19e9e5dcf5
Original change: https://android-review.googlesource.com/c/platform/external/uwb/+/2683227 Change-Id: I2090bf0a830c44913f236eac7ef200f4c99c3ed1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--src/rust/uwb_core/examples/main.rs1
-rw-r--r--src/rust/uwb_core/protos/uwb_service.proto5
-rw-r--r--src/rust/uwb_core/src/error.rs3
-rw-r--r--src/rust/uwb_core/src/proto/mappings.rs1
4 files changed, 9 insertions, 1 deletions
diff --git a/src/rust/uwb_core/examples/main.rs b/src/rust/uwb_core/examples/main.rs
index 63317b1..5f298c6 100644
--- a/src/rust/uwb_core/examples/main.rs
+++ b/src/rust/uwb_core/examples/main.rs
@@ -52,6 +52,7 @@ fn main() {
UwbError::Timeout => {}
UwbError::CommandRetry => {}
UwbError::DuplicatedSessionId => {}
+ UwbError::RegulationUwbOff => {}
UwbError::Unknown => {}
// UwbError is non_exhaustive so we need to add a wild branch here.
diff --git a/src/rust/uwb_core/protos/uwb_service.proto b/src/rust/uwb_core/protos/uwb_service.proto
index abf58af..e979bcc 100644
--- a/src/rust/uwb_core/protos/uwb_service.proto
+++ b/src/rust/uwb_core/protos/uwb_service.proto
@@ -56,8 +56,11 @@ enum Status {
// Duplicated SessionId.
DUPLICATED_SESSION_ID = 8;
+ //Regulation UWB off
+ REGULATION_UWB_OFF = 9;
+
// The unknown error.
- UNKNOWN = 9;
+ UNKNOWN = 10;
}
// Represent uwb_uci_packets::StatusCode.
diff --git a/src/rust/uwb_core/src/error.rs b/src/rust/uwb_core/src/error.rs
index 0b9c6b3..5889448 100644
--- a/src/rust/uwb_core/src/error.rs
+++ b/src/rust/uwb_core/src/error.rs
@@ -49,6 +49,9 @@ pub enum Error {
/// Packet Tx Error
#[error("The packet send failed with an error")]
PacketTxError,
+ /// Country code regulation UWB Off
+ #[error("The country code command failed with a UWB regulatory error")]
+ RegulationUwbOff,
/// The unknown error.
#[error("The unknown error")]
Unknown,
diff --git a/src/rust/uwb_core/src/proto/mappings.rs b/src/rust/uwb_core/src/proto/mappings.rs
index cd21315..1b14711 100644
--- a/src/rust/uwb_core/src/proto/mappings.rs
+++ b/src/rust/uwb_core/src/proto/mappings.rs
@@ -711,6 +711,7 @@ impl<T> From<Result<T>> for ProtoStatus {
Err(Error::Timeout) => Self::TIMEOUT,
Err(Error::CommandRetry) => Self::COMMAND_RETRY,
Err(Error::DuplicatedSessionId) => Self::DUPLICATED_SESSION_ID,
+ Err(Error::RegulationUwbOff) => Self::REGULATION_UWB_OFF,
Err(_) => Self::UNKNOWN,
}
}