Skip to content

Commit

Permalink
* Refactor storage and transport_inner into their own modules
Browse files Browse the repository at this point in the history
* Section off utils
* Start of vsomeip applications is done in a graceful manner, using signaling
  • Loading branch information
PLeVasseur committed Jul 15, 2024
1 parent b3364e6 commit c83176a
Show file tree
Hide file tree
Showing 29 changed files with 4,456 additions and 3,671 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ async-trait = { version = "0.1" }
bimap = { version = "0.6.3" }
bytes = { version = "1.5" }
console-subscriber = { version = "0.3.0" }
crossbeam-channel = { version = "0.5.13" }
cxx = { version = "1.0" }
rand = { version = "0.8" }
regex = { version = "1.10" }
Expand Down
1 change: 1 addition & 0 deletions up-transport-vsomeip/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ async-trait = { workspace = true }
bimap = { workspace = true }
bytes = { workspace = true }
console-subscriber = { workspace = true }
crossbeam-channel = { workspace = true }
cxx = { workspace = true }
rand = { workspace = true }
regex = { workspace = true }
Expand Down
9 changes: 8 additions & 1 deletion up-transport-vsomeip/src/determine_message_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use crate::{ClientId, UeId};
use up_rust::{UStatus, UUri};

/// Registration type containing the [ClientId] of the [vsomeip_sys::vsomeip::application]
/// which should be used for this message
#[derive(Clone, Debug, PartialEq)]
pub(crate) enum RegistrationType {
Publish(ClientId),
Expand All @@ -23,6 +25,8 @@ pub(crate) enum RegistrationType {
}

impl RegistrationType {
/// Get the [ClientId] of the [vsomeip_sys::vsomeip::application]
/// which should be used for this message
pub fn client_id(&self) -> ClientId {
match self {
RegistrationType::Publish(client_id) => *client_id,
Expand All @@ -33,7 +37,7 @@ impl RegistrationType {
}
}

// infer the type of message desired based on the filters provided
/// infer the type of message desired based on the filters provided in a registration / unregistration
pub(crate) fn determine_registration_type(
source_filter: &UUri,
sink_filter: &Option<UUri>,
Expand All @@ -47,18 +51,21 @@ pub(crate) fn determine_registration_type(
)
}

/// infer the type of message desired based on the source and sink contained in a message
pub(crate) fn determine_send_type(
source_filter: &UUri,
sink_filter: &Option<UUri>,
) -> Result<RegistrationType, UStatus> {
determine_type(source_filter, sink_filter, None, DeterminationType::Send)
}

/// Whether the [determine_type] function should treat this as a registration / unregistration or send
enum DeterminationType {
Register,
Send,
}

/// Determines [RegistrationType] of a source and sink filter [UUri]
fn determine_type(
source_filter: &UUri,
sink_filter: &Option<UUri>,
Expand Down
198 changes: 0 additions & 198 deletions up-transport-vsomeip/src/extern_fn_registry.rs

This file was deleted.

Loading

0 comments on commit c83176a

Please sign in to comment.