AUTOSAR 通信
配置通信端口和接口
AUTOSAR 软件组件的通信接口由明确定义的端口组成。AUTOSAR 组件通过其端口与其他 AUTOSAR 软件组件或基础软件 (BSW) 服务进行通信。端口向其通信合作方提供信息,或向其通信合作方请求信息。基于组件功能需求,组件拥有的每个端口都映射到一个通信接口。通信接口包括:
发送方-接收方 (S-R) 接口,用于消息传递
客户端-服务器 (C-S) 接口,用于函数调用
模式-切换 (M-S) 接口,用于管理基于模式的执行
非易失性 (NV) 数据接口,用于基于端口的 NV 数据访问
参数接口,用于基于端口的参数数据访问
触发器接口,用于管理基于触发器的执行
要为组件端口配置 AUTOSAR 通信,您需要创建一个 AUTOSAR 接口,将端口映射到该接口,并将 Simulink® 元素(如根输入端口或输出端口)映射到接口类型要求的 AUTOSAR 端口。使用 AUTOSAR 字典和代码映射编辑器或等效的 AUTOSAR 属性和映射函数。
模块
Signal Invalidation | 控制 AUTOSAR 根输出端口数据元素失效 |
函数
getDataDefaults | Get default end-to-end (E2E) protection method for AUTOSAR component model (自 R2022b 起) |
setDataDefaults | Set default end-to-end (E2E) protection method for AUTOSAR component model (自 R2022b 起) |
getDataTransfer | Get AUTOSAR mapping information for Simulink data transfer |
mapDataTransfer | Map Simulink data transfer to AUTOSAR inter-runnable variable |
getInternalDataPackaging | Get default internal data packaging for AUTOSAR component model (自 R2021a 起) |
setInternalDataPackaging | Set default internal data packaging for AUTOSAR component model (自 R2021a 起) |
getFunctionCaller | Get AUTOSAR mapping information for Simulink function-caller block |
mapFunctionCaller | Map Simulink function-caller block to AUTOSAR client port and operation |
overflowed | Determine when message queue overflows |
对象
autosar.api.getAUTOSARProperties | 以编程方式配置 AUTOSAR 软件组件元素和属性 |
autosar.api.getSimulinkMapping | 将 Simulink 元素映射到 AUTOSAR 元素 |
主题
发送方-接收方通信
- Configure AUTOSAR Sender-Receiver Communication
Read and write AUTOSAR data by using port-based sender-receiver communication. - Configure AUTOSAR Queued Sender-Receiver Communication
Read and write queued AUTOSAR data by using port-based sender-receiver communication. - Configure AUTOSAR Sender-Receiver Interface Ports for End-to-End Protection
Provide end-to-end (E2E) protection for AUTOSAR sender-receiver data transmission. - Programmatically Configure AUTOSAR Sender-Receiver Communication
Configure sender-receiver communication using AUTOSAR property and map functions.
客户端-服务器通信
- Configure AUTOSAR Client-Server Communication
Implement AUTOSAR client and server runnables with Simulink Function and Function Caller blocks. - Configure Client-Server Communication in AUTOSAR Architectures Using Service Interfaces
Configure client-server communication by using client server ports and service interfaces in AUTOSAR architectures. - Programmatically Configure AUTOSAR Client-Server Communication
Configure client-server communication using AUTOSAR property and map functions.
模式-切换通信
- Configure AUTOSAR Mode-Switch Communication
Define AUTOSAR modes and mode elements to activate runnables in response to system mode changes. - Programmatically Configure AUTOSAR Mode-Switch Communication
Configure mode-switch communication using AUTOSAR property and map functions.
非易失性通信
- Configure AUTOSAR Nonvolatile Data Communication
Read and write AUTOSAR nonvolatile (NV) data by using port-based NV data communication. - Programmatically Configure AUTOSAR Nonvolatile Communication
This example shows how to programmatically read and write AUTOSAR nonvolatile (NV) data using port-based NV data communication.
端口
- Configure AUTOSAR Port Parameters for Communication with Parameter Software Component
Configure AUTOSAR parameter receiver component for port-based access to parameter data. Generate ARXML descriptions of parameter software components and ports. - Configure AUTOSAR Ports By Using Simulink Bus Ports
Model AUTOSAR ports by using Simulink In Bus Element and Out Bus Element blocks.
可运行实体和事件
- Configure Receiver for AUTOSAR External Trigger Event Communication
Define trigger interface that activates AUTOSAR runnables in response to external trigger events. - Programmatically Configure AUTOSAR Runnables and Events
This example shows how to programmatically configure AUTOSAR runnables and events.