diff options
author | Chih-Yu Huang <akahuang@google.com> | 2022-03-25 18:00:51 +0900 |
---|---|---|
committer | Chih-Yu Huang <akahuang@google.com> | 2022-03-29 13:07:05 +0900 |
commit | f040474b04822f1d13d7212c80916e8d63841f93 (patch) | |
tree | c864db9a3961c0e3fa6fcb41b0e83bec098a496a /src | |
parent | 9e3e7c95fc09c95fb8b591a4c8dc923780e1480e (diff) | |
download | uwb-f040474b04822f1d13d7212c80916e8d63841f93.tar.gz |
uwb_uci_packets: change ControleeStatus's status type to MulticastUpdateStatusCode
According to the UCI spec, ControleeStatus's status field is the
MulticastUpdateStatusCode enum, not a simple u8 value. This CL updates
the type of the field.
Bug: 227263938
Test: atest libuwb_uci_rust_tests
Test: mmm external/uwb
Change-Id: I1d764fc27682a24366f70744eb39a478fe0cdf20
Diffstat (limited to 'src')
-rw-r--r-- | src/rust/event_manager/mod.rs | 5 | ||||
-rw-r--r-- | src/rust/uwb_uci_packets/uci_packets.pdl | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/rust/event_manager/mod.rs b/src/rust/event_manager/mod.rs index 0a0c06e..34e79b1 100644 --- a/src/rust/event_manager/mod.rs +++ b/src/rust/event_manager/mod.rs @@ -595,7 +595,10 @@ impl EventManagerImpl { for iter in controlee_status { mac_address_list.push(iter.mac_address.into()); subsession_id_list.push(iter.subsession_id.into()); - status_list.push(iter.status.into()); + status_list.push(iter.status.to_i32().ok_or_else(|| { + error!("Failed to convert controlee_status's status field: {:?}", iter.status); + Error::JavaException + })?); } let mac_address_jintarray = env.new_int_array(count)?; diff --git a/src/rust/uwb_uci_packets/uci_packets.pdl b/src/rust/uwb_uci_packets/uci_packets.pdl index 3f0e95f..0f8dffe 100644 --- a/src/rust/uwb_uci_packets/uci_packets.pdl +++ b/src/rust/uwb_uci_packets/uci_packets.pdl @@ -616,7 +616,7 @@ test SessionUpdateControllerMulticastListRsp { struct ControleeStatus { mac_address: 16, subsession_id: 32, - status: 8, + status: MulticastUpdateStatusCode, } packet SessionUpdateControllerMulticastListNtf : SessionNotification (opcode = 0x7) { //SESSION_UPDATE_CONTROLLER_MULTICAST_LIST |