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
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
| Part | Described as |
|---|---|
| Notifier | A data element of a sender-receiver interface |
| Getter | A ClientServerOperation with one OUT argument |
| Setter | A 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
| Term | Meaning |
|---|---|
| field | A value the server holds, with a getter, a setter and a notifier (at least one of them) |
| getter | Reads the value: REQUEST with empty payload, RESPONSE with the value |
| setter | Changes the value: the RESPONSE carries the value actually set |
| notifier | Sends a NOTIFICATION to the subscribers when the value changes |
| initial event | The 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.