AutoSAR Series Explanation (Introduction) 2.3-Types of Ports

Types of Ports

First, the type of interface

2. S/R interface

3. C/S interface


First, the type of interface

Ports are used by SWC and SWC for interface (Interface) communication, or SWC uses RTE and BSW for interface (Interface) communication.

Ports are mainly divided into 5 types, listed in the following figure:

 

Which can be classified into: R-Ports, P-Ports and PR-Ports. It is worth noting that the PR-Ports here are only defined in AutoSAR4. Or it can be divided into: Send/Receiver (S/R) interface and Client/Server (C/S) interface. The S/R interface is used to transmit data; the C/S interface is used to perform operations.

2. S/R interface

 

effect:

  • transfer data. Transfer data through RTE, and manage data transmission through RTE to avoid data problems (for example, errors may occur when calling the same data at the same time)
  • An interface can contain multiple data, similar to transmission through a structure
  • Can transfer basic data types (int, float, etc.) and complex data types (record, array, etc.)
  • Let's be more specific, as an example to call the receiving interface:

Rte_Read_Port>_Data>()

// Here xx refers to the transmitted data content, such as DoorOpen is:

SWC_DoorOpen = Rte_Read_Door_DoorOpen();

3. C/S interface

 

effect:

  • Provide action. That is, the Server provides functions for the Client to call
  • Can be synchronous and asynchronous. Synchronization is a direct call, which is equivalent to directly inserting the function into the context to run; asynchronous, it needs to wait, which is equivalent to letting the function run in another thread, returning after running, and the original context is still running
  • An interface can provide multiple operations, that is, an interface can contain many functions
  • Both within the ECU and across ECUs can be called, and the cross-ECU is also through the external bus
  • To be more specific, let’s take an example to call the client interface:

Rte_Call_Port>_Function>()

//The xx here refers to the function called, for example, calling State() is:

Rte_Call_Door_State();

Guess you like

Origin blog.csdn.net/qq_42700289/article/details/131366060