Main Content

target.XCP Class

Namespace: target

Describe XCP protocol stack for target hardware

Since R2021a

Description

Use the target.XCP class to describe the XCP protocol stack for the target hardware.

To create a target.XCP 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 the XCP transport protocol layer through a target.XCPTCPIPTransport or a target.XCPSerialTransport object.

Attributes:

GetAccess
public
SetAccess
public

Optional property to specify the XCP platform abstraction layer. If you do not specify a value, the software uses the default platform abstraction layer, which supports Linux®, Windows®, and Mac platforms.

Attributes:

GetAccess
public
SetAccess
public

Examples

collapse all

This code snippet from Customise Connectivity for XCP External Mode Simulations shows how you can provide a description of the XCP protocol stack for your target hardware.

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

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

xcpTransport = target.create('XCPTCPIPTransport', ...
                'Name', 'XCP Transport');
xcpConfiguration = target.create('XCP', ...
                'Name', 'XCP Configuration', ...
                'XCPTransport', xcpTransport, ...
                'XCPPlatformAbstraction', xcpPlatformAbstraction);

Note

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

xcpConfiguration = target.create('XCP', ...
       'Name', 'XCP TCP/IP Configuration', ...
       'XCPTransportLayer', 'TCP', ...
       'SourceFiles', {fullfile('pathToImplementationFolder', 'myXCPPlatform.c'}, ...
       'IncludePaths', {'pathToImplementationFolder'});

Version History

Introduced in R2021a