summaryrefslogtreecommitdiff
path: root/src/rust/event_manager
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2022-01-25 12:16:45 -0800
committerRoshan Pius <rpius@google.com>2022-01-25 14:07:22 -0800
commit6a1c305329decda79aeeaa952911d3dd53613e02 (patch)
treeb6889d55f80fa97889862c1453e141a635bd12bb /src/rust/event_manager
parent42ce1615a5356e27ca8156292bf8e5876ef92819 (diff)
downloaduwb-6a1c305329decda79aeeaa952911d3dd53613e02.tar.gz
uwb(uci-rust): Use {Packet} instead of {Packet}Builder
The {Packet} struct should be used for parsed data. Also, made all EventManager method names consistent with "_received". Test: UwbManagerTest, adb shell cmd uwb start-fira-ranging-session Bug: 197341298 Change-Id: I9b08c43bb05254f01c495e53b630c96f323518ee
Diffstat (limited to 'src/rust/event_manager')
-rw-r--r--src/rust/event_manager/mod.rs40
1 files changed, 25 insertions, 15 deletions
diff --git a/src/rust/event_manager/mod.rs b/src/rust/event_manager/mod.rs
index b8f6f46..cf93988 100644
--- a/src/rust/event_manager/mod.rs
+++ b/src/rust/event_manager/mod.rs
@@ -52,12 +52,15 @@ pub trait Manager {
fn device_status_notification_received(&self, data: DeviceStatusNtfPacket) -> Result<()>;
fn core_generic_error_notification_received(&self, data: GenericErrorPacket) -> Result<()>;
fn session_status_notification_received(&self, data: SessionStatusNtfPacket) -> Result<()>;
- fn short_range_data_notification(&self, data: ShortMacTwoWayRangeDataNtfPacket) -> Result<()>;
- fn extended_range_data_notification(
+ fn short_range_data_notification_received(
+ &self,
+ data: ShortMacTwoWayRangeDataNtfPacket,
+ ) -> Result<()>;
+ fn extended_range_data_notification_received(
&self,
data: ExtendedMacTwoWayRangeDataNtfPacket,
) -> Result<()>;
- fn session_update_controller_multicast_list_notification(
+ fn session_update_controller_multicast_list_notification_received(
&self,
data: SessionUpdateControllerMulticastListNtfPacket,
) -> Result<()>;
@@ -93,29 +96,33 @@ impl Manager for EventManager {
result
}
- fn short_range_data_notification(&self, data: ShortMacTwoWayRangeDataNtfPacket) -> Result<()> {
+ fn short_range_data_notification_received(
+ &self,
+ data: ShortMacTwoWayRangeDataNtfPacket,
+ ) -> Result<()> {
let env = self.jvm.attach_current_thread()?;
- let result = self.handle_short_range_data_notification(&env, data);
+ let result = self.handle_short_range_data_notification_received(&env, data);
self.clear_exception(env);
result
}
- fn extended_range_data_notification(
+ fn extended_range_data_notification_received(
&self,
data: ExtendedMacTwoWayRangeDataNtfPacket,
) -> Result<()> {
let env = self.jvm.attach_current_thread()?;
- let result = self.handle_extended_range_data_notification(&env, data);
+ let result = self.handle_extended_range_data_notification_received(&env, data);
self.clear_exception(env);
result
}
- fn session_update_controller_multicast_list_notification(
+ fn session_update_controller_multicast_list_notification_received(
&self,
data: SessionUpdateControllerMulticastListNtfPacket,
) -> Result<()> {
let env = self.jvm.attach_current_thread()?;
- let result = self.handle_session_update_controller_multicast_list_notification(&env, data);
+ let result =
+ self.handle_session_update_controller_multicast_list_notification_received(&env, data);
self.clear_exception(env);
result
}
@@ -454,7 +461,7 @@ impl EventManager {
)
}
- fn handle_short_range_data_notification(
+ fn handle_short_range_data_notification_received(
&self,
env: &JNIEnv,
data: ShortMacTwoWayRangeDataNtfPacket,
@@ -507,7 +514,7 @@ impl EventManager {
.map(|_| ()) // drop void method return
}
- fn handle_extended_range_data_notification(
+ fn handle_extended_range_data_notification_received(
&self,
env: &JNIEnv,
data: ExtendedMacTwoWayRangeDataNtfPacket,
@@ -561,7 +568,7 @@ impl EventManager {
.map(|_| ()) // drop void method return
}
- pub fn handle_session_update_controller_multicast_list_notification(
+ pub fn handle_session_update_controller_multicast_list_notification_received(
&self,
env: &JNIEnv,
data: SessionUpdateControllerMulticastListNtfPacket,
@@ -654,16 +661,19 @@ impl Manager for EventManagerTest {
fn session_status_notification_received(&self, data: SessionStatusNtfPacket) -> Result<()> {
Ok(())
}
- fn short_range_data_notification(&self, data: ShortMacTwoWayRangeDataNtfPacket) -> Result<()> {
+ fn short_range_data_notification_received(
+ &self,
+ data: ShortMacTwoWayRangeDataNtfPacket,
+ ) -> Result<()> {
Ok(())
}
- fn extended_range_data_notification(
+ fn extended_range_data_notification_received(
&self,
data: ExtendedMacTwoWayRangeDataNtfPacket,
) -> Result<()> {
Ok(())
}
- fn session_update_controller_multicast_list_notification(
+ fn session_update_controller_multicast_list_notification_received(
&self,
data: SessionUpdateControllerMulticastListNtfPacket,
) -> Result<()> {