Main Content

target.XCPExternalModeConnectivity Class

Namespace: target

Represent connectivity options in external mode protocol stack

Since R2021a

Description

Use the target.XCPExternalModeConnectivity class, which is derived from target.ExternalModeConnectivity, to represent XCP connectivity options in the external mode protocol stack.

To create a target.XCPExternalModeConnectivity 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 XCP protocol stack for target hardware.

Examples

collapse all

This code snippet from Customise Connectivity for XCP External Mode Simulations shows how to specify the external mode protocol stack for your target hardware.

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

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

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

extModeTCPConnectivity = ... 
             target.create('XCPExternalModeConnectivity', ...                
             'Name', 'External Mode TCP Connectivity', ...
             'XCP', xcpConfiguration);

externalMode = target.create('ExternalMode', ...
                'Name', 'External Mode', ...
                'Connectivities', extModeTCPConnectivity);

board.CommunicationProtocolStacks = externalMode;

Note

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

extModeTCPConnectivity = target.create('XCPExternalModeConnectivity', ...
        'Name', 'External Mode TCP Connectivity', ...
        'XCPTransportLayer', 'TCP', ...
        'Defines', {'XCP_CUSTOM_PLATFORM'}, ...
        'SourceFiles', {fullfile('pathToImplementationFolder', 'myXCPPlatform.c'}, ...
        'IncludePaths', {'pathToImplementationFolder'});

Version History

Introduced in R2021a