Panasonic PAN9520 Integration Manual page 17

Embedded wi-fi module
Hide thumbs Also See for PAN9520:
Table of Contents

Advertisement

PAN9520 Wi-Fi Module
6.1.1.1
Country Code Setting with ESP-IDF
The Espressif Integrated Development Framwork (ESP-IDF) is the official software
development kit (SDK) for the ESP32-S2 IC used on the PAN9520. This contains the function
esp_wifi_set_country
range. The function returns an error code of type
wifi_country_t
*country
variable (
The linked variable (type
which are listed below.
For further details please refer to
idf/en/v4.2/esp32s2/api-reference/network/esp_wifi.html?highlight=esp_wifi_set_coun-
try#_CPPv420esp_wifi_set_countryPK14wifi_country_t.
Structure of Type "wifi_country_t"
Name
cc
3
schan
nchan
max_tx_power
policy
4
Entries "0" and "1" contain the alpha-2 country code specified by ISO3166. For a list of codes please refer to
3
https://www.iso.org/obp/ui/#search/code/. Please note that there are also reserved codes that do not
represent a country but are valid as well. An example is "EU" for the European union.
The setting "policy" is of another custom datatype wifi_country_policy_t. Variables of this type are
4
enumerations with two valid numbers. The numbers are represented by following macros:
WIFI_COUNTRY_POLICY_AUTO and WIFI_COUNTRY_POLICY_AUTO.
Module Integration Guide Rev. 1.1
that can be used for setting the country code and limiting the channel
is needed as input. When the function is called, the settings of the linked input
) are stored to the module's flash memory.
wifi_country_t)
https://docs.espressif.com/projects/esp-
Type
Example Settings
cc[0-2] = ['D', 'E', ' ']
char array
(3 bytes)
cc[0-2] = ['U', 'S', ' ']
cc[0-2] = ['C', 'A', ' ']
cc[0-2] = ['E', 'U', ' ']
uint8_t
1
uint8_t
11
int8_t
56
wifi_country
WIFI_COUNTRY
_policy_t
_POLICY_MANUAL
6 Regulatory and Certification Information
esp_err_t
. A pointer to a variable of type
is a structure that contains all needed settings,
Description
This array of three characters contains
the two-digit country code
(ISO/IEC3166-1) and an environmental
setting (byte 3). Example codes are
given for Germany (DE), USA (US),
Canada (CA), and the European Union
(EU).
Index of first channel of the allowed
range.
Number of channels in the allowed
range. The index of the last channel in
the range is schan + nchan - 1
Maximum Tx power in steps of 0.25 dBm
(valid values 8 to 78 ≙ 2 to 19.5 dBm)
Setting, if the configured country code is
always used, or if the module adapts to
the AP configuration (if it is station).
Details are given in the following.
Page 17 of 44

Advertisement

Table of Contents
loading

Table of Contents