summaryrefslogtreecommitdiff
path: root/NodeStateAccess/interfaces/NodeStateManager.fidl
blob: 0865989ffc8e374d391e815ff6dc58f855e6ba2c (plain)
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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
/**********************************************************************************************************************
 *
 * Copyright (C) 2017 BMW AG
 *
 * Interface definition for NodeStateManager CommonAPI interface
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 **********************************************************************************************************************/

package org.genivi.nodestatemanager
import org.genivi.* from "NodeStateManagerTypes.fidl"

<**
    @author : Alexander Wenzel
**>

interface Consumer {
    version {
        major 1
        minor 0
    }
    broadcast ShutdownEvents selective {
        out {
            UInt32 Mode
        }
    }

    <**
        @description : and will include the current Node Application Mode as a parameter
    **>
    broadcast NodeApplicationMode {
        out {

            <**
                @description : This parameter will be based upon the NsmApplicationMode_e
            **>
            NodeStateManagerTypes.NsmApplicationMode_e ApplicationModeId
        }
    }

    <**
        @description : include the current Node State as a parameter
    **>
    broadcast NodeState {
        out {

            <**
                @description : This parameter will be based upon the NsmNodeState_e
            **>
            NodeStateManagerTypes.NsmNodeState_e NodeStateId
        }
    }

    <**
    @description :
        through the use of the Session Name.

        The signal will include the session name and the new session state
    **>
    broadcast SessionStateChanged {
        out {

            <**
                @description : The Session name will be based upon either the pre-defined platform session names or using a newly added product defined session name
            **>
            String SessionName

            <**
                @description : This parameter will be based upon the enum NsmSeat_e
            **>
            NodeStateManagerTypes.NsmSeat_e SeatID

            <**
                @description : This parameter will be based upon the NsmSessionState_e but it will not be bounded by the values in that enumeration. The listed values are the default values that are mandatory for platform sessions, but product sessions may have additional session states
            **>
            NodeStateManagerTypes.NsmSessionState_e SessionState
        }
    }

    <**
        @description : The method is used by other applications to get the NodeState without the need of registration to the signal
    **>
    method GetNodeState {
        out {

            <**
                @description : Will be based on the NsmNodeState_e
            **>
            NodeStateManagerTypes.NsmNodeState_e NodeStateId
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    }

    <**
        @description : The method is used by applications to set the state of a session
    **>
    method SetSessionState {
        in {

            <**
                @description : This is a null terminated string that identifies the name of the session that should be updated
            **>
            String SessionName

            <**
                @description : This parameter defines the name of the application that is setting the state of the session. This must be the applications systemd unit filename.
            **>
            String SessionOwner

            <**
                @description : This parameter will be based upon the enum NsmSeat_e
            **>
            NodeStateManagerTypes.NsmSeat_e SeatID

            <**
                @description : Will be based on the NsmSessionState_e but it will not be bounded by the values in that enum as extended session states are possible for new product sessions
            **>
            NodeStateManagerTypes.NsmSessionState_e SessionState
        }
        out {

            <**
                @description : NsmErrorStatus_e value
            **>
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    }

    <**
        @description : The method is used by applications to get the state of a session
    **>
    method GetSessionState {
        in {
            String SessionName

            <**
                @description : This parameter will be based upon the enum NsmSeat_e
            **>
            NodeStateManagerTypes.NsmSeat_e SeatID
        }
        out {

            <**
                @description : Will be based on the NsmSessionState_e but it will not be bounded by the values in that enum as extended session states are possible for new product sessions
            **>
            NodeStateManagerTypes.NsmSessionState_e SessionState

            <**
                @description : NsmErrorStatus_e value
            **>
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    }

    <**
        @description : The method is used by other applications to get the application mode.
    **>
    method GetApplicationMode {
        out {

            <**
                @description : Will be based on NsmApplicationMode_e
            **>
            NodeStateManagerTypes.NsmApplicationMode_e ApplicationModeId
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    }

    <**
        @description : object called NSMLifecycleRequest. This method will take one parameter which is the Lifecycle Request (i.e. normal shutdown, fast shutdown, runup). For an example of the required client interface please see the Boot Manager component who will be a client of the NSM
    **>
    method RegisterShutdownClient {
        in {

            <**
                @description : Shutdown mode for which client wants to be informed (i.e normal, fast etc)
            **>
            UInt32 ShutdownMode

            <**
                @description : Max. Timeout to wait for response from shutdown client.
            **>
            UInt32 TimeoutMs
        }
        out {

            <**
            @description :
                Returned error code of the method.
                NsmErrorStatus_e value
            **>
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    }

    <**
        @description : The method is used by other applications to unregister themselves as shutdown client
    **>
    method UnRegisterShutdownClient {
        in {

            <**
                @description : Shutdown mode from which client wants to be unregistered
            **>
            UInt32 ShutdownMode
        }
        out {

            <**
            @description :
                Returned error code of the method.
                NsmErrorStatus_e value
            **>
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    }

    <**
        @description : The method is used by other applications to register a new session whose state should be observed and distributed by the NSM
    **>
    method RegisterSession {
        in {

            <**
                @description : Session name to be registered
            **>
            String SessionName

            <**
                @description : This is the name of the application that is registering the new session (this must be the applications systemd unit filename)
            **>
            String SessionOwner

            <**
                @description : This parameter will be based upon the enum NsmSeat_e
            **>
            NodeStateManagerTypes.NsmSeat_e SeatID

            <**
                @description : Will be based on the NsmSessionState_e but it will not be bounded by the values in that enum as extended session states are possible for new product sessions
            **>
            NodeStateManagerTypes.NsmSessionState_e SessionState
        }
        out {

            <**
            @description :
                Returned error code of the method.
                NsmErrorStatus_e value
            **>
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    }

    <**
        @description : The method is used by other applications to remove a new session from the session list hosted by NSM
    **>
    method UnRegisterSession {
        in {

            <**
                @description : Session name to be unregistered
            **>
            String SessionName

            <**
                @description : This is the name of the application that originally registered the session. It will be validated that this value matches the stored value from the registration
            **>
            String SessionOwner

            <**
                @description : This parameter will be based upon the enum NsmSeat_e
            **>
            NodeStateManagerTypes.NsmSeat_e SeatID
        }
        out {

            <**
            @description :
                Returned error code of the method.
                NsmErrorStatus_e value
            **>
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    }

    <**
        @description : This method can be used to read the number of failed applications in the system
    **>
    method GetAppHealthCount {
        out {

            <**
                @description : Number of currently failing apps
            **>
            UInt32 Count
        }
    }

    <**
    @description :
        The method returns the version number of the Node State Manager. The number is organized in four bytes:

        Version: VVV.RRR.PPP.BBB

            	&lt;literallayout&gt;
            		VVV =&gt; Version  [1..255]
            		RRR =&gt; Release  [0..255]
            		PPP =&gt; Patch    [0..255]
            		BBB =&gt; Build    [0..255]
            	&lt;/literallayout&gt;
    **>
    method GetInterfaceVersion {
        out {

            <**
                @description : Unsigned integer that represents the version number of the Node State Manager.
            **>
            UInt32 Version
        }
    }

    <**
        @description : The method is used by a client to notify the NSM that a LifecycleRequest has been completed
    **>
    method LifecycleRequestComplete {
        in {

            <**
                @description : Status of the request to be performed. This will be based on the enum NsmErrorStatus_e
            **>
            NodeStateManagerTypes.NsmErrorStatus_e Status
        }
        out {

            <**
                @description : NsmErrorStatus_e value
            **>
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    } attribute Int32 BootMode

    attribute NodeStateManagerTypes.NsmRestartReason_e RestartReason

    attribute NodeStateManagerTypes.NsmShutdownReason_e ShutdownReason

    attribute NodeStateManagerTypes.NsmRunningReason_e WakeUpReason

}

<**
    @author : Alexander Wenzel
**>

interface LifecycleControl {
    version {
        major 1
        minor 0
    }

    <**
        @description : The method is used by other applications to request a restart of the node.
    **>
    method RequestNodeRestart {
        in {

            <**
                @description : The passed value will be based upon the enum NsmRestartReason_e.
            **>
            NodeStateManagerTypes.NsmRestartReason_e RestartReason

            <**
            @description :
                This parameter will define the type of shutdown that is requested as part of the restart process. The acceptable values for this parameter are

                NSM_SHUTDOWNTYPE_NORMAL
                and
                NSM_SHUTDOWNTYPE_FAST
            **>
            UInt32 RestartType
        }
        out {
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    }

    <**
        @description : application mode
    **>
    method SetApplicationMode {
        in {

            <**
                @description : This parameter will be based upon the NsmApplicationMode_e
            **>
            NodeStateManagerTypes.NsmApplicationMode_e ApplicationModeId
        }
        out {
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    }

    <**
        @description : registered consumers of the new state
    **>
    method SetNodeState {
        in {

            <**
                @description : The passed value will be based upon the enum NsmNodeState_e
            **>
            NodeStateManagerTypes.NsmNodeState_e NodeStateId
        }
        out {

            <**
                @description : The passed value will be based upon the enum NsmErrorStatus_e
            **>
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    }

    <**
        @description : The method has been introduced, because the property ‘BootMode’ can only be read by other applications. Nevertheless there are some exceptions where the property should be set by a restricted set of applications which will be handled within this method
    **>
    method SetBootMode {
        in {

            <**
            @description : The passed value will not be boundary checked to allow for product extensions. The actual value that a client should use will be defined in another common header that is currently not available


            **>
            Int32 BootMode
        }
        out {

            <**
                @description : Returned error code for set.
            **>
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    }

    <**
        @description : will use this information to keep a count of the number of failed applications within the current lifecycle. Additionally it will unset any sessions that the failing application may have had active. It will also be possible for the product node state machine to make a decision on what to do with this information, i.e. even reset the node or reset the node if too many applications have failed
    **>
    method SetAppHealthStatus {
        in {

            <**
                @description : This parameter can be used to give the name of the application that has failed (this must be the applications systemd unit name)
            **>
            String AppName

            <**
                @description : The AppRunning will define whether the application is currently running or not
            **>
            Boolean AppRunning
        }
        out {
            NodeStateManagerTypes.NsmErrorStatus_e ErrorCode
        }
    }

    <**
        @description : This is required whilst in certain Node Application Modes (i.e. Transport, Factory) we do not want the LUC Applications started. Internally the Node State Manager will need to call a product interface to get the mapping back for the current NAM.
    **>
    method CheckLucRequired {
        out {

            <**
                @description : This will be a simple TRUE or FALSE to define whether the LUC is wanted in the current Lifecycle
            **>
            Boolean LucWanted
        }
    }

}