Main Content

getCodeInterfaceType

Class: coder.Dictionary
Namespace: coder

Determine whether coder.Dictionary object represents a service interface configuration or data interface configuration

Since R2023b

Syntax

interfaceType = getCodeInterfaceType(dict)

Description

interfaceType = getCodeInterfaceType(dict) returns the code interface type of the coder.Dictionary object. The type is either ServiceInterface or DataInterface. The interface type determines which types of code definitions you use in the dictionary and how you can deploy the generated code.

  • Data interface — The code generator creates a program intended to run on the target device. You define the code interfaces by using storage classes, memory sections, and function customization templates.

  • Service interface — The code generator creates an algorithm that you intend to deploy within a larger application for a target platform. The platform middleware calls the algorithm code and defines services for the target device. You define how the generated code calls the services by creating function and service interface definitions in the dictionary.

Input Arguments

expand all

Embedded Coder dictionary, specified as a coder.Dictionary object.

Output Arguments

expand all

Code interface configuration type of the coder dictionary, returned as a string. The interface type is either 'ServiceInterface' or 'DataInterface'.

Examples

expand all

Open the model RollAxisAutopilot. Assign the coder.Dictionary object for the model to the variable coderDictObj.

openExample('RollAxisAutopilot')
coderDictObj = coder.dictionary.open('RollAxisAutopilot');

Determine the code interface type for the Embedded Coder Dictionary by using the coder.Dictionary object.

interfaceType = getCodeInterfaceType(coderDictObj)
interfaceType =

    'DataInterface'

The dictionary has the data interface type. For the data interface type, you can add storage classes, memory sections, and function customization templates to represent the code interface.

Version History

Introduced in R2023b