Simplify the generic wrapper that takes care of Protected Devices.
Skips checking Device Protection for gen2 devices (both dfu and normal modes)
A Protected Device is put into Service Mode to run a CLI operation and after that CLI command execution finishes (either success/error), we expect the device to be ready to take a control request to turn off Service Mode. It's the responsibility of the module (usb, serial, flash, etc...) to exit the CLI command execution with a device that is able to take control requests in normal mode (or simply be ready in dfu mode)
How to Test
Unfortunately, this is a stand alone PR.
Since usb module already uses this helper, run any particle usb xxx commands to test this out on your Protected Device.
Your device should be Protected at the start of the test. Run any particle usb xxx command. The command should run fine. After the command finishes, check particle device-protection status and your device should now be a Protected Device.
Description
See - https://github.com/particle-iot/particle-cli/pull/753 See - https://github.com/particle-iot/particle-cli/pull/754
Simplify the generic wrapper that takes care of Protected Devices.
How to Test
Unfortunately, this is a stand alone PR. Since usb module already uses this helper, run any
particle usb xxx
commands to test this out on your Protected Device.Your device should be Protected at the start of the test. Run any
particle usb xxx
command. The command should run fine. After the command finishes, checkparticle device-protection status
and your device should now be a Protected Device.Related Issues / Discussions
A small part of https://app.shortcut.com/particle/story/129067/add-generic-helpers-for-a-device-to-put-into-service-mode-and-back-to-perform-a-cli-operation See - https://github.com/particle-iot/particle-cli/pull/753 See - https://github.com/particle-iot/particle-cli/pull/754
Completeness