-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
Added extended EnterpriseWifi class #83
Conversation
Cool. Although the changes are not mergable at this time due to compile errors. Took a quick look at the compile errors and this should solve the issue: diff --git a/core/src/main/java/net/glxn/qrgen/core/scheme/EnterpriseWifi.java b/core/src/main/java/net/glxn/qrgen/core/scheme/EnterpriseWifi.java
index a9ec9ef..aee8bc1 100644
--- a/core/src/main/java/net/glxn/qrgen/core/scheme/EnterpriseWifi.java
+++ b/core/src/main/java/net/glxn/qrgen/core/scheme/EnterpriseWifi.java
@@ -25,7 +25,7 @@ public class EnterpriseWifi extends Wifi {
throw new IllegalArgumentException(
"this is not a valid WIFI code: " + wifiCode);
}
- Wifi wifi = new Wifi();
+ EnterpriseWifi wifi = new EnterpriseWifi();
Map<String, String> parameters = getParameters(
wifiCode.substring(WIFI_PROTOCOL_HEADER.length()), "(?<!\\\\);");
if (parameters.containsKey(SSID)) {
@@ -35,7 +35,7 @@ public class EnterpriseWifi extends Wifi {
wifi.setPsk(unescape(parameters.get(PSK)));
}
if (parameters.containsKey(USER)) {
- wifi.setUser(unescape(parameters.get(USER)));
+ wifi.setUsername(unescape(parameters.get(USER)));
}
if (parameters.containsKey(EAP)) {
wifi.setEap(unescape(parameters.get(EAP)));
@@ -64,20 +64,20 @@ public class EnterpriseWifi extends Wifi {
}
public EnterpriseWifi setUsername(String username) {
- withUsername(username);
+ return withUsername(username);
}
public String getUsername() {
return username;
}
- public EnterpriseWifi withEap(Strin eap) {
+ public EnterpriseWifi withEap(String eap) {
this.eap = eap;
return this;
}
public EnterpriseWifi setEap(String eap) {
- withEap(eap);
+ return withEap(eap);
}
public String getEap() { |
I'll definitely take a look at fixing this over the weekend. On Oct 28, 2016 9:26 AM, "Ken Gullaksen" [email protected] wrote:
|
Build compiles and the tests pass 👍 |
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. Thank you. I have two small things I would like changed before I merge this :)
protected static final String AUTHENTICATION = "T"; | ||
protected static final String SSID = "S"; | ||
protected static final String PSK = "P"; | ||
protected static final String HIDDEN = "H"; |
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.
Would prefer these to be public static final:
public static final String WIFI_PROTOCOL_HEADER = "WIFI:";
public static final String AUTHENTICATION = "T";
public static final String SSID = "S";
public static final String PSK = "P";
public static final String HIDDEN = "H";
protected String authentication; | ||
protected String ssid; | ||
protected String psk; | ||
protected boolean hidden = false; |
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.
These can remain private:
private String authentication;
private String ssid;
private String psk;
private boolean hidden = false;
👍 |
Thank you for the PR. I will publish it as part of a new minor tomorrow👍 |
Adds support for connecting to enterprise wi-fi networks that have both a username and password. This is a fix for #82.