96 "WPA_WPA2_PSK": "WPA/WPA2", |
96 "WPA_WPA2_PSK": "WPA/WPA2", |
97 "WPA2_ENTERPRISE": "WPA2 (CCMP)", |
97 "WPA2_ENTERPRISE": "WPA2 (CCMP)", |
98 "WPA3_PSK": "WPA3", |
98 "WPA3_PSK": "WPA3", |
99 "WPA2_WPA3_PSK": "WPA2/WPA3", |
99 "WPA2_WPA3_PSK": "WPA2/WPA3", |
100 } |
100 } |
|
101 |
101 self.__securityCode2AuthModeString = { |
102 self.__securityCode2AuthModeString = { |
102 0: "[wifi.AuthMode.OPEN]", |
103 "SEC_OPEN": "[wifi.AuthMode.OPEN]", |
103 1: "[wifi.AuthMode.WEP]", |
104 "SEC_WEP": "[wifi.AuthMode.WEP]", |
104 2: "[wifi.AuthMode.WPA, wifi.AuthMode.PSK]", |
105 "SEC_WPA": "[wifi.AuthMode.WPA, wifi.AuthMode.PSK]", |
105 3: "[wifi.AuthMode.WPA2, wifi.AuthMode.PSK]", |
106 "SEC_WPA2": "[wifi.AuthMode.WPA2, wifi.AuthMode.PSK]", |
106 4: "[wifi.AuthMode.WPA, wifi.AuthMode.WPA2, wifi.AuthMode.PSK]", |
107 "SEC_WPA_WPA2": "[wifi.AuthMode.WPA, wifi.AuthMode.WPA2, wifi.AuthMode.PSK]", |
107 5: "[wifi.AuthMode.WPA2, wifi.AuthMode.ENTERPRISE]", |
108 # noqa: E-501 |
108 6: "[wifi.AuthMode.WPA3, wifi.AuthMode.PSK]", |
109 "SEC_WPA2_ENT": "[wifi.AuthMode.WPA2, wifi.AuthMode.ENTERPRISE]", |
109 7: "[wifi.AuthMode.WPA2, wifi.AuthMode.WPA3, wifi.AuthMode.PSK]", |
110 "SEC_WPA3": "[wifi.AuthMode.WPA3, wifi.AuthMode.PSK]", |
|
111 "SEC_WPA2_WPA3": "[wifi.AuthMode.WPA2, wifi.AuthMode.WPA3, wifi.AuthMode.PSK]", |
|
112 # noqa: E-501 |
110 } |
113 } |
|
114 |
111 self.__bleAddressType = { |
115 self.__bleAddressType = { |
112 0: self.tr("Public"), |
116 0: self.tr("Public"), |
113 1: self.tr("Random Static"), |
117 1: self.tr("Random Static"), |
114 2: self.tr("Random Private Resolvable"), |
118 2: self.tr("Random Private Resolvable"), |
115 3: self.tr("Random Private Non-Resolvable"), |
119 3: self.tr("Random Private Non-Resolvable"), |
1235 """ |
1239 """ |
1236 Public method to start the access point interface. |
1240 Public method to start the access point interface. |
1237 |
1241 |
1238 @param ssid SSID of the access point |
1242 @param ssid SSID of the access point |
1239 @type str |
1243 @type str |
1240 @param security security method (defaults to None) |
1244 @param security security mode (defaults to None) (unused) |
1241 @type int (optional) |
1245 @type str (optional) |
1242 @param password password (defaults to None) |
1246 @param password password (defaults to None) |
1243 @type str (optional) |
1247 @type str (optional) |
1244 @param hostname host name of the device (defaults to None) |
1248 @param hostname host name of the device (defaults to None) |
1245 @type str (optional) |
1249 @type str (optional) |
1246 @param ifconfig IPv4 configuration for the access point if not default |
1250 @param ifconfig IPv4 configuration for the access point if not default |
1248 @type tuple of (str, str, str, str) |
1252 @type tuple of (str, str, str, str) |
1249 @return tuple containing a flag indicating success and an error message |
1253 @return tuple containing a flag indicating success and an error message |
1250 @rtype tuple of (bool, str) |
1254 @rtype tuple of (bool, str) |
1251 """ |
1255 """ |
1252 if security is None or password is None: |
1256 if security is None or password is None: |
1253 security = 0 |
1257 security = "SEC_OPEN" |
1254 password = "" # secok |
1258 password = "" # secok |
1255 authmode = self.__securityCode2AuthModeString[security] |
1259 authmode = self.__securityCode2AuthModeString[security] |
1256 |
1260 |
1257 if ifconfig: |
1261 if ifconfig: |
1258 return ( |
1262 return ( |
1329 """ |
1333 """ |
1330 return ( |
1334 return ( |
1331 [], |
1335 [], |
1332 self.tr("CircuitPython does not support reporting of connected clients."), |
1336 self.tr("CircuitPython does not support reporting of connected clients."), |
1333 ) |
1337 ) |
|
1338 |
|
1339 def getSecurityModes(self): |
|
1340 """ |
|
1341 Public method to get a list of security modes supported by the device. |
|
1342 |
|
1343 @return list of supported security modes |
|
1344 @rtype list of str |
|
1345 """ |
|
1346 return list(self.__securityCode2AuthModeString.keys()) |
1334 |
1347 |
1335 ################################################################## |
1348 ################################################################## |
1336 ## Methods below implement Ethernet related methods |
1349 ## Methods below implement Ethernet related methods |
1337 ################################################################## |
1350 ################################################################## |
1338 |
1351 |