Main Content

setDataDefaults

Set default end-to-end (E2E) protection method for AUTOSAR component model

Since R2022b

    Description

    example

    setDataDefaults(slMap,elementCategory,property,value) sets the default setting for the end-to-end (E2E) protection method property in the modeling element category inports and outports of an AUTOSAR component model.

    Use E2E protection to optionally configure sender and receiver ports to securely transmit data between AUTOSAR components. The default end-to-end protection method sets which end-to-end protection method is used for root-level inports and outports in the generated code.

    Supported protection methods are E2E Transformer and E2E Protection Wrapper.

    The protection method is applied to AUTOSAR inports that are configured in the code mappings as EndToEndRead and AUTOSAR outports that are configured as EndToEndWrite.

    Examples

    collapse all

    Set the default end-to-end protection method for the AUTOSAR component model.

    Get the default E2E protection method.

    hModel = 'autosar_swc';
    openExample(hModel);
    
    slMap = autosar.api.getSimulinkMapping(hModel);
    e2eMethod = getDataDefaults(slMap, ...
       'InportsOutports', 'EndToEndProtectionMethod');
    
    e2eMethod =
        'ProtectionWrapper'
    

    Set and then read back the default E2E protection method.

    setDataDefaults(slMap,'InportsOutports', ...
       'EndToEndProtectionMethod', 'TransformerError');
    e2eMethod = getDataDefaults(slMap,...
       'InportsOutports', 'EndToEndProtectionMethod');
    
    e2eMethod =
        'TransformerError'

    Input Arguments

    collapse all

    Simulink to AUTOSAR mapping information for a model, specified as a function handle. Obtain this information using autosar.api.getSimulinkMapping(model), where model is a handle, character vector, or string scalar representing the model name.

    Example: slMap

    Category of model data elements that apply the end-to-end protection property, specified as 'InportsExports'. The only supported modeling element is inports and outports.

    Default end-to-end protection method property that you set with the input parameter value, specified as 'EndToEndProtectionMethod'. The only supported property is E2E protection method.

    Default protection method parameter value to set, specified as one of the following:

    • 'ProtectionWrapper':

      E2E Protection Wrapper, which uses an E2E protection wrapper in the generated code in support of end-to-end data consistency checks.

      E2E protection wrapper is the default setting.

    • 'TransformerError':

      E2E Transformer, which configures RTE calls to use a transformer error argument in the generated code.

      Supported when using AUTOSAR schema version 4.2 or later.

    Example: 'TransformerError'

    Data Types: character vector

    Version History

    Introduced in R2022b