<a id="api-transition-v1"></a>

# Transition to v1

The launch of the JS220 in 2022 introduced a new API based upon
[publish-subscribe](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern).
You can find the source code at
[joulescope_driver](https://github.com/jetperch/joulescope_driver).  We
encourage all new code to use this API directly.

However, this project provides a backwards-compatible v0 convenience wrapper.
Access the wrapper through any of the scan functions:

* **scan**
* **scan_require_one**
* **scan_for_changes**

These scan functions return **Driver** wrapper instances compatible with the
v0 API.  The **Driver** wrapper removes the following methods found in the
v0 API:

* **Driver.usb_device**
* **Driver.bootloader**
* **Driver.run_from_bootloader**
* **Driver.calibration_program**
* **Driver.enter_test_mode**

The **Driver.serial_number** now returns **Driver.device_serial_number**.

Parameter support has also changed.
The following parameters have modified behavior:

| Parameter                      | JS320                           | JS220                          | JS110                |
|--------------------------------|---------------------------------|--------------------------------|----------------------|
| sensor_power                   | ignored                         | ignored                        | ignored              |
| source                         | ignored                         | ignored                        | ignored              |
| i_range                        | ✔                               | ✔                              | ✔                    |
| v_range                        | 15V,2V; 5V→15 V                 | 15V,2V; 5V→15 V                | ✔                    |
| ovr_to_lsb                     | ❌                               | ❌                              | ❌                    |
| io_voltage                     | ignored; use Vref               | ignored; use Vref              | ✔                    |
| gpo0                           | ✔                               | ✔                              | ✔                    |
| gpo1                           | ✔                               | ✔                              | ✔                    |
| current_lsb                    | enables gpi0                    | enables gpi0                   | ✔                    |
| voltage_lsb                    | enables gpi1                    | enables gpi1                   | ✔                    |
| current_ranging_type           | ignored                         | ignored                        | ✔                    |
| current_ranging_samples_pre    | ignored                         | ignored                        | ✔                    |
| current_ranging_samples_window | ignored                         | ignored                        | ✔                    |
| current_ranging_samples_post   | ignored                         | ignored                        | ✔                    |
| buffer_duration                | ✔                               | ✔                              | ✔                    |
| reduction_frequency            | ✔                               | ✔                              | ✔                    |
| sampling_frequency             | ≤1 MHz; no 500 kHz; 2 MHz→1 MHz | ≤1 MHz; 2 MHz→1 MHz            | ✔                    |
| signals                        | ✔ (1.6+) incl 2,3,T             | ✔ (1.6+) incl 2,3,T; ≤7 with r | ✔ (1.6+) i,v,p,r,0,1 |

New JS220 topics are available as parameters.  However, the parameter metadata
is retrieved dynamically and is not available until the device is opened.
