Implement the SOME/IP stack

The SOME/IP transport stack manages low-level SOME/IP wire protocol and network logic through an Android Interface Definition Language (AIDL) interface (ISomeIpStack). This stack sends and receives SOME/IP events and remote procedure calls (RPCs). Partners can integrate custom SOME/IP stack implementations through ISomeIpStack, or use the included reference implementation built atop the open-source COVESA vsomeip library. This page describes the following concepts:

  • Reference implementation: SDV provides a non-production reference sample implementation for a SOME/IP stack.

  • Binder API: The ISomeIpStack interface defines methods for interacting with a SOME/IP stack instance.

  • SELinux: A sample SELinux configuration for the reference stack enables binder communication and granular file system access.

While this stack reads the SOME/IP wire format, it leaves the payload as opaque binary blobs and forwards the payload to the SOME/IP broker.

The SOME/IP standard provides no definition of the stack or stack API layer. SDV provides an AIDL API that operates within the familiar definitions of the standard and requires a minimal amount of code to adapt existing stacks.

This API lets you select different implementations of the stack and simplifies the integration of the stack with other components in the system.

Reference implementation

SDV provides a non-production reference sample implementation for a SOME/IP stack, consisting of a thin wrapper atop the open-source COVESA vsomeip library. The system deploys the reference stack only to the SDV Core targets (aosp_cf_x86_64_sdv_core and aosp_cf_arm64_sdv_core on Android 17 QPR2 and higher, or sdv_core_cf and sdv_core_arm64 on Android 17), and init starts it when ro.boot.sdv.someip.enable=true:

  • On Android 17 QPR2 and higher: Configured in device/google/sdv/aosp_cf_x86_64_sdv_core/init.aosp_cf_x86_64_sdv_core.rc (or device/google/sdv/aosp_cf_arm64_sdv_core/init.aosp_cf_arm64_sdv_core.rc on ARM64) with VSOMEIP_CONFIGURATION set to /vendor/etc/someip/vsomeip_config.json:

    on property:dev.bootcomplete=1 && property:ro.boot.sdv.someip.enable=true
        start sdv_someip_stack_agent
    
  • On Android 17: Configured in device/google/sdv/sdv_core_cf/init.sdv_core_cf.rc:

    on property:dev.bootcomplete=1 && property:ro.boot.sdv.someip.enable=true
        start sdv_someip_stack_agent
    

Define the production deployment configuration for your OEM-defined stack. For more information, see Integrate SOME/IP with SDV.

Configuration

The reference stack declares a configuration for the vSomeIP library. The configuration file specifies SOME/IP service discovery (SD) parameters, such as a multicast address and the port used by the stack. For a description of the configuration file structure, see the vsomeip user guide.

Binder API

The ISomeIpStack interface (ISomeIpStack.aidl) is declared in hardware/sdv/interfaces/some_ip/stack_agent/aidl/google/sdv/someip/. The ISomeIpStack interface defines methods for interacting with a SOME/IP stack instance and provides essential qualities for these items.

Service availability

  • register_availability_callback Registers a callback for service availability changes.

  • monitor_service Instructs the stack to monitor a specific service's availability.

  • unregister_availability_callback Unregisters the availability callback.

  • on_sdv_service_availability Indicates a change in SDV service availability.

Remote procedure calls (RPC)

You can send an RPC request with:

  • rpc_transact to wait for a response
  • rpc_oneway to not wait for a response

For RPC request handling:

  • register_rpc_request_callback Registers a callback for incoming RPC requests.

  • unregister_rpc_request_callback Unregisters the RPC request callback.

Event notification

  • register_event_notification_callback Registers a callback for subscribed event notifications.

  • unregister_event_notification_callback Unregisters the event notification callback.

  • on_sdv_topic_availability Indicates a change in SDV topic availability.

  • subscribe Subscribes to a specific event from an event group.

  • unsubscribe Unsubscribes from a specific event.

  • publish Publishes an event with a given payload.

SELinux

The device/google/sdv/sdv_core_base/sepolicy/samples/vendor/ folder contains a sample SELinux configuration for the reference stack:

  • sdv_someip_stack_default.te defines the sdv_someip_stack_default type and maps it to attributes and contexts.

  • file_contexts maps binary and data folders to appropriate contexts.

The configuration enables Binder communication between the stack and the broker, allowing access to networking qualities and granular access to the file system of the device.