-
Notifications
You must be signed in to change notification settings - Fork 92
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
Put a Protected Device automatically in Service Mode to run CLI commands #751
Put a Protected Device automatically in Service Mode to run CLI commands #751
Conversation
b1bf844
to
f029ce6
Compare
src/cmd/usb-util.js
Outdated
if (usbDevice && usbDevice.isOpen){ | ||
await usbDevice.close(); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (usbDevice.isInDfuMode && semver.lt(firmwareVersion, '6.1.3')) {
outputMsg.push(`Your device may be in Service Mode. Re-enable Device Protection by running ${chalk.yellow('particle device-protection enable')}`);
this will cause particle usb dfu
to have this error as well. I will fix this in usb module or here if you prefer
Can you change the base branch to a long running branch like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Ensure that the target branch is a long-running branch before merging.
src/cmd/usb-util.js
Outdated
* Waits for the device to reboot to reboot by checking if the device is ready to accept control requests. | ||
* It waits for a maximum of 60 seconds with a 1-second interval. | ||
*/ | ||
async function waitForDeviceToReboot(deviceId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this function used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was useful when I was working with dfu devices and flashing modules. This is again, used for an edge case on 6.1.1. I will remove this for now and insert it later if needed.
25af477
to
159325a
Compare
This PR adds a helper module
device-protection-helper.js
that can be used by multiple modules and prevent circular dependency issues. It also adds a new method that checks if a device is ready for use (ie rebooted after a certain reset operation was done)How to Test
See this test plan
Related Issues / Discussions
Completeness