@robdobsn/raftjs 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +14 -0
- package/.gitattributes +11 -0
- package/.nvmrc +1 -0
- package/LICENSE +22 -0
- package/README.md +11 -0
- package/TODO.md +1 -0
- package/dist/RaftAttributeHandler.d.ts +12 -0
- package/dist/RaftAttributeHandler.js +241 -0
- package/dist/RaftAttributeHandler.js.map +1 -0
- package/dist/RaftChannel.d.ts +18 -0
- package/dist/RaftChannel.js +12 -0
- package/dist/RaftChannel.js.map +1 -0
- package/dist/RaftChannelWebBLE.d.ts +38 -0
- package/dist/RaftChannelWebBLE.js +274 -0
- package/dist/RaftChannelWebBLE.js.map +1 -0
- package/dist/RaftChannelWebSerial.d.ts +37 -0
- package/dist/RaftChannelWebSerial.js +319 -0
- package/dist/RaftChannelWebSerial.js.map +1 -0
- package/dist/RaftChannelWebSocket.d.ts +28 -0
- package/dist/RaftChannelWebSocket.js +197 -0
- package/dist/RaftChannelWebSocket.js.map +1 -0
- package/dist/RaftCommsStats.d.ts +39 -0
- package/dist/RaftCommsStats.js +128 -0
- package/dist/RaftCommsStats.js.map +1 -0
- package/dist/RaftConnEvents.d.ts +31 -0
- package/dist/RaftConnEvents.js +44 -0
- package/dist/RaftConnEvents.js.map +1 -0
- package/dist/RaftConnector.d.ts +242 -0
- package/dist/RaftConnector.js +613 -0
- package/dist/RaftConnector.js.map +1 -0
- package/dist/RaftCustomAttrHandler.d.ts +4 -0
- package/dist/RaftCustomAttrHandler.js +50 -0
- package/dist/RaftCustomAttrHandler.js.map +1 -0
- package/dist/RaftDeviceInfo.d.ts +64 -0
- package/dist/RaftDeviceInfo.js +36 -0
- package/dist/RaftDeviceInfo.js.map +1 -0
- package/dist/RaftDeviceManager.d.ts +37 -0
- package/dist/RaftDeviceManager.js +450 -0
- package/dist/RaftDeviceManager.js.map +1 -0
- package/dist/RaftDeviceMsg.d.ts +9 -0
- package/dist/RaftDeviceMsg.js +11 -0
- package/dist/RaftDeviceMsg.js.map +1 -0
- package/dist/RaftDeviceStates.d.ts +33 -0
- package/dist/RaftDeviceStates.js +60 -0
- package/dist/RaftDeviceStates.js.map +1 -0
- package/dist/RaftFileHandler.d.ts +52 -0
- package/dist/RaftFileHandler.js +502 -0
- package/dist/RaftFileHandler.js.map +1 -0
- package/dist/RaftLog.d.ts +22 -0
- package/dist/RaftLog.js +63 -0
- package/dist/RaftLog.js.map +1 -0
- package/dist/RaftMiniHDLC.d.ts +18 -0
- package/dist/RaftMiniHDLC.js +383 -0
- package/dist/RaftMiniHDLC.js.map +1 -0
- package/dist/RaftMsgHandler.d.ts +57 -0
- package/dist/RaftMsgHandler.js +480 -0
- package/dist/RaftMsgHandler.js.map +1 -0
- package/dist/RaftMsgTrackInfo.d.ts +17 -0
- package/dist/RaftMsgTrackInfo.js +42 -0
- package/dist/RaftMsgTrackInfo.js.map +1 -0
- package/dist/RaftProtocolDefs.d.ts +30 -0
- package/dist/RaftProtocolDefs.js +48 -0
- package/dist/RaftProtocolDefs.js.map +1 -0
- package/dist/RaftStreamHandler.d.ts +38 -0
- package/dist/RaftStreamHandler.js +257 -0
- package/dist/RaftStreamHandler.js.map +1 -0
- package/dist/RaftSystemType.d.ts +21 -0
- package/dist/RaftSystemType.js +3 -0
- package/dist/RaftSystemType.js.map +1 -0
- package/dist/RaftSystemUtils.d.ts +136 -0
- package/dist/RaftSystemUtils.js +410 -0
- package/dist/RaftSystemUtils.js.map +1 -0
- package/dist/RaftTypes.d.ts +184 -0
- package/dist/RaftTypes.js +157 -0
- package/dist/RaftTypes.js.map +1 -0
- package/dist/RaftUpdateEvents.d.ts +33 -0
- package/dist/RaftUpdateEvents.js +46 -0
- package/dist/RaftUpdateEvents.js.map +1 -0
- package/dist/RaftUpdateManager.d.ts +61 -0
- package/dist/RaftUpdateManager.js +618 -0
- package/dist/RaftUpdateManager.js.map +1 -0
- package/dist/RaftUtils.d.ts +125 -0
- package/dist/RaftUtils.js +454 -0
- package/dist/RaftUtils.js.map +1 -0
- package/dist/RaftWifiTypes.d.ts +23 -0
- package/dist/RaftWifiTypes.js +43 -0
- package/dist/RaftWifiTypes.js.map +1 -0
- package/dist/TestDataGen.d.ts +7 -0
- package/dist/TestDataGen.js +133 -0
- package/dist/TestDataGen.js.map +1 -0
- package/dist/main.d.ts +18 -0
- package/dist/main.js +42 -0
- package/dist/main.js.map +1 -0
- package/eslint.config.mjs +33 -0
- package/examples/dashboard/package.json +39 -0
- package/examples/dashboard/src/ConnManager.ts +86 -0
- package/examples/dashboard/src/Main.tsx +100 -0
- package/examples/dashboard/src/StatusScreen.tsx +72 -0
- package/examples/dashboard/src/SystemTypeCog/CogStateInfo.ts +144 -0
- package/examples/dashboard/src/SystemTypeCog/SystemTypeCog.ts +77 -0
- package/examples/dashboard/src/SystemTypeMarty/RICAddOn.ts +70 -0
- package/examples/dashboard/src/SystemTypeMarty/RICAddOnBase.ts +33 -0
- package/examples/dashboard/src/SystemTypeMarty/RICAddOnManager.ts +342 -0
- package/examples/dashboard/src/SystemTypeMarty/RICCommsStats.ts +170 -0
- package/examples/dashboard/src/SystemTypeMarty/RICHWElem.ts +123 -0
- package/examples/dashboard/src/SystemTypeMarty/RICLEDPatternChecker.ts +207 -0
- package/examples/dashboard/src/SystemTypeMarty/RICROSSerial.ts +464 -0
- package/examples/dashboard/src/SystemTypeMarty/RICServoFaultDetector.ts +146 -0
- package/examples/dashboard/src/SystemTypeMarty/RICStateInfo.ts +32 -0
- package/examples/dashboard/src/SystemTypeMarty/RICSystemUtils.ts +371 -0
- package/examples/dashboard/src/SystemTypeMarty/RICTypes.ts +20 -0
- package/examples/dashboard/src/SystemTypeMarty/SystemTypeMarty.ts +113 -0
- package/examples/dashboard/src/index.html +15 -0
- package/examples/dashboard/src/index.tsx +15 -0
- package/examples/dashboard/src/styles.css +122 -0
- package/examples/dashboard/tsconfig.json +18 -0
- package/jest.config.js +11 -0
- package/package.json +50 -0
- package/src/RaftAttributeHandler.ts +289 -0
- package/src/RaftChannel.ts +30 -0
- package/src/RaftChannelWebBLE.ts +342 -0
- package/src/RaftChannelWebSerial.ts +408 -0
- package/src/RaftChannelWebSocket.ts +245 -0
- package/src/RaftCommsStats.ts +142 -0
- package/src/RaftConnEvents.ts +46 -0
- package/src/RaftConnector.ts +745 -0
- package/src/RaftCustomAttrHandler.ts +54 -0
- package/src/RaftDeviceInfo.ts +104 -0
- package/src/RaftDeviceManager.ts +542 -0
- package/src/RaftDeviceMsg.ts +20 -0
- package/src/RaftDeviceStates.ts +89 -0
- package/src/RaftFileHandler.ts +668 -0
- package/src/RaftLog.ts +70 -0
- package/src/RaftMiniHDLC.ts +396 -0
- package/src/RaftMsgHandler.ts +778 -0
- package/src/RaftMsgTrackInfo.ts +51 -0
- package/src/RaftProtocolDefs.ts +46 -0
- package/src/RaftStreamHandler.ts +328 -0
- package/src/RaftSystemType.ts +25 -0
- package/src/RaftSystemUtils.ts +487 -0
- package/src/RaftTypes.ts +250 -0
- package/src/RaftUpdateEvents.ts +48 -0
- package/src/RaftUpdateManager.ts +778 -0
- package/src/RaftUtils.ts +484 -0
- package/src/RaftWifiTypes.ts +36 -0
- package/src/TestDataGen.ts +157 -0
- package/src/main.ts +28 -0
- package/testdata/TestDeviceTypeRecs.json +492 -0
- package/tsconfig.json +27 -0
package/src/main.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
//
|
|
3
|
+
// RaftJS
|
|
4
|
+
// Commms library for the Raft ESP32 application framework supporting BLE, WebSockets and Serial
|
|
5
|
+
//
|
|
6
|
+
// Rob Dobson & Chris Greening 2020-2024
|
|
7
|
+
// (C) 2020-2024 All rights reserved
|
|
8
|
+
//
|
|
9
|
+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
10
|
+
|
|
11
|
+
export { default as RaftCommsStats } from './RaftCommsStats';
|
|
12
|
+
export { default as RaftConnector } from './RaftConnector';
|
|
13
|
+
export { default as RaftChannel } from './RaftChannel';
|
|
14
|
+
export { default as RaftChannelWebBLE } from './RaftChannelWebBLE';
|
|
15
|
+
export { default as RaftChannelWebSocket } from './RaftChannelWebSocket';
|
|
16
|
+
export { default as RaftFileHandler } from './RaftFileHandler';
|
|
17
|
+
export { default as RaftLog } from './RaftLog';
|
|
18
|
+
export { default as RaftMiniHDLC } from './RaftMiniHDLC';
|
|
19
|
+
export { default as RaftMsgHandler } from './RaftMsgHandler'
|
|
20
|
+
export { default as RaftStreamHandler } from './RaftStreamHandler';
|
|
21
|
+
export { default as RaftSystemUtils } from './RaftSystemUtils';
|
|
22
|
+
export { default as RaftUtils } from './RaftUtils';
|
|
23
|
+
export * from './RaftTypes';
|
|
24
|
+
export * from './RaftSystemType';
|
|
25
|
+
export * from './RaftWifiTypes';
|
|
26
|
+
export * from './RaftConnEvents';
|
|
27
|
+
export * from './RaftUpdateEvents';
|
|
28
|
+
export * from "./RaftProtocolDefs";
|
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
{
|
|
2
|
+
"devTypes": {
|
|
3
|
+
"VCNL4040": {
|
|
4
|
+
"addresses": "0x60",
|
|
5
|
+
"deviceType": "VCNL4040",
|
|
6
|
+
"detectionValues": "0x0c=0b100001100000XXXX",
|
|
7
|
+
"initValues": "0x041007=&0x030e08=&0x000000=",
|
|
8
|
+
"pollInfo": {
|
|
9
|
+
"c": "0x08=r2&0x09=r2&0x0a=r2",
|
|
10
|
+
"i": 200,
|
|
11
|
+
"s": 10
|
|
12
|
+
},
|
|
13
|
+
"scanPriority": "high",
|
|
14
|
+
"devInfoJson": {
|
|
15
|
+
"name": "VCNL4040",
|
|
16
|
+
"desc": "Prox&ALS",
|
|
17
|
+
"manu": "Vishay",
|
|
18
|
+
"type": "VCNL4040",
|
|
19
|
+
"resp": {
|
|
20
|
+
"b": 6,
|
|
21
|
+
"a": [
|
|
22
|
+
{
|
|
23
|
+
"n": "prox",
|
|
24
|
+
"t": "<H",
|
|
25
|
+
"u": "",
|
|
26
|
+
"r": [0,65535],
|
|
27
|
+
"d": 0,
|
|
28
|
+
"f": "5d",
|
|
29
|
+
"o": "uint16"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"n": "als",
|
|
33
|
+
"t": "<H",
|
|
34
|
+
"u": "lux",
|
|
35
|
+
"r": [0,65535],
|
|
36
|
+
"d": 10,
|
|
37
|
+
"f": "5.2f",
|
|
38
|
+
"o": "float"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"n": "white",
|
|
42
|
+
"t": "<H",
|
|
43
|
+
"u": "lux",
|
|
44
|
+
"r": [0,65535],
|
|
45
|
+
"d": 10,
|
|
46
|
+
"f": "5.2f",
|
|
47
|
+
"o": "float"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"VL6180": {
|
|
54
|
+
"_notes": "Interleaved mode ALS & Range (0x2a3=>0x01)\nRange settings defined in https://www.st.com/resource/en/application_note/an4545-vl6180x-basic-ranging-application-note-stmicroelectronics.pdf\nALS integration period 100ms (0x0040=>0x0063)\nALS gain 20 (0x003f=>0x40)\n",
|
|
55
|
+
"addresses": "0x29",
|
|
56
|
+
"deviceType": "VL6180",
|
|
57
|
+
"detectionValues": "0x0000=0b10110100",
|
|
58
|
+
"initValues": "0x020701&0x020801&0x009600&0x0097fd&0x00e301&0x00e403&0x00e502&0x00e601&0x00e703&0x00f502&0x00d905&0x00dbce&0x00dc03&0x00ddf8&0x009f00&0x00a33c&0x00b700&0x00bb3c&0x00b209&0x00ca09&0x019801&0x01b017&0x01ad00&0x00ff05&0x010005&0x019905&0x01a61b&0x01ac3e&0x01a71f&0x003000&0x001110&0x010a30&0x003f42&0x0031ff&0x004000&0x004163&0x002e01&0x001b09&0x003e31&0x001424&0x003801",
|
|
59
|
+
"pollInfo": {
|
|
60
|
+
"c": "0x004f=r1&0x0062=r1&0x001507&0x001801",
|
|
61
|
+
"i": 200,
|
|
62
|
+
"s": 10
|
|
63
|
+
},
|
|
64
|
+
"scanPriority": "high",
|
|
65
|
+
"devInfoJson": {
|
|
66
|
+
"name": "VL6180",
|
|
67
|
+
"desc": "ToF",
|
|
68
|
+
"manu": "ST",
|
|
69
|
+
"type": "VL6180",
|
|
70
|
+
"resp": {
|
|
71
|
+
"b": 2,
|
|
72
|
+
"a": [
|
|
73
|
+
{
|
|
74
|
+
"n": "valid",
|
|
75
|
+
"t": "B",
|
|
76
|
+
"u": "",
|
|
77
|
+
"r": [0,1],
|
|
78
|
+
"m": "0x04",
|
|
79
|
+
"s": 2,
|
|
80
|
+
"f": "b",
|
|
81
|
+
"o": "bool",
|
|
82
|
+
"vs": false
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"n": "dist",
|
|
86
|
+
"t": "B",
|
|
87
|
+
"u": "mm",
|
|
88
|
+
"r": [0,255],
|
|
89
|
+
"f": "3d",
|
|
90
|
+
"o": "float",
|
|
91
|
+
"vft": "valid"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"MAX30101": {
|
|
98
|
+
"_notes": "init: 0x0940 (reset), 0x00=r1 (clear INT), 0x0903 (SpO2mode Red+IR), 0x085f (4 sample avg, FIFO rollover, FIFO Int 17), 0x0A27 (100 samples/s, 18bit), 0x0c40&0x0d40 (LEDs 12.6mA), 0x1121 (Slot interleaved)",
|
|
99
|
+
"addresses": "0x57",
|
|
100
|
+
"deviceType": "MAX30101",
|
|
101
|
+
"detectionValues": "0xff=0x15",
|
|
102
|
+
"initValues": "0x0940&0x00=r1&0x085f&0x0903&0x0a27&0x0c4040&0x11=0x21",
|
|
103
|
+
"pollInfo": {
|
|
104
|
+
"c": "0x04=r51",
|
|
105
|
+
"i": 200,
|
|
106
|
+
"s": 5
|
|
107
|
+
},
|
|
108
|
+
"scanPriority": "high",
|
|
109
|
+
"devInfoJson": {
|
|
110
|
+
"name": "MAX30101",
|
|
111
|
+
"desc": "Prox&ALS",
|
|
112
|
+
"manu": "Vishay",
|
|
113
|
+
"type": "MAX30101",
|
|
114
|
+
"resp": {
|
|
115
|
+
"b": 51,
|
|
116
|
+
"a": [
|
|
117
|
+
{
|
|
118
|
+
"n": "Red",
|
|
119
|
+
"t": ">I",
|
|
120
|
+
"u": "",
|
|
121
|
+
"r": [0, 16777215],
|
|
122
|
+
"f": "6d",
|
|
123
|
+
"o": "uint32"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"n": "IR",
|
|
127
|
+
"t": ">I",
|
|
128
|
+
"u": "",
|
|
129
|
+
"r": [0, 16777215],
|
|
130
|
+
"f": "6d",
|
|
131
|
+
"o": "uint32"
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"c": {
|
|
135
|
+
"n": "max30101_fifo",
|
|
136
|
+
"c": "int N=(buf[0]+32-buf[2])%32;int k=3;int i=0;while(i<N){out.Red=(buf[k]<<16)|(buf[k+1]<<8)|buf[k+2];out.IR=(buf[k+3]<<16)|(buf[k+4]<<8)|buf[k+5];k+=6;i++;next;}"
|
|
137
|
+
},
|
|
138
|
+
"us": 40000
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"ADXL313": {
|
|
143
|
+
"addresses": "0x1d,0x53",
|
|
144
|
+
"deviceType": "ADXL313",
|
|
145
|
+
"detectionValues": "0x00=0b1010110100011101",
|
|
146
|
+
"initValues": "0x2d0c=;0x310a=",
|
|
147
|
+
"pollInfo": {
|
|
148
|
+
"c": "0x32=r6",
|
|
149
|
+
"i": 100,
|
|
150
|
+
"s": 10
|
|
151
|
+
},
|
|
152
|
+
"scanPriority": "high",
|
|
153
|
+
"devInfoJson": {
|
|
154
|
+
"name": "ADXL313",
|
|
155
|
+
"desc": "3-Axis Accel",
|
|
156
|
+
"manu": "Analog Devices",
|
|
157
|
+
"type": "ADXL313",
|
|
158
|
+
"resp": {
|
|
159
|
+
"b": 6,
|
|
160
|
+
"a": [
|
|
161
|
+
{
|
|
162
|
+
"n": "x",
|
|
163
|
+
"t": "<h",
|
|
164
|
+
"u": "g",
|
|
165
|
+
"r": [-4.0, 4.0],
|
|
166
|
+
"d": 1024,
|
|
167
|
+
"f": ".2f",
|
|
168
|
+
"o": "float"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"n": "y",
|
|
172
|
+
"t": "<h",
|
|
173
|
+
"u": "g",
|
|
174
|
+
"r": [-4.0,4.0],
|
|
175
|
+
"d": 1024,
|
|
176
|
+
"f": ".2f",
|
|
177
|
+
"o": "float"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"n": "z",
|
|
181
|
+
"t": "<h",
|
|
182
|
+
"u": "g",
|
|
183
|
+
"r": [-4.0,4.0],
|
|
184
|
+
"d": 1024,
|
|
185
|
+
"f": ".2f",
|
|
186
|
+
"o": "float"
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"AHT20": {
|
|
193
|
+
"addresses": "0x38",
|
|
194
|
+
"deviceType": "AHT20",
|
|
195
|
+
"detectionValues": "",
|
|
196
|
+
"initValues": "0xbe0800=",
|
|
197
|
+
"pollInfo": {
|
|
198
|
+
"c": "=r6&0xac3300=",
|
|
199
|
+
"i": 5000,
|
|
200
|
+
"s": 2
|
|
201
|
+
},
|
|
202
|
+
"scanPriority": "high",
|
|
203
|
+
"devInfoJson": {
|
|
204
|
+
"name": "AHT20",
|
|
205
|
+
"desc": "Temp&Humid",
|
|
206
|
+
"manu": "Asair",
|
|
207
|
+
"type": "AHT20",
|
|
208
|
+
"resp": {
|
|
209
|
+
"b": 6,
|
|
210
|
+
"a": [
|
|
211
|
+
{
|
|
212
|
+
"n": "status",
|
|
213
|
+
"t": "B",
|
|
214
|
+
"u": "",
|
|
215
|
+
"f": "02x",
|
|
216
|
+
"o": "uint8",
|
|
217
|
+
"vs": false
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"n": "humidity",
|
|
221
|
+
"t": ">I",
|
|
222
|
+
"u": "%",
|
|
223
|
+
"r": [0, 100],
|
|
224
|
+
"m": "0xfffff000",
|
|
225
|
+
"s": 12,
|
|
226
|
+
"d": 10485.76,
|
|
227
|
+
"f": "3.1f",
|
|
228
|
+
"o": "float"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"n": "temperature",
|
|
232
|
+
"at": 2,
|
|
233
|
+
"t": ">I",
|
|
234
|
+
"u": "°C",
|
|
235
|
+
"r": [-40,80],
|
|
236
|
+
"m": "0x000fffff",
|
|
237
|
+
"d": 5242.88,
|
|
238
|
+
"a": -50,
|
|
239
|
+
"f": "3.2f",
|
|
240
|
+
"o": "float"
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"MCP9808": {
|
|
247
|
+
"addresses": "0x18-0x1f",
|
|
248
|
+
"deviceType": "MCP9808",
|
|
249
|
+
"detectionValues": "0x06=0b0000000001010100&0x07=0b00000100XXXXXXXX",
|
|
250
|
+
"initValues": "0x010000",
|
|
251
|
+
"pollInfo": {
|
|
252
|
+
"c": "0x05=r2",
|
|
253
|
+
"i": 5000,
|
|
254
|
+
"s": 2
|
|
255
|
+
},
|
|
256
|
+
"scanPriority": "high",
|
|
257
|
+
"devInfoJson": {
|
|
258
|
+
"name": "MCP9808",
|
|
259
|
+
"desc": "Temp",
|
|
260
|
+
"manu": "Microchip",
|
|
261
|
+
"type": "MCP9808",
|
|
262
|
+
"resp": {
|
|
263
|
+
"b": 2,
|
|
264
|
+
"a": [
|
|
265
|
+
{
|
|
266
|
+
"n": "temperature",
|
|
267
|
+
"t": ">H",
|
|
268
|
+
"u": "°C",
|
|
269
|
+
"r": [-40,125],
|
|
270
|
+
"m": "0x1fff",
|
|
271
|
+
"d": 16,
|
|
272
|
+
"sb": 12,
|
|
273
|
+
"ss": 4096,
|
|
274
|
+
"f": "3.2f",
|
|
275
|
+
"o": "float"
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"LPS25": {
|
|
282
|
+
"addresses": "0x5D",
|
|
283
|
+
"deviceType": "LPS25",
|
|
284
|
+
"detectionValues": "0x0f=0b10111101",
|
|
285
|
+
"initValues": "0x2104=&0x20C0=",
|
|
286
|
+
"pollInfo": {
|
|
287
|
+
"c": "0xA7=r6",
|
|
288
|
+
"i": 1000,
|
|
289
|
+
"s": 2
|
|
290
|
+
},
|
|
291
|
+
"scanPriority": "high",
|
|
292
|
+
"devInfoJson": {
|
|
293
|
+
"name": "LPS25",
|
|
294
|
+
"desc": "Pressure",
|
|
295
|
+
"manu": "ST",
|
|
296
|
+
"type": "LPS25",
|
|
297
|
+
"resp": {
|
|
298
|
+
"b": 6,
|
|
299
|
+
"a": [
|
|
300
|
+
{
|
|
301
|
+
"n": "status",
|
|
302
|
+
"t": "B",
|
|
303
|
+
"r": [0,255],
|
|
304
|
+
"m": "0xff",
|
|
305
|
+
"f": "02x",
|
|
306
|
+
"o": "uint8",
|
|
307
|
+
"vs": false
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"n": "pressure",
|
|
311
|
+
"at": 0,
|
|
312
|
+
"t": "<I",
|
|
313
|
+
"u": "hPa",
|
|
314
|
+
"r": [260,1260],
|
|
315
|
+
"s": 8,
|
|
316
|
+
"d": 4096,
|
|
317
|
+
"f": "4.2f",
|
|
318
|
+
"o": "float"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"n": "temperature",
|
|
322
|
+
"at": 4,
|
|
323
|
+
"t": "<h",
|
|
324
|
+
"u": "°C",
|
|
325
|
+
"r": [-30,105],
|
|
326
|
+
"d": 480,
|
|
327
|
+
"a": 42.5,
|
|
328
|
+
"f": "3.2f",
|
|
329
|
+
"o": "float"
|
|
330
|
+
}
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"CAP1203": {
|
|
336
|
+
"addresses": "0x28",
|
|
337
|
+
"deviceType": "CAP1203",
|
|
338
|
+
"detectionValues": "0xfd=0b01101101",
|
|
339
|
+
"initValues": "0x0000&0x1f06",
|
|
340
|
+
"pollInfo": {
|
|
341
|
+
"c": "0x02=r2&0x0000",
|
|
342
|
+
"i": 100,
|
|
343
|
+
"s": 10
|
|
344
|
+
},
|
|
345
|
+
"scanPriority": "high",
|
|
346
|
+
"devInfoJson": {
|
|
347
|
+
"name": "CAP1203",
|
|
348
|
+
"desc": "Capacitive Touch x 3",
|
|
349
|
+
"manu": "Sparkfun",
|
|
350
|
+
"type": "CAP1203",
|
|
351
|
+
"resp": {
|
|
352
|
+
"b": 2,
|
|
353
|
+
"a": [
|
|
354
|
+
{
|
|
355
|
+
"n": "A",
|
|
356
|
+
"at": 1,
|
|
357
|
+
"t": "B",
|
|
358
|
+
"r": [0, 1],
|
|
359
|
+
"m": "0x01",
|
|
360
|
+
"s": 0,
|
|
361
|
+
"f": "b",
|
|
362
|
+
"o": "bool"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"n": "B",
|
|
366
|
+
"at": 1,
|
|
367
|
+
"t": "B",
|
|
368
|
+
"r": [0, 1],
|
|
369
|
+
"m": "0x02",
|
|
370
|
+
"s": 1,
|
|
371
|
+
"f": "b",
|
|
372
|
+
"o": "bool"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"n": "C",
|
|
376
|
+
"at": 1,
|
|
377
|
+
"t": "B",
|
|
378
|
+
"r": [0, 1],
|
|
379
|
+
"m": "0x04",
|
|
380
|
+
"s": 2,
|
|
381
|
+
"f": "b",
|
|
382
|
+
"o": "bool"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"n": "status",
|
|
386
|
+
"t": ">H",
|
|
387
|
+
"vs": false,
|
|
388
|
+
"f": "04x",
|
|
389
|
+
"o": "uint16"
|
|
390
|
+
}
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
"QwiicButton": {
|
|
396
|
+
"addresses": "0x6f",
|
|
397
|
+
"deviceType": "QwiicButton",
|
|
398
|
+
"detectionValues": "0x00=0b01011101",
|
|
399
|
+
"initValues": "",
|
|
400
|
+
"pollInfo": {
|
|
401
|
+
"c": "0x03=r1",
|
|
402
|
+
"i": 100,
|
|
403
|
+
"s": 10
|
|
404
|
+
},
|
|
405
|
+
"scanPriority": "high",
|
|
406
|
+
"devInfoJson": {
|
|
407
|
+
"name": "Qwiic Button",
|
|
408
|
+
"desc": "Button",
|
|
409
|
+
"manu": "Sparkfun",
|
|
410
|
+
"type": "QwiicButton",
|
|
411
|
+
"resp": {
|
|
412
|
+
"b": 1,
|
|
413
|
+
"a": [
|
|
414
|
+
{
|
|
415
|
+
"n": "press",
|
|
416
|
+
"t": "B",
|
|
417
|
+
"u": "",
|
|
418
|
+
"r": [0, 1],
|
|
419
|
+
"m": "0x04",
|
|
420
|
+
"s": 2,
|
|
421
|
+
"f": "b",
|
|
422
|
+
"o": "bool"
|
|
423
|
+
}
|
|
424
|
+
]
|
|
425
|
+
},
|
|
426
|
+
"actions": [
|
|
427
|
+
{
|
|
428
|
+
"n": "brightness",
|
|
429
|
+
"t": "B",
|
|
430
|
+
"w": "19",
|
|
431
|
+
"r": [0,255]
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"n": "granularity",
|
|
435
|
+
"t": "B",
|
|
436
|
+
"w": "1a",
|
|
437
|
+
"r": [1,255]
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"n": "cycle time",
|
|
441
|
+
"t": "<H",
|
|
442
|
+
"w": "1b",
|
|
443
|
+
"r": [0,65535]
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"n": "off time",
|
|
447
|
+
"t": "<H",
|
|
448
|
+
"w": "1d",
|
|
449
|
+
"r": [0,65535]
|
|
450
|
+
}
|
|
451
|
+
]
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
"QwiicLEDStick": {
|
|
455
|
+
"addresses": "0x23",
|
|
456
|
+
"deviceType": "QwiicLEDStick",
|
|
457
|
+
"detectionValues": "",
|
|
458
|
+
"initValues": "",
|
|
459
|
+
"pollInfo": {},
|
|
460
|
+
"scanPriority": "high",
|
|
461
|
+
"devInfoJson": {
|
|
462
|
+
"name": "Qwiic LED Stick",
|
|
463
|
+
"desc": "LEDs",
|
|
464
|
+
"manu": "Sparkfun",
|
|
465
|
+
"type": "QwiicLEDStick",
|
|
466
|
+
"actions": [
|
|
467
|
+
{
|
|
468
|
+
"n": "pixels",
|
|
469
|
+
"t": "BBBB",
|
|
470
|
+
"w": "71",
|
|
471
|
+
"f": "LEDPIX",
|
|
472
|
+
"NX": 10,
|
|
473
|
+
"NY": 1,
|
|
474
|
+
"concat": false,
|
|
475
|
+
"r": [0,255]
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"n": "brightness",
|
|
479
|
+
"t": "B",
|
|
480
|
+
"w": "76",
|
|
481
|
+
"r": [0,255],
|
|
482
|
+
"d": 50
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"n": "off",
|
|
486
|
+
"w": "78"
|
|
487
|
+
}
|
|
488
|
+
]
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2017",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": ["dom", "es2017"],
|
|
6
|
+
"outDir": "./dist/",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"moduleResolution": "node",
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
|
|
16
|
+
"strictNullChecks": true /* Enable strict null checks. */,
|
|
17
|
+
"strictFunctionTypes": true /* Enable strict checking of function types. */,
|
|
18
|
+
"noUnusedLocals": true /* Report errors on unused locals. */,
|
|
19
|
+
"noUnusedParameters": true /* Report errors on unused parameters. */,
|
|
20
|
+
"noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
|
|
21
|
+
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */,
|
|
22
|
+
"importHelpers": true,
|
|
23
|
+
"resolveJsonModule": true,
|
|
24
|
+
},
|
|
25
|
+
"include": ["src","__tests__"],
|
|
26
|
+
"exclude": ["node_modules","dist","**/*.test.ts"]
|
|
27
|
+
}
|