Repository navigation
Expand file tree
/
Copy pathble-protocol.schema.json
More file actions
74 lines (74 loc) · 2.12 KB
/
Copy pathble-protocol.schema.json
File metadata and controls
74 lines (74 loc) · 2.12 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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "FloRo BLE Protocol Schema",
"description": "Nordic UART GATT service and ASCII command contract for FloRo neon signs",
"type": "object",
"properties": {
"service": {
"type": "object",
"required": ["uuid", "txCharacteristic", "rxCharacteristic"],
"properties": {
"uuid": {
"type": "string",
"const": "6e400001-b5a3-f393-e0a9-e50e24dcca9e"
},
"txCharacteristic": {
"type": "string",
"const": "6e400002-b5a3-f393-e0a9-e50e24dcca9e"
},
"rxCharacteristic": {
"type": "string",
"const": "6e400003-b5a3-f393-e0a9-e50e24dcca9e"
}
}
},
"commands": {
"type": "object",
"required": ["brightness", "speed", "color", "mode", "scene"],
"properties": {
"brightness": {
"type": "object",
"properties": {
"key": { "const": "B" },
"pattern": "^B=([0-8]);?\\n?$",
"minLevel": 0,
"maxLevel": 8
}
},
"speed": {
"type": "object",
"properties": {
"key": { "const": "S" },
"pattern": "^S=([0-9]{1,3});?\\n?$",
"uiRange": { "min": 0, "max": 100 },
"wireMapping": "100 - uiSpeed"
}
},
"color": {
"type": "object",
"properties": {
"key": { "const": "C" },
"pattern": "^C=(\\d{1,3}),(\\d{1,3}),(\\d{1,3});\\n$",
"channelOrder": "R,B,G (green/blue swapped for FloRo LED wiring)"
}
},
"mode": {
"type": "object",
"properties": {
"key": { "const": "M" },
"pattern": "^M(\\d{1,3})\\n$",
"minMode": 1,
"maxMode": 200
}
},
"scene": {
"type": "object",
"properties": {
"description": "Compound scene sequence: brightness, speed, color, mode",
"requiredFields": ["brightness", "speed", "r", "g", "b", "mode"]
}
}
}
}
}
}