Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example-utils/hello-world-protos/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn main() -> std::io::Result<()> {
"helloworld",
) {
let error_message = format!("Failed to fetch and build protobuf file: {err:?}");
return Err(std::io::Error::new(std::io::ErrorKind::Other, error_message));
return Err(std::io::Error::other(error_message));
}

Ok(())
Expand All @@ -49,7 +49,7 @@ fn get_and_build_protos(
let mut proto_files = Vec::new();

for url in urls {
let file_name = url.split('/').last().unwrap();
let file_name = url.split('/').next_back().unwrap();
let mut file_path_buf = PathBuf::from(&proto_folder);

// Check if the URL is from googleapis to determine the correct path
Expand Down
4 changes: 2 additions & 2 deletions up-transport-vsomeip/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl UPTransportVsomeip {
///
/// * `local_authority_name` - authority_name of the host device
/// * `remote_authority_name` - authority_name to attach for messages originating from SOME/IP network.
/// Should be set to `IP:port` of the endpoint mDevice
/// Should be set to `IP:port` of the endpoint mDevice
/// * `ue_id` - the ue_id of the uEntity
/// * `config_path` - path to a JSON vsomeip configuration file
///
Expand Down Expand Up @@ -183,7 +183,7 @@ impl UPTransportVsomeip {
///
/// * `local_authority_name` - authority_name of the host device
/// * `remote_authority_name` - authority_name to attach for messages originating from SOME/IP network
/// Should be set to `IP:port` of the endpoint mDevice
/// Should be set to `IP:port` of the endpoint mDevice
/// * `ue_id` - the ue_id of the uEntity
pub fn new(
vsomeip_application_config: VsomeipApplicationConfig,
Expand Down
12 changes: 10 additions & 2 deletions up-transport-vsomeip/tests/point_to_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,21 +353,29 @@ async fn point_to_point() {
};
let point_to_point_client = Arc::new(point_to_point_client);

let source = UUri::any();
let source = any_from_authority(PTP_AUTHORITY_NAME);
let legacy_source = UUri::any();
let sink = any_from_authority(PTP_AUTHORITY_NAME);

let point_to_point_listener_check =
Arc::new(PointToPointListener::new(point_to_point_client.clone()));
let point_to_point_listener: Arc<dyn UListener> = point_to_point_listener_check.clone();
trace!("Registering point to point listener: Start");
let reg_res = point_to_point_client
.register_listener(&source, Some(&sink), point_to_point_listener)
.register_listener(&source, Some(&sink), point_to_point_listener.clone())
.await;
trace!("Registering point to point listener: End");
if let Err(err) = reg_res {
panic!("Unable to register with UTransport: {err}");
}

let fallback_reg_res = point_to_point_client
.register_listener(&legacy_source, Some(&sink), point_to_point_listener)
.await;
if let Err(err) = fallback_reg_res {
trace!("Fallback point-to-point listener registration not applied: {err}");
}

tokio::time::sleep(Duration::from_millis(200)).await;

let client_config = "vsomeip_configs/client.json";
Expand Down
5 changes: 5 additions & 0 deletions vsomeip-sys/src/glue_additions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ impl RuntimeWrapper {
/// # TODO
///
/// Add some runtime safety checks on the pointer
#[allow(clippy::mut_from_ref)]
pub fn get_pinned(&self) -> Pin<&mut vsomeip::runtime> {
unsafe { Pin::new_unchecked(self.get_mut().as_mut().unwrap()) }
}
Expand Down Expand Up @@ -72,6 +73,7 @@ impl ApplicationWrapper {
///
/// I do see a runtime panic here, perhaps when we try to work with the app before it's setup
/// should probably do a sleep of half a second or something
#[allow(clippy::mut_from_ref)]
pub fn get_pinned(&self) -> Pin<&mut vsomeip::application> {
unsafe { Pin::new_unchecked(self.get_mut().as_mut().unwrap()) }
}
Expand Down Expand Up @@ -270,6 +272,7 @@ impl MessageWrapper {
/// # TODO
///
/// Add some runtime safety checks on the pointer
#[allow(clippy::mut_from_ref)]
pub fn get_pinned(&self) -> Pin<&mut vsomeip::message> {
unsafe { Pin::new_unchecked(self.get_mut().as_mut().unwrap()) }
}
Expand All @@ -293,6 +296,7 @@ impl MessageWrapper {
/// # TODO
///
/// Add some runtime safety checks on the pointer
#[allow(clippy::mut_from_ref)]
pub fn get_message_base_pinned(&self) -> Pin<&mut vsomeip::message_base> {
unsafe {
let msg_ptr: *mut message = self.get_mut();
Expand Down Expand Up @@ -389,6 +393,7 @@ impl PayloadWrapper {
/// # TODO
///
/// Add some runtime safety checks on the pointer
#[allow(clippy::mut_from_ref)]
pub fn get_pinned(&self) -> Pin<&mut vsomeip::payload> {
unsafe { Pin::new_unchecked(self.get_mut().as_mut().unwrap()) }
}
Expand Down
6 changes: 2 additions & 4 deletions vsomeip-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

#![allow(unused_attributes)]

mod cxx_bridge;

use autocxx::prelude::*;
Expand Down Expand Up @@ -410,8 +412,6 @@ mod tests {
let duration = Duration::from_millis(test_duration);
let start_time = Instant::now();

#[allow(unused_variables)]
let mut iterations: usize = 0;
while Instant::now().duration_since(start_time) < duration {
let vsomeip_payload =
make_payload_wrapper(runtime_wrapper.get_pinned().create_payload());
Expand All @@ -425,8 +425,6 @@ mod tests {
attachable_payload,
true,
);

iterations += 1;
}

thread::sleep(Duration::from_millis(500));
Expand Down
Loading