Sender-Receiver Communication
Sender-receiver communication involves the transmission and reception of signals consisting of atomic data elements sent by one SWC and received by one or more SWCs
.
An SWC type can have multiple sender-receiver ports.
Each sender-receiver port can contain multiple data elements, each of which can be sent and received independently. Data elements within the interface can be simple (integer, float, ...) or complex (array, matrix, record) types.
Sender-receiver communication is one-way; each reply by a receiver must be modeled as separate sender-receiver communication.
An Rport of an SWC that requires a sender-receiver interface can read the data elements of the interface. A Pport that provides the interface can write the data elements.
Sender-receiver communication can be 1:n (one sender, several receivers) or n:1 (several senders, one receiver). In the second case, no synchronization is imposed on the senders.
Sender-receiver communication can be unqueued or queued. In ASCET, unqueued communication is the default; queued communication is only available for elements in SenderReceiver interfaces. See Queued Communication and the AUTOSAR documentation for details.
In ASCET, the SenderReceiver Interface and NVData Interface components are used to specify sender-receiver communication. These components are inserted into software components as SenderReceiver / NVData interface prototypes that can be used either as Pport (in ASCET: SenderReceiver Interface only) or as Rport. They can be connected to appropriate diagram elements; the connections can be set up as implicit or explicit read/write. The following rules apply:
Rports and Pports must be used in runnables or in methods called by runnables.
Example- A direct connection between Rport and Pport cannot be explicit.
- Implicit read/write uses a buffer.
- Implicit read delivers a value (basic element) or a reference to the buffer (complex element).
- The result of an implicit write is available outside the runnable when the execution of the runnable is finished.
- Explicit read needs a data element.
- Explicit write transfers a value (basic element) or address (complex element). A data structure in the software component is required for the latter.
- The result of an explicit write is available outside the runnable as soon as the write process is done.
ASCET provides a built-in enumeration type, Std_ReturnType, that contains possible error codes. All enumeration values defined by the AUTOSAR standard are made known to each SWC, and thus are valid to be used even if no element with such a type has been created. Enumeration types used in an SWC must not specify any (symbolic) value used already by Std_ReturnType.
See also
Status of Explicit and Implicit Access
Basics – SenderReceiver and NVData Interfaces
Specifying a SenderReceiver or NVData Interface Prototype
Sending to a Port – Block Diagram
