Skip to content

Commit

Permalink
Merge pull request #754 from particle-iot/feature/automatic-service-mode
Browse files Browse the repository at this point in the history
Protected Device Automation for CLI commands
  • Loading branch information
keeramis authored Aug 28, 2024
2 parents 5884949 + 90d80c0 commit fb91a2c
Show file tree
Hide file tree
Showing 34 changed files with 2,129 additions and 967 deletions.
14 changes: 7 additions & 7 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"particle-api-js": "^10.5.1",
"particle-commands": "^1.0.1",
"particle-library-manager": "^0.1.15",
"particle-usb": "^3.4.0",
"particle-usb": "^3.6.0",
"request": "https://github.com/particle-iot/request/releases/download/v2.75.1-relativepath.1/request-2.75.1-relativepath.1.tgz",
"safe-buffer": "^5.2.0",
"semver": "^7.5.2",
Expand Down
12 changes: 6 additions & 6 deletions src/cli/device-protection.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module.exports = ({ commandProcessor, root }) => {
const deviceProtection = commandProcessor.createCategory(root, 'device-protection', 'Manage device protection');
const deviceProtection = commandProcessor.createCategory(root, 'device-protection', 'Manage Device Protection');

commandProcessor.createCommand(deviceProtection, 'status', 'Gets the current device protection status', {
commandProcessor.createCommand(deviceProtection, 'status', 'Gets the current Device Protection status', {
handler: () => {
const DeviceProtectionCommands = require('../cmd/device-protection');
return new DeviceProtectionCommands().getStatus();
},
examples: {
'$0 $command': 'Gets the current device protection status'
'$0 $command': 'Gets the current Device Protection status'
}
});

commandProcessor.createCommand(deviceProtection, 'disable', 'Disables device protection', {
commandProcessor.createCommand(deviceProtection, 'disable', 'Disables Device Protection', {

handler: () => {
const DeviceProtectionCommands = require('../cmd/device-protection');
Expand All @@ -23,10 +23,10 @@ module.exports = ({ commandProcessor, root }) => {
epilogue: 'A Protected Device in Service Mode allows any command to be performed on it that can be performed on an Open Device like flashing firmware or serial monitor.'
});

commandProcessor.createCommand(deviceProtection, 'enable', 'Enables device protection', {
commandProcessor.createCommand(deviceProtection, 'enable', 'Enables Device Protection', {
options: {
file: {
description: 'File to use for device protection'
description: 'File to use for Device Protection'
}
},
handler: (args) => {
Expand Down
Loading

0 comments on commit fb91a2c

Please sign in to comment.