P2P-GO-NEG-REQUEST 42:fc:89:a8:96:09 dev_passwd_id=4 {@hide}
String[] tokens = supplicantEvent.split(" ");
if (tokens.length < 2 || !tokens[0].equals("P2P-GO-NEG-REQUEST")) {
throw new IllegalArgumentException("Malformed supplicant event");
}
deviceAddress = tokens[1];
wps = new WpsInfo();
if (tokens.length > 2) {
String[] nameVal = tokens[2].split("=");
int devPasswdId;
try {
devPasswdId = Integer.parseInt(nameVal[1]);
} catch (NumberFormatException e) {
devPasswdId = 0;
}
//Based on definitions in wps/wps_defs.h
switch (devPasswdId) {
//DEV_PW_USER_SPECIFIED = 0x0001,
case 0x01:
wps.setup = WpsInfo.DISPLAY;
break;
//DEV_PW_PUSHBUTTON = 0x0004,
case 0x04:
wps.setup = WpsInfo.PBC;
break;
//DEV_PW_REGISTRAR_SPECIFIED = 0x0005
case 0x05:
wps.setup = WpsInfo.KEYPAD;
break;
default:
wps.setup = WpsInfo.PBC;
break;
}
}