Main Content

Configure AUTOSAR Adaptive Service Instance Identification

You can configure service instance identification for service ports in an AUTOSAR adaptive component. When you build an adaptive software component model:

  • Exported ARXML files include a service instance manifest file, which describes port-to-service instance mapping.

  • Generated C++ code uses the configured service instance information in ara::com function calls.

To configure service instance identification:

  1. Open the AUTOSAR Dictionary and select XML Options. Set XML option Identify Service Instance Using to indicate the form in which to generate service instance information. Select InstanceIdentifier or InstanceSpecifier. The form that you select is used to identify service instances in C++ code files.

    AUTOSAR Dictionary shows XML option "Identify Service Instance Using" specifying Instance Identifier.

  2. Go to the required ports and provided ports views in the dictionary.

  3. If you have selected Instance Specifier to identify the service instance, Instance Specifier for a port is automatically generated.

  4. If you have selected Instance Identifier to identify the service instance, examine the Instance Identifier for the port in AUTOSAR Dictionary. You can enter a value or accept the existing value.

Building the model generates the service instance manifest file model_ServiceInstanceManifest.arxml. The manifest file describes service interface deployments, service instances, and service instance to port mapping for the adaptive component.

In the generated C++ code, ara::com function calls use the configured service instance information. For example, if you selected the InstanceIdentifier form, and set Instance Identifier to 1 for a required port, the generated function calls use that configuration.

// Model initialize function
void autosar_LaneGuidanceModelClass::initialize()
{
  {
    ara::com::ServiceHandleContainer< company::chassis::required::proxy::
      RequiredInterfaceProxy::HandleType > handles;
    ...
    handles = company::chassis::required::proxy::RequiredInterfaceProxy::
      FindService(ara::com::InstanceIdentifier(ara::core::StringView("1")));
    
...

Related Examples

More About