Files
fastbee/firmware/esp-idf/wumei-smart-firmware/main/include/wifi.h
2021-07-13 17:15:20 +08:00

47 lines
1.3 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/******************************************************************************
* 作者kerwincui
* 时间2021-06-08
* 邮箱164770707@qq.com
* 源码地址https://gitee.com/kerwincui/wumei-smart
* author: kerwincui
* create: 2021-06-08
* email164770707@qq.com
* source:https://github.com/kerwincui/wumei-smart
*****************************************************************************/
#ifndef _WIFI_H_
#define _WIFI_H_
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "esp_wifi.h"
#include "esp_event.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "lwip/err.h"
#include "lwip/sys.h"
#define LISTEN_INTERVAL 3 //站监听AP信标的间隔。监听间隔的单位是一个信标间隔。例如如果信标间隔为100 ms侦听间隔为3则站侦听信标的间隔为300 ms。
#define POWER_SAVE_MODE WIFI_PS_MIN_MODEM
#define MAXIMUM_RETRY 5
#define AP_SSID "wumei"
#define AP_PASS "wumei.live"
#define AP_CHANNEL 1 //wifi频道1-13的值
#define AP_MAX_STA_CONN 4
#define WIFI_CONNECTED_BIT BIT0
#define WIFI_FAIL_BIT BIT1
void wifi_start(void);
void wifi_mqtt_stop(void);
void wifi_continue(void);
void ap_start(void);
#endif