-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapiDocs.json
More file actions
91 lines (91 loc) · 4.04 KB
/
Copy pathapiDocs.json
File metadata and controls
91 lines (91 loc) · 4.04 KB
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
{
"paths": {
"/ChannelEKG/config": {
"get": {
"summary": "Get the currently monitored channels",
"description": "Returns the list of channels currently being monitored, up to 128 entries.",
"responses": {
"200": {
"description": "Array of monitored channels",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"channel": { "type": "integer" },
"label": { "type": "string" }
}
}
},
"example": [{ "channel": 123, "label": "Mega Tree - Pixel 5 R" }]
}
}
}
}
},
"post": {
"summary": "Set the monitored channels",
"description": "Replaces the list of monitored channels (max 128) and persists it to disk.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"channel": { "type": "integer" },
"label": { "type": "string" }
}
},
"maxItems": 128
}
}
}
},
"responses": {
"200": { "description": "The new list of monitored channels, as saved" },
"400": { "description": "Invalid body, too many channels, or a channel number out of range" }
}
}
},
"/ChannelEKG/data": {
"get": {
"summary": "Get live channel samples",
"description": "Returns the current value of each monitored channel plus any samples newer than 'since'. Pass since=0 (or omit it) for the full ~30 second history; pass the 'now' value from the previous response to fetch only new samples.",
"parameters": [
{
"name": "since",
"in": "query",
"required": false,
"description": "Millisecond timestamp; only samples strictly newer than this are returned",
"schema": { "type": "integer" }
}
],
"responses": {
"200": {
"description": "Current values and new samples per channel",
"content": {
"application/json": {
"example": {
"now": 1699999999999,
"channels": [
{
"channel": 123,
"label": "Mega Tree - Pixel 5 R",
"value": 200,
"samples": [[1699999999000, 180], [1699999999050, 200]]
}
]
}
}
}
}
}
}
}
}
}