FlexRay TP ISO

Start Page

General

Distribution Restrictions

With the Committee Draft on ISO/CD 10681-2 Road vehicles – Communication on Flex Ray – Part 2: Communication Layer services (2008-11-28), ISO (www.iso.org) has defined a way to transfer large blocks of data between nodes connected to a FlexRay network.

This implementation of ISO 10681 -2 is distributed as part of any standard installation of CANoe.FlexRay.

About this Document

Sample Configurations

This document describes the node layer DLL for Vector.CANoe.FlexRay that implement the transport protocol to allow nodes simulated by CANoe to interact with hardware nodes attached to a FlexRay network.

In order to demonstrate the usage of the Transport Protocol, a respective sample configuration with a current DLL is installed along with CANoe:

  • FlexRay Sample Configurations
  • FlexRay_ISO_TP_PDU_based.CFG
  • UDSsimExt_Fr_ISOTP_PDU_based.CFG

Name of the DLL

The DLL is delivered together with the CANoe installation

  • FlexRayTPISO.DLL

Basics

Further Information
  • Modeling Libraries
  • Introduction for Modeling Libraries
  • Assigning of Modeling Libraries (DLLs)
  • Error Codes
  • Small Buffer Handling - Introduction and Gateways
  • Fault Injections - Introduction

Function Availability

Function Overview
  • Supported Hardware
  • Supported Features
  • Overview
  • CAPL Functions
  • CAPL Callback Functions
Caution

Caution!

Please read the chapters on Supported Hardware and features carefully.
FAQ

FAQ

Contact Vector Informatik GmbH if your concrete use case is not yet supported, and provide information on what you would like to do. You can also ask for newer versions of the DLL.

Cross Reference

The FlexRay AUTOSAR Transport Protocol (FrAsrTp) based on the AUTOSAR standard is implemented by the AutosarFlexRayTP3.DLL that also comes along with CANoe. Cf. Online Help FlexRayTP AUTOSAR.

FlexRay TP ISO
© Vector Informatik GmbH


Supported Features

FlexRay TP ISO » Supported Features

Introduction

The first version of the DLL supports a subset of the features defined in the standard. Please contact Vector Informatik GmbH if a feature you need is not yet supported.

Feature

Short Description

Channel Options

The DLL supports transport connections over channels occupying one FlexRay channel.

Connection Options

It is possible to transfer data using the following types of connections:

  • Unicast: One-to-one communication
  • Acknowledged unicast: One-to-one communication where the receiver acknowledges the reception
  • Multicast: One-to-many communication

All unicast connections can principally be used in full-duplex mode (transmission and reception simultaneously).

Slot Usage

The DLL allows using dynamic slots for the reception and transmission. It is possible to reserve multiple slots per direction, i.e. one FlexRay cycle may carry several TP PDUs in different slots.

PDU Definitions

It is possible to define PDUs in the FIBEX database. This DLL will detect those PDUs of type TPL (5) and DIAGNOSTICS (6, 7, 8), and register for their reception or transmission. Please refer to the Creation of Connections on PDUs or Frames function group.

Maximum PDU Size

It is possible to specify any PDU length up to a FlexRay maximum of 254 byte. The padding byte can be specified.

Dynamic Bandwidth Control

The bandwidth control algorithm is supported. CANoe simulation nodes can request a specific behavior from a sender, and follow the behavior requested by a receiver.

The receiver may indicate the number of slots the sender can use in one FlexRay cycle, or specify the number of separation cycles between the sending of consecutive frames.

TP Parameters

The ISO TP parameters for bandwidth control, buffer size and timer values can be set.

Configuration via CAPL

FlexRay TP connections and parameters can be configured by calling CAPL functions during initialization of the measurement. Some settings like the length of PDUs may be changed at any time, with effect on future data transfers only in some cases.

Small Buffer Handling

Instead of providing all data immediately, it is possible to start sending without having the complete data. During reception, it is possible to access the already received data at any time.

This helps to implement efficient gateway code that does not need to receive completely the data request before forwarding the request to another bus.

2nd ECU address

This allows accepting a 2nd ECU TP address for the reception of data.

Fault Injection

Some miss-behaviors of the protocol engine can be specified in order to test the peer.

FlexRay TP ISO


Supported Hardware

FlexRay TP ISO » Supported Hardware

Introduction

Since there are several FlexRay hardware systems available, and not all of them provide the functionality necessary to implement a reliable transport protocol following the standard, this DLL may only be used with the hardware systems listed here.

Caution

Caution!

Vector Informatik GmbH does not promise to support any hardware than those listed here explicitly.

Feature

Short Description

CANoe Bus Simulator

It is possible to create a remaining bus simulation that does not access any physical FlexRay hardware.

VN FlexRay Interface
(N3x00, VN7600, VN8970)

Vector FlexRay interface – please activate the generation of Tx confirmation events!


Add-on DLLs

FlexRay TP ISO » Basics » Add-on DLLs

Simulation Setup

In order to use this node layer DLL in the CANoe Simulation Setup, the DLL must be loaded into the simulation nodes. This can be done in the configuration menu of the node in the Simulation Setup; please refer to the following pages for details:

  • Function and Modeling Libraries (Add-on DLLs)
  • Assigning of Modeling Libraries (Add-on DLLs)

Additional CAPL functions

After the DLL has been loaded into the node, its CAPL program can access the TP functionality via additional CAPL functions, all marked with the prefix FrTP_.

Please note that the CAPL Browser offers a shortcut menu (press right mouse button in an edit area) where you can select a CAPL function. All functions provided by this DLL are collected in the category FlexRay TP Functions.

Version information

In order to determine the version and location of the DLL loaded in CANoe, you can get additional information in the Write Window when you open the menu path Help|About|More Info.


Small Buffer Handling - Introduction and Gateways

FlexRay TP ISO » Basics » Small Buffer Handling - Introduction and Gateways

Introduction

The ISO TP specification defines an event once the complete data has been transferred, i.e. the receiver has to wait until the last Consecutive Frame is received before he has access to the data. There are applications where this behavior is not desirable, e.g.: A gateway that has to wait for a complete block of data from the source bus before it can forward to the target bus will introduce a considerable delay in the end-to-end transfer: it will take about twice the time (for identical TP parameters).

A gateway that has to wait for a complete block of data from the source bus before it can forward to the target bus will introduce a considerable delay in the end-to-end transfer: it will take about twice the time (for identical TP parameters).

Store and Forward Gateway

Source Bus |  | Gateway |  | Target Bus
First Frame | → |  |  |
 | ← | Flow Control |  |
Consecutive Frame 1 | → |  |  |
Consecutive Frame2 | → |  |  |
Consecutive Frame 3 | → |  |  |
... |  |  |  |
Last Frame | → | (completed) |  |
 |  | First Frame | → |
 |  |  | ← | Flow Control
 |  | Consecutive Frame 1 | → |
 |  | Consecutive Frame 2 | → |
 |  | Consecutive Frame 3 | → |
 |  | ... |  |
 |  | Last Frame | → | (completed)

With small buffer handling, the time needed for an end-to-end transfer can be reduced to the time for one transfer plus a small overhead.

Gateway using Small Buffer Handling

Source Bus |  | Gateway |  | Target Bus
First Frame | → |  |  |
 | ← | Flow Control |  |
 |  | First Frame | → |
Consecutive Frame 1 | → |  |  |
 |  |  | ← | Flow Control
Consecutive Frame 2 | → |  |  |
 |  | Consecutive Frame1 | → |
Consecutive Frame 3 | → |  |  |
... |  |  |  |
 |  | Consecutive Frame 2 | → |
 |  | Consecutive Frame 3 | → |
 |  | ... |  |
Last Frame | → | (completed) |  |
 |  | Last Frame | → | (completed)

This section introduces the CAPL functions needed to activate this feature and lists the callback functions a node can implement.


Fault Injections - Introduction

FlexRay TP ISO » Basics » Fault Injections - Introduction

Introduction

The following functions (all beginning with the prefix FrTPFI_) allow, before a transmission or reception is starting, to define some miss-behavior for the TP DLL per connection. Thus, failures can be injected for the C-PDUs that are to be sent by the DLL in order to test the peer.

Categories

The following categories of failures exist:

  • Delay a Tx C-PDU
    The sending of any C-PDU will additionally be delayed.
  • Double a Tx C-PDU
    Any C-PDU will be transmitted twice, whereas the doubled C-PDU can optionally be delayed.
  • Drop a Tx C-PDU
    Any C-PDU will not be sent on the bus, although the DLL assumes that it was sent.
  • Miss-interpret a Rx FC or ACK-RETRY
    Any received Flow Control or Acknowledge Frame can be miss-interpreted.

Thereby Data Frames (DF: STF, CF and LF) are distinguished versus Flow Control (FC) and Acknowledge (ACK_RET) C-PDUs.

Restrictions

Each of the functions can define exactly one failure. Thus, it is not possible to define e.g. the dropping of the STF and the LF simultaneously.

But when the failure was injected (e.g. the STF was dropped), a new one (dropping the LF) can immediately be defined.

But, any two different functions can be used in order to define simultaneously different fault injections (e.g. to define dropping a Data Frame n and doubling any other Data Frame m; n ≠ m).

Cross Reference

For manipulation of the receiver status see function FrTP_SetReceiverStatus.


Error Codes

FlexRay TP ISO » Basics » Error Codes

Number | Short Description
-3 | No (matching) PDU definitions were found.
-2 | The reservation of slots failed, e.g. because the cycle repetition value is not a divider of the cycle length (64).
-1 | No such connection, i.e. creation of a connection failed or the given handle is unknown.
0 | OK, no error.
1 | Some mandatory settings are missing, e.g. the addresses to use.
2 | The value given contradicts another setting made earlier, e.g. payload length is larger than maximum.
3 | The request to send some data was rejected since another transmission is in progress.
4 | A reception was active when a first frame or single frame was received.
5 | A negative ACK was received for acknowledged connections.
6 | The bus did not confirm transmission of a frame in time.
7 | The transmitter did not receive a flow control frame in time.
8 | The receiver did not receive the next consecutive frame in time.
9 | A setting cannot be changed because data is transferred at the moment and an inconsistent state would result.
10 | Transmission was aborted because application did not provide data in time.
11 | The peer rejected the data since it is too long.
12 | Peer sent an undefined Ack.
13 | Peer sent a First Frame where a Single Frame would have sufficed. The First Frame is ignored, an error is indicated, and a warning is printed in the Write Window.
14 | Receiver has sent too many wait frames and must therefore abort the transfer.
15 | Receiver has requested the resending of an illegal frame, e.g. the Start Frame.
16 | Receiver requested the transfer to be aborted.
17 | The ML parameter of the LF does not match the received data or the given ML in the STF.


Function Overview

FlexRay TP ISO » Functions » Function Overview

Shortcuts CAPL Functions | Shortcut CAPL Callback Functions
Reservation of Slots | Reception of Data
Creation of Connections on Slots | Indication of Protocol Errors
Creation of Connections on PDUs or Frames | Indication of Any Received C-PDU
Deletion of Connections | Indications of the Start and End of Data Transmissions
Configure Connections |
Data Transfer |
Slot Assignment |
Utility Functions |
Control Receiver Status |
Small Buffer Handling | Indication of a Partially Received Data
Retrieve Additional Information |
Fault Injections | Request for Additional Data to be Transmitted Next

Introduction

Since in FlexRay, a schedule has to be defined before the network can start to operate, it is necessary to “reserve” the slots used by the transport protocol during the initialization phase, i.e. in the on prestart handler.

Alternatively, it is possible to define TPL or DIAGNOSTICS PDUs in the FIBEX database. These will be recognized and “reserved” automatically during the start of the measurement.

The CAPL program has to create the connection it intends to use, receiving a connection handle for each one. This handle must be given to every function that performs any change to the configuration of the connection or starts the transfer of data. In addition, CAPL callback functions will receive the handle to indicate the connection creating events like the reception of data.

CAPL Functions

Additional Functions

These functions are implemented in the DLL and can be called in CAPL programs.
Note that all functions start with the prefix FrTP_.

Return values

All functions returning long values indicate the success by returning 0 (no error), or a positive value indicating the requested information, e.g. the connection handle. Exceptions are indicated at the functions.

Reservation of Slots [▲ back]

Note

Note

This is only necessary if there are no PDU definitions in the FIBEX database!

Functions | Short Description
FrTP_ReserveSendSlots | The node reserves a sequence of consecutive slots for sending.
FrTP_ReserveSendSlot | The node reserves one slot in a subset of cycles for sending.
FrTP_ReserveReceiveSlots | The node reserves a sequence of consecutive slots for reception.
FrTP_ReserveReceiveSlot | The node reserves one slot in a subset of cycles for reception.

Creation of Connections on Slots [▲ back]

Functions | Short Description
FrTP_CreateConnUnicast | This function will create a single slot unicast full-duplex connection
FrTP_CreateConnUnicast | This function will create a single slot unicast full-duplex connection.
FrTP_CreateConnUnicast | This function will create a multiple slot unicast full-duplex connection.

Creation of Connections on PDUs or Frames [▲ back]

Functions | Short Description
FrTP_CreateConnUnicast | This function creates a unicast (one-to-one) connection with optional one Tx and one Rx frame or PDU or frame of any type.
FrTP_CreatePDUConnUnicast | This function creates a unicast (one-to-one) connection that uses the next maxSendPDU TPL or DIAGNOSTICS PDUs for sending, that have a length of sendPDUlen byte.
FrTP_CreatePDUConnUnicast | This function creates a unicast (one-to-one) connection that uses the TPL or DIAGNOSTICS PDUs with the given names for sending.

Deletion of Connections [▲ back]

Functions | Short Description
FrTP_DeleteConn | Destroy a connection to free its slots or PDUs.

Configure Connections [▲ back]

Functions | Short Description
FrTP_SetAddresses | Set addresses (C_AI) used in the C-PDUs to the values given.
FrTP_Set2ndAddresses | Sets optionally 2nd ECU addresses that are used for incoming or outgoing connection data.
FrTP_SetBandwidthControl | Configures the way a sender should send data to this node.
FrTP_SetConnMode | This function allows to change the mode of a connection, where connMode may have different values.
FrTP_SetMaxPDULength | The transport protocol will send data in slots with the specified maximum C-PDU length filling undefined bytes with the fill byte specified by FrTP_SetFillByte( ).
FrTP_SetFillByte | Defines the fill byte for padding un-used bytes in the C-PDUs. If the function is not called, then 0 is used.
FrTP_SetBufferSize | Configures the way a sender should send data to this node.
FrTP_SetTimingParams | Defines some timing parameters that handle the distance between two C-PDUs for transmission or reception (timeout).

Data Transfer [▲ back]

Functions | Short Description
FrTP_DataRequest | Send data to the peer.

Slot Assignment [▲ back]

Functions | Short Description
FrTP_AddConnSlots | Assign already reserved slots to an existing connection.
FrTP_AddConnSendSlot | This function adds one Tx frame or PDU to an existing connection.
FrTP_AddConnReceiveSlot | This function adds one Rx frame or PDU to an existing connection.

Utility Functions [▲ back]

Functions | Short Description
FrTP_GetNodeName | Retrieve this node's name.
FrTP_GetDLLInfo | Retrieves additional information about DLL and settings.
FrTP_SetVerbosity | The function sets the amount of debug information written to the Write Window.
FrTP_SetExpertParam | The expert parameter should only be used on explicit request by Vector Informatik GmbH.
FrTP_GetLastReceivedAddresses | Returns the addresses of the last received incoming frame.

Control Receiver Status [▲ back]

Functions | Short Description
FrTP_SetReceiverStatus | Allows to set the status of the receiver.

Small Buffer Handling [▲ back]

Small Buffer Handling - Introduction and Gateways

Functions | Short Description
FrTP_SetRxBufferSize | This function limits the receive buffer for the connection to the given number of bytes.
FrTP_SmallBufferSend | This function is provided as a replacement for FrTP_DataRequest in case small buffer handling is to be used.
FrTP_ProvideTxData | The data provided with this function will be sent as soon as the respective Consecutive Frame or Last Frame has to be filled.
FrTP_CopyDataReceived | While data is received on a connection, it is possible to copy it into a buffer at any time.

Retrieve Additional Information [▲ back]

Functions | Short Description
FrTP_GetPCIOffset | Returns the offset of the first byte after the C_PCI. Valid for STF, CF, FC and LF C-PDUs.
FrTP_GetSequenceNumber | Returns the sequence number.
FrTP_GetFlowStatus | Returns the receiver flow status reported in this flow control frame.
FrTP_GetAckRetryState | Returns the ACK parameter of a FC-ACK_RET C-PDU.
FrTP_GetBlockSize | eturns the buffer size (BfS) parameter of a FC-CTS C-PDU. Only valid for FC-CTS frames.
FrTP_GetStMinOrBC | Returns the bandwidth control (BC) parameter of a FC-CTS C-PDU.
FrTP_GetFrameSubType | Returns the appropriate sub-type of the C-PDU.

Fault Injections [▲ back]

Fault Injections - Introduction

Functions | Short Description
FrTPFI_DelayTX_DF | Delay the sending of the appropriate STF, LF or CF.
FrTPFI_DoubleTX_DF | Send the appropriate STF, LF or CF twice.
FrTPFI_DropTX_DF | Do not send the appropriate STF, LF or CF.
FrTPFI_DelayTX_FC | Delay the sending of the appropriate Flow Control (FC) or Acknowledge Frame (ACK).
FrTPFI_DoubleTX_FC | Send the appropriate Flow Control (FC) or Acknowledge Frame (ACK) twice.
FrTPFI_DropTX_FC | Do not send the appropriate Flow Control (FC) or Acknowledge Frame (ACK).
FrTPFI_MissInterpretRX_FC | Miss interpret the appropriate received Flow Control (FC) or Acknowledge (ACK-RETRY) frame.
FrTPFI_ClearAll | Deletes all fault injections that are currently defined for the connection.

CAPL Callback Functions

Introduction

The CAPL program has to define these optional functions (marked with the postfix Ind) to receive indications about TP events like the reception of data or a protocol error. It is highly recommended to implement at least the error indication function.

Reception of Data [▲ back]

Functions | Short Description
FrTP_ReceptionInd | This function is called when the node has received data from its peer.

Indication of Protocol Errors [▲ back]

Functions | Short Description
FrTP_ErrorInd | An error occurred for the connection indicated.

Indications of the Start and End of Data Transmissions [▲ back]

Functions | Short Description
FrTP_FirstFrameInd | This function allows the CAPL program to determine the start of a segmented data reception.
FrTP_TxConfirmationInd | This function allows the CAPL program to determine the end of a data transmission.

Indication of Any Received C-PDU [▲ back]

Functions | Short Description
FrTP_FrameRxInd | Every TP PDU received by this node is forwarded to this function.

Indication of a Partially Received Data [▲ back]

Functions | Short Description
FrTP_RxBufferFullInd | This CAPL callback function is called by the DLL when the receiver buffer is full.

Request for Additional Data to be Transmitted Next [▲ back]

Functions | Short Description
FrTP_ProvideTxDataInd | This Function requests next data for transmission.


FrTP_ReserveSendSlots

FlexRay TP ISO » CAPL Functions » Reservation of Slots » FrTP_ReserveSendSlots

Note

Note

Use these reservation functions in on PreStart only!

Please note that one slot may only be sent by one FlexRay node! The hardware interface will print a warning to the Write Window if more than one simulation node reserves the same slot for sending.

Syntax

long FrTP_ReserveSendSlots( dword startSlotId, long count);

Function

The node reserves a sequence of consecutive slots for sending. The slots can be assigned to connections later, and this assignment can be changed.

Parameters
  • startSlotId
    The first slot ID that is to be reserved.
  • count
    The number of consecutive slots that are to be reserved.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Reservation of the slots 130 to 139 for sending of up to 10 PDUs in the same cycle.

FrTP_ReserveSendSlots( 130, 10);

Concept Link Icon See Also


FrTP_ReserveSendSlot

FlexRay TP ISO » CAPL Functions » Reservation of Slots »FrTP_ReserveSendSlot

Note

Note

Use these reservation functions in on PreStart only!

Please note that one slot may only be sent by one FlexRay node! The hardware interface will print a warning to the Write Window if more than one simulation node reserves the same slot for sending.

Syntax

long FrTP_ReserveSendSlot( dword startSlotId, long startCycle, long cycleRepetition);

Function

The node reserves one slot in a subset of cycles for sending. The slot can be assigned to connections later, and this assignment can be changed.

Parameters
  • slotId
    The slot ID.
  • startCycle
    The offset in the cycle multiplexing [0 – cycleRepetition].
  • cycleRepetition
    The repetion factor of the cycle multiplexing (1, 2, 4, 8, 16, 32, 64).

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Reservation of the slot 130 to 139 for sending of up to 10 PDUs in the same cycle.

FrTP_ReserveSendSlot( 130, 10);


FrTP_ReserveReceiveSlot

FlexRay TP ISO » CAPL Functions » Reservation of Slots » FrTP_ReserveReceiveSlot

Note

Note

Use these reservation functions in on PreStart only!

Syntax

long FrTP_ReserveReceiveSlot( dword slotId, long startCycle, long cycleRepetition);

Function

The node reserves one slot in a subset of cycles for reception. The slot can be assigned to connections later, and this assignment can be changed.

Parameters
  • slotId
    The slot ID.
  • startCycle
    The offset in the cycle multiplexing [0 – cycleRepetition].
  • cycleRepetition
    The repetion factor of the cycle multiplexing (1, 2, 4, 8, 16, 32, 64).

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Reserve slot 125 in every other cycle, starting with the second cycle.

FrTP_ReserveReceiveSlot( 125, 1, 2);


FrTP_ReserveReceiveSlots

FlexRay TP ISO » CAPL Functions » Reservation of Slots » FrTP_ReserveReceiveSlots

Note

Note

Use these reservation functions in on PreStart only!

Syntax

long FrTP_ReserveReceiveSlots( dword startSlotId, long count);

Function

The node reserves a sequence of consecutive slots for reception. The slots can be assigned to connections later, and this assignment can be changed.

Parameters
  • startSlotId
    The first slot ID that is to be reserved.
  • count
    The number of consecutive slots that are to be reserved.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Reserve slot 125 in every other cycle, starting with the second cycle.

FrTP_ReserveReceiveSlots( 125, 1, 2);


FrTP_CreateConnUnicast

FlexRay TP ISO » CAPL Functions » Creation of Connections on Slots » FrTP_CreateConnUnicast

Note

Note

You can call these functions outside of the on Prestart handler only if the slots indicated have been reserved during on Prestart. (See function group Reservation of Slots).

If the function is called in on PreStart, slots will be reserved implicitly.

Syntax

long FrTP_CreateConnUnicast( dword localSlotId, WORD remoteSlotId);

Function

This function will create a unicast (one-to-one) connection that uses the specified slots and return its connection handle. Local slots are used by this node to send its TP frames, and the node listens to TP frames received on the remote slots.

Parameters
  • localSlotId
    The slot ID that is used for sending.
  • remoteSlotId
    The slot ID that is used for receiving.

Return Values
  • >0: The handle for the created connection.
  • ≤0: Error code (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example 1

Creation of a unicast connection that sends PDUs in slot 123 and receives PDUs in slot 234.

Variables {
long gConnHandle;
}
On Prestart {
gConnHandle = FrTP_CreateConnUnicast( 123, 234);
}

Example 2

Assign slots reserved in on Start to a connection created later.

Variables {
long gConnHandle;
}
On Prestart {
FrTP_ReserveSendSlots( 130, 10);
FrTP_ReserveReceiveSlot( 140, 0, 1);
}
On key '1' {
gConnHandle = FrTP_CreateConnUnicast( 130, 5, 140, 1);
}


FrTP_CreateConnUnicast

FlexRay TP ISO » CAPL Functions » Creation of Connections on Slots » FrTP_CreateConnUnicast

Note

Note

You can call these functions outside of the on Prestart handler only if the slots indicated have been reserved during on Prestart. (See function group Reservation of Slots).

If the function is called in on PreStart, slots will be reserved implicitly.

Syntax

long FrTP_CreateConnUnicast( dword localSlotId, long localStartCycle, long localCycleRepetition, dword remoteSlotId, long remoteStartCycle, long remoteCycleRepetition);

Function

This function will create a unicast (one-to-one) connection that uses the specified slots and return its connection handle. Local slots are used by this node to send its TP frames, and the node listens to TP frames received on the remote slots.

Parameters
  • localSlotId
    The slot ID that is used for sending.
  • ocalStartCycle
    The offset in the cycle multiplexing [0 – localCycleRepetition].
  • localCycleRepetition
    The repetion factor of the cycle multiplexing (1, 2, 4, 8, 16, 32, 64).
  • remoteSlotId
    The slot ID that is used for receiving.
  • remoteStartCycle
    The offset in the cycle multiplexing [0 – remoteCycleRepetition].
  • remoteCycleRepetition
    The repetion factor of the cycle multiplexing (1, 2, 4, 8, 16, 32, 64).

Return Values
  • >0: The handle for the created connection.
  • ≤0: Error code (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example 1

Creation of a unicast connection that sends PDUs in slot 123 and receives PDUs in slot 234.

Variables {
long gConnHandle;
}
On Prestart {
gConnHandle = FrTP_CreateConnUnicast( 123, 234);
}

Example 2

Assign slots reserved in on Start to a connection created later.

Variables {
long gConnHandle;
}
On Prestart {
FrTP_ReserveSendSlots( 130, 10);
FrTP_ReserveReceiveSlot( 140, 0, 1);
}
On key '1' {
gConnHandle = FrTP_CreateConnUnicast( 130, 5, 140, 1);
}


FrTP_CreateConnUnicast

FlexRay TP ISO » CAPL Functions » Creation of Connections on Slots » FrTP_CreateConnUnicast

Note

Note

You can call these functions outside of the on Prestart handler only if the slots indicated have been reserved during on Prestart. (See function group Reservation of Slots).

If the function is called in on PreStart, slots will be reserved implicitly.

Syntax

long FrTP_CreateConnUnicast( dword localSlotId, long countSend, dword remoteSlotId, long countReceive);

Function

This function will create a unicast (one-to-one) connection that uses the specified slots and return its connection handle. Local slots are used by this node to send its TP frames, and the node listens to TP frames received on the remote slots.

Parameters
  • localSlotId
    The slot ID that is used for sending.
  • countSend
    The number of consecutive slots that are used for sending.
  • remoteSlotId
    The slot ID that is used for receiving.
  • countReceive
    The number of consecutive slots that are used for receiving.

Return Values
  • >0: The handle for the created connection.
  • ≤0: Error code (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example 1

Creation of a unicast connection that sends PDUs in slot 123 and receives PDUs in slot 234.

Variables {
long gConnHandle;
}
On Prestart {
gConnHandle = FrTP_CreateConnUnicast( 123, 234);
}

Example 2

Assign slots reserved in on Start to a connection created later.

Variables {
long gConnHandle;
}
On Prestart {
FrTP_ReserveSendSlots( 130, 10);
FrTP_ReserveReceiveSlot( 140, 0, 1);
}
On key '1' {
gConnHandle = FrTP_CreateConnUnicast( 130, 5, 140, 1);
}


FrTP_CreateConnUnicast

FlexRay TP ISO » CAPL Functions » Creation of Connections on PDUs or Frames » FrTP_CreateConnUnicast

Note

Note

Additional PDUs/frames can be added per direction by multiple calls of the functions FrTP_AddConnSendSlot(…) and FrTP_AddConnReceiveSlot(…) (Cf. function group Slot Assignment).

The connections will receive data on all TPL and DIAGNOSTICS PDUs defined, that are not sent by this node, i.e. addresses are used to determine if this node is the target of a TPL/DIAGNOSTICS PDU.

Only PDUs that are of type TPL or DIAGNOSTICS (see FIBEX definition of the PDU) can be used by this DLL for creating connections.

If not enough suitable PDUs for sending are defined, creation of the connection will fail with return code -3.

Syntax

long FrTP_CreateConnUnicast( dword flags, char aTXFrameOrPDUName[], char aRXFrameOrPDUName[]);

Function

This function creates a unicast (one-to-one) connection with optional one Tx and one Rx frame or PDU or frame of any type. Further frames or PDUs can be added. (Cf. function group Slot Assignment).

Parameters
  • flags
    The bit mask control the behavior of this function:
  • Mask: 0x0001
  • Mode: If bit is set then a frame is specified; otherwise a PDU or frame (depending on database type).
  • aTXFrameOrPDUName
    The optional name of a Tx frame or PDU in the communication database.
  • aRXFrameOrPDUName
    The optional name of a Rx frame or PDU in the communication database.

Return Values
  • >0: The handle for the created connection.
  • ≤0: Error code (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example 1

Given a set of PDU definitions in a FIBEX database, CAPL can assign PDUs to connections.

Sample Definitions

Sender Node

PDU name

Length in byte

Gateway

TPL_PhysReq0

10

Gateway

TPL_PhysReq1

10

Gateway

TPL_PhysReq2

10

Gateway

TPL_PhysReq3

10

Gateway

TPL_PhysReq4

10

Gateway

TPL_FuncReq0

15

Gateway

TPL_FuncReq1

15

ABC

TPL_PhysRespABC0

10

ABC

TPL_PhysRespABC1

10

DEF

TPL_PhysRespDEF0

10

DEF

TPL_PhysRespDEF1

10

GHI

TPL_PhysRespGHI0

10

GHI

TPL_PhysRespGHI1

10
Code in Gateway

// Reserve TPL_FuncReq0 for sending
gFunctionalRequest0 = FrTP_CreateConnUnicast( 0, "TPL_FuncReq0", "");

// Reserve TPL_FuncReq1 for sending, since TPL_FuncReq0 is already used
gFunctionalRequest1 = FrTP_CreateConnUnicast( 0, "TPL_FuncReq1", "");

// Reserve the PDUs TPL_PhysReq0 to TPL_PhysReq4 for
// sending in Gateway, i.e. multiple PDUs will be used
gPhysicalRequest = FrTP_CreateConnUnicast( 0, "TPL_PhysReq0", "TPL_PhysRespABC0");
FrTP_AddConnSendSlot( gPhysicalRequest, 0, "TPL_PhysReq1");
FrTP_AddConnSendSlot( gPhysicalRequest, 0, "TPL_PhysReq2");
FrTP_AddConnSendSlot( gPhysicalRequest, 0, "TPL_PhysReq3");
FrTP_AddConnSendSlot( gPhysicalRequest, 0, "TPL_PhysReq4");
FrTP_AddConnReceiveSlot( gPhysicalRequest, 0, "TPL_PhysRespABC1");

Code in ABC

// Listen to functional requests:
gFunctionalRequest0 = FrTP_CreateConnUnicast( 0, "", "TPL_FuncReq0");
gFunctionalRequest1 = FrTP_CreateConnUnicast( 0, "", "TPL_FuncReq1");
// Note: The addresses have to be set on the connection!

// Create a connection to send data on TPL_PhysRespABC0
gPhysicalResponse = FrTP_CreateConnUnicast( 0, "TPL_PhysRespABC0", "TPL_PhysReq0");
FrTP_AddConnSendSlot( gPhysicalResponse, 0, "TPL_PhysRespABC1");
FrTP_AddConnReceiveSlot( gPhysicalResponse, 0, "TPL_PhysReq1");
FrTP_AddConnReceiveSlot( gPhysicalResponse, 0, "TPL_PhysReq2");
FrTP_AddConnReceiveSlot( gPhysicalResponse, 0, "TPL_PhysReq3");
FrTP_AddConnReceiveSlot( gPhysicalResponse, 0, "TPL_PhysReq4");


FrTP_CreatePDUConnUnicast

FlexRay TP ISO » CAPL Functions » Creation of Connections on PDUs or Frames » FrTP_CreatePDUConnUnicast

Note

Note

Additional PDUs/frames can be added per direction by multiple calls of the functions FrTP_AddConnSendSlot(…) and FrTP_AddConnReceiveSlot(…) (Cf. function group Slot Assignment).

The connections will receive data on all TPL and DIAGNOSTICS PDUs defined, that are not sent by this node, i.e. addresses are used to determine if this node is the target of a TPL/DIAGNOSTICS PDU.

Only PDUs that are of type TPL or DIAGNOSTICS (see FIBEX definition of the PDU) can be used by this DLL for creating connections.

If not enough suitable PDUs for sending are defined, creation of the connection will fail with return code -3.

Syntax

long FrTP_CreatePDUConnUnicast( dword sendPDUlen, dword maxSendPDU);

Function

This function creates a unicast (one-to-one) connection that uses the next maxSendPDU TPL or DIAGNOSTICS PDUs for sending, that have a length of sendPDUlen byte. Note that it is possible to set the number of send PDUs to 0, e.g. when receiving multicast data.

Parameters
  • sendPDUlen
    The PDU will be identified by its payload length that must match this value.
  • maxSendPDU
    The number of PDUs to search for.

Return Values
  • >0: The handle for the created connection.
  • ≤0: Error code (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example 2

Given a set of PDU definitions in a FIBEX database, CAPL can assign PDUs to connections.

Sample Definitions

Sender Node

PDU name

Length in byte

Gateway

TPL_PhysReq0

10

Gateway

TPL_PhysReq1

10

Gateway

TPL_PhysReq2

10

Gateway

TPL_PhysReq3

10

Gateway

TPL_PhysReq4

10

Gateway

TPL_FuncReq0

15

Gateway

TPL_FuncReq1

15

ABC

TPL_PhysRespABC0

10

ABC

TPL_PhysRespABC1

10

DEF

TPL_PhysRespDEF0

10

DEF

TPL_PhysRespDEF1

10

GHI

TPL_PhysRespGHI0

10

GHI

TPL_PhysRespGHI1

10
Code in Gateway

// Reserve TPL_FuncReq0 for sending
gFunctionalRequest0 = FrTP_CreatePDUConnUnicast( 15, 1);

// Reserve TPL_FuncReq1 for sending, since TPL_FuncReq0 is already used
gFunctionalRequest1 = FrTP_CreatePDUConnUnicast( 15, 1);

// Reserve the PDUs TPL_PhysReq0 to TPL_PhysReq4 for
// sending in Gateway, i.e. multiple PDUs will be used
gFlashSending = FrTP_CreatePDUConnUnicast( 10, 5);

Code in ABC

// Listen to functional requests: since no PDUs are sent,
// both arguments are 0
gFunctionalRequest0 = FrTP_CreatePDUConnUnicast( 0, 0);
// Note: The addresses have to be set on the connection!

// Create a connection to send data on TPL_PhysRespABC0
gPhysicalResponse = FrTP_CreatePDUConnUnicast( 10, 1);


FrTP_CreatePDUConnUnicast

FlexRay TP ISO » CAPL Functions » Creation of Connections on PDUs or Frames » FrTP_CreatePDUConnUnicast

Note

Note

Additional PDUs/frames can be added per direction by multiple calls of the functions FrTP_AddConnSendSlot(…) and FrTP_AddConnReceiveSlot(…) (Cf. function group Slot Assignment).

The connections will receive data on all TPL and DIAGNOSTICS PDUs defined, that are not sent by this node, i.e. addresses are used to determine if this node is the target of a TPL/DIAGNOSTICS PDU.

Only PDUs that are of type TPL or DIAGNOSTICS (see FIBEX definition of the PDU) can be used by this DLL for creating connections.

If not enough suitable PDUs for sending are defined, creation of the connection will fail with return code -3.

Syntax

long FrTP_CreatePDUConnUnicast( char sendPDUNameArray[][], dword nameLength, dword numPDUs);

Function

This function creates a unicast (one-to-one) connection that uses the TPL or DIAGNOSTICS PDUs with the given names for sending.

Parameters
  • sendPDUNameArray
    A two dimensional array containing the names of the PDUs that are used for sending.
  • nameLength
    The maximum name length in the array (size of first dimension).
  • numPDUs
    The number of PDUs that are defined in the array (size of second dimension).

Return Values
  • >0: The handle for the created connection.
  • ≤0: Error code (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example 3

Given a set of PDU definitions in a FIBEX database, CAPL can assign symbolically PDUs for sending to connections.

// Reserve PDU TPL_FuncReq1 for sending
const dword cPDUNameLen = 257;
const dword cNumSendPDUs = 1;
// This is the PDU that is used for sending on the connection:
FrPDU TPL_FuncReq1 diagPDU1;
long gDiagConnHandle = -1;
long sendPDULen;
char sendPDUNames[cNumSendPDUs][cPDUNameLen];

strncpy(sendPDUNames[0], diagPDU1.name, lcount(diagPDU1.name));
sendPDULen = diagPDU1.FR_PDULength;
gDiagConnHandle = FrTP_CreatePDUConnUnicast(sendPDUNames,
cPDUNameLen,
cNumSendPDUs);
FrTP_SetMaxPDULength(gDiagConnHandle, sendPDULen);


FrTP_DeleteConn

FlexRay TP ISO » CAPL Functions » Deletion of Connections » FrTP_DeleteConn

Syntax

long FrTP_DeleteConn( long connHandle);

Function

Destroy a connection to free its slots or PDUs. They can be assigned to other connections later, though the direction (sending or receiving) cannot be changed.

Parameters
  • connHandle
    The handle of the connection.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_SetAddresses

FlexRay TP ISO » CAPL Functions » Configure Connections » FrTP_SetAddresses

Note

Note

Changing the addresses will only affect future data transfers!

Syntax

long FrTP_SetAddresses( long connHandle, dword localAddress, dword remoteAddress);

Function

Set addresses (C_AI) used in the C-PDUs to the values given.

Parameters
  • connHandle
    The handle of the connection.
  • localAddress
    The local address ([0x0000 – 0xFFFF] 16 Bit).
  • remoteAddress
    The remote address ([0x0000 – 0xFFFF] 16 Bit).

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Set addresses to 27 and 29.

FrTP_SetAddresses( gConnHandle, 27, 29);


FrTP_Set2ndAddresses

FlexRay TP ISO » CAPL Functions » Configure Connections » FrTP_Set2ndAddresses

Note

Note

Changing the addresses will affect future data transfers!

Syntax

long FrTP_Set2ndAddresses( long connHandle, dword flags, dword a2ndLocalAddress, dword a2ndRemoteAddress);

Function

Sets optionally 2nd ECU addresses that are used for incoming or outgoing connection data.

This allows e.g. in the context of the Tester to receive responses from the ECU from 2 different (remote) TP addresses. In the context of the ECU (simulation) this allows to accept/receive requests that are directed to 2 different (local) TP addresses. In normal case either the local address or the remote address should be valid according to the current application context (Tester or ECU simulation).

The flags control whether the new local or the new remote or both addresses should be accepted.

Mask for flags

Meaning

0x01

If set it enables the use of the 2nd remote address and enables the adaptation of the TP addresses in flow control frames to be sent.

0x02

If set it enables the use of the 2nd local address and enables the adaptation of the TP addresses in flow control frames to be sent.

0x04

If set additionally it disables the adaptation of the TP addresses in flow control frames.

Default: If the function is not called, then both 2nd addresses are disabled.

Parameters
  • connHandle
    The handle of the connection.
  • flags
    Controls which addresses should be used, and whether responding flow control frames should use the second address.
  • a2ndLocalAddress
    The 2nd local address ([0x0000 – 0xFFFF] 16 Bit).
  • a2ndRemoteAddress
    The 2nd remote address ([0x0000 – 0xFFFF] 16 Bit).

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Set additionally 2nd ECU address from CANoe/CDD parameter settings.

const int cIsTester = 0; // default: we are an ECU simulation
long localAddress;
long localAddress2;
long useAddress2;
long remoteAddress;
long remoteAddress2;
long addressType;
long gDiagConnHandle = -1;
...
localAddress = DiagGetCommParameter("FlexRay.LocalAddress");
remoteAddress = DiagGetCommParameter("FlexRay.RemoteAddress");
addressType = 2;
localAddress &= 0xFFFF;
remoteAddress &= 0xFFFF;
useAddress2 = DiagGetCommParameter("FlexRay.Has2ndECUAddress");
if (useAddress2 == 1)
{
if (cIsTester)
{
remoteAddress2 =
DiagGetCommParameter("FlexRay.RemoteAddress2");

writeDbgLevel( 1, "%s: Setting %d byte addresses (0x%04X,
      0x%04X)", gECU,
addressType, localAddress,
      remoteAddress);
FrTP_SetAddresses(gDiagConnHandle, localAddress,
      remoteAddress);

writeDbgLevel( 1, "%s: Setting 2nd ECU address for
      reception 0x%04X", gECU,
localAddress2);
FrTP_Set2ndAddresses(gDiagConnHandle, 0x01, 0,
      remoteAddress2);
}
else
{
localAddress2 =
DiagGetCommParameter("FlexRay.LocalAddress2");

writeDbgLevel( 1, "%s: Setting %d byte addresses (0x%04X,
      0x%04X)", gECU,
addressType, localAddress2,
      remoteAddress);
FrTP_SetAddresses(gDiagConnHandle, localAddress2,
      remoteAddress);

writeDbgLevel( 1, "%s: Setting 2nd ECU address for
      reception 0x%04X", gECU,
localAddress);
FrTP_Set2ndAddresses(gDiagConnHandle, 0x02, localAddress,
      0);
}
}
else
{
writeDbgLevel( 1, "%s: Setting %d byte addresses (0x%04X,
    0x%04X)", gECU,
addressType, localAddress, remoteAddress);
FrTP_SetAddresses(gDiagConnHandle, localAddress,
    remoteAddress);
}


FrTP_SetBandwidthControl

FlexRay TP ISO » CAPL Functions » Configure Connections » FrTP_SetBandwidthControl

Note

Note

The DLL will select the Separation Cycle Exponent that indicates the same or a higher number of separation cycles automatically. Changing the values will only affect future data transfers!

Syntax

long FrTP_SetBandwidthControl( long connHandle, long separationCycles, long maxPDUsPerCycle );

Function

Configures the way a sender should send data to this node. Please be aware that additional parameters influence the actual behavior of a sender: If fewer slots than allowed are configured, the sender will not be able to send the specified number of PDUs per cycle. The same is true for the receiver buffer size, since a full buffer at the receiver requires the sender to wait for a Flow Control frame.

This parameter (BC) is transmitted in the first FC after the STF of an segmented transmission.

If maxPDUsPerCycle is 0, then bandwidth control is not used (i.e. as many PDUs as possible are sent in every possible cycle).

Parameters
  • connHandle
    The handle of the connection.
  • separationCycles
    The number of separation cycles must be smaller than 128.
  • maxPDUsPerCycle
    Up to 31 C-PDUs per cycle are possible.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

The sender should send up to 7 PDUs in the same cycle, then pausing for 2 cycles.

FrTP_SetBandwidthControl( gConnHandle, 2, 7);


FrTP_SetConnMode

FlexRay TP ISO » CAPL Functions » Configure Connections » FrTP_SetConnMode

Syntax

long FrTP_SetConnMode( long connHandle, dword connMode);

Function

This function allows to change the mode of a connection, where connMode may have these values:

  • 1: Un-acknowledged unicast (one-to-one) connection.
  • 2: Acknowledged unicast (one-to-one) connection.
  • 3: Acknowledged unicast (one-to-one) connection without retry.
  • 10: Multicast (one-to-many) connection – Flow Control and Acknowledging is not enabled.
  • 11: Segmented multicast (not implemented yet).

Parameters
  • connHandle
    The handle of the connection.
  • connMode
    Sets the mode of the connection.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Change the connection mode to multicast.

FrTP_SetConnMode( gConnHandle, 10);


FrTP_SetMaxPDULength

FlexRay TP ISO » CAPL Functions » Configure Connections » FrTP_SetMaxPDULength

Note

Note

You can set the fillByte to -1 (long) to indicate that padding should not be performed. Only the data actually needed by the protocol will be transferred – please note that this is only possible for C-PDUs scheduled in the dynamic FlexRay segment and may not work on all FlexRay systems!

Syntax

long FrTP_SetMaxPDULength( long connHandle, dword maxPDUlen);

Function

The transport protocol will send data in slots with the specified maximum C-PDU length filling undefined bytes with the fill byte specified by FrTP_SetFillByte( ).

If the function is not called, then a default of 254 byte is used.

Parameters
  • connHandle
    The handle of the connection.
  • maxPDUlen
    The maximum size of a C-PDU in bytes.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Set the maximum PDU length to 32 and the fill byte to $E5.

FrTP_SetMaxPDULength( gConnHandle, 32);


FrTP_SetFillByte

FlexRay TP ISO » CAPL Functions » Configure Connections » FrTP_SetFillByte

Note

Note

You can set the fillByte to -1 (long) to indicate that padding should not be performed. Only the data actually needed by the protocol will be transferred – please note that this is only possible for C-PDUs scheduled in the dynamic FlexRay segment and may not work on all FlexRay systems!

Syntax

long FrTP_SetFillByte( long connHandle, long fillByte);

Function

Defines the fill byte for padding un-used bytes in the C-PDUs. If the function is not called, then 0 is used.

Parameters
  • connHandle
    The handle of the connection.
  • fillByte
    The filler byte.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Set the maximum PDU length to 32 and the fill byte to $E5.

FrTP_SetFillByte( gConnHandle, 0xE5);


FrTP_SetBufferSize

FlexRay TP ISO » CAPL Functions » Configure Connections » FrTP_SetBufferSize

Note

Note

Please note that the TP parameters have to follow certain restrictions to allow correct behavior of the transport protocol!

For example, the following has to hold:

timeBR + timeoutAR ≤ timeoutBS
timeCS + timeoutAS ≤ timeoutCR

Syntax

long FrTP_SetBufferSize( long connHandle, dword bufferSize);

Function

Configures the way a sender should send data to this node. The sender should await a Flow Control frame after sending this amount of data in one connection. 0 indicates that no further flow control frames should be expected.

Default: 0

Parameters
  • connHandle
    The handle of the connection.
  • bufferSize
    The maximum buffer size for receiving data.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Set the buffer size to 0 (if DLL receives data, it will not send further flow control frames after the first one ).

FrTP_SetBufferSize( gConnHandle, 0 );


FrTP_SetTimingParams

FlexRay TP ISO » CAPL Functions » Configure Connections » FrTP_SetTimingParams

Note

Note

Please note that the TP parameters have to follow certain restrictions to allow correct behavior of the transport protocol.

For example, the following has to hold:

timeBR + timeoutAR ≤ timeoutBS
timeCS + timeoutAS ≤ timeoutCR

Syntax

long FrTP_SetTimingParams( long connHandle, dword timeoutAS, dword timeoutAR, dword timeoutBS, dword timeBR, dword timeCS, dword timeoutCR);

Function

Defines some timing parameters that handle the distance between two C-PDUs for transmission or reception (timeout).

If the function is not called, then 0 is used.

Parameters
  • connHandle
    The handle of the connection.
  • timeoutAS
    Maximum tolerated time [ms] between the request to send a FlexRay frame and its transmission (Tx acknowledge from bus) on the sender side (Default: 125 ms).
  • timeoutAR
    Maximum tolerated time [ms] between the request to send a FlexRay frame and its transmission (Tx acknowledge from bus) on the receiver side (Default: 125 ms).
  • timeoutBS
    Timeout [ms] for the reception of a flow control frame on the sender side (Default : 150 ms).
  • timeBR
    Time [ms] between receiving a frame from the sender and sending out a flow control frame by the receiver, if necessary (Default: 25 ms).
  • timeCS
    Time [ms] between the sending of two frames by the sender (Default: 25 ms).
  • timeoutCR
    Timeout [ms] waiting for a frame from the sender after receiving a consecutive frame or sending a flow control frame (Default: 150 ms).

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_DataRequest

FlexRay TP ISO » CAPL Functions » Data Transfer » FrTP_DataRequest

Syntax

long FrTP_DataRequest( long connHandle, byte data[], dword dataLength);

Function

Send data to the peer.

Attention: After return of the function the sending might still be in progress!

The return value will indicate if the request could be processed correctly (0), or if an error occurred.

Parameters
  • connHandle
    The handle of the connection.
  • data
    Byte array that contains the data.
  • dataLength
    Length of the data to send and minimum size of the data array.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Send the content of a byte array to the peer.

Byte data[20]; // Fill data!
if( 0 != FrTP_DataRequest( gConnHandle, data, elcount(data)))
{
write( "Request to send data failed!");
}


FrTP_AddConnSlots

FlexRay TP ISO » CAPL Functions » Slot Assignment » FrTP_AddConnSlots

Note

Note

Note that it is only possible to add slots that are sent in every cycle! It is possible to set one of the count values to 0 (the slot id is ignored in that case) to indicate that no slot for that direction should be added.

Syntax

long FrTP_AddConnSlots( long connHandle, dword localSlotId, long countSend, dword remoteSlotId, long countReceive);

Function

Assign already reserved slots to an existing connection.

It is possible to set one of the count values to 0 (the slot id is ignored in that case) to indicate that no slot for that direction should be added.

Parameters
  • connHandle
    The handle of the connection.
  • localSlotId
    The slot ID that is used for sending.
  • countSend
    The number of consecutive slots that are used for sending.
  • remoteSlotId
    The slot ID that is used for receiving.
  • countReceive
    The number of consecutive slots that are used for receiving.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup
Example

Example

Create a connection that sends frames in the slots 141, 143 and 147, assuming that the slots have been reserved before.

connHandle = FrTP_CreateConnUnicast( 141, 150);
FrTP_AddConnSlots( connHandle, 143, 1, -1, 0);
FrTP_AddConnSlots( connHandle, 147, 1, -1, 0);


FrTP_AddConnSendSlot

FlexRay TP ISO » CAPL Functions » Slot Assignment » FrTP_AddConnSendSlot

Syntax

long FrTP_AddConnSendSlot( long connHandle, dword flags, char aTXFrameOrPDUName[]);

Function

This function adds one Tx frame or PDU to an existing connection (cf. function group Creation of Connections on PDUs or Frames). The frame or PDU possibly needs to be reserved before (cf. function group Reservation of Slots).

Parameters
  • connHandle
    The handle of the connection.
  • flags
    The bit mask control the behavior of this function.

Mask

Mode

0x0001

If bit is set then a frame is specified; otherwise a PDU or frame (depending on database type).

0x0002

If bit is set then delete all existing PDUs/frames per one direction depending on function, before adding the specified one.

  • aTXFrameOrPDUName
    The optional name of a Tx frame or PDU in the communication database.

Return Values
  • >0: The handle for the created connection.
  • ≤0: Error code (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_AddConnReceiveSlot

FlexRay TP ISO » CAPL Functions » Slot Assignment » FrTP_AddConnReceiveSlot

Syntax

long FrTP_AddConnReceiveSlot( long connHandle, dword flags, char aRXFrameOrPDUName[]);

Function

This function adds one Rx frame or PDU to an existing connection(cf. function group Creation of Connections on PDUs or Frames ).

Parameters
  • connHandle
    The handle of the connection.
  • flags
    The bit mask control the behavior of this function.

Mask

Mode

0x0001

If bit is set then a frame is specified; otherwise a PDU or frame (depending on database type).

0x0002

If bit is set then delete all existing PDUs/frames per one direction depending on function, before adding the specified one.

  • aRXFrameOrPDUName
    The optional name of a Rx frame or PDU in the communication database.

Return Values
  • >0: The handle for the created connection.
  • ≤0: Error code (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_GetNodeName

FlexRay TP ISO » CAPL Functions » Utility Functions » FrTP_GetNodeName

Syntax

void FrTP_GetNodeName( char bufferOut[], dword bufferSize);

Function

Retrieve this node's name.

Parameters
  • bufferOut
    Buffer to which the node name is written.
  • bufferSize
    Maximum size of the buffer (including the trailing 0).

Return Values

—

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Indicate the name of the node and the version of the DLL loaded in the Write Window.

char nodeName[50];
FrTP_GetNodeName( nodeName, elcount( nodeName));
write( "This is node <%s>, using DLL V%d.%d.%d", nodeName
, FrTP_GetDLLInfo(1)
, FrTP_GetDLLInfo(2)
, FrTP_GetDLLInfo(3));


FrTP_GetDLLInfo

FlexRay TP ISO » CAPL Functions » Utility Functions » FrTP_GetDLLInfo

Syntax

void FrTP_GetDLLInfo( dword selector);

Function

Retrieves additional information about DLL and settings. Possible values for selector are:

  • 0: Return DLL version as 6 digit BCD number, e.g. 0x000909.
  • 1: Return DLL major version number, e.g. 0.
  • 2: Return DLL minor version number, e.g. 9.
  • 3: Return DLL build version number, e.g. 9.

Parameters
  • selector
    See function description.

Return Values

See function description.

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Indicate the name of the node and the version of the DLL loaded in the Write Window.

char nodeName[50];
FrTP_GetNodeName( nodeName, elcount( nodeName));
write( "This is node <%s>, using DLL V%d.%d.%d", nodeName
, FrTP_GetDLLInfo(1)
, FrTP_GetDLLInfo(2)
, FrTP_GetDLLInfo(3));


FrTP_SetVerbosity

FlexRay TP ISO » CAPL Functions » Utility Functions » FrTP_SetVerbosity

Syntax

void FrTP_SetVerbosity( dword level);

Function

The function sets the amount of debug information written to the Write Window (the higher the level, the more is printed).

Parameters
  • level
    Level of debug information that is printed.

Return Values

—

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_SetExpertParam

FlexRay TP ISO » CAPL Functions » Utility Functions » FrTP_SetExpertParam

Syntax

void FrTP_SetExpertParam( long connHandle, dword option, long value);

Function

The expert parameter function should only be used on instruction by Vector Informatik GmbH.

Parameters
  • connHandle
    The handle of the connection.
  • option
    The specific parameter option that should be set.
  • value
    The value for the parameter.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_GetLastReceivedAddresses

FlexRay TP ISO » CAPL Functions » Utility Functions » FrTP_GetLastReceivedAddresses

Syntax

long FrTP_GetLastReceivedAddresses(long connectionHandle, word receiverAddress[], word senderAddress[]);

Function

Returns the addresses of the last received incoming frame.

Parameters
  • connectionHandle
    Identifier for connection.
  • receiverAddress
    Array that can hold one value for output.
  • senderAddress
    Array that can hold one value for output.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_SetReceiverStatus

FlexRay TP ISO » CAPL Functions » Control Receiver Status » FrTP_SetReceiverStatus

Syntax

long FrTP_SetReceiverStatus( long connHandle, dword status, long argument);

Function

Allows to set the status of the receiver in order to send a FC-CTS, FC-ACK_RET, FC-WT, FC-ABT or FC-OVFLW next.

Parameters
  • connHandle
    The handle of the connection.
  • status
    The flow status to be set in the next FC C-PDU that will be sent.
Flow Status | Argument | Description
3 | BfS | Continue To Send (CTS)
4 | BP | Retry (ACK_RET with ACK = 1)
5 | — | Wait
6 | — | Abort
7 | — | Overflow
  • argument
    Additional parameter that is to be set in the FC C-PDU according to its status.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_SetRxBufferSize

FlexRay TP ISO » CAPL Functions » Small Buffer Handling » FrTP_SetRxBufferSize

Note

Note

This call will affect ongoing as well as future data receptions!

Syntax

long FrTP_SetRxBufferSize( long connHandle, dword receiverBufferSize);

Function

This function limits the receive buffer for the connection to the given number of bytes. Every time the buffer is full, the callback function FrTP_RxBufferFullInd is called.

Setting a value of 0 will give the buffer an unlimited size, i.e. the callback function will never be called (this is the default).

Parameters
  • connHandle
    The handle of the connection.
  • receiverBufferSize
    The received data size after the appropriate callback is called.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Limit the receive buffer to 200 bytes.

FrTP_SetRxBufferSize( connHandle, 200);


FrTP_SmallBufferSend

FlexRay TP ISO » CAPL Functions » Small Buffer Handling » FrTP_SmallBufferSend

Syntax

long FrTP_SmallBufferSend( long connHandle, dword totalDataLength, BYTE startData[], dword startDataLength);

Function

This function is provided as a replacement for FrTP_DataRequest in case small buffer handling is to be used. FrTP_DataRequest always expects the complete TP data in advance.

Parameters
  • connHandle
    The handle of the connection.
  • totalDataLength
    Length of this data transfer. May be 0 to indicate that the total length is not known in advance. Please consider that the standard limits the length to a maximum of 65535 byte. Note that the First Frame indication provides this number.
  • startData
    Buffer holding the first bytes for transfer in the First Frame.
  • startDataLength
    Initial amount of data available for sending, must be > 0.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Start sending data while only a part of it is already set.

FillFirstBytes( globalData, 10); // set first 10 bytes of data FrTP_SmallBufferSend( gConnHandle, elcount(globalData) , globalData, 10);


FrTP_ProvideTxData

FlexRay TP ISO » CAPL Functions » Small Buffer Handling » FrTP_ProvideTxData

Note

Note

In case a transmission was started without specifying the total length, the end of the data is indicated by a call to this function with lengthThisSendData = 0.

Syntax

long FrTP_ProvideTxData( long connHandle, BYTE data[], dword offsetInData, dword lengthThisSendData);

Function

The data provided with this function will be sent as soon as the respective Consecutive Frame or Last Frame has to be filled. It is possible that the DLL currently waits for data to send for the connection; in this case a Consecutive Frame (or Last Frame, see below) is sent immediately.

Parameters
  • connHandle
    The handle of the connection.
  • data
    Buffer holding the data.
  • offsetInData
    The first byte to add to the send data does not have to be located at the start of the buffer given. This argument indicates the position of the first byte.
  • lengthThisSendData
    Number of bytes to copy from the data buffer to the send buffer starting at the offset. Must be > 0 if the total length of the data to send was given for the transfer.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Every time a diagnostic trouble code (DTC) has been created it is added to the send buffer and forwarded to the connection that is currently transmitting.

void ProvideNextDTC( WORD DTC, BYTE status)
{
BYTE sListOfDTC[1000]; // static list of DTC
WORD sNextDTC = 0; // static start position
sListOfDTC[sNextDTC ] = (BYTE) (DTC >> 8);
sListOfDTC[sNextDTC + 1] = (BYTE) DTC;
sListOfDTC[sNextDTC + 2] = status;
FrTP_ProvideTxData(gResponseHandle, sListOfDTC, sNextDTC, 3);
sNextDTC += 3;
}


FrTP_CopyDataReceived

FlexRay TP ISO » CAPL Functions » Small Buffer Handling » FrTP_CopyDataReceived

Syntax

long FrTP_CopyDataReceived( long connHandle, dword posFirstByte, BYTE dataOut[], dword nrOfBytesToCopy);

Function

While data is received on a connection, it is possible to copy it into a buffer at any time.

Parameters
  • connHandle
    The handle of the connection.
  • posFirstByte
    Location of the first byte to copy in the received data. If no bytes are available at this position, an error is returned.
  • dataOut
    Buffer the bytes are copied into.
  • nrOfBytesToCopy
    Maximum number of bytes to copy, i.e. if fewer bytes are available, only those will be copied.

Return Values
  • ≥0: This are the number of bytes that are copied into the buffer.
  • <0: An error occurred, e.g. no data available at the given position. (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

During the indication of a First Frame, it is possible to access the first bytes of data.

void FrTP_FirstFrameInd(long connectionHdl, dword dataLength)
{
BYTE data[100];
FrTP_CopyDataReceived(connectionHdl, 0, data, elcount(data));
// process first data bytes ...
}


FrTP_GetPCIOffset

FlexRay TP ISO » CAPL Functions » Retrieve Additional Information » FrTP_GetPCIOffset

Note

Note

These functions are allowed to be called only during execution of the callback function FrTP_FrameRxInd!

Syntax

long FrTP_GetPCIOffset();

Function

Returns the offset of the first byte after the C_PCI. Valid for STF, CF, FC and LF C-PDUs.

Parameters
    —

Return Values
  • ≥0: This is the appropriate requested value.
  • <0: An error occurred. (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_GetSequenceNumber

FlexRay TP ISO » CAPL Functions » Retrieve Additional Information » FrTP_GetSequenceNumber

Note

Note

These functions are allowed to be called only during execution of the callback function FrTP_FrameRxInd!

Syntax

long FrTP_GetSequenceNumber();

Function

Returns the sequence number (SN) parameter of a CF C-PDU or the message length (ML) parameter of a STF or LF -PDU or the byte position (BP) of a FC-ACK_RET C-PDU.

Valid for STF, CF, FC and LF frames.

Parameters
    —

Return Values
  • ≥0: This is the appropriate requested value.
  • <0: An error occurred. (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_GetFlowStatus

FlexRay TP ISO » CAPL Functions » Retrieve Additional Information » FrTP_GetFlowStatus

Note

Note

These functions are allowed to be called only during execution of the callback function FrTP_FrameRxInd!

Syntax

long FrTP_GetFlowStatus();

Function

Returns the flow status parameter (type of flow control frame) of a FC C-PDU:

  • 3: Continue To Send (CTS)
  • 4: Acknowledge/Retry (ACK_RET)
  • 5: Wait
  • 6: Abort
  • 7: Overflow

Only valid for FC frames.

Parameters
    —

Return values
  • ≥0: This is the appropriate requested value.
  • <0: An error occurred. (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_GetAckRetryState

FlexRay TP ISO » CAPL Functions » Retrieve Additional Information » FrTP_GetAckRetryState

Note

Note

These functions are allowed to be called only during execution of the callback function FrTP_FrameRxInd

Syntax

long FrTP_GetAckRetryState();

Function

Returns the ACK parameter of a FC-ACK_RET C-PDU:

  • 0: Positive acknowledge
  • 1: RETRY

Only valid for FC-ACK_RET frames.

Parameters

—

Return Values
  • ≥0: This is the appropriate requested value.
  • <0: An error occurred. (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_GetBlockSize

FlexRay TP ISO » CAPL Functions » Retrieve Additional Information » FrTP_GetBlockSize

Note

Note

These functions are allowed to be called only during execution of the callback function FrTP_FrameRxInd!

Syntax

long FrTP_GetBlockSize();

Function

Returns the buffer size (BfS) parameter of a FC-CTS C-PDU. Only valid for FC-CTS frames.

Parameters

—

Return Values
  • ≥0: This is the appropriate requested value.
  • <0: An error occurred. (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_GetStMinOrBC

FlexRay TP ISO » CAPL Functions » Retrieve Additional Information » FrTP_GetStMinOrBC

Note

Note

These functions are allowed to be called only during execution of the callback function FrTP_FrameRxInd!

Syntax

long FrTP_GetStMinOrBC();

Function

Returns the bandwidth control (BC) parameter of a FC-CTS C-PDU.

Only valid for FC-CTS frames.

Parameters

—

Return Values
  • ≥0: This is the appropriate requested value.
  • <0: An error occurred. (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_GetFrameSubType

FlexRay TP ISO » CAPL Functions » Retrieve Additional Information » FrTP_GetFrameSubType

Note

Note

These functions are allowed to be called only during execution of the callback function FrTP_FrameRxInd!

Syntax

long FrTP_GetFrameSubType();

Function

Returns the appropriate sub-type of the C-PDU:

  • 0: STF, CF, FC
  • 1: ACK_RET, CF1
  • 2: CF2
  • 3: CF_EOB
  • 4: Not used
  • 5: LF

Can be called for all valid TP frame types.

Parameters

—

Return Values
  • ≥0: This is the appropriate requested value.
  • <0: An error occurred. (Cf. Error Codes).

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTPFI_DelayTx_DF

FlexRay TP ISO » CAPL Functions » Fault Injections » FrTPFI_DelayTx_DF

Syntax

long FrTPFI_DelayTX_DF( long connHandle, long frameNo, dword delay, dword flags);

Function

Delay the sending of the appropriate STF, LF or CF.

Parameters
  • connHandle
    The handle of the connection.
  • frameNo
    Number of the frame to be disturbed:
  • 0: Disturb the STF
  • n>0: Disturb specific CF (absolute or with SN = n)
  • -1: Disturb the LF
  • -2: Disturb all DF C-PDUs
  • delay
    Time [ms] the frame should be delayed.
  • flags
  • 0x01
    If set, then interpret the frame no. as an absolutely counted number (else interpret the frame no. as the SN of the CF).

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTPFI_DoubleTx_DF

FlexRay TP ISO » CAPL Functions » Fault Injections » FrTPFI_DoubleTx_DF

Syntax

long FrTPFI_DoubleTX_DF( long connHandle, long frameNo, dword delay, dword flags);

Function

Send the appropriate STF, LF or CF twice. The repeated frame will optionally delayed (delay > 0).

Parameters
  • connHandle
    The handle of the connection.
  • frameNo
    Number of the frame to be disturbed:
  • 0: Disturb the STF
  • n>0: Disturb specific CF (absolute or with SN = n)
  • -1: Disturb the LF
  • -2: Disturb all DF C-PDUs
  • delay
    Time [ms] the frame should be delayed.
  • flags
  • 0x01
    If set, then interpret the frame no. as an absolutely counted number (else interpret the frame no. as the SN of the CF).

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTPFI_DropTx_DF

FlexRay TP ISO » CAPL Functions » Fault Injections » FrTPFI_DropTx_DF

Syntax

long FrTPFI_DropTX_DF( long connHandle, long frameNo, dword flags);

Function

Do not send the appropriate STF, LF or CF.

Parameters
  • connHandle
    The handle of the connection.
  • frameNo
    Number of the frame to be disturbed:
  • 0: Disturb the STF
  • n>0: Disturb specific CF (absolute or with SN = n)
  • -1: Disturb the LF
  • -2: Disturb all DF C-PDUs
  • flags
  • 0x01
    If set, then interpret the frame no. as an absolutely counted number (else interpret the frame no. as the SN of the CF).

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTPFI_DelayTx_FC

FlexRay TP ISO » CAPL Functions » Fault Injections » FrTPFI_DelayTx_FC

Syntax

long FrTPFI_DelayTX_FC( long connHandle, long frameNo, dword delay, dword flags);

Function

Delay the sending of the appropriate Flow Control (FC) or Acknowledge Frame (ACK).

Parameters
  • connHandle
    The handle of the connection.
  • frameNo
    Number of the frame to be disturbed:
  • 0: Disturb the first FC
  • n>0: Disturb specific FC (absolutely counted per transmission)
  • -1: Disturb the ACK
  • -2: Disturb all FC C-PDUs
  • delay
    Time [ms] the frame should be delayed.
  • flags
    Not used yet.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTPFI_DoubleTx_FC

FlexRay TP ISO » CAPL Functions » Fault Injections » FrTPFI_DoubleTx_FC

Syntax

long FrTPFI_DoubleTX_FC( long connHandle, long frameNo, dword delay, dword flags);

Function

Send the appropriate Flow Control (FC) or Acknowledge Frame (ACK) twice. The repeated frame will optionally delayed (delay > 0).

Parameters
  • connHandle
    The handle of the connection.
  • frameNo
    Number of the frame to be disturbed:
  • 0: Disturb the first FC
  • n>0: Disturb specific FC (absolutely counted per transmission)
  • -1: Disturb the ACK
  • -2: Disturb all FC C-PDUs
  • delay
    Time [ms] the frame should be delayed.
  • flags
    Not used yet.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTPFI_DropTx_FC

FlexRay TP ISO » CAPL Functions » Fault Injections » FrTPFI_DropTx_FC

Syntax

long FrTPFI_DropTX_FC( long connHandle, long frameNo, dword flags);

Function

Do not send the appropriate Flow Control (FC) or Acknowledge Frame (ACK).

Parameters
  • connHandle
    The handle of the connection.
  • frameNo
    Number of the frame to be disturbed:
  • 0: Disturb the first FC
  • n>0: Disturb specific FC (absolutely counted per transmission)
  • -1: Disturb the ACK
  • -2: Disturb all FC C-PDUs
  • flags
    Not used yet.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTPFI_MissInterpretRX_FC

FlexRay TP ISO » CAPL Functions » Fault Injections » FrTPFI_MissInterpretRX_FC

Syntax

long FrTPFI_MissInterpretRX_FC( long connHandle, long frameNo, dword flags);

Function

Miss interpret the appropriate received Flow Control (FC) or Acknowledge (ACK-RETRY) frame.

Parameters
  • connHandle
    The handle of the connection.
  • frameNo
    Number of the frame to be disturbed:
  • 0: Disturb the first FC
  • n>0: Disturb specific FC (absolutely counted per transmission)
  • -1: Disturb the ACK
  • -2: Disturb all DF C-PDUs
  • flags
  • 0x01
    If bit is set, then interpret the FC frame as Clear to Send (CTS) or an ACK as a positive acknowledge regardless of its real content and meaning.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTPFI_ClearAll

FlexRay TP ISO » CAPL Functions » Fault Injections » FrTPFI_ClearAll

Syntax

long FrTPFI_ClearAll( long connHandle);

Function

Deletes all fault injections that are currently defined for the connection. Additionally the connection is reset (any currently ongoing transmission and reception are cancelled).

Parameters
  • connHandle
    The handle of the connection.

Return Values

see Error Codes

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_ReceptionInd

FlexRay TP ISO » CAPL Callback Functions » FrTP_ReceptionInd

Syntax

void FrTP_ReceptionInd( long connHandle, BYTE data[]);

Function

This function is called when the node has received data from its peer. Since the node may use several connections, the handle indicates which one has received the data. The number of data is available as length of the byte array.

Parameters
  • connHandle
    The handle of the connection.
  • data
    Buffer the bytes are copied into.

Return Values

—

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

On reception of data, its length and first byte are written to the Write Window.

void FrTP_ReceptionInd( long connHandle, byte data[])
{
write( "Received %d byte: [%02x] ..."
, elcount( data), data[0]);
}


FrTP_ErrorInd

FlexRay TP ISO » CAPL Callback Functions » FrTP_ErrorInd

Syntax

void FrTP_ErrorInd( long connHandle, dword error);

Function

An error occurred for the connection indicated. Please refer to Error Codes for details.

Parameters
  • connHandle
    The handle of the connection.
  • error
    The error code.

Return Values

—

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

A warning is written to the Write Window when an error occurs.

void FrTP_ErrorInd( long connHandle, dword error)
{
write( "Error %d for connection %d", error, connHandle);
}


FrTP_FirstFrameInd

FlexRay TP ISO » CAPL Callback Functions » FrTP_FirstFrameInd

Note

Note

Only one data transmission can be performed per connection at a time, so the application code has to wait for the transmission confirmation before requesting the sending of the next data block.

Syntax

void FrTP_FirstFrameInd( long connHandle, dword length);

Function

This function allows the CAPL program to determine the start of a segmented data reception.

Parameters
  • connHandle
    The handle of the connection.
  • length
    The number of bytes expected.

Return Values

—

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Indicate the events in the Write Window.

void FrTP_FirstFrameInd( long connHandle, dword length)
{
write( "Peer has started transfer of %d byte to this node"
, length);
}


FrTP_TxConfirmationInd

FlexRay TP ISO » CAPL Callback Functions » FrTP_TxConfirmationInd

Note

Note

Only one data transmission can be performed per connection at a time, so the application code has to wait for the transmission confirmation before requesting the sending of the next data block.

Syntax

void FrTP_TxConfirmationInd( long connHandle);

Function

This function allows the CAPL program to determine the end of a data transmission.

Parameters
  • connHandle
    The handle of the connection.

Return Values

—

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

Indicate the events in the Write Window.

void FrTP_TxConfirmationInd( long connHandle)
{
write( "Data transmission on connection %d successful"
, connHandle);
}


FrTP_FrameRxInd

FlexRay TP ISO » CAPL Callback Functions » FrTP_FrameRxInd

Syntax

void FrTP_FrameRxInd( long connHandle, long typeOfCPDU, BYTE buffer[]);

Function

This CAPL callback function is called by the DLL whenever a C-PDU is received on its observed slots. During this callback additional information of the frame can be retrieved by calling functions from the group Retrieve Additional Information.

Parameters
  • connHandle
    The handle of the connection.
  • typeOfCPDU
    The type (interpretation) of the received PDU:
  • -1: Unknown (unexpected)
  • 0: Un-segmented STF (Single Frame)
  • 1: Segmented STF (First Frame)
  • 2: CF (Continuous Frame) or LF (last Frame)
  • 3: FC/ACK_RET (Flow Control or Acknowledge/Retry Frame)
  • buffer
    Received payload of the PDU.

Return Values

—

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup


FrTP_RxBufferFullInd

FlexRay TP ISO » CAPL Callback Functions » FrTP_RxBufferFullInd

Syntax

void FrTP_RxBufferFullInd( long connHandle, dword posFirstByte, BYTE buffer[]);

Function

This CAPL callback function is called by the DLL when the receiver buffer is full. As default the receiver buffer is not limited, therefore FrTP_SetRxBufferSize() has to reduce the buffer size for the connection (cf. FrTP_SetRxBufferSize).

Parameters
  • connHandle
    The handle of the connection.
  • posFirstByte
    The position of the first byte in the receiver buffer.
  • buffer
    Received data buffer.

Return Values

—

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

In a gateway, data received on the source bus is forwarded to the target bus. In case of the first segment of data, a new data transfer with incomplete data is started. Otherwise the data is forwarded to the ongoing transmission.

void FrTp_RxBufferFullInd( long connHandle,
dword posFirstByte, BYTE segment[])
{
SetBusContext( gTargetBus); // activate target bus
if( posFirstByte == 0)
FrTP_SmallBufferSend( gTargetHandle
, gTotalDataLength
// set in FirstFrameInd
, segment, elcount( segment));
else
FrTP_ProvideTxData( gTargetHandle
, segment, 0, elcount( segment));
}


FrTP_ProvideTxDataInd

FlexRay TP ISO » CAPL Callback Functions » FrTP_ProvideTxDataInd

Note

Note

If no data is provided before timer Cr has expired, the receiver will have run into a timeout, aborting the reception. In that case the transmission is aborted too (error indication 10; see Error Codes).

Syntax

void FrTP_ProvideTxDataInd( long connHandle, dword nextBytePosToSend);

Function

This callback is called when the DLL is not able to fill the data part of the next Consecutive Frame it has to send, i.e. the data provided so far does not cover the bytes starting at nextBytePosToSend. It will only be called for transmissions started with FrTp_SmallBufferSend.

If data is provided often enough with FrTp_ProvideTxData , this callback function is never called.

Parameters
  • connHandle
    The handle of the connection.
  • nextBytePosToSend
    The position of the next expected data to be transmitted.

Return Values

—

Availability

Since Version

Restricted To

Measurement Setup

Simulation / Test Setup

CANoe 7.5 SP4
+ DLL 3.3.0

CANoe

—

Node Context in the
Simulation Setup

Example

Example

The CANoe sender node introduces a delay in the sequence of Consecutive Frames by providing additional transmission data only after 100 ms have passed.

void FrTp_ProvideTxDataInd( long connHandle,
dword nextBytePosToSend)
{
gNextBytePosToSend = nextBytePosToSend;
setTimer( tDelayTx, 100);
}
on timer tDelayTx
{
// Provide some additional data to continue sending
FrTp_ProvideTxData( gConnHandle, gData
, gNextBytePosToSend, 50);
}