Chapter 4. API Guides
Wi-Fi Country Code
Call esp_wifi_set_country() to set the country info. The table below describes the fields in detail, please
consult local 2.4 GHz RF operating regulations before configuring these fields.
Field Description
cc[3] Country code string, this attributes identify the country
or noncountry entity in which the station/AP is operat-
ing. If it’s a country, the first two octets of this string
is the two character country info as described in doc-
ument ISO/IEC3166-1. The third octect is one of the
following:
• an ASCII space character, if the regulations un-
der which the station/AP is operating encompass
all environments for the current frequency band
in the country.
• an ASCII ‘O’character if the regulations un-
der which the station/AP is operating are for an
outdoor environment only.
• an ASCII ‘I’character if the regulations un-
der which the station/AP is operating are for an
indoor environment only.
• an ASCII ‘X’character if the station/AP is
operating under a noncountry entity. The first
two octets of the noncountry entity is two ASCII
‘XX’characters.
• the binary representation of the Operating Class
table number currently in use. Refer to Annex E,
IEEE Std 802.11-2012.
schan Start channel, it’s the minimum channel number of the
regulations under which the station/AP can operate.
nchan Total number of channels as per the regulations, e.g.
if the schan=1, nchan=13, it means the station/AP can
send data from channel 1 to 13.
policy Country policy, this field control which country info
will be used if the configured country info is conflict
with the connected AP’s. More description about pol-
icy is provided in following section.
The default country info is {.cc=”CN”, .schan=1, .nchan=13, policy=WIFI_COUNTRY_POLICY_AUTO}, if the
Wi-Fi Mode is station/AP coexist mode, they share the same configured country info. Sometimes, the country info
of AP, to which the station is connected, is different from the country info of configured. For example, the configured
station has country info {.cc=”JP”, .schan=1, .nchan=14, policy=WIFI_COUNTRY_POLICY_AUTO}, but the
connected AP has country info {.cc=”CN”, .schan=1, .nchan=13}, then country info of connected AP’s is used.
Following table depicts which country info is used in different Wi-Fi Mode and different country policy, also describe
the impact to active scan.
Espressif Systems 1536
Submit Document Feedback
Release v4.4