-
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
Set up wifi using credentials from a JSON file #405
Conversation
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.
👍
src/cli/serial.js
Outdated
} | ||
}, | ||
examples: { | ||
'$0 $command': 'Prompt for Wi-Fi credentials and send them to device connected over serial', |
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.
to the device that's*
src/cli/serial.js
Outdated
}, | ||
examples: { | ||
'$0 $command': 'Prompt for Wi-Fi credentials and send them to device connected over serial', | ||
'$0 $command --file credentials.json': 'Read Wi-Fi credentials from credentials.json and send them to device connected over serial' |
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.
^
let security = 3; | ||
if (securityType.indexOf('WPA2') >= 0 && securityType.indexOf('802.1x') >= 0) { |
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.
Your code looks good and works, this is just a random idea.
Not sure 100% if it works, but it looks kinda cool
if (opts.security) {
const s = opts.security.reduce((acc, current) => { return Object.assign({}, acc, { [current]: true })}, {});
security = security || (s['WPA2'] && s['802.1x'] && 5);
isEnterprise = security || isEnterprise;
security = security || (s['WPA'] && s['802.1x'] && 4);
isEnterprise = security || isEnterprise;
security = security || (s['WEP'] && 3);
isEnterprise = security || isEnterprise;
}
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 is not my code. It doesn't have any tests so I'd rather leave it alone.
Fixes #404