CLASSIC
Modul: cantp
Rolle: heuristic
Konfidenz: 85%
SNIP_CLASSIC_CANTP_SECTION_7_3_3_Buffer_strategy
Wortlaut
7.3.3 Buffer strategy
Because CanTp has no buffering capability, the N-SDU payload, which is to be transmitted, is not copied internally and the N-PDU received is not reassembled internally.
The CAN Transport Layer works directly on the memory area of the upper layers (e.g.
PduR, DCM, or COM). To access these memory areas, the CAN Transport Layer uses
the PduR_CanTpCopyTxData() or PduR_CanTpCopyRxData() functions.
Thus, to guarantee data consistency, the upper layer should lock this memory area
until an indication occurs.
When a transmit buffer is locked, the upper layer must not write data inside the buffer
area.
When a receiving buffer is locked the CAN Transport Layer does not guarantee data
consistency of the buffer. The upper layer should neither read nor write data in the
buffer area.
Figure 7.3: Tx and Rx Buffer locking
It is assumed that upper layer module has locked the buffer when it returns a status
BUFREQ_OK to a PduR_CanTpStartOfReception() call or when CanTp_Transmit
() returns E_OK and shall keep the buffer locked until a confirmation or indication (
PduR_CanTpTxConfirmation() or PduR_CanTpRxIndication() call) occurs.
The following figure provides an example, to summarize the process of sending a
frame, with a length of 50 bytes utilizing CAN 2.0 frames.
Figure 7.4: Example of transmit process
1: The PduR asks for the transmission of 50 data bytes;
2: The CanTp asks the PduR for the payload data; the CanTp send the First Frame;
3: The CanTp send the rest of payload data as sequences of Consecutive Frames; 6
or 7 payload data bytes are copied by the upper layer on each CF;
4: The CanTp confirms transmission of the payload data.
The next figure is an example of an N-SDU receiving 49 bytes; the upper layer reports
25 bytes as available Rx buffer.
PduR_CanTpStartOfReception (id, length=49, *RemainingRxBuff)
No buffer
PduR_CanTpRxIndication (id, OK)
CanTp_RxIndication (id, *(data, length))
CanIf
1
2
4
5
7
Versionen & Provenienz · Zugeordnete Anforderungen
Diese Angaben zeigt der Versions-Explorer.
Begründung & Zuweisungs-Evidenz
Buffer handling via PduR_CanTpCopyTxData service
Dokumenten-Herkunft & Rückverfolgbarkeit
| Spezifikations-Dokument | SWS_CANTransportLayer.pdf |
|---|---|
| Dokumentseite | Seite 35 |
| Ziel-Modul | cantp (classic) |
| Ziel-Anforderung | SWS_CanTp_00298 |
| Semantische Rolle | heuristic |
| Automatisierungs-Konfidenz | 0.85 |