joulescope_driver 2.4.2 → 2.5.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/README.md +2 -1
- package/binding.gyp +17 -0
- package/example/samples.js +7 -3
- package/example/statistics.js +8 -4
- package/index.js +3 -2
- package/joulescope_driver.d.ts +17 -0
- package/package.json +1 -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-arm64/joulescope_driver.node +0 -0
- package/prebuilds/win32-x64/joulescope_driver.node +0 -0
- package/src/addon.cc +2 -1
- package/src/joulescope_driver.cc +2 -1
- package/src/joulescope_driver.h +2 -1
- package/test/test_binding.js +3 -1
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
# Copyright 2023-2024 Jetperch LLC
|
|
2
|
+
# SPDX-FileCopyrightText: Copyright 2023-2024 Jetperch LLC
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
#
|
|
4
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
6
|
# you may not use this file except in compliance with the License.
|
package/binding.gyp
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright 2023-2026 Jetperch LLC
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
1
16
|
{
|
|
2
17
|
'targets': [
|
|
3
18
|
{
|
|
@@ -6,6 +21,7 @@
|
|
|
6
21
|
'src/addon.cc',
|
|
7
22
|
'src/joulescope_driver.cc',
|
|
8
23
|
'../src/buffer.c',
|
|
24
|
+
'../src/buffer_params.c',
|
|
9
25
|
'../src/buffer_signal.c',
|
|
10
26
|
'../src/calibration_hash.c',
|
|
11
27
|
'../src/check32.c',
|
|
@@ -25,6 +41,7 @@
|
|
|
25
41
|
'../src/devices/js320/firmware.c',
|
|
26
42
|
'../src/devices/js320/js320_cal.c',
|
|
27
43
|
'../src/devices/js320/js320_drv.c',
|
|
44
|
+
'../src/devices/js320/js320_params.c',
|
|
28
45
|
'../src/devices/js320/js320_fwup.c',
|
|
29
46
|
'../src/devices/js320/js320_fwup_mgr.c',
|
|
30
47
|
'../src/devices/js320/js320_jtag.c',
|
package/example/samples.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2024 Jetperch LLC
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright 2024 Jetperch LLC
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
*
|
|
4
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -19,7 +20,8 @@ const JoulescopeDriver = require("..");
|
|
|
19
20
|
|
|
20
21
|
function initialize(){
|
|
21
22
|
const drv = new JoulescopeDriver();
|
|
22
|
-
|
|
23
|
+
// Skip other devices, such as a MiniBitty at u/mb/{serial_number}.
|
|
24
|
+
const device_paths = drv.device_paths().filter((p) => /^[^/]+\/js\d+\//.test(p));
|
|
23
25
|
console.log('device_paths: ' + device_paths);
|
|
24
26
|
if (0 == device_paths.length) {
|
|
25
27
|
drv.finalize()
|
|
@@ -63,4 +65,6 @@ function initialize(){
|
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
finalize_cbk = initialize();
|
|
66
|
-
|
|
68
|
+
if (finalize_cbk) {
|
|
69
|
+
process.on('SIGINT', finalize_cbk);
|
|
70
|
+
}
|
package/example/statistics.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2024 Jetperch LLC
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright 2024 Jetperch LLC
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
*
|
|
4
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -14,11 +15,12 @@
|
|
|
14
15
|
* limitations under the License.
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
|
-
const JoulescopeDriver = require("
|
|
18
|
+
const JoulescopeDriver = require("..");
|
|
18
19
|
|
|
19
20
|
function initialize(){
|
|
20
21
|
const drv = new JoulescopeDriver();
|
|
21
|
-
|
|
22
|
+
// Skip other devices, such as a MiniBitty at u/mb/{serial_number}.
|
|
23
|
+
const device_paths = drv.device_paths().filter((p) => /^[^/]+\/js\d+\//.test(p));
|
|
22
24
|
console.log('device_paths: ' + device_paths);
|
|
23
25
|
if (0 == device_paths.length) {
|
|
24
26
|
drv.finalize()
|
|
@@ -60,4 +62,6 @@ function initialize(){
|
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
finalize_cbk = initialize();
|
|
63
|
-
|
|
65
|
+
if (finalize_cbk) {
|
|
66
|
+
process.on('SIGINT', finalize_cbk);
|
|
67
|
+
}
|
package/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2024 Jetperch LLC
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright 2024 Jetperch LLC
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
*
|
|
4
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -61,7 +62,7 @@ class JoulescopeDriver {
|
|
|
61
62
|
|
|
62
63
|
device_paths(timeout=-1) {
|
|
63
64
|
var p = this.query("@/list");
|
|
64
|
-
return p.split(',').sort()
|
|
65
|
+
return p ? p.split(',').sort() : [];
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
/**
|
package/joulescope_driver.d.ts
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright 2025 Jetperch LLC
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
1
18
|
declare module 'joulescope_driver' {
|
|
2
19
|
|
|
3
20
|
export interface Value {
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/addon.cc
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2024 Jetperch LLC
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright 2024 Jetperch LLC
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
*
|
|
4
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
6
|
* you may not use this file except in compliance with the License.
|
package/src/joulescope_driver.cc
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2024 Jetperch LLC
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright 2024 Jetperch LLC
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
*
|
|
4
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
6
|
* you may not use this file except in compliance with the License.
|
package/src/joulescope_driver.h
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2024 Jetperch LLC
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright 2024 Jetperch LLC
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
*
|
|
4
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
6
|
* you may not use this file except in compliance with the License.
|
package/test/test_binding.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2024-2026 Jetperch LLC
|
|
2
|
+
* SPDX-FileCopyrightText: Copyright 2024-2026 Jetperch LLC
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
*
|
|
4
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -25,6 +26,7 @@ async function testBasic(){
|
|
|
25
26
|
var device_paths = drv.device_paths();
|
|
26
27
|
console.log('device_paths: ' + device_paths);
|
|
27
28
|
assert.ok(Array.isArray(device_paths), 'device_paths must be an array');
|
|
29
|
+
device_paths.forEach((p) => assert.ok(p.length > 0, 'device_paths must not contain empty paths'));
|
|
28
30
|
drv.finalize();
|
|
29
31
|
console.log('testBasic passed');
|
|
30
32
|
}
|