summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhenix Chen <phenixchen@google.com>2024-04-19 06:06:36 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-04-19 06:06:36 +0000
commit2cc334a04bac3315496092f9feea28fa0392c540 (patch)
tree62821544dfffe325b62181a4dd5a68f176acd973
parent5835b6498cad3cd40a3f2809bd347440209244c3 (diff)
downloaduwb-2cc334a04bac3315496092f9feea28fa0392c540.tar.gz
Revert "[uci] Pass in a boolean to indicate if support multicast..."
Revert submission 3047732-multicastNtfV2 Reason for revert: Potential culprit for build issue Reverted changes: /q/submissionid:3047732-multicastNtfV2 Change-Id: I642e26bb9f6636d47f20c77d8354ecd54b8dba4d
-rw-r--r--src/rust/uwb_core/src/session/uwb_session.rs1
-rw-r--r--src/rust/uwb_core/src/uci/command.rs3
-rw-r--r--src/rust/uwb_core/src/uci/message.rs9
-rw-r--r--src/rust/uwb_core/src/uci/mock_uci_manager.rs1
-rw-r--r--src/rust/uwb_core/src/uci/notification.rs84
-rw-r--r--src/rust/uwb_core/src/uci/uci_manager.rs24
-rw-r--r--src/rust/uwb_core/src/uci/uci_manager_sync.rs11
7 files changed, 35 insertions, 98 deletions
diff --git a/src/rust/uwb_core/src/session/uwb_session.rs b/src/rust/uwb_core/src/session/uwb_session.rs
index 7e82e0a..d41b693 100644
--- a/src/rust/uwb_core/src/session/uwb_session.rs
+++ b/src/rust/uwb_core/src/session/uwb_session.rs
@@ -312,7 +312,6 @@ impl<T: UciManager> UwbSessionActor<T> {
self.session_id,
action,
Controlees::NoSessionKey(controlees),
- false,
)
.await?;
diff --git a/src/rust/uwb_core/src/uci/command.rs b/src/rust/uwb_core/src/uci/command.rs
index 51cbdcb..b15d387 100644
--- a/src/rust/uwb_core/src/uci/command.rs
+++ b/src/rust/uwb_core/src/uci/command.rs
@@ -68,7 +68,6 @@ pub enum UciCommand {
session_token: SessionToken,
action: UpdateMulticastListAction,
controlees: Controlees,
- is_multicast_list_ntf_v2_supported: bool,
},
SessionUpdateDtTagRangingRounds {
session_token: u32,
@@ -147,7 +146,6 @@ impl TryFrom<UciCommand> for uwb_uci_packets::UciControlPacket {
session_token,
action,
controlees,
- ..
} => build_session_update_controller_multicast_list_cmd(
session_token,
action,
@@ -408,7 +406,6 @@ mod tests {
session_token: 1,
action: UpdateMulticastListAction::AddControlee,
controlees: Controlees::NoSessionKey(vec![]),
- is_multicast_list_ntf_v2_supported: false,
};
packet = uwb_uci_packets::UciControlPacket::try_from(cmd.clone()).unwrap();
assert_eq!(
diff --git a/src/rust/uwb_core/src/uci/message.rs b/src/rust/uwb_core/src/uci/message.rs
index b0f4c22..a4f72e8 100644
--- a/src/rust/uwb_core/src/uci/message.rs
+++ b/src/rust/uwb_core/src/uci/message.rs
@@ -28,22 +28,19 @@ pub(super) enum UciMessage {
Notification(UciNotification),
}
-impl TryFrom<(uwb_uci_packets::UciControlPacket, UCIMajorVersion, bool)> for UciMessage {
+impl TryFrom<(uwb_uci_packets::UciControlPacket, UCIMajorVersion)> for UciMessage {
type Error = Error;
fn try_from(
- pair: (uwb_uci_packets::UciControlPacket, UCIMajorVersion, bool),
+ pair: (uwb_uci_packets::UciControlPacket, UCIMajorVersion),
) -> Result<Self, Self::Error> {
let packet = pair.0;
let uci_fira_major_ver = pair.1;
- let is_multicast_list_ntf_v2_supported = pair.2;
match packet.specialize() {
uwb_uci_packets::UciControlPacketChild::UciResponse(evt) => {
Ok(UciMessage::Response(evt.try_into()?))
}
uwb_uci_packets::UciControlPacketChild::UciNotification(evt) => {
- Ok(UciMessage::Notification(
- (evt, uci_fira_major_ver, is_multicast_list_ntf_v2_supported).try_into()?,
- ))
+ Ok(UciMessage::Notification((evt, uci_fira_major_ver).try_into()?))
}
_ => {
error!("Unknown packet for converting to UciMessage: {:?}", packet);
diff --git a/src/rust/uwb_core/src/uci/mock_uci_manager.rs b/src/rust/uwb_core/src/uci/mock_uci_manager.rs
index 7ae33ab..6dd222f 100644
--- a/src/rust/uwb_core/src/uci/mock_uci_manager.rs
+++ b/src/rust/uwb_core/src/uci/mock_uci_manager.rs
@@ -839,7 +839,6 @@ impl UciManager for MockUciManager {
session_id: SessionId,
action: UpdateMulticastListAction,
controlees: Controlees,
- _is_multicast_list_ntf_v2_supported: bool,
) -> Result<()> {
let mut expected_calls = self.expected_calls.lock().unwrap();
match expected_calls.pop_front() {
diff --git a/src/rust/uwb_core/src/uci/notification.rs b/src/rust/uwb_core/src/uci/notification.rs
index 58e68cd..41c4002 100644
--- a/src/rust/uwb_core/src/uci/notification.rs
+++ b/src/rust/uwb_core/src/uci/notification.rs
@@ -342,21 +342,20 @@ impl UciNotification {
}
}
-impl TryFrom<(uwb_uci_packets::UciNotification, UCIMajorVersion, bool)> for UciNotification {
+impl TryFrom<(uwb_uci_packets::UciNotification, UCIMajorVersion)> for UciNotification {
type Error = Error;
fn try_from(
- pair: (uwb_uci_packets::UciNotification, UCIMajorVersion, bool),
+ pair: (uwb_uci_packets::UciNotification, UCIMajorVersion),
) -> std::result::Result<Self, Self::Error> {
use uwb_uci_packets::UciNotificationChild;
let evt = pair.0;
let uci_fira_major_ver = pair.1;
- let is_multicast_list_ntf_v2_supported = pair.2;
match evt.specialize() {
UciNotificationChild::CoreNotification(evt) => Ok(Self::Core(evt.try_into()?)),
- UciNotificationChild::SessionConfigNotification(evt) => Ok(Self::Session(
- (evt, uci_fira_major_ver, is_multicast_list_ntf_v2_supported).try_into()?,
- )),
+ UciNotificationChild::SessionConfigNotification(evt) => {
+ Ok(Self::Session((evt, uci_fira_major_ver).try_into()?))
+ }
UciNotificationChild::SessionControlNotification(evt) => {
Ok(Self::Session(evt.try_into()?))
}
@@ -392,17 +391,16 @@ impl TryFrom<uwb_uci_packets::CoreNotification> for CoreNotification {
}
}
-impl TryFrom<(uwb_uci_packets::SessionConfigNotification, UCIMajorVersion, bool)>
+impl TryFrom<(uwb_uci_packets::SessionConfigNotification, UCIMajorVersion)>
for SessionNotification
{
type Error = Error;
fn try_from(
- pair: (uwb_uci_packets::SessionConfigNotification, UCIMajorVersion, bool),
+ pair: (uwb_uci_packets::SessionConfigNotification, UCIMajorVersion),
) -> std::result::Result<Self, Self::Error> {
use uwb_uci_packets::SessionConfigNotificationChild;
let evt = pair.0;
let uci_fira_major_ver = pair.1;
- let is_multicast_list_ntf_v2_supported = pair.2;
match evt.specialize() {
SessionConfigNotificationChild::SessionStatusNtf(evt) => Ok(Self::Status {
//no sessionId recieved, assign from sessionIdToToken map in uci_manager
@@ -412,8 +410,7 @@ impl TryFrom<(uwb_uci_packets::SessionConfigNotification, UCIMajorVersion, bool)
reason_code: evt.get_reason_code(),
}),
SessionConfigNotificationChild::SessionUpdateControllerMulticastListNtf(evt)
- if uci_fira_major_ver == UCIMajorVersion::V1
- || !is_multicast_list_ntf_v2_supported =>
+ if uci_fira_major_ver == UCIMajorVersion::V1 =>
{
let payload = evt.get_payload();
let multicast_update_list_payload_v1 =
@@ -946,12 +943,9 @@ mod tests {
let session_notification_packet =
uwb_uci_packets::SessionConfigNotification::try_from(session_status_ntf).unwrap();
let uci_fira_major_version = UCIMajorVersion::V1;
- let session_notification = SessionNotification::try_from((
- session_notification_packet,
- uci_fira_major_version,
- false,
- ))
- .unwrap();
+ let session_notification =
+ SessionNotification::try_from((session_notification_packet, uci_fira_major_version))
+ .unwrap();
let uci_notification_from_session_status_ntf =
UciNotification::Session(session_notification);
assert_eq!(
@@ -1035,12 +1029,9 @@ mod tests {
)
.unwrap();
let uci_fira_major_version = UCIMajorVersion::V1;
- let session_notification = SessionNotification::try_from((
- session_notification_packet,
- uci_fira_major_version,
- false,
- ))
- .unwrap();
+ let session_notification =
+ SessionNotification::try_from((session_notification_packet, uci_fira_major_version))
+ .unwrap();
let uci_notification_from_session_update_controller_multicast_list_ntf =
UciNotification::Session(session_notification);
assert_eq!(
@@ -1079,11 +1070,8 @@ mod tests {
)
.unwrap();
let uci_fira_major_version = UCIMajorVersion::V1;
- let session_notification = SessionNotification::try_from((
- session_notification_packet,
- uci_fira_major_version,
- false,
- ));
+ let session_notification =
+ SessionNotification::try_from((session_notification_packet, uci_fira_major_version));
assert_eq!(session_notification, Err(Error::BadParameters));
}
@@ -1111,11 +1099,8 @@ mod tests {
)
.unwrap();
let uci_fira_major_version = UCIMajorVersion::V2;
- let session_notification = SessionNotification::try_from((
- session_notification_packet,
- uci_fira_major_version,
- true,
- ));
+ let session_notification =
+ SessionNotification::try_from((session_notification_packet, uci_fira_major_version));
assert_eq!(session_notification, Err(Error::BadParameters));
}
@@ -1149,12 +1134,9 @@ mod tests {
)
.unwrap();
let uci_fira_major_version = UCIMajorVersion::V2;
- let session_notification = SessionNotification::try_from((
- session_notification_packet,
- uci_fira_major_version,
- true,
- ))
- .unwrap();
+ let session_notification =
+ SessionNotification::try_from((session_notification_packet, uci_fira_major_version))
+ .unwrap();
let uci_notification_from_session_update_controller_multicast_list_ntf =
UciNotification::Session(session_notification);
assert_eq!(
@@ -1179,12 +1161,9 @@ mod tests {
)
.unwrap();
let uci_fira_major_version = UCIMajorVersion::V1;
- let session_notification = SessionNotification::try_from((
- session_notification_packet,
- uci_fira_major_version,
- false,
- ))
- .unwrap();
+ let session_notification =
+ SessionNotification::try_from((session_notification_packet, uci_fira_major_version))
+ .unwrap();
let uci_notification_from_session_data_transfer_phase_config_ntf =
UciNotification::Session(session_notification);
assert_eq!(
@@ -1344,33 +1323,26 @@ mod tests {
let uci_notification_from_vendor_9 = UciNotification::try_from((
vendor_9_empty_notification,
uci_fira_major_version.clone(),
- false,
))
.unwrap();
let uci_notification_from_vendor_A = UciNotification::try_from((
vendor_A_nonempty_notification,
uci_fira_major_version.clone(),
- false,
))
.unwrap();
let uci_notification_from_vendor_B = UciNotification::try_from((
vendor_B_nonempty_notification,
uci_fira_major_version.clone(),
- false,
))
.unwrap();
let uci_notification_from_vendor_E = UciNotification::try_from((
vendor_E_nonempty_notification,
uci_fira_major_version.clone(),
- false,
- ))
- .unwrap();
- let uci_notification_from_vendor_F = UciNotification::try_from((
- vendor_F_nonempty_notification,
- uci_fira_major_version,
- false,
))
.unwrap();
+ let uci_notification_from_vendor_F =
+ UciNotification::try_from((vendor_F_nonempty_notification, uci_fira_major_version))
+ .unwrap();
assert_eq!(
uci_notification_from_vendor_9,
UciNotification::Vendor(RawUciMessage {
@@ -1419,7 +1391,7 @@ mod tests {
uwb_uci_packets::TestNotificationBuilder { opcode: 0x22, payload: None }.build().into();
let uci_fira_major_version = UCIMajorVersion::V1;
let test_uci_notification =
- UciNotification::try_from((test_notification, uci_fira_major_version, false)).unwrap();
+ UciNotification::try_from((test_notification, uci_fira_major_version)).unwrap();
assert_eq!(
test_uci_notification,
UciNotification::Vendor(RawUciMessage {
diff --git a/src/rust/uwb_core/src/uci/uci_manager.rs b/src/rust/uwb_core/src/uci/uci_manager.rs
index fcbb921..c811168 100644
--- a/src/rust/uwb_core/src/uci/uci_manager.rs
+++ b/src/rust/uwb_core/src/uci/uci_manager.rs
@@ -121,7 +121,6 @@ pub trait UciManager: 'static + Send + Sync + Clone {
session_id: SessionId,
action: UpdateMulticastListAction,
controlees: Controlees,
- is_multicast_list_ntf_v2_supported: bool,
) -> Result<()>;
// Update ranging rounds for DT Tag
@@ -471,7 +470,6 @@ impl UciManager for UciManagerImpl {
session_id: SessionId,
action: UpdateMulticastListAction,
controlees: Controlees,
- is_multicast_list_ntf_v2_supported: bool,
) -> Result<()> {
let controlees_len = match controlees {
Controlees::NoSessionKey(ref controlee_vec) => controlee_vec.len(),
@@ -486,7 +484,6 @@ impl UciManager for UciManagerImpl {
session_token: self.get_session_token(&session_id).await?,
action,
controlees,
- is_multicast_list_ntf_v2_supported,
};
match self.send_cmd(UciManagerCmd::SendUciCommand { cmd }).await {
Ok(UciResponse::SessionUpdateControllerMulticastList(resp)) => resp,
@@ -790,9 +787,6 @@ struct UciManagerActor<T: UciHal, U: UciLogger> {
// DATA_MSG_SEND packets (from Host to UWBS), larger than this should be fragmented into
// multiple packets with this as the payload size.
max_data_packet_payload_size: usize,
-
- // The flag that indicate whether multicast list ntf v2 is supported.
- is_multicast_list_ntf_v2_supported: bool,
}
impl<T: UciHal, U: UciLogger> UciManagerActor<T, U> {
@@ -830,7 +824,6 @@ impl<T: UciHal, U: UciLogger> UciManagerActor<T, U> {
session_id_to_token_map,
get_device_info_rsp: None,
max_data_packet_payload_size: MAX_DATA_PACKET_PAYLOAD_SIZE,
- is_multicast_list_ntf_v2_supported: false,
}
}
@@ -1085,16 +1078,6 @@ impl<T: UciHal, U: UciLogger> UciManagerActor<T, U> {
});
}
- if let UciCommand::SessionUpdateControllerMulticastList {
- session_token: _,
- action: _,
- controlees: _,
- is_multicast_list_ntf_v2_supported,
- } = cmd.clone()
- {
- self.is_multicast_list_ntf_v2_supported = is_multicast_list_ntf_v2_supported;
- }
-
self.uci_cmd_retryer =
Some(UciCmdRetryer { cmd, result_sender, retry_count: MAX_RETRY_COUNT });
@@ -1298,7 +1281,6 @@ impl<T: UciHal, U: UciLogger> UciManagerActor<T, U> {
packet,
UCIMajorVersion::from_u8(uci_fira_major_version)
.map_or(UCIMajorVersion::V1, |v| v),
- self.is_multicast_list_ntf_v2_supported,
)
.try_into()
{
@@ -2569,7 +2551,6 @@ mod tests {
session_token,
action,
controlees: Controlees::NoSessionKey(vec![controlee_clone]),
- is_multicast_list_ntf_v2_supported: false,
};
let resp = into_uci_hal_packets(
uwb_uci_packets::SessionUpdateControllerMulticastListRspBuilder {
@@ -2591,7 +2572,6 @@ mod tests {
session_id,
action,
uwb_uci_packets::Controlees::NoSessionKey(vec![controlee]),
- false,
)
.await;
assert!(result.is_ok());
@@ -2620,7 +2600,6 @@ mod tests {
session_token,
action,
controlees: Controlees::ShortSessionKey(vec![controlee_clone]),
- is_multicast_list_ntf_v2_supported: true,
};
let resp = into_uci_hal_packets(
uwb_uci_packets::SessionUpdateControllerMulticastListRspBuilder {
@@ -2642,7 +2621,6 @@ mod tests {
session_id,
action,
uwb_uci_packets::Controlees::ShortSessionKey(vec![controlee]),
- true,
)
.await;
assert!(result.is_ok());
@@ -2672,7 +2650,6 @@ mod tests {
session_token,
action,
controlees: Controlees::LongSessionKey(vec![controlee_clone]),
- is_multicast_list_ntf_v2_supported: true,
};
let resp = into_uci_hal_packets(
uwb_uci_packets::SessionUpdateControllerMulticastListRspBuilder {
@@ -2694,7 +2671,6 @@ mod tests {
session_id,
action,
uwb_uci_packets::Controlees::LongSessionKey(vec![controlee]),
- true,
)
.await;
assert!(result.is_ok());
diff --git a/src/rust/uwb_core/src/uci/uci_manager_sync.rs b/src/rust/uwb_core/src/uci/uci_manager_sync.rs
index 53e47d9..0375f97 100644
--- a/src/rust/uwb_core/src/uci/uci_manager_sync.rs
+++ b/src/rust/uwb_core/src/uci/uci_manager_sync.rs
@@ -316,14 +316,11 @@ impl<U: UciManager> UciManagerSync<U> {
session_id: SessionId,
action: UpdateMulticastListAction,
controlees: Controlees,
- is_multicast_list_ntf_v2_supported: bool,
) -> Result<()> {
- self.runtime_handle.block_on(self.uci_manager.session_update_controller_multicast_list(
- session_id,
- action,
- controlees,
- is_multicast_list_ntf_v2_supported,
- ))
+ self.runtime_handle.block_on(
+ self.uci_manager
+ .session_update_controller_multicast_list(session_id, action, controlees),
+ )
}
/// Update ranging rounds for DT Tag