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. 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.

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

Note

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

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