Main Content

target.XCPPlatformAbstraction class

Package: target

Specify XCP platform abstraction layer for target hardware

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.

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');

xcpPlatformAbstraction.BuildDependencies.Defines = {'XCP_CUSTOM_PLATFORM'};
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);
Introduced in R2021a