mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
wifi_prov: Added support for WPA3_PSK and WPA2_WPA3_PSK APs
This commit is contained in:
parent
6c5fb29c2c
commit
279ab23244
@ -202,7 +202,7 @@ const ProtobufCEnumDescriptor wifi_connect_failed_reason__descriptor =
|
||||
wifi_connect_failed_reason__value_ranges,
|
||||
NULL,NULL,NULL,NULL /* reserved[1234] */
|
||||
};
|
||||
static const ProtobufCEnumValue wifi_auth_mode__enum_values_by_number[6] =
|
||||
static const ProtobufCEnumValue wifi_auth_mode__enum_values_by_number[8] =
|
||||
{
|
||||
{ "Open", "WIFI_AUTH_MODE__Open", 0 },
|
||||
{ "WEP", "WIFI_AUTH_MODE__WEP", 1 },
|
||||
@ -210,16 +210,20 @@ static const ProtobufCEnumValue wifi_auth_mode__enum_values_by_number[6] =
|
||||
{ "WPA2_PSK", "WIFI_AUTH_MODE__WPA2_PSK", 3 },
|
||||
{ "WPA_WPA2_PSK", "WIFI_AUTH_MODE__WPA_WPA2_PSK", 4 },
|
||||
{ "WPA2_ENTERPRISE", "WIFI_AUTH_MODE__WPA2_ENTERPRISE", 5 },
|
||||
{ "WPA3_PSK", "WIFI_AUTH_MODE__WPA3_PSK", 6 },
|
||||
{ "WPA2_WPA3_PSK", "WIFI_AUTH_MODE__WPA2_WPA3_PSK", 7 },
|
||||
};
|
||||
static const ProtobufCIntRange wifi_auth_mode__value_ranges[] = {
|
||||
{0, 0},{0, 6}
|
||||
{0, 0},{0, 8}
|
||||
};
|
||||
static const ProtobufCEnumValueIndex wifi_auth_mode__enum_values_by_name[6] =
|
||||
static const ProtobufCEnumValueIndex wifi_auth_mode__enum_values_by_name[8] =
|
||||
{
|
||||
{ "Open", 0 },
|
||||
{ "WEP", 1 },
|
||||
{ "WPA2_ENTERPRISE", 5 },
|
||||
{ "WPA2_PSK", 3 },
|
||||
{ "WPA2_WPA3_PSK", 7 },
|
||||
{ "WPA3_PSK", 6 },
|
||||
{ "WPA_PSK", 2 },
|
||||
{ "WPA_WPA2_PSK", 4 },
|
||||
};
|
||||
@ -230,9 +234,9 @@ const ProtobufCEnumDescriptor wifi_auth_mode__descriptor =
|
||||
"WifiAuthMode",
|
||||
"WifiAuthMode",
|
||||
"",
|
||||
6,
|
||||
8,
|
||||
wifi_auth_mode__enum_values_by_number,
|
||||
6,
|
||||
8,
|
||||
wifi_auth_mode__enum_values_by_name,
|
||||
1,
|
||||
wifi_auth_mode__value_ranges,
|
||||
|
@ -38,7 +38,9 @@ typedef enum _WifiAuthMode {
|
||||
WIFI_AUTH_MODE__WPA_PSK = 2,
|
||||
WIFI_AUTH_MODE__WPA2_PSK = 3,
|
||||
WIFI_AUTH_MODE__WPA_WPA2_PSK = 4,
|
||||
WIFI_AUTH_MODE__WPA2_ENTERPRISE = 5
|
||||
WIFI_AUTH_MODE__WPA2_ENTERPRISE = 5,
|
||||
WIFI_AUTH_MODE__WPA3_PSK = 6,
|
||||
WIFI_AUTH_MODE__WPA2_WPA3_PSK = 7
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(WIFI_AUTH_MODE)
|
||||
} WifiAuthMode;
|
||||
|
||||
|
@ -19,6 +19,8 @@ enum WifiAuthMode {
|
||||
WPA2_PSK = 3;
|
||||
WPA_WPA2_PSK = 4;
|
||||
WPA2_ENTERPRISE = 5;
|
||||
WPA3_PSK = 6;
|
||||
WPA2_WPA3_PSK = 7;
|
||||
}
|
||||
|
||||
message WifiConnectedState {
|
||||
|
@ -13,7 +13,7 @@ _sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14wifi_constants.proto\"v\n\x12WifiConnectedState\x12\x10\n\x08ip4_addr\x18\x01 \x01(\t\x12 \n\tauth_mode\x18\x02 \x01(\x0e\x32\r.WifiAuthMode\x12\x0c\n\x04ssid\x18\x03 \x01(\x0c\x12\r\n\x05\x62ssid\x18\x04 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x05 \x01(\x05*Y\n\x10WifiStationState\x12\r\n\tConnected\x10\x00\x12\x0e\n\nConnecting\x10\x01\x12\x10\n\x0c\x44isconnected\x10\x02\x12\x14\n\x10\x43onnectionFailed\x10\x03*=\n\x17WifiConnectFailedReason\x12\r\n\tAuthError\x10\x00\x12\x13\n\x0fNetworkNotFound\x10\x01*c\n\x0cWifiAuthMode\x12\x08\n\x04Open\x10\x00\x12\x07\n\x03WEP\x10\x01\x12\x0b\n\x07WPA_PSK\x10\x02\x12\x0c\n\x08WPA2_PSK\x10\x03\x12\x10\n\x0cWPA_WPA2_PSK\x10\x04\x12\x13\n\x0fWPA2_ENTERPRISE\x10\x05\x62\x06proto3')
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14wifi_constants.proto\"v\n\x12WifiConnectedState\x12\x10\n\x08ip4_addr\x18\x01 \x01(\t\x12 \n\tauth_mode\x18\x02 \x01(\x0e\x32\r.WifiAuthMode\x12\x0c\n\x04ssid\x18\x03 \x01(\x0c\x12\r\n\x05\x62ssid\x18\x04 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x05 \x01(\x05*Y\n\x10WifiStationState\x12\r\n\tConnected\x10\x00\x12\x0e\n\nConnecting\x10\x01\x12\x10\n\x0c\x44isconnected\x10\x02\x12\x14\n\x10\x43onnectionFailed\x10\x03*=\n\x17WifiConnectFailedReason\x12\r\n\tAuthError\x10\x00\x12\x13\n\x0fNetworkNotFound\x10\x01*\x84\x01\n\x0cWifiAuthMode\x12\x08\n\x04Open\x10\x00\x12\x07\n\x03WEP\x10\x01\x12\x0b\n\x07WPA_PSK\x10\x02\x12\x0c\n\x08WPA2_PSK\x10\x03\x12\x10\n\x0cWPA_WPA2_PSK\x10\x04\x12\x13\n\x0fWPA2_ENTERPRISE\x10\x05\x12\x0c\n\x08WPA3_PSK\x10\x06\x12\x11\n\rWPA2_WPA3_PSK\x10\x07\x62\x06proto3')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'wifi_constants_pb2', globals())
|
||||
@ -24,8 +24,8 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
_WIFISTATIONSTATE._serialized_end=233
|
||||
_WIFICONNECTFAILEDREASON._serialized_start=235
|
||||
_WIFICONNECTFAILEDREASON._serialized_end=296
|
||||
_WIFIAUTHMODE._serialized_start=298
|
||||
_WIFIAUTHMODE._serialized_end=397
|
||||
_WIFIAUTHMODE._serialized_start=299
|
||||
_WIFIAUTHMODE._serialized_end=431
|
||||
_WIFICONNECTEDSTATE._serialized_start=24
|
||||
_WIFICONNECTEDSTATE._serialized_end=142
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
|
@ -1,16 +1,5 @@
|
||||
# Copyright 2018 Espressif Systems (Shanghai) PTE LTD
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# SPDX-FileCopyrightText: 2018-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
# APIs for interpreting and creating protobuf packets for Wi-Fi Scanning
|
||||
@ -89,7 +78,8 @@ def scan_result_response(security_ctx, response_data):
|
||||
print_verbose(security_ctx, 'ScanResult status ' + str(resp.status))
|
||||
if resp.status != 0:
|
||||
raise RuntimeError
|
||||
authmode_str = ['Open', 'WEP', 'WPA_PSK', 'WPA2_PSK', 'WPA_WPA2_PSK', 'WPA2_ENTERPRISE']
|
||||
authmode_str = ['Open', 'WEP', 'WPA_PSK', 'WPA2_PSK', 'WPA_WPA2_PSK',
|
||||
'WPA2_ENTERPRISE', 'WPA3_PSK', 'WPA2_WPA3_PSK']
|
||||
results = []
|
||||
for entry in resp.resp_scan_result.entries:
|
||||
results += [{'ssid': entry.ssid.decode('latin-1').rstrip('\x00'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user