4. Examples

4.1. Introduction

This section includes examples of how to use rtiaragen against an ECU AUTOSAR ARXML export "Lights.arxml". Wherever you see <path to examples>, replace it with the appropriate path. Default paths to the examples are shown below:

  • macOS systems: /Users/your user name/rti_workspace/drive-3.0.0/6.1.2/examples

  • Linux systems: /home/your user name/rti_workspace/drive-3.0.0/6.1.2/examples

  • Windows systems: <your Windows documents folder>\rti_workspace\drive-3.0.0\6.1.2\examples, where <your Windows documents folder> depends on your version of Windows. For example, on Windows 10 systems, the path to the Documents folder is C:\Users\your user name\Documents.

You will find the file "Lights.arxml" under <path to examples>/integration_toolkit_for_autosar_adaptive/lights.

This export file features the following relevant entities:

  • An AUTOSAR package containing fundamental Standard Types.

  • An examples/lights package defining a Service Interface related to vehicle lights control.

  • An examples/lights/types subpackage defining project-specific Implementation Data Types.

  • An examples/lights/deployment subpackage defining DDS-specific Interface and Instance Deployments of the above defined Service Interface.

  • An examples/lights/components subpackage defining an Adaptive Application Software Component Type which both requires and Provides the above defined Service Interface.

  • An examples/lights/executables subpackage defining an Executable hosting the above defined Adaptive Application.

  • An examples/lights/mappings subpackage Service Instance to Port Prototype Mappings suitable for the above defined Service Instance Deployments and Port Prototypes.

The goal of this model is to portray a generic executable that can both provide and consume the Lights Service Interface, which is comprised of the following elements:

  • An Exception event used to convey the status of the lights subsystem according to a Severity color scale (Red, Amber, None).

  • LowBeam, HighBeam, Brake and Backup fields indicating, and allowing to change, the status of each independent light (Low Beam, Hight Beam, Brake and Backup, respectively).

Figure 1: Example AUTOSAR Classic ECU architecture featuring DDS integration

Using this simple ECU design as starting point, the following sections will demonstrate code generation features offered by rtiaragen. These examples are progressive, where each step produces the outputs from all previous examples plus the use case at hand. However, the different command-line parameters can be used to generate any set of outputs in isolation or combination.

Note

In all following sections, a UNIX-style convention is used for describing file paths ("/" is the component separator). On Windows platforms, use Windows-style paths ("\" is the component separator, and drive specifiers such as "C:" or "\\" should be used in absolute paths).

4.2. Getting Help

You can access online help with rtiaragen parameters and variables with the following command:

$ rtiaragen -help
RTI Connext Integration Toolkit for AUTOSAR Adaptive 3.0.0.0

Usage:
   rtiaragen [options] <input> <input> ...

...

4.3. Self-Testing

To ensure proper access to code generation template files (mandatory) and rtiddsgen (optional), use the following commmand-line parameter:

$ rtiaragen -selfTest
[CLI|inf] C++ templates base path: "templates/cpp"
[CLI|inf] // C++ templates OK
[CLI|inf]
[CLI|inf] DDS-IDL templates base path: "templates/ddsidl"
[CLI|inf] /* DDS-IDL templates OK */
[CLI|inf]
[CLI|inf] DDS-XML templates base path: "templates/ddsxml"
[CLI|inf] <!-- DDS-XML templates OK -->
[CLI|inf]
[CLI|inf] Key-Value templates base path: "templates/keyvalue"
[CLI|inf] # DDS-XML templates OK
[CLI|inf]
[CLI|inf] JSON templates base path: "templates/json"
[CLI|inf]     "JSON templates OK",
[CLI|inf]
[CLI|inf] rtiddsgen is NOT available
[CLI|inf] rtiddsgen parameters are: <undefined>

In the above example, template files are found, but rtiddsgen is not in the terminal session's PATH environment variable, so rtiaragen can't ensure its availability. After making rtiddsgen available through PATH inclusion as follows:

$ export PATH=$PATH:/opt/Connext/rti_connext_dds_micro-2.4.14.1/rtiddsgen/scripts

All integrity checks succeed:

$ rtiaragen -selfTest
[CLI|inf] C++ templates base path: "templates/cpp"
[CLI|inf] // C++ templates OK
[CLI|inf]
[CLI|inf] DDS-IDL templates base path: "templates/ddsidl"
[CLI|inf] /* DDS-IDL templates OK */
[CLI|inf]
[CLI|inf] DDS-XML templates base path: "templates/ddsxml"
[CLI|inf] <!-- DDS-XML templates OK -->
[CLI|inf]
[CLI|inf] Key-Value templates base path: "templates/keyvalue"
[CLI|inf] # DDS-XML templates OK
[CLI|inf]
[CLI|inf] JSON templates base path: "templates/json"
[CLI|inf]     "JSON templates OK",
[CLI|inf]
INFO com.rti.ndds.nddsgen.Main rtiddsgen version 2.5.2.32
INFO com.rti.ndds.nddsgen.Main Connext DDS templates: E4EE-7F61-28DC-89C9-D1F9-8AED-A94C-BB28
INFO com.rti.ndds.nddsgen.Main Connext Micro templates: 05F2-53AD-C0CA-DF36-387C-37DF-CC26-13F6
[CLI|inf] rtiddsgen is available
[CLI|inf] rtiddsgen parameters are: <undefined>

4.4. Generating DDS Types from AUTOSAR Types (Multiple Files)

As mentioned above, Lights.arxml contains a rather complete set of platform- and project-specific data types. In the following example we will use rtiaragen to produce DDS-IDL files mapping AUTOSAR types referenced either directly or indirectly by any SW-C:

$ mkdir types
$ rtiaragen -idlTypes <path to examples>/integration_toolkit_for_autosar_adaptive/lights/Lights.arxml -idlPath types
RTI Connext Integration Toolkit for AUTOSAR Adaptive 3.0.0.0
[CLI|inf] Parsing XML file(s)...
[CLI|inf] Parsing types...
[CLI|inf] Parsing error domains...
[CLI|inf] Parsing service interfaces...
[CLI|inf] Parsing DDS deployments...
[CLI|inf] Parsing components...
[CLI|inf] Parsing executables...
[CLI|inf] Pruned 0/1 executables.
[CLI|inf] Pruned 0/1 service interfaces.
[CLI|inf] Pruned 0/0 error domains.
[CLI|inf] Pruned 0/1 service interface deployments.
[CLI|inf] Pruned 10/16 types.
[CLI|inf] Pruned 1/16 compu-method types.
[CLI|inf] Generating for target environment generic_generic.
[CLI|inf] Generating DDS-IDL types...
[CLI|inf] Done.
[CLI|inf] 0 error(s), 0 warning(s).
$ tree types
types
├── SeverityCompuMethod.idl
└── examples
    └── lights
        └── types
            ├── Exception.idl
            ├── LightStatus.idl
            └── Severity.idl

Note how directories are used to convey AUTOSAR namespace (and DDS module) structure. The -idlPath types flag is employed to direct all generation to a specific path.

Also, a similar command line can be used to output DDS-XML instead of DDS-XML files, by using -xmlTypes and -xmlPath ... command-line arguments instead:

$ rm -rf types
$ mkdir types
$ rtiaragen -xmlTypes <path to examples>/integration_toolkit_for_autosar_adaptive/lights/Lights.arxml -xmlPath types
RTI Connext Integration Toolkit for AUTOSAR Adaptive 3.0.0.0
[CLI|inf] Parsing XML file(s)...
[CLI|inf] Parsing types...
[CLI|inf] Parsing error domains...
[CLI|inf] Parsing service interfaces...
[CLI|inf] Parsing DDS deployments...
[CLI|inf] Parsing components...
[CLI|inf] Parsing executables...
[CLI|inf] Pruned 0/1 executables.
[CLI|inf] Pruned 0/1 service interfaces.
[CLI|inf] Pruned 0/0 error domains.
[CLI|inf] Pruned 0/1 service interface deployments.
[CLI|inf] Pruned 10/16 types.
[CLI|inf] Pruned 1/16 compu-method types.
[CLI|inf] Generating for target environment generic_generic.
[CLI|inf] Generating DDS-XML types...
[CLI|inf] Done.
[CLI|inf] 0 error(s), 0 warning(s).
$ tree types
types
├── SeverityCompuMethod.xml
└── examples
    └── lights
        └── types
            ├── Exception.xml
            ├── LightStatus.xml
            └── Severity.xml

4.5. Generating DDS Types from AUTOSAR Types (Single File)

Producing too many DDS-IDL (or DDS-XML) files can be undesired or problematic in some environments, thus rtiaragen provides the -singleFile command-line flag:

$ rm -rf types
$ mkdir types
$ rtiaragen -idlTypes <path to examples>/integration_toolkit_for_autosar_adaptive/lights/Lights.arxml -idlPath types -singleFile
RTI Connext Integration Toolkit for AUTOSAR Adaptive 3.0.0.0
[CLI|inf] Parsing XML file(s)...
[CLI|inf] Parsing types...
[CLI|inf] Parsing error domains...
[CLI|inf] Parsing service interfaces...
[CLI|inf] Parsing DDS deployments...
[CLI|inf] Parsing components...
[CLI|inf] Parsing executables...
[CLI|inf] Pruned 0/1 executables.
[CLI|inf] Pruned 0/1 service interfaces.
[CLI|inf] Pruned 0/0 error domains.
[CLI|inf] Pruned 0/1 service interface deployments.
[CLI|inf] Pruned 10/16 types.
[CLI|inf] Pruned 1/16 compu-method types.
[CLI|inf] Generating for target environment generic_generic.
[CLI|inf] Generating DDS-IDL types...
[CLI|inf] Done.
[CLI|inf] 0 error(s), 0 warning(s).
$ tree types
types
└── Lights_types.idl

In the above example, Lights_types.idl contains the same set of types (within the same namespace/module structure) generated in previous examples, but appended together in a single file and sorted by dependency. This way, no type is defined without all related types being defined earlier.

Note

From this point on, all examples will use the -singleFile command-line parameter, so examples produce a smaller and easier to understand set of files.

4.6. Generating DDS Types from AUTOSAR Service Interfaces

AUTOSAR Service Interfaces are represented in DDS-IDL (or DDS-XML) as a set of DDS types specifically designed for the purpose of exercising instance-oriented Request and Reply transmission. This pattern is also commonly known as "Remote Procedure Call" or simply "RPC".

$ rm -rf types
$ mkdir types
$ rtiaragen -idlTypes -idlServiceInterfaces <path to examples>/integration_toolkit_for_autosar_adaptive/lights/Lights.arxml -idlPath types -singleFile
RTI Connext Integration Toolkit for AUTOSAR Adaptive 3.0.0.0
[CLI|inf] Parsing XML file(s)...
[CLI|inf] Parsing types...
[CLI|inf] Parsing error domains...
[CLI|inf] Parsing service interfaces...
[CLI|inf] Parsing DDS deployments...
[CLI|inf] Parsing components...
[CLI|inf] Parsing executables...
[CLI|inf] Pruned 0/1 executables.
[CLI|inf] Pruned 0/1 service interfaces.
[CLI|inf] Pruned 0/0 error domains.
[CLI|inf] Pruned 0/1 service interface deployments.
[CLI|inf] Pruned 10/16 types.
[CLI|inf] Pruned 1/16 compu-method types.
[CLI|inf] Generating for target environment generic_generic.
[CLI|inf] Generating DDS-IDL types...
[CLI|inf] Generating service interfaces (DDS-IDL)...
[CLI|inf] Done.
[CLI|inf] 0 error(s), 0 warning(s).
$ tree types
types
├── Lights_types.idl
├── compatibility.idl
├── dds_rpc.idl
└── lights.idl

In the above example, Lights_types.idl contains the DDS-IDL translation of the AUTOSAR Data types defined in the input ARXML file, whereas lights.idl defines the DDS-IDL types specific to the examples::lights::Lights Service Interface.

compatibility.idl and dds_rpc.idl contain common DDS-RPC support types required by all DDS Service Interface definitions.

Note

All of the above generations can target DDS-XML instead of DDS-IDL, via the -xmlTypes, -xmlServiceInterfaces and -xmlPath flags.

4.7. Generating DDS Type Support Files

DDS-IDL and/or DDS-XML files produced by previous examples can be fed to rtiddsgen as needed, in order to produce C-language type support code. rtiaragen can also do this via the -ddsTypeSupport command-line parameter, provided that rtiddsgen is available in the terminal sessions PATH environment variable (see self-testing above for details):

$ rm -rf types
$ mkdir types
$ rtiaragen -idlTypes -idlServiceInterfaces -ddsTypeSupport <path to examples>/integration_toolkit_for_autosar_adaptive/lights/Lights.arxml -idlPath types -cppHeaderPath types -cppSourcePath types -singleFile
RTI Connext Integration Toolkit for AUTOSAR Adaptive 3.0.0.0
[CLI|inf] Parsing XML file(s)...
[CLI|inf] Parsing types...
[CLI|inf] Parsing error domains...
[CLI|inf] Parsing service interfaces...
[CLI|inf] Parsing DDS deployments...
[CLI|inf] Parsing components...
[CLI|inf] Parsing executables...
[CLI|inf] Pruned 0/1 executables.
[CLI|inf] Pruned 0/1 service interfaces.
[CLI|inf] Pruned 0/0 error domains.
[CLI|inf] Pruned 0/1 service interface deployments.
[CLI|inf] Pruned 10/16 types.
[CLI|inf] Pruned 1/16 compu-method types.
[CLI|inf] Generating for target environment generic_generic.
[CLI|inf] Generating DDS-IDL types...
[CLI|inf] Generating service interfaces (DDS-IDL)...
INFO com.rti.ndds.nddsgen.Main rtiddsgen version 2.5.2.32
INFO com.rti.ndds.nddsgen.Main Connext DDS templates: E4EE-7F61-28DC-89C9-D1F9-8AED-A94C-BB28
INFO com.rti.ndds.nddsgen.Main Connext Micro templates: 05F2-53AD-C0CA-DF36-387C-37DF-CC26-13F6
[CLI|inf] Generating type support files...
[CLI|inf] Generating C type support files from types/Lights_types.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/lights.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/dds_rpc.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/compatibility.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Done.
[CLI|inf] 0 error(s), 0 warning(s).
$ tree types
types
├── Lights_types.cxx
├── Lights_types.h
├── Lights_types.idl
├── Lights_typesPlugin.cxx
├── Lights_typesPlugin.h
├── Lights_typesSupport.cxx
├── Lights_typesSupport.h
├── compatibility.cxx
├── compatibility.h
├── compatibility.idl
├── compatibilityPlugin.cxx
├── compatibilityPlugin.h
├── compatibilitySupport.cxx
├── compatibilitySupport.h
├── dds_rpc.cxx
├── dds_rpc.h
├── dds_rpc.idl
├── dds_rpcPlugin.cxx
├── dds_rpcPlugin.h
├── dds_rpcSupport.cxx
├── dds_rpcSupport.h
├── lights.cxx
├── lights.h
├── lights.idl
├── lightsPlugin.cxx
├── lightsPlugin.h
├── lightsSupport.cxx
└── lightsSupport.h

Note how -cppSourcePath ... and -cppHeaderPath ... command-line parameters are used to direct the target folder of .cxx and .h file generation.

4.8. Generating C++ Implementation Types, Error Domains and Service Interfaces

This feature is not strictly required of rtiaragen, since generation of C++ Implementation Types, Error Domains and Service Interfaces are a generic feature of the Adaptive Platform.

Still, the DDS Network Binding depends on their predictable generation in order to correctly marshal data from generic ara::com API calls into DDS API calls. So, for reference and testing, rtiaragen also provides the -implementationTypes, -errorDomains and -serviceInterfaces options:

$ rm -rf types
$ mkdir types
$ rtiaragen -idlTypes -idlServiceInterfaces -ddsTypeSupport -implementationTypes -errorDomains -serviceInterfaces <path to examples>/integration_toolkit_for_autosar_adaptive/lights/Lights.arxml -idlPath types -cppHeaderPath types -cppSourcePath types -singleFile
RTI Connext Integration Toolkit for AUTOSAR Adaptive 3.0.0.0
[CLI|inf] Parsing XML file(s)...
[CLI|inf] Parsing types...
[CLI|inf] Parsing error domains...
[CLI|inf] Parsing service interfaces...
[CLI|inf] Parsing DDS deployments...
[CLI|inf] Parsing components...
[CLI|inf] Parsing executables...
[CLI|inf] Pruned 0/1 executables.
[CLI|inf] Pruned 0/1 service interfaces.
[CLI|inf] Pruned 0/0 error domains.
[CLI|inf] Pruned 0/1 service interface deployments.
[CLI|inf] Pruned 10/16 types.
[CLI|inf] Pruned 1/16 compu-method types.
[CLI|inf] Generating for target environment generic_generic.
[CLI|inf] Generating DDS-IDL types...
[CLI|inf] Generating service interfaces (DDS-IDL)...
INFO com.rti.ndds.nddsgen.Main rtiddsgen version 2.5.2.32
INFO com.rti.ndds.nddsgen.Main Connext DDS templates: E4EE-7F61-28DC-89C9-D1F9-8AED-A94C-BB28
INFO com.rti.ndds.nddsgen.Main Connext Micro templates: 05F2-53AD-C0CA-DF36-387C-37DF-CC26-13F6
[CLI|inf] Generating type support files...
[CLI|inf] Generating C type support files from types/Lights_types.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/lights.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/dds_rpc.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/compatibility.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating implementation types...
[CLI|inf] Generating error domains...
[CLI|inf] Generating service interfaces (C++)...
[CLI|inf] Done.
[CLI|inf] 0 error(s), 0 warning(s).
$ tree types
types
├── Lights_types.cxx
├── Lights_types.h
├── Lights_types.idl
├── Lights_typesPlugin.cxx
├── Lights_typesPlugin.h
├── Lights_typesSupport.cxx
├── Lights_typesSupport.h
├── compatibility.cxx
├── compatibility.h
├── compatibility.idl
├── compatibilityPlugin.cxx
├── compatibilityPlugin.h
├── compatibilitySupport.cxx
├── compatibilitySupport.h
├── dds_rpc.cxx
├── dds_rpc.h
├── dds_rpc.idl
├── dds_rpcPlugin.cxx
├── dds_rpcPlugin.h
├── dds_rpcSupport.cxx
├── dds_rpcSupport.h
├── examples
│   └── lights
│       └── types
│           ├── impl_type_Exception.h
│           ├── impl_type_LightStatus.h
│           └── impl_type_Severity.h
├── impl_type_SeverityCompuMethod.h
├── lights.cxx
├── lights.h
├── lights.idl
├── lightsPlugin.cxx
├── lightsPlugin.h
├── lightsSupport.cxx
├── lightsSupport.h
├── lights_common.cpp
├── lights_common.h
├── lights_proxy.h
└── lights_skeleton.h

Note how the examples folder containing C++ Implementation Types has been generated, containing one header per type located in a directory that represents the enclosing namespace hierachy.

Additionally, C++ skeleton, proxy, and common files have been generated, representing the examples::lights::Lights Service Interface.

The example input file does not define any application-specific error domains, so none have been generated.

In the next section, C type support and C++ Implementation types will be tied together towards DDS Network Binding generation via generation of conversion routines.

4.9. Generating C++ Conversion Routines

After DDS-IDL (and/or DDS-XML) type files, their C type support counterparts and their corresponding C++ Implementation Types have been produced, the next step towards ECU integration is conversion routine generation with the -conversions command-line parameter:

$ rm -rf types
$ mkdir types
$ rtiaragen -idlTypes -idlServiceInterfaces -ddsTypeSupport -implementationTypes -errorDomains -serviceInterfaces -conversions <path to examples>/integration_toolkit_for_autosar_adaptive/lights/Lights.arxml -idlPath types -cppHeaderPath types -cppSourcePath types -singleFile
RTI Connext Integration Toolkit for AUTOSAR Adaptive 3.0.0.0
[CLI|inf] Parsing XML file(s)...
[CLI|inf] Parsing types...
[CLI|inf] Parsing error domains...
[CLI|inf] Parsing service interfaces...
[CLI|inf] Parsing DDS deployments...
[CLI|inf] Parsing components...
[CLI|inf] Parsing executables...
[CLI|inf] Pruned 0/1 executables.
[CLI|inf] Pruned 0/1 service interfaces.
[CLI|inf] Pruned 0/0 error domains.
[CLI|inf] Pruned 0/1 service interface deployments.
[CLI|inf] Pruned 10/16 types.
[CLI|inf] Pruned 1/16 compu-method types.
[CLI|inf] Generating for target environment generic_generic.
[CLI|inf] Generating DDS-IDL types...
[CLI|inf] Generating service interfaces (DDS-IDL)...
INFO com.rti.ndds.nddsgen.Main rtiddsgen version 2.5.2.32
INFO com.rti.ndds.nddsgen.Main Connext DDS templates: E4EE-7F61-28DC-89C9-D1F9-8AED-A94C-BB28
INFO com.rti.ndds.nddsgen.Main Connext Micro templates: 05F2-53AD-C0CA-DF36-387C-37DF-CC26-13F6
[CLI|inf] Generating type support files...
[CLI|inf] Generating C type support files from types/Lights_types.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/lights.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/dds_rpc.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/compatibility.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating implementation types...
[CLI|inf] Generating conversions...
[CLI|inf] Generating error domains...
[CLI|inf] Generating service interfaces (C++)...
[CLI|inf] Done.
[CLI|inf] 0 error(s), 0 warning(s).
$ tree types
types
├── Lights_conversions.cpp
├── Lights_conversions.h
├── Lights_types.cxx
├── Lights_types.h
├── Lights_types.idl
├── Lights_typesPlugin.cxx
├── Lights_typesPlugin.h
├── Lights_typesSupport.cxx
├── Lights_typesSupport.h
├── compatibility.cxx
├── compatibility.h
├── compatibility.idl
├── compatibilityPlugin.cxx
├── compatibilityPlugin.h
├── compatibilitySupport.cxx
├── compatibilitySupport.h
├── dds_rpc.cxx
├── dds_rpc.h
├── dds_rpc.idl
├── dds_rpcPlugin.cxx
├── dds_rpcPlugin.h
├── dds_rpcSupport.cxx
├── dds_rpcSupport.h
├── examples
│   └── lights
│       └── types
│           ├── impl_type_Exception.h
│           ├── impl_type_LightStatus.h
│           └── impl_type_Severity.h
├── impl_type_SeverityCompuMethod.h
├── lights.cxx
├── lights.h
├── lights.idl
├── lightsPlugin.cxx
├── lightsPlugin.h
├── lightsSupport.cxx
├── lightsSupport.h
├── lights_common.cpp
├── lights_common.h
├── lights_proxy.h
└── lights_skeleton.h

Two new Lights_conversions.cpp and Lights_conversions.h C++ files have now been generated, containing conversion routines between AUTOSAR C++ Language Binding types a nd DDS IDL C PSM types.

4.10. Generating Deployment Configuration Files (Key/Value Format)

Adaptive Platform Network Bindings are allowed to obtain certain parameters in run-time by loading them from the Deployment Configuration stored in the Processed Application Manifest.

Again, for reference, rtiaragen produces a version of this Deployment Configuration in Key/Value file format. This format has been chosen for readability and simplicity, and doesn't conform to any AUTOSAR standard or particular vendor implementation.

$ rm -rf types
$ mkdir types
$ rtiaragen -idlTypes -idlServiceInterfaces -ddsTypeSupport -implementationTypes -errorDomains -serviceInterfaces -conversions -deployments <path to examples>/integration_toolkit_for_autosar_adaptive/lights/Lights.arxml -idlPath types -cppHeaderPath types -cppSourcePath types -kvPath types -singleFile
RTI Connext Integration Toolkit for AUTOSAR Adaptive 3.0.0.0
[CLI|inf] Parsing XML file(s)...
[CLI|inf] Parsing types...
[CLI|inf] Parsing error domains...
[CLI|inf] Parsing service interfaces...
[CLI|inf] Parsing DDS deployments...
[CLI|inf] Parsing components...
[CLI|inf] Parsing executables...
[CLI|inf] Pruned 0/1 executables.
[CLI|inf] Pruned 0/1 service interfaces.
[CLI|inf] Pruned 0/0 error domains.
[CLI|inf] Pruned 0/1 service interface deployments.
[CLI|inf] Pruned 10/16 types.
[CLI|inf] Pruned 1/16 compu-method types.
[CLI|inf] Generating for target environment generic_generic.
[CLI|inf] Generating DDS-IDL types...
[CLI|inf] Generating service interfaces (DDS-IDL)...
INFO com.rti.ndds.nddsgen.Main rtiddsgen version 2.5.2.32
INFO com.rti.ndds.nddsgen.Main Connext DDS templates: E4EE-7F61-28DC-89C9-D1F9-8AED-A94C-BB28
INFO com.rti.ndds.nddsgen.Main Connext Micro templates: 05F2-53AD-C0CA-DF36-387C-37DF-CC26-13F6
[CLI|inf] Generating type support files...
[CLI|inf] Generating C type support files from types/Lights_types.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/lights.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/dds_rpc.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/compatibility.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating implementation types...
[CLI|inf] Generating conversions...
[CLI|inf] Generating error domains...
[CLI|inf] Generating service interfaces (C++)...
[CLI|inf] Generating deployments...
[CLI|inf] Done.
[CLI|inf] 0 error(s), 0 warning(s).
$ tree types
types
├── Executable
│   └── etc
│       └── Executable.kv
├── Lights_conversions.cpp
├── Lights_conversions.h
├── Lights_types.cxx
├── Lights_types.h
├── Lights_types.idl
├── Lights_typesPlugin.cxx
├── Lights_typesPlugin.h
├── Lights_typesSupport.cxx
├── Lights_typesSupport.h
├── compatibility.cxx
├── compatibility.h
├── compatibility.idl
├── compatibilityPlugin.cxx
├── compatibilityPlugin.h
├── compatibilitySupport.cxx
├── compatibilitySupport.h
├── dds_rpc.cxx
├── dds_rpc.h
├── dds_rpc.idl
├── dds_rpcPlugin.cxx
├── dds_rpcPlugin.h
├── dds_rpcSupport.cxx
├── dds_rpcSupport.h
├── examples
│   └── lights
│       └── types
│           ├── impl_type_Exception.h
│           ├── impl_type_LightStatus.h
│           └── impl_type_Severity.h
├── impl_type_SeverityCompuMethod.h
├── lights.cxx
├── lights.h
├── lights.idl
├── lightsPlugin.cxx
├── lightsPlugin.h
├── lightsSupport.cxx
├── lightsSupport.h
├── lights_common.cpp
├── lights_common.h
├── lights_proxy.h
└── lights_skeleton.h

For each Executable, new Key/Value is generated (Executable/etc/Executable.kv in this case), containing conversion run-time adjustable parameters for each DDS Service Instance Deployment.

In the next section, JSON-formatted DDS Service Instance Deployment configuration will be generated, more in line with commercially available AUTOSAR Adaptive Platform implementations.

4.11. Vendor-specific Code Generation

A command-line option that has not been discussed so far is -target. This command-line option allows the user to inform the code generator about the specific AUTOSAR Adaptive Platform implementation in which the generated code will be used. Doing so directs rtiaragen with regards to file formats and implementation-specific generation of assets.

Possible values for target are documented in Command Line Parameters for rtiaragen, and describe the target Adaptive Platform's vendor, product and version information, although generally only vendor and product names are required.

In the following example we produce DDS Network Binding code compatible with Vector® Adaptive Microsar®.

$ rm -rf types
$ mkdir types
$ rtiaragen -target vector_microsar -idlTypes -idlServiceInterfaces -ddsTypeSupport -conversions -deployments -vendorSupport <path to examples>/integration_toolkit_for_autosar_adaptive/lights/Lights.arxml -idlPath types -cppHeaderPath types -cppSourcePath types -jsonPath types -singleFile
RTI Connext Integration Toolkit for AUTOSAR Adaptive 3.0.0.0
[CLI|inf] Parsing XML file(s)...
[CLI|inf] Parsing types...
[CLI|inf] Parsing error domains...
[CLI|inf] Parsing service interfaces...
[CLI|inf] Parsing DDS deployments...
[CLI|inf] Parsing components...
[CLI|inf] Parsing executables...
[CLI|inf] Pruned 0/1 executables.
[CLI|inf] Pruned 0/1 service interfaces.
[CLI|inf] Pruned 0/0 error domains.
[CLI|inf] Pruned 0/1 service interface deployments.
[CLI|inf] Pruned 10/16 types.
[CLI|inf] Pruned 1/16 compu-method types.
[CLI|inf] Generating for target environment vector_microsar.
[CLI|inf] Generating DDS-IDL types...
[CLI|inf] Generating service interfaces (DDS-IDL)...
INFO com.rti.ndds.nddsgen.Main rtiddsgen version 2.5.2.32
INFO com.rti.ndds.nddsgen.Main Connext DDS templates: E4EE-7F61-28DC-89C9-D1F9-8AED-A94C-BB28
INFO com.rti.ndds.nddsgen.Main Connext Micro templates: 05F2-53AD-C0CA-DF36-387C-37DF-CC26-13F6
[CLI|inf] Generating type support files...
[CLI|inf] Generating C type support files from types/Lights_types.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/lights.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/dds_rpc.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating C type support files from types/compatibility.idl ...
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.5.2.32, please wait ...
INFO com.rti.ndds.nddsgen.Main Done
[CLI|inf] Generating conversions...
[CLI|inf] Generating deployments...
[CLI|inf] Generating vendor-specific support files...
[CLI|inf] Done.
[CLI|inf] 0 error(s), 0 warning(s).
$ tree types
types
├── Executable
│   ├── etc
│   │   └── Executable.json
│   ├── include
│   │   └── amsr
│   │       └── rti_dds_binding
│   │           └── transformation_layer
│   │               └── internal
│   │                   └── examples
│   │                       └── lights
│   │                           ├── Lights_proxy_rti_dds_binding.h
│   │                           ├── Lights_proxy_rti_dds_binding_events.h
│   │                           ├── Lights_skeleton_rti_dds_binding.h
│   │                           └── Lights_skeleton_rti_dds_binding_events.h
│   └── src
│       └── amsr
│           └── rti_dds_binding
│               ├── internal
│               │   └── compile_time_configurator.cpp
│               └── transformation_layer
│                   └── internal
│                       └── life_cycle_manager_xf.cpp
├── Lights_conversions.cpp
├── Lights_conversions.h
├── Lights_types.cxx
├── Lights_types.h
├── Lights_types.idl
├── Lights_typesPlugin.cxx
├── Lights_typesPlugin.h
├── Lights_typesSupport.cxx
├── Lights_typesSupport.h
├── compatibility.cxx
├── compatibility.h
├── compatibility.idl
├── compatibilityPlugin.cxx
├── compatibilityPlugin.h
├── compatibilitySupport.cxx
├── compatibilitySupport.h
├── dds_rpc.cxx
├── dds_rpc.h
├── dds_rpc.idl
├── dds_rpcPlugin.cxx
├── dds_rpcPlugin.h
├── dds_rpcSupport.cxx
├── dds_rpcSupport.h
├── lights.cxx
├── lights.h
├── lights.idl
├── lightsPlugin.cxx
├── lightsPlugin.h
├── lightsSupport.cxx
├── lightsSupport.h
├── lights_common.cpp
├── lights_common.h
└── lights_dds.h

Note how several command line flags (-implementationTypes, -errorDomains and -serviceInterfaces) are no longer in use. This is because the Adaptive Microsar® will produce them within its own code generators.

Instead, this example employs -target vector_microsar and -vendorSupport to generate the following, in addition to artifacts described by previous sections:

  • JSON-formatted deployment configuration for the DDS Network Binding, which is the format Adaptive Microsar® uses for configuration files (Executable/etc).

  • Compile-time deployment configuration implementation (Executable/include and Executable/src).