주요 콘텐츠

Configure AUTOSAR Adaptive Service Instance Identifier

Service instance identifiers, service interface identifiers, and service versioning facilitate communication and interaction between software components in service-oriented architectures. A service interface defines the type of service, and a service instance defines where a specific service is running. The service interface identifier (also known as Service ID) identifies the interface of a service, and the service instance identifier identifies a specific instance of a service.

AUTOSAR Blockset allows you to configure the service instance identifier for a service port in an AUTOSAR adaptive component. In the AUTOSAR dictionary, under XML Options, set the Identify Service Instance Using option to:

  • InstanceSpecifier to automatically generate the instance specifier and identify the service instance.

  • InstanceIdentifier to accept the generated instance identifier or specify a value for it.

Configure Instance Identifier

These steps show how to configure the instance identifier for a service port in the autosar_LaneGuidance model.

  1. Open the model.

    open_system("autosar_LaneGuidance");

  2. Enable the AUTOSAR tab by clicking the AUTOSAR Component Designer app on the Apps tab.

  3. Open the AUTOSAR Dictionary by clicking the Code Interface > AUTOSAR Dictionary on the AUTOSAR tab.

  4. View and edit XML options by clicking the XML Options in the AUTOSAR Dictionary.

  5. Set the Identify Service Instance Using XML option to InstanceIdentifier.

  6. Specify a value for the Instance Identifier in the AdaptiveApplications > LaneGuidance > RequiredPorts.

  7. Save and build the model.

The model build process generates the service instance manifest file (autosarLaneGuidance_ServiceInstanceManifest.arxml) which describes service interface deployments, service instances, and service instance to port mapping for the adaptive component. In the generated C++ code, the ara::com function calls use the configured service instance information.

For example, if you specify 1 for the instance identifier 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")));

See Also

|

Topics