Main Content

getDataDefaults

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

Since R2022b

    Description

    e2eMethod = getDataDefaults(slMap,elementCategory,property) returns the default setting for the end-to-end (E2E) protection method used for inports and outports of an AUTOSAR component model.

    Use E2E protection to optionally configure sender-receiver ports to securely transmit data between AUTOSAR components. The default E2E protection method sets the E2E protection method used for root-level inports and outports in the generated code. E2E protection methods are applied to AUTOSAR inports that are configured as EndToEndRead ports and AUTOSAR outports that are configured as EndToEndWrite ports.

    Supported protection methods are E2E Transformer Error and E2E Protection Wrapper.

    example

    Examples

    collapse all

    Return the default E2E protection method setting for an 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 display 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 by using autosar.api.getSimulinkMapping(model), where model is a handle, character vector, or string scalar representing the model name.

    Example: slMap = autosar.api.getSimulinkMapping("modelName")

    Category of model data elements that apply the E2E protection property, specified as "InportsOutports". The only supported model elements are inports and outports.

    Default E2E protection method, specified as "EndToEndProtectionMethod". The only supported property is E2E protection method.

    Output Arguments

    collapse all

    Name of the protection method, returned as one of these values:

    • 'ProtectionWrapper' — Generated code uses an E2E protection wrapper in support of E2E data consistency checks.

    • 'TransformerError' — E2E Transformer configures RTE calls to use a transformer error argument in the generated code.

      When the data type of the error status port is uint16, the error status value combines the return value of the Rte_Read function and the transformer error code to create a 16-bit error code, where the least significant eight bits are the output of the Rte_Read function and the most significant eight bits are the transformer error code.

      The TransformerError protection method is supported only when using AUTOSAR schema version 4.2 or later.

    Data Types: char

    Version History

    Introduced in R2022b