Wi-Fi周辺機器¶
Wi-Fi Peripheral
Wi-Fiペリフェラルは、Wi-Fi接続の構成、Wi-Fi接続構成を制御するためのAPIの提供、およびWi-Fiネットワークのステータスの監視に使用されます。
The Wi-Fi Peripheral is used to configure Wi-Fi connections, provide APIs to control Wi-Fi connection configuration, as well as monitor the status of Wi-Fi networks.
アプリケーション例¶
Application Example
このAPIの実装は、player/pipeline_http_mp3の例で示されています。
Implementation of this API is demonstrated in player/pipeline_http_mp3 example.
APIリファレンス¶
API Reference
関数¶
Functions
-
esp_periph_handle_t
periph_wifi_init(periph_wifi_cfg_t *config)¶ esp_peripheralsのwifiペリフェラルハンドルを作成します。
Create the wifi peripheral handle for esp_peripherals.
- Note
- この関数によって作成されたハンドルは、
esp_periph_destroyが呼び出されたときに自動的に破棄されますThe handle was created by this function automatically destroy when
esp_periph_destroyis called - Return
- espペリフェラルハンドル
The esp peripheral handle
- Parameters
config: 構成config: The configuration
-
esp_err_t
periph_wifi_wait_for_connected(esp_periph_handle_t periph, TickType_t tick_to_wait)¶ この関数は、現在のスレッド(
tick_to_waitティック)をブロックし、ESP32がWi-Fiネットワークに接続してIPを取得するまで待機します。This function will block current thread (in
tick_to_waittick) and wait until ESP32 connected to the Wi-Fi network, and got ip.- Return
- ESP_OK
- ESP_FAIL
- Parameters
periph: ペリフperiph: The periphtick_to_wait: 待つダニtick_to_wait: The tick to wait
-
periph_wifi_state_t
periph_wifi_is_connected(esp_periph_handle_t periph)¶ Wi-Fi接続状態を確認してください。
Check the Wi-Fi connection status.
- Return
- Wi-Fiネットワークステータス
Wi-Fi network status
- Parameters
periph: ペリフperiph: The periph
-
esp_err_t
periph_wifi_config_start(esp_periph_handle_t periph, periph_wifi_config_mode_t mode)¶ モードでWi-Fiネットワークセットアップを開始しますStart Wi-Fi network setup in
mode- Return
- ESP_OK
- ESP_FAIL
- Parameters
periph: ペリフperiph: The periphmode: モードmode: The mode
-
esp_err_t
periph_wifi_config_wait_done(esp_periph_handle_t periph, TickType_t tick_to_wait)¶ Wi-Fiのセットアップが完了するのを待ちます。
Wait for Wi-Fi setup done.
- Return
- ESP_OK
- ESP_FAIL
- Parameters
periph: ペリフperiph: The periphtick_to_wait: 待つダニtick_to_wait: The tick to wait
構造体¶
Structures
-
struct
periph_wifi_cfg_t¶ Wi-Fi周辺機器の構成。
The Wi-Fi peripheral configuration.
Public Members
-
bool
disable_auto_reconnect¶ Wi-Fi自動再接続を無効にする
Disable Wi-Fi auto reconnect
-
int
reconnect_timeout_ms¶ Wi-Fiネットワークから切断した後の再接続タイムアウト
The reconnect timeout after disconnected from Wi-Fi network
-
const char *
ssid¶ ターゲットAPのSSID
SSID of target AP
-
const char *
password¶ ターゲットAPのパスワード
password of target AP
-
bool
列挙¶
Enumerations
-
enum
periph_wifi_state_t¶ 周辺Wi-FiイベントID。
Peripheral Wi-Fi event id.
Values:
-
PERIPH_WIFI_UNCHANGE= 0¶
-
PERIPH_WIFI_CONNECTING¶
-
PERIPH_WIFI_CONNECTED¶
-
PERIPH_WIFI_DISCONNECTED¶
-
PERIPH_WIFI_SETTING¶
-
PERIPH_WIFI_CONFIG_DONE¶
-
PERIPH_WIFI_CONFIG_ERROR¶
-
PERIPH_WIFI_ERROR¶
-
-
enum
periph_wifi_config_mode_t¶ Wi-Fiセットアップモードタイプ。
Wi-Fi setup mode type.
Values:
-
WIFI_CONFIG_ESPTOUCH¶ ESPTOUCHプロトコルでsmartconfigを使用する
Using smartconfig with ESPTOUCH protocol
-
WIFI_CONFIG_AIRKISS¶ AIRKISSプロトコルでsmartconfigを使用する
Using smartconfig with AIRKISS protocol
-
WIFI_CONFIG_ESPTOUCH_AIRKISS¶ ESPTOUCH_AIRKISSプロトコルでsmartconfigを使用する
Using smartconfig with ESPTOUCH_AIRKISS protocol
-
WIFI_CONFIG_WPS¶ WPSの使用(サポートされていません)
Using WPS (not support)
-
WIFI_CONFIG_BLUEFI¶ BLUEFIの使用
Using BLUEFI
-
WIFI_CONFIG_WEB¶ HTTPサーバーの使用(サポートされていません)
Using HTTP Server (not support)
-