The docs currently use a branch of particle-usb with a few custom modifications. The plan is to roll the changes back into the mainline, fixing the API, adding tests, etc.
The new changes
There are two changes:
In enterDfuMode, add a noReconnectWait option. This is desirable in a WebUSB environment because if the device was first use when already in DFU mode, when exiting DFU mode, the browser may request authorization to the non-DFU interface, since the browser must separately authorize each. This leads to an awkward user experience when the user doesn’t need to manipulate the device.
Added a new method openNativeUsbDevice, which works like openByDeviceID, except it takes a native WebUSB device object. This is useful when you want to customize the device selection for WebUSB, and other cases where you already have the native WebUSB object but want to wrap it in particle-usb.
Tests
I also added test cases for the new code. There are unit tests in device-base-test.js that are run automatically during the test:ci phase. There is also an e2e test in browser.e2e.js that is not automatically run because it requires interacting with WebUSB authorization in a browser.
The docs currently use a branch of particle-usb with a few custom modifications. The plan is to roll the changes back into the mainline, fixing the API, adding tests, etc.
The new changes
There are two changes:
Tests
I also added test cases for the new code. There are unit tests in device-base-test.js that are run automatically during the test:ci phase. There is also an e2e test in browser.e2e.js that is not automatically run because it requires interacting with WebUSB authorization in a browser.