32namespace PoliticianWPS {
38 case 1:
return "Computer";
39 case 2:
return "Input Device";
40 case 3:
return "Printer/Scanner/Fax/Copier";
41 case 4:
return "Camera";
42 case 5:
return "Storage";
43 case 6:
return "Network Infrastructure";
44 case 7:
return "Displays";
45 case 8:
return "Multimedia Device";
46 case 9:
return "Gaming";
47 case 10:
return "Telephone";
48 case 11:
return "Audio";
49 case 12:
return "Docking Device";
50 case 255:
return "Other";
51 default:
return "Unknown";
73 if (!buf || bufSz == 0)
return "";
75 if (methods &
CFG_PUSH_BUTTON) strncat(buf,
"PBC ", bufSz - strlen(buf) - 1);
76 if (methods &
CFG_KEYPAD) strncat(buf,
"PIN-Keypad ", bufSz - strlen(buf) - 1);
77 if (methods &
CFG_LABEL) strncat(buf,
"PIN-Label ", bufSz - strlen(buf) - 1);
78 if (methods &
CFG_DISPLAY) strncat(buf,
"Display ", bufSz - strlen(buf) - 1);
79 if (methods &
CFG_NFC_IFACE) strncat(buf,
"NFC ", bufSz - strlen(buf) - 1);
80 if (buf[0] ==
'\0') strncat(buf,
"None", bufSz - strlen(buf) - 1);
82 size_t n = strlen(buf);
83 if (n > 0 && buf[n - 1] ==
' ') buf[n - 1] =
'\0';
109template<
typename TStream>
112 snprintf(mac,
sizeof(mac),
"%02X:%02X:%02X:%02X:%02X:%02X",
114 out.printf(
"┌─ WPS M1 Enrollee ───────────────────────\n");
115 out.printf(
"│ STA: %s ch%d %d dBm\n", mac, rec.
channel, rec.
rssi);
119 out.printf(
"│ Model: %s %s\n",
123 out.printf(
"│ Dev Type: %s (cat 0x%04X)\n",
125 out.printf(
"│ Config Meth: %s (0x%04X)\n",
127 out.printf(
"│ RF Bands: %s%s\n",
128 (rec.
rf_bands & 0x01) ?
"2.4GHz " :
"",
129 (rec.
rf_bands & 0x02) ?
"5GHz" :
"");
130 out.printf(
"└─────────────────────────────────────────\n");
static const uint16_t AUTH_OPEN
Open (no authentication)
static const uint16_t AUTH_SHARED
Shared Key (deprecated WEP-era)
static const uint16_t AUTH_WPA2PSK
WPA2 Personal (PSK)
static const uint16_t AUTH_WPA
WPA Enterprise (802.1X)
static const uint16_t AUTH_WPA2
WPA2 Enterprise (802.1X)
static const uint16_t AUTH_WPAPSK
WPA Personal (PSK)
static const uint16_t CFG_DISPLAY
static const uint16_t CFG_VIRTUAL_PIN
const char * devTypeCatStr(uint16_t cat)
static const uint16_t CFG_KEYPAD
static const uint16_t CFG_EXT_NFC
static const uint16_t CFG_LABEL
static const uint16_t CFG_PHYSICAL_PIN
static const uint16_t CFG_ETHERNET
static const uint16_t CFG_NFC_IFACE
const char * configMethodsStr(uint16_t methods, char *buf, size_t bufSz)
Returns a compact human-readable string of supported WPS setup methods.
static const uint16_t CFG_INT_NFC
static const uint16_t CFG_USBA
static const uint16_t CFG_VIRTUAL_PBC
void print(TStream &out, const WpsRecord &rec)
Pretty-prints a WpsRecord to any Print-compatible stream (Serial, etc.).
static const uint16_t CFG_PHYSICAL_PBC
static const uint16_t CFG_PUSH_BUTTON
uint16_t primary_dev_type_cat
WPS M1 device attributes harvested from an EAP-WSC exchange.