Main Content

target.XCPPlatformAbstraction Class

Namespace: target

Specify XCP platform abstraction layer for target hardware

Since R2021a

Description

Use the target.XCPPlatformAbstraction class to specify the implementation of the XCP Platform Abstraction Layer for your target hardware. The layer provides:

To create a target.XCPPlatformAbstraction object, use the target.create function. Create the object and then use separate steps to specify properties. Or, using name-value arguments, create the object and specify properties in a single step.

If you do not create a target.XCPPlatformAbstraction object, the software uses the default platform abstraction layer, which supports Linux®, Windows®, and Mac platforms.

Properties

expand all

Specify preprocessor directives, source files, and header files that are required for the implementation of the XCP platform abstraction layer.

Attributes:

GetAccess
public
SetAccess
public

Examples

collapse all

This code snippet from Customise Connectivity for XCP External Mode Simulations shows how to specify and use a custom implementation of the XCP platform abstraction layer.

xcpPlatformAbstraction = target.create('XCPPlatformAbstraction', ...
                'Name', 'XCP Platform Abstraction');

customPlatformAbstractionPath = 'pathToImplementationFolder';
xcpPlatformAbstraction.BuildDependencies.SourceFiles = ...
                {fullfile(customPlatformAbstractionPath, 'myXCPPlatform.c')};
xcpPlatformAbstraction.BuildDependencies.IncludePaths = ...
                {customPlatformAbstractionPath};

xcpTCPIPTransport = target.create('XCPTCPIPTransport', ...
                'Name', 'XCP TCPIP Transport');

xcpTCPIPConfiguration = target.create('XCP', ...
                'Name', 'XCP TCP/IP Configuration', ...
                'XCPTransport', xcpTCPIPTransport, ...
                'XCPPlatformAbstraction', xcpPlatformAbstraction);

Note

You can create the target.XCPPlatformAbstraction object in a single step.

xcpPlatformAbstraction = target.create('XCPPlatformAbstraction', ...
       'Name', 'XCP Platform Abstraction', ...
       'SourceFiles', {fullfile('pathToImplementationFolder', 'myXCPPlatform.c'}, ...
       'IncludePaths', {'pathToImplementationFolder'});

Version History

Introduced in R2021a