forked from COVESA/ifex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
seats-service.yml
279 lines (261 loc) · 8.48 KB
/
seats-service.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# TODO:
# + Define additional semantics for a service, if needed.
#
# + How do we map namespaces to FrancaIDL (packages?)
# Multiple namespaces in a single service file does not map
# to single FrancaIDL package name.
#
service:
name: comfort
description: A collection of interfaces pertaining to cabin comfort.
# Datatypes
#
# Datatypes are global for all interfaces under the given service (comfort)
#
# TODO:
# + How do we import datatypes from other service files? Importing
# datatypes used by multiple services make sense, but it will put
# a strain on the build pipeline since we now will have to seach
# for and assemble a library of interdependent services.
#
# + Decide if datatypes can be placed at lower levels (interfaces,
# commands, etc) in order to create scope-local datatypes. Also
# decide if we can have global data types (above service level),
# which ties into the issue above.
#
datatypes:
# Namespaces
#
# Name spaces are used to separate out data types with the same name
# popping up in different interfaces.
#
- namespace: movement
description: |
The units used to describe movement of the seats
types:
# Typedefs
#
# Standard redefinition of native types are supported.
# Min/max intervals can be optionally specified
#
- name: movement_t
type: uint16_t
min: 0
max: 1000
description: |
The movement of a seat component
# Structs
#
# Standard structs can be defind, using either native types, tyepdefs,
# or other (nested) structs.
#
- name: position_t
type: struct
description: |
The position of the entire seat
members:
- name: base
type: movement.movement_t
description: |
The position of the base 0 front, 1000 back
- name: cushion
type: movement.movement_t
description: |
The position of the cushion 0 short, 1000 long
- name: lumbar
type: movement.movement_t
description: |
The position of the lumbar support
- name: side_bolster
type: movement.movement_t
description: |
The position of the side bolster
- name: head_restraint
type: movement.movement_t
description: |
The position of the head restraint 0 down, 1000 up
- name: seat_location_t
type: struct
description: |
The location of the seat in the vehicle
members:
- name: row
type: uint8_t
description: |
The row, front 0 and +1 toward rear
- name: index
type: uint8_t
description: |
The index within the row, 0 left most, +1 toward right
# Enums
#
# TODO:
# + Decide if we need to move enum_type (uint8_t) to a separate deployment
# file, one per target (python, C++, etc).
# The upside is a cleaner, more service-oriented catalog.
# The downside is it inter-target operability is harder to
# define an over-the-wire payload format since one target
# can define uint16_t while another has uint8_t.
#
- name: seat_component_t
type: enumeration # RESOLUTION: was enum. Ok to rename enumeration.
enum_type: uint8_t
options:
- name: base
value: 0
- name: cushion
value: 1
- name: lumbar
value: 2
- name: side_bolster
value: 3
- name: head_restraint
value: 4
- name: seat_t
type: struct
description: |
The structure used to describe the seat's position in the vehicle
members:
- name: location
type: movement.seat_location_t
description: |
The location of the seat in the vehicle
- name: position
type: movement.position_t
description: |
The various positions of the seat
# Interface
#
# An interface is a collection of commands, methods, and events.
#
# A command is a single sender -> single receiver request
# with no return value.
#
# A method is a single sender -> single receiver request
# with a return value.
#
# An event is a single sender -> multiple receiver request
# with no return value.
#
interfaces: # ok with JLR.
# TODO
# + Add HVAC and ambient lighting to complete the comfort service.
#
# + Define include directives.
# Example:- include: "hvac.yml"
# Research if we can use YAML's anchor mechanism to get built-in
# include support.
# We need to figure out how data types spanning multiple interfaces
# are handled in this case.
#
# + Do we specify delivery effort level here?
# UDP vs. TCP-level effort for commands, methodsm and events?
#
- include-interface: "xxx.yml"
- name: seats
description: Seats API
# Commands
#
# A command invokes a function for a given service with no return
# value being sent back.
#
commands:
- name: move
description: |
Set the desired seat position
in_arguments: # TODO FYI: Gunnar
- name: seat
description: |
The desired seat position
type: movement.seat_t
- name: move_component
description: |
Set a seat component position
# Arguments
#
# Argument can be of any native type, enum, struct, or typedef.
#
in_arguments:
- name: seat
description: |
The seat location to change
type: movement.seat_location_t
- name: component
description: |
The component position to change
type: movement.seat_component_t
- name: position
description: |
The desired position to move the component to
type: movement.movement_t
# Method
#
# A method invokes a function for a given service with a return
# value being sent back.
#
methods: #
- name: current_position
description: |
Get the current position of the seat
in_arguments:
- name: row
description: |
The desired seat to row query
type: uint8_t
- name: index
description: |
The desired seat index to query
type: uint8_t
out_arguments:
- name: seat
description: |
The seat state that was requested
type: movement.seat_t
# Events
#
# Events are non-returning commands with multiple subscribers,
# much like SOME/IP events.
# Unlike signals an event retains no state (value) after it has
# been called; once it has been sent it is forgotten.
#
# TODO:
# + FrancaIDL may lack semantics to cover this. We need to
# create apropriate transformation rules.
#
events:
- name: seat_moving
description: |
The event of a seat beginning movement
in_arguments:
- name: status
description: |
The movement status, moving (1), not moving (0)
type: uint8_t
- name: row
description: |
The row of the seat
type: uint8_t
- name: index
description: |
The index of the seat position in the row
type: uint8_t
- name: component
description: |
The seat component that is moving
type: movement.seat_component_t
- name: passenger_present
description: |
When the seat passenger status changes
in_arguments:
- name: status
description: |
The status of seat passenger, passenger (1), no passenger (0)
type: uint8_t
- name: row
description: |
The row of the seat
type: uint8_t
- name: index
description: |
The index of the seat position in the row
type: uint8_t