Skip to main content

Crate recentip

Crate recentip 

Source
Expand description

§RecentIP

Crate Docs License: GPL-3.0

An async SOME/IP protocol implementation for tokio.

§Quick Start

use recentip::prelude::*;

#[tokio::main]
async fn main() -> Result<()> {
    let runtime = recentip::configure().start().await?;

    // Client: find and call a remote service
    let proxy = runtime.find(0x1234u16).await?;
    let response = proxy.call(MethodId::new(1).unwrap(), b"").await?;

    // Server: offer a service
    let mut offering = runtime.offer(0x5678u16, InstanceId::Id(1))
        .udp().start().await?;
     
    while let Some(event) = offering.next().await {
        // Handle requests...
    }
    Ok(())
}

§Configuration

use recentip::prelude::*;

let someip = recentip::configure()
    .preferred_transport(Transport::Tcp)  // Prefer TCP when service offers both
    .magic_cookies(true)                  // Enable Magic Cookies for debugging
    .offer_ttl(3)                         // Service offer TTL in seconds
    .start().await?;

§API Overview

TypeRole
SomeIpCentral coordinator, owns sockets
OfferedServiceClient proxy to remote service
ServiceOfferingServer handle for offered service
SubscriptionBuilderBuild subscription to eventgroups
SubscriptionReceive events from eventgroups
ResponderReply to incoming RPC request

§Learn More

  • examples — Complete guides: RPC, Pub/Sub, Transport, Monitoring
  • prelude — Common imports
  • compliance — Spec traceability report
  • internals — Contributor documentation (architecture, internals)

Re-exports§

pub use builder::SomeIpBuilder;
pub use handles::OfferBuilder;
pub use handles::SomeIp;
pub use config::MethodConfig;
pub use config::RuntimeConfig;
pub use config::Transport;
pub use handles::EventBuilder;
pub use handles::EventHandle;
pub use handles::FindBuilder;
pub use handles::OfferedService;
pub use handles::Responder;
pub use handles::ServiceEvent;
pub use handles::ServiceOffering;
pub use handles::Subscription;
pub use handles::SubscriptionBuilder;
pub use error::*;

Modules§

builder
Builder for configuring and starting SOME/IP runtimes.
compliance
Specification Compliance Documentation
config
SOME/IP Configuration Types
error
Error Types
examples
Examples
handles
Handle Types for SOME/IP Communication
internals
Internals
net
Network Abstraction Layer
prelude
tcp
TCP Connection Management
wire
Wire format parsing for SOME/IP headers and messages. Exposed for testing and interoperability verification.

Structs§

ClientInfo
Information about a client (for server-side)
Event
Specific event received from a subscription (aka Notify message or Notification)
EventId
Event identifier (high bit must be set: 0x8000-0xFFFE)
EventgroupId
Eventgroup identifier
MethodId
Method identifier
MinorVersion
Minor version of a service interface
Response
Response from a method call
ServiceId
Service identifier (0x0001-0xFFFE valid, 0x0000 and 0xFFFF reserved)

Enums§

ApplicationError
Error codes that applications can send in response to method calls.
InstanceId
Instance identifier - can be a specific ID or Any (wildcard)
MajorVersion
Major version of a service interface - can be exact or wildcard (Any)
ReturnCode
SOME/IP return codes (for parsing received responses).
SdEvent
Service Discovery event notification

Functions§

configure
Configure and start a SOME/IP runtime.