Skip to main content

AREthAddField

Valid for: CANoe DE • CANoe4SW DE

Function Syntax

Description

This function adds a field to a Provided Service Instance that was created by AREthCreateProvidedServiceInstance. Field contents can be set using the corresponding access functions (AREthSetValue…). These changes are only applied when the AREthCommitField is called. A field can be removed again using the AREthRemoveField function.

Parameters

  • psiHandle: Handle of the Provided Service Instance that was created with AREthCreateConsumerServiceInstance.
  • notificationId: Identifier of the field notification. If the field does not support a notifier, the value -1 must be specified here.
  • getterId: Identifier of the Field Getter method. If a consumer calls the getter method, the field content is returned by default. If this default behavior is to be changed, a method with the getterId must be created (see also AREthAddMethod and <OnAREthMethodRequest>). If the field does not support a getter method, the value -1 must be specified here.
  • setterId: Identifier of the Field Setter method. If a consumer calls the setter method, the field content is overwritten by default and the new field content is then sent via a response. If this default behavior is to be changed, a method with the getterId must be created (see also AREthAddMethod and <OnAREthMethodRequest>). If the field does not support a setter method, the value -1 must be specified here.

Return Values

  • 0: An error occurred. The error can be evaluated using the AREthGetLastError function.
  • >0: Handle of the created field

Example

In this example, it is assumed that the utilized field is contained in the FIBEX database that is assigned to the CANoe configuration. The field has the Notification ID 30, the Getter ID 31, and the Setter ID 32. The data type of the field is a standard data type (for example, UINT8).
See Also