Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the generic helper that takes care of Protected Devices #759

Conversation

keeramis
Copy link
Contributor

@keeramis keeramis commented Jul 31, 2024

Description

See - #753
See - #754

Simplify the generic wrapper that takes care of Protected Devices.

  1. Skips checking Device Protection for gen2 devices (both dfu and normal modes)
  2. 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.

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 - #753
See - #754

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA
  • Problem and solution clearly stated
  • Tests have been provided
  • Docs have been updated
  • CI is passing

@keeramis keeramis force-pushed the feature/sc-129067/automatic-service-mode-usbutil branch from 7fd3de3 to 1ebcd6c Compare July 31, 2024 22:19
@keeramis keeramis changed the title Improve the logic that checks for Device Protection when obtaining th… Simplify the generic helper that takes care of Protected Devices Jul 31, 2024
@keeramis keeramis marked this pull request as ready for review July 31, 2024 22:21
@keeramis keeramis merged commit c7f7833 into feature/automatic-service-mode Jul 31, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants