joulescope_driver 1.9.4 → 1.11.0
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/index.js +4 -1
- package/joulescope_driver.d.ts +42 -0
- package/package.json +2 -1
- package/prebuilds/darwin-arm64/joulescope_driver.node +0 -0
- package/prebuilds/linux-arm64/joulescope_driver.node +0 -0
- package/prebuilds/linux-x64/joulescope_driver.node +0 -0
- package/prebuilds/win32-x64/joulescope_driver.node +0 -0
package/index.js
CHANGED
|
@@ -14,8 +14,11 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const addon = require('node-gyp-build')(__dirname);
|
|
18
17
|
|
|
18
|
+
const path = require('path')
|
|
19
|
+
const nodeGypBuild = require('node-gyp-build')
|
|
20
|
+
|
|
21
|
+
const addon = nodeGypBuild(path.dirname(require.resolve('joulescope_driver/package.json')))
|
|
19
22
|
|
|
20
23
|
class JoulescopeDriver {
|
|
21
24
|
constructor() {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare module 'joulescope_driver' {
|
|
2
|
+
|
|
3
|
+
export interface Value {
|
|
4
|
+
data: number[]
|
|
5
|
+
decimate_factor: number
|
|
6
|
+
field_id: number
|
|
7
|
+
index: number
|
|
8
|
+
sample_id: number
|
|
9
|
+
sample_rate: number
|
|
10
|
+
time_map: {
|
|
11
|
+
offset_time: number
|
|
12
|
+
offset_counter: number
|
|
13
|
+
counter_rate: number
|
|
14
|
+
}
|
|
15
|
+
utc: number
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class JoulescopeDriver {
|
|
19
|
+
constructor()
|
|
20
|
+
|
|
21
|
+
publish(topic: string, value: any, timeout?: number): void
|
|
22
|
+
|
|
23
|
+
query(topic: string, timeout?: number): any
|
|
24
|
+
|
|
25
|
+
finalize(): void
|
|
26
|
+
|
|
27
|
+
device_paths(timeout?: number): string[]
|
|
28
|
+
|
|
29
|
+
open(topic: string, mode?: number): void
|
|
30
|
+
|
|
31
|
+
close(topic: string): void
|
|
32
|
+
|
|
33
|
+
subscribe(
|
|
34
|
+
topic: string,
|
|
35
|
+
flags: number,
|
|
36
|
+
fn: (topic: string, value: Value) => void,
|
|
37
|
+
timeout?: number
|
|
38
|
+
): () => void
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default JoulescopeDriver
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "joulescope_driver",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Interface with Joulescopes using node.js and Electron",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Joulescope",
|
|
7
7
|
"Jetperch"
|
|
8
8
|
],
|
|
9
9
|
"main": "./index.js",
|
|
10
|
+
"types": "./joulescope_driver.d.ts",
|
|
10
11
|
"scripts": {
|
|
11
12
|
"install": "node-gyp-build",
|
|
12
13
|
"test": "node --napi-modules ./test/test_binding.js",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|