You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs_src/design/adr/device-service/0020-invoking-functions.md
+22-14
Original file line number
Diff line number
Diff line change
@@ -24,51 +24,59 @@ this is unintuitive.
24
24
25
25
## Decision
26
26
27
-
1.Add a new section to device profiles describing functions
27
+
**Add a new section to device profiles describing functions**
28
28
29
+
```
29
30
{
30
31
"deviceFunctions":
31
32
[
32
33
{
33
34
"name": "Name by which the function is accessed",
34
35
"description": "Readable description of the function",
35
-
"attributes": { device-specific parameters which select this function },
36
+
"attributes": { device-service-specific attributes which select this function },
36
37
"parameters":
37
38
{
38
39
"in":
39
40
[
40
41
{
41
42
"name": "Parameter name",
42
-
"description": "description of what the parameter controls",
43
-
"type": "Any of the usual EdgeX data types"
43
+
"description": "(optional) description of what the parameter controls",
44
+
"type": "Any of the usual EdgeX data types",
45
+
"defaultValue": "(optional) value to use if param is not supplied",
46
+
"maximum": "(optional) for numerics, maximum allowed value",
47
+
"minimum": "(optional) for numerics, minimum allowed value"
44
48
}
45
49
],
46
50
"out":
47
51
[
48
52
{
49
-
"name": "Parameter name",
50
-
"description": "description of what the parameter controls",
53
+
"name": "Name of returned value",
54
+
"description": "(optional) description of what the value indicates",
51
55
"type": "Any of the usual EdgeX data types"
52
56
}
53
57
]
54
58
}
55
59
}
56
60
]
57
61
}
62
+
```
58
63
59
-
2. Add a REST endpoint to the device service for performing functions
64
+
Note: the `attributes` structure is analagous to `attributes` in a `deviceResource`. Each device service should document and implement a scheme of required attributes that will allow for selection of the relevant funtion. The function's `name` is intended for UI and logging purposes and should not be used for actual function selection on the device.
0 commit comments