SOME/IP in AUTOSAR Classic

SOME/IP

Fields: getter, setter and notifier

A field is a value the server always holds. Clients can read it with the getter, ask to change it with the setter, and be told by the notifier when it changes, starting with its current value the moment they subscribe.

One value, three parts

The UpdateRate field at the radar. Getter: a REQUEST with no payload, answered by a RESPONSE with the value. Setter: a REQUEST with the wanted value, answered by a RESPONSE with the value actually set. Notifier: a NOTIFICATION sent when the value changes, and once as initial event right after a client subscribes. UpdateRate now: 20 → 50 held by the radar getterread the value Brake ECUreads REQUEST · empty RESPONSE · 20 setterchange the value Display ECUchanges REQUEST · 80 wanted RESPONSE · 50 (limit) notifierNOTIFICATION on every change initial event:once, after subscribing subscriber new subscriber
Figure 1. Blue and green arrows come in pairs (REQUEST and RESPONSE); orange arrows go out alone. Look at the setter: the display ECU asked for 80 and the RESPONSE says 50, the value the server really set.

part 1

Getter

A REQUEST with an empty payload. The RESPONSE carries the current value.

part 2

Setter

A REQUEST carrying the wanted value. The RESPONSE carries the value that was actually set; the server may adjust it, for example to stay within limits.

part 3

Notifier

An event (Message Type NOTIFICATION) sent when the value changes, following the rules for events, and once to each new subscriber right after it subscribes.

A field has at least one of the three parts; which ones exist is part of the service interface. A field without getter, setter and notifier does not exist.

The difference to a plain event

A plain event says "something happened"; a new subscriber only gets the next one. A field says "this is the state"; a new subscriber needs the state at once. So right after accepting the subscription to the eventgroup (lesson 14), the server sends it an initial event (the field's current value, sent once to a new subscriber only). Lesson 14 shows when exactly it is sent, and lesson 21 shows which AUTOSAR module triggers it.

How the Classic Platform describes it

PartDescribed as
NotifierA data element of a sender-receiver interface
GetterA ClientServerOperation with one OUT argument
SetterA ClientServerOperation with an IN and an OUT argument

In the system description the three parts belong together as one field of the service. For the SWC they are an ordinary write or read and two ordinary client-server calls.

Try it

The radar holds UpdateRate, limited to 10–50. Subscribe clients, call the getter and the setter, and let the radar change the value itself. Every message appears in the log.

Value at the radar: 20

Things to notice. Subscribing immediately brings one initial event with the current value, only to the client that subscribed. Asking the setter for 80 brings back 50, and because the value changed, every subscriber also gets a NOTIFICATION. Setting the value it already has brings a RESPONSE but no notification, because nothing changed.

Check yourself optional

New terms in this lesson

TermMeaning
fieldA value the server holds, with a getter, a setter and a notifier (at least one of them)
getterReads the value: REQUEST with empty payload, RESPONSE with the value
setterChanges the value: the RESPONSE carries the value actually set
notifierSends a NOTIFICATION to the subscribers when the value changes
initial eventThe current value, sent once to a new subscriber right after its subscription is accepted

Source: SOME/IP Protocol Specification, R20-11, section 4.2.5; SOME/IP-SD Protocol Specification, R20-11, section 4.1.6 (initial events); System Template, R20-11, section 10.1.4.