MeterLogger
Data Structures | Macros | Typedefs | Enumerations | Functions
user_interface.h File Reference
#include "os_type.h"
#include "lwip/ip_addr.h"
#include "queue.h"
#include "user_config.h"
#include "spi_flash.h"
#include "gpio.h"
Include dependency graph for user_interface.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rst_info
 
struct  bss_info
 
struct  _scaninfo
 
struct  station_config
 
struct  scan_config
 
struct  softap_config
 
struct  station_info
 
struct  dhcps_lease
 
struct  Event_StaMode_Connected_t
 
struct  Event_StaMode_Disconnected_t
 
struct  Event_StaMode_AuthMode_Change_t
 
struct  Event_StaMode_Got_IP_t
 
struct  Event_SoftAPMode_StaConnected_t
 
struct  Event_SoftAPMode_StaDisconnected_t
 
struct  Event_SoftAPMode_ProbeReqRecved_t
 
union  Event_Info_u
 
struct  _esp_event
 

Macros

#define MAC2STR(a)   (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
 
#define MACSTR   "%02x:%02x:%02x:%02x:%02x:%02x"
 
#define UPGRADE_FW_BIN1   0x00
 
#define UPGRADE_FW_BIN2   0x01
 
#define SYS_BOOT_ENHANCE_MODE   0
 
#define SYS_BOOT_NORMAL_MODE   1
 
#define SYS_BOOT_NORMAL_BIN   0
 
#define SYS_BOOT_TEST_BIN   1
 
#define SYS_CPU_80MHZ   80
 
#define SYS_CPU_160MHZ   160
 
#define NULL_MODE   0x00
 
#define STATION_MODE   0x01
 
#define SOFTAP_MODE   0x02
 
#define STATIONAP_MODE   0x03
 
#define STATION_IF   0x00
 
#define SOFTAP_IF   0x01
 
#define ESP_U32_DIFF(a, b)   (((a) >= (b)) ? ((a) - (b)) : (((a) + ((b) ^ 0xFFFFFFFF) + 1)))
 
#define FIXED_RATE_MASK_NONE   0x00
 
#define FIXED_RATE_MASK_STA   0x01
 
#define FIXED_RATE_MASK_AP   0x02
 
#define FIXED_RATE_MASK_ALL   0x03
 
#define RC_LIMIT_11B   0
 
#define RC_LIMIT_11G   1
 
#define RC_LIMIT_11N   2
 
#define RC_LIMIT_P2P_11G   3
 
#define RC_LIMIT_P2P_11N   4
 
#define RC_LIMIT_NUM   5
 
#define LIMIT_RATE_MASK_NONE   0x00
 
#define LIMIT_RATE_MASK_STA   0x01
 
#define LIMIT_RATE_MASK_AP   0x02
 
#define LIMIT_RATE_MASK_ALL   0x03
 

Typedefs

typedef void(* init_done_cb_t) (void)
 
typedef enum _auth_mode AUTH_MODE
 
typedef struct _scaninfo scaninfo
 
typedef void(* scan_done_cb_t) (void *arg, STATUS status)
 
typedef void(* wifi_promiscuous_cb_t) (uint8 *buf, uint16 len)
 
typedef void(* fpm_wakeup_cb) (void)
 
typedef struct _esp_event System_Event_t
 
typedef void(* wifi_event_handler_cb_t) (System_Event_t *event)
 
typedef enum wps_type WPS_TYPE_t
 
typedef void(* wps_st_cb_t) (int status)
 
typedef void(* freedom_outside_cb_t) (uint8 status)
 
typedef void(* rfid_locp_cb_t) (uint8 *frm, int len, int rssi)
 
typedef void(* user_ie_manufacturer_recv_cb_t) (uint8 type, const uint8 sa[6], const uint8 m_oui[3], uint8 *ie, uint8 ie_len, int rssi)
 

Enumerations

enum  rst_reason {
  REASON_DEFAULT_RST = 0, REASON_WDT_RST = 1, REASON_EXCEPTION_RST = 2, REASON_SOFT_WDT_RST = 3,
  REASON_SOFT_RESTART = 4, REASON_DEEP_SLEEP_AWAKE = 5, REASON_EXT_SYS_RST = 6
}
 
enum  { USER_TASK_PRIO_0 = 0, USER_TASK_PRIO_1, USER_TASK_PRIO_2, USER_TASK_PRIO_MAX }
 
enum  flash_size_map {
  FLASH_SIZE_4M_MAP_256_256 = 0, FLASH_SIZE_2M, FLASH_SIZE_8M_MAP_512_512, FLASH_SIZE_16M_MAP_512_512,
  FLASH_SIZE_32M_MAP_512_512, FLASH_SIZE_16M_MAP_1024_1024, FLASH_SIZE_32M_MAP_1024_1024
}
 
enum  _auth_mode {
  AUTH_OPEN = 0, AUTH_WEP, AUTH_WPA_PSK, AUTH_WPA2_PSK,
  AUTH_WPA_WPA2_PSK, AUTH_MAX
}
 
enum  {
  STATION_IDLE = 0, STATION_CONNECTING, STATION_WRONG_PASSWORD, STATION_NO_AP_FOUND,
  STATION_CONNECT_FAIL, STATION_GOT_IP
}
 
enum  dhcp_status { DHCP_STOPPED, DHCP_STARTED }
 
enum  dhcps_offer_option { OFFER_START = 0x00, OFFER_ROUTER = 0x01, OFFER_END }
 
enum  phy_mode { PHY_MODE_11B = 1, PHY_MODE_11G = 2, PHY_MODE_11N = 3 }
 
enum  sleep_type { NONE_SLEEP_T = 0, LIGHT_SLEEP_T, MODEM_SLEEP_T }
 
enum  {
  EVENT_STAMODE_CONNECTED = 0, EVENT_STAMODE_DISCONNECTED, EVENT_STAMODE_AUTHMODE_CHANGE, EVENT_STAMODE_GOT_IP,
  EVENT_STAMODE_DHCP_TIMEOUT, EVENT_SOFTAPMODE_STACONNECTED, EVENT_SOFTAPMODE_STADISCONNECTED, EVENT_SOFTAPMODE_PROBEREQRECVED,
  EVENT_MAX
}
 
enum  {
  REASON_UNSPECIFIED = 1, REASON_AUTH_EXPIRE = 2, REASON_AUTH_LEAVE = 3, REASON_ASSOC_EXPIRE = 4,
  REASON_ASSOC_TOOMANY = 5, REASON_NOT_AUTHED = 6, REASON_NOT_ASSOCED = 7, REASON_ASSOC_LEAVE = 8,
  REASON_ASSOC_NOT_AUTHED = 9, REASON_DISASSOC_PWRCAP_BAD = 10, REASON_DISASSOC_SUPCHAN_BAD = 11, REASON_IE_INVALID = 13,
  REASON_MIC_FAILURE = 14, REASON_4WAY_HANDSHAKE_TIMEOUT = 15, REASON_GROUP_KEY_UPDATE_TIMEOUT = 16, REASON_IE_IN_4WAY_DIFFERS = 17,
  REASON_GROUP_CIPHER_INVALID = 18, REASON_PAIRWISE_CIPHER_INVALID = 19, REASON_AKMP_INVALID = 20, REASON_UNSUPP_RSN_IE_VERSION = 21,
  REASON_INVALID_RSN_IE_CAP = 22, REASON_802_1X_AUTH_FAILED = 23, REASON_CIPHER_SUITE_REJECTED = 24, REASON_BEACON_TIMEOUT = 200,
  REASON_NO_AP_FOUND = 201, REASON_AUTH_FAIL = 202, REASON_ASSOC_FAIL = 203, REASON_HANDSHAKE_TIMEOUT = 204
}
 
enum  wps_type {
  WPS_TYPE_DISABLE = 0, WPS_TYPE_PBC, WPS_TYPE_PIN, WPS_TYPE_DISPLAY,
  WPS_TYPE_MAX
}
 
enum  wps_cb_status { WPS_CB_ST_SUCCESS = 0, WPS_CB_ST_FAILED, WPS_CB_ST_TIMEOUT, WPS_CB_ST_WEP }
 
enum  FIXED_RATE {
  PHY_RATE_48 = 0x8, PHY_RATE_24 = 0x9, PHY_RATE_12 = 0xA, PHY_RATE_6 = 0xB,
  PHY_RATE_54 = 0xC, PHY_RATE_36 = 0xD, PHY_RATE_18 = 0xE, PHY_RATE_9 = 0xF
}
 
enum  support_rate {
  RATE_11B5M = 0, RATE_11B11M = 1, RATE_11B1M = 2, RATE_11B2M = 3,
  RATE_11G6M = 4, RATE_11G12M = 5, RATE_11G24M = 6, RATE_11G48M = 7,
  RATE_11G54M = 8, RATE_11G9M = 9, RATE_11G18M = 10, RATE_11G36M = 11
}
 
enum  RATE_11B_ID { RATE_11B_B11M = 0, RATE_11B_B5M = 1, RATE_11B_B2M = 2, RATE_11B_B1M = 3 }
 
enum  RATE_11G_ID {
  RATE_11G_G54M = 0, RATE_11G_G48M = 1, RATE_11G_G36M = 2, RATE_11G_G24M = 3,
  RATE_11G_G18M = 4, RATE_11G_G12M = 5, RATE_11G_G9M = 6, RATE_11G_G6M = 7,
  RATE_11G_B5M = 8, RATE_11G_B2M = 9, RATE_11G_B1M = 10
}
 
enum  RATE_11N_ID {
  RATE_11N_MCS7S = 0, RATE_11N_MCS7 = 1, RATE_11N_MCS6 = 2, RATE_11N_MCS5 = 3,
  RATE_11N_MCS4 = 4, RATE_11N_MCS3 = 5, RATE_11N_MCS2 = 6, RATE_11N_MCS1 = 7,
  RATE_11N_MCS0 = 8, RATE_11N_B5M = 9, RATE_11N_B2M = 10, RATE_11N_B1M = 11
}
 
enum  {
  USER_IE_BEACON = 0, USER_IE_PROBE_REQ, USER_IE_PROBE_RESP, USER_IE_ASSOC_REQ,
  USER_IE_ASSOC_RESP, USER_IE_MAX
}
 

Functions

struct rst_infosystem_get_rst_info (void)
 
void system_restore (void)
 
void system_restart (void)
 
bool system_deep_sleep_set_option (uint8 option)
 
void system_deep_sleep (uint32 time_in_us)
 
uint8 system_upgrade_userbin_check (void)
 
void system_upgrade_reboot (void)
 
uint8 system_upgrade_flag_check ()
 
void system_upgrade_flag_set (uint8 flag)
 
void system_timer_reinit (void)
 
uint32 system_get_time (void)
 
bool system_os_task (os_task_t task, uint8 prio, os_event_t *queue, uint8 qlen)
 
bool system_os_post (uint8 prio, os_signal_t sig, os_param_t par)
 
void system_print_meminfo (void)
 
uint32 system_get_free_heap_size (void)
 
void system_set_os_print (uint8 onoff)
 
uint8 system_get_os_print ()
 
uint64 system_mktime (uint32 year, uint32 mon, uint32 day, uint32 hour, uint32 min, uint32 sec)
 
uint32 system_get_chip_id (void)
 
void system_init_done_cb (init_done_cb_t cb)
 
uint32 system_rtc_clock_cali_proc (void)
 
uint32 system_get_rtc_time (void)
 
bool system_rtc_mem_read (uint8 src_addr, void *des_addr, uint16 load_size)
 
bool system_rtc_mem_write (uint8 des_addr, const void *src_addr, uint16 save_size)
 
void system_uart_swap (void)
 
void system_uart_de_swap (void)
 
uint16 system_adc_read (void)
 
void system_adc_read_fast (uint16 *adc_addr, uint16 adc_num, uint8 adc_clk_div)
 
uint16 system_get_vdd33 (void)
 
const char * system_get_sdk_version (void)
 
uint8 system_get_boot_version (void)
 
uint32 system_get_userbin_addr (void)
 
uint8 system_get_boot_mode (void)
 
bool system_restart_enhance (uint8 bin_type, uint32 bin_addr)
 
bool system_update_cpu_freq (uint8 freq)
 
uint8 system_get_cpu_freq (void)
 
enum flash_size_map system_get_flash_size_map (void)
 
void system_phy_set_max_tpw (uint8 max_tpw)
 
void system_phy_set_tpw_via_vdd33 (uint16 vdd33)
 
void system_phy_set_rfoption (uint8 option)
 
void system_phy_set_powerup_option (uint8 option)
 
bool system_param_save_with_protect (uint16 start_sec, void *param, uint16 len)
 
bool system_param_load (uint16 start_sec, uint16 offset, void *param, uint16 len)
 
void system_soft_wdt_stop (void)
 
void system_soft_wdt_restart (void)
 
void system_soft_wdt_feed (void)
 
void system_show_malloc (void)
 
uint8 wifi_get_opmode (void)
 
uint8 wifi_get_opmode_default (void)
 
bool wifi_set_opmode (uint8 opmode)
 
bool wifi_set_opmode_current (uint8 opmode)
 
uint8 wifi_get_broadcast_if (void)
 
bool wifi_set_broadcast_if (uint8 interface)
 
bool wifi_station_get_config (struct station_config *config)
 
bool wifi_station_get_config_default (struct station_config *config)
 
bool wifi_station_set_config (struct station_config *config)
 
bool wifi_station_set_config_current (struct station_config *config)
 
bool wifi_station_connect (void)
 
bool wifi_station_disconnect (void)
 
sint8 wifi_station_get_rssi (void)
 
bool wifi_station_scan (struct scan_config *config, scan_done_cb_t cb)
 
uint8 wifi_station_get_auto_connect (void)
 
bool wifi_station_set_auto_connect (uint8 set)
 
bool wifi_station_set_reconnect_policy (bool set)
 
uint8 wifi_station_get_connect_status (void)
 
uint8 wifi_station_get_current_ap_id (void)
 
bool wifi_station_ap_change (uint8 current_ap_id)
 
bool wifi_station_ap_number_set (uint8 ap_number)
 
uint8 wifi_station_get_ap_info (struct station_config config[])
 
bool wifi_station_dhcpc_start (void)
 
bool wifi_station_dhcpc_stop (void)
 
enum dhcp_status wifi_station_dhcpc_status (void)
 
bool wifi_station_dhcpc_set_maxtry (uint8 num)
 
char * wifi_station_get_hostname (void)
 
bool wifi_station_set_hostname (char *name)
 
int wifi_station_set_cert_key (uint8 *client_cert, int client_cert_len, uint8 *private_key, int private_key_len, uint8 *private_key_passwd, int private_key_passwd_len)
 
void wifi_station_clear_cert_key (void)
 
int wifi_station_set_username (uint8 *username, int len)
 
void wifi_station_clear_username (void)
 
bool wifi_softap_get_config (struct softap_config *config)
 
bool wifi_softap_get_config_default (struct softap_config *config)
 
bool wifi_softap_set_config (struct softap_config *config)
 
bool wifi_softap_set_config_current (struct softap_config *config)
 
uint8 wifi_softap_get_station_num (void)
 
struct station_infowifi_softap_get_station_info (void)
 
void wifi_softap_free_station_info (void)
 
bool wifi_softap_dhcps_start (void)
 
bool wifi_softap_dhcps_stop (void)
 
bool wifi_softap_set_dhcps_lease (struct dhcps_lease *please)
 
bool wifi_softap_get_dhcps_lease (struct dhcps_lease *please)
 
uint32 wifi_softap_get_dhcps_lease_time (void)
 
bool wifi_softap_set_dhcps_lease_time (uint32 minute)
 
bool wifi_softap_reset_dhcps_lease_time (void)
 
enum dhcp_status wifi_softap_dhcps_status (void)
 
bool wifi_softap_set_dhcps_offer_option (uint8 level, void *optarg)
 
bool wifi_get_ip_info (uint8 if_index, struct ip_info *info)
 
bool wifi_set_ip_info (uint8 if_index, struct ip_info *info)
 
bool wifi_get_macaddr (uint8 if_index, uint8 *macaddr)
 
bool wifi_set_macaddr (uint8 if_index, uint8 *macaddr)
 
uint8 wifi_get_channel (void)
 
bool wifi_set_channel (uint8 channel)
 
void wifi_status_led_install (uint8 gpio_id, uint32 gpio_name, uint8 gpio_func)
 
void wifi_status_led_uninstall ()
 
void wifi_promiscuous_enable (uint8 promiscuous)
 
void wifi_set_promiscuous_rx_cb (wifi_promiscuous_cb_t cb)
 
void wifi_promiscuous_set_mac (const uint8_t *address)
 
enum phy_mode wifi_get_phy_mode (void)
 
bool wifi_set_phy_mode (enum phy_mode mode)
 
bool wifi_set_sleep_type (enum sleep_type type)
 
enum sleep_type wifi_get_sleep_type (void)
 
void wifi_fpm_open (void)
 
void wifi_fpm_close (void)
 
void wifi_fpm_do_wakeup (void)
 
sint8 wifi_fpm_do_sleep (uint32 sleep_time_in_us)
 
void wifi_fpm_set_sleep_type (enum sleep_type type)
 
enum sleep_type wifi_fpm_get_sleep_type (void)
 
void wifi_fpm_set_wakeup_cb (fpm_wakeup_cb cb)
 
void wifi_fpm_auto_sleep_set_in_null_mode (uint8 req)
 
void wifi_set_event_handler_cb (wifi_event_handler_cb_t cb)
 
bool wifi_wps_enable (WPS_TYPE_t wps_type)
 
bool wifi_wps_disable (void)
 
bool wifi_wps_start (void)
 
bool wifi_set_wps_cb (wps_st_cb_t cb)
 
int wifi_register_send_pkt_freedom_cb (freedom_outside_cb_t cb)
 
void wifi_unregister_send_pkt_freedom_cb (void)
 
int wifi_send_pkt_freedom (uint8 *buf, int len, bool sys_seq)
 
int wifi_rfid_locp_recv_open (void)
 
void wifi_rfid_locp_recv_close (void)
 
int wifi_register_rfid_locp_recv_cb (rfid_locp_cb_t cb)
 
void wifi_unregister_rfid_locp_recv_cb (void)
 
int wifi_set_user_fixed_rate (uint8 enable_mask, uint8 rate)
 
int wifi_get_user_fixed_rate (uint8 *enable_mask, uint8 *rate)
 
int wifi_set_user_sup_rate (uint8 min, uint8 max)
 
bool wifi_set_user_rate_limit (uint8 mode, uint8 ifidx, uint8 max, uint8 min)
 
uint8 wifi_get_user_limit_rate_mask (void)
 
bool wifi_set_user_limit_rate_mask (uint8 enable_mask)
 
bool wifi_set_user_ie (bool enable, uint8 *m_oui, uint8 type, uint8 *user_ie, uint8 len)
 
int wifi_register_user_ie_manufacturer_recv_cb (user_ie_manufacturer_recv_cb_t cb)
 
void wifi_unregister_user_ie_manufacturer_recv_cb (void)
 
void wifi_enable_gpio_wakeup (uint32 i, GPIO_INT_TYPE intr_status)
 
void wifi_disable_gpio_wakeup (void)
 

Macro Definition Documentation

◆ ESP_U32_DIFF

#define ESP_U32_DIFF (   a,
 
)    (((a) >= (b)) ? ((a) - (b)) : (((a) + ((b) ^ 0xFFFFFFFF) + 1)))

Get the absolute difference between 2 u32_t values (correcting overflows) 'a' is expected to be 'higher' (without overflow) than 'b'.

Definition at line 350 of file user_interface.h.

◆ FIXED_RATE_MASK_ALL

#define FIXED_RATE_MASK_ALL   0x03

Definition at line 541 of file user_interface.h.

◆ FIXED_RATE_MASK_AP

#define FIXED_RATE_MASK_AP   0x02

Definition at line 540 of file user_interface.h.

◆ FIXED_RATE_MASK_NONE

#define FIXED_RATE_MASK_NONE   0x00

Definition at line 538 of file user_interface.h.

◆ FIXED_RATE_MASK_STA

#define FIXED_RATE_MASK_STA   0x01

Definition at line 539 of file user_interface.h.

◆ LIMIT_RATE_MASK_ALL

#define LIMIT_RATE_MASK_ALL   0x03

Definition at line 609 of file user_interface.h.

◆ LIMIT_RATE_MASK_AP

#define LIMIT_RATE_MASK_AP   0x02

Definition at line 608 of file user_interface.h.

◆ LIMIT_RATE_MASK_NONE

#define LIMIT_RATE_MASK_NONE   0x00

Definition at line 606 of file user_interface.h.

◆ LIMIT_RATE_MASK_STA

#define LIMIT_RATE_MASK_STA   0x01

Definition at line 607 of file user_interface.h.

◆ MAC2STR

#define MAC2STR (   a)    (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]

Definition at line 41 of file user_interface.h.

Referenced by wifi_handle_event_cb().

◆ MACSTR

#define MACSTR   "%02x:%02x:%02x:%02x:%02x:%02x"

Definition at line 42 of file user_interface.h.

Referenced by wifi_handle_event_cb().

◆ NULL_MODE

#define NULL_MODE   0x00

◆ RC_LIMIT_11B

#define RC_LIMIT_11B   0

Definition at line 599 of file user_interface.h.

◆ RC_LIMIT_11G

#define RC_LIMIT_11G   1

Definition at line 600 of file user_interface.h.

◆ RC_LIMIT_11N

#define RC_LIMIT_11N   2

Definition at line 601 of file user_interface.h.

◆ RC_LIMIT_NUM

#define RC_LIMIT_NUM   5

Definition at line 604 of file user_interface.h.

◆ RC_LIMIT_P2P_11G

#define RC_LIMIT_P2P_11G   3

Definition at line 602 of file user_interface.h.

◆ RC_LIMIT_P2P_11N

#define RC_LIMIT_P2P_11N   4

Definition at line 603 of file user_interface.h.

◆ SOFTAP_IF

#define SOFTAP_IF   0x01

Definition at line 335 of file user_interface.h.

Referenced by add_offer_options(), captdnsRecv(), and wifi_softap_set_dhcps_lease().

◆ SOFTAP_MODE

#define SOFTAP_MODE   0x02

Definition at line 169 of file user_interface.h.

◆ STATION_IF

#define STATION_IF   0x00

Definition at line 334 of file user_interface.h.

◆ STATION_MODE

#define STATION_MODE   0x01

◆ STATIONAP_MODE

#define STATIONAP_MODE   0x03

◆ SYS_BOOT_ENHANCE_MODE

#define SYS_BOOT_ENHANCE_MODE   0

Definition at line 124 of file user_interface.h.

◆ SYS_BOOT_NORMAL_BIN

#define SYS_BOOT_NORMAL_BIN   0

Definition at line 127 of file user_interface.h.

◆ SYS_BOOT_NORMAL_MODE

#define SYS_BOOT_NORMAL_MODE   1

Definition at line 125 of file user_interface.h.

◆ SYS_BOOT_TEST_BIN

#define SYS_BOOT_TEST_BIN   1

Definition at line 128 of file user_interface.h.

◆ SYS_CPU_160MHZ

#define SYS_CPU_160MHZ   160

Definition at line 136 of file user_interface.h.

◆ SYS_CPU_80MHZ

#define SYS_CPU_80MHZ   80

Definition at line 135 of file user_interface.h.

◆ UPGRADE_FW_BIN1

#define UPGRADE_FW_BIN1   0x00

Definition at line 67 of file user_interface.h.

◆ UPGRADE_FW_BIN2

#define UPGRADE_FW_BIN2   0x01

Definition at line 68 of file user_interface.h.

Typedef Documentation

◆ AUTH_MODE

typedef enum _auth_mode AUTH_MODE

◆ fpm_wakeup_cb

typedef void(* fpm_wakeup_cb) (void)

Definition at line 385 of file user_interface.h.

◆ freedom_outside_cb_t

typedef void(* freedom_outside_cb_t) (uint8 status)

Definition at line 515 of file user_interface.h.

◆ init_done_cb_t

typedef void(* init_done_cb_t) (void)

Definition at line 105 of file user_interface.h.

◆ rfid_locp_cb_t

typedef void(* rfid_locp_cb_t) (uint8 *frm, int len, int rssi)

Definition at line 523 of file user_interface.h.

◆ scan_done_cb_t

typedef void(* scan_done_cb_t) (void *arg, STATUS status)

Definition at line 213 of file user_interface.h.

◆ scaninfo

typedef struct _scaninfo scaninfo

◆ System_Event_t

typedef struct _esp_event System_Event_t

◆ user_ie_manufacturer_recv_cb_t

typedef void(* user_ie_manufacturer_recv_cb_t) (uint8 type, const uint8 sa[6], const uint8 m_oui[3], uint8 *ie, uint8 ie_len, int rssi)

Definition at line 624 of file user_interface.h.

◆ wifi_event_handler_cb_t

typedef void(* wifi_event_handler_cb_t) (System_Event_t *event)

Definition at line 489 of file user_interface.h.

◆ wifi_promiscuous_cb_t

typedef void(* wifi_promiscuous_cb_t) (uint8 *buf, uint16 len)

Definition at line 354 of file user_interface.h.

◆ wps_st_cb_t

typedef void(* wps_st_cb_t) (int status)

Definition at line 512 of file user_interface.h.

◆ WPS_TYPE_t

typedef enum wps_type WPS_TYPE_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
USER_TASK_PRIO_0 
USER_TASK_PRIO_1 
USER_TASK_PRIO_2 
USER_TASK_PRIO_MAX 

Definition at line 85 of file user_interface.h.

◆ anonymous enum

anonymous enum
Enumerator
STATION_IDLE 
STATION_CONNECTING 
STATION_WRONG_PASSWORD 
STATION_NO_AP_FOUND 
STATION_CONNECT_FAIL 
STATION_GOT_IP 

Definition at line 247 of file user_interface.h.

◆ anonymous enum

anonymous enum
Enumerator
EVENT_STAMODE_CONNECTED 
EVENT_STAMODE_DISCONNECTED 
EVENT_STAMODE_AUTHMODE_CHANGE 
EVENT_STAMODE_GOT_IP 
EVENT_STAMODE_DHCP_TIMEOUT 
EVENT_SOFTAPMODE_STACONNECTED 
EVENT_SOFTAPMODE_STADISCONNECTED 
EVENT_SOFTAPMODE_PROBEREQRECVED 
EVENT_MAX 

Definition at line 390 of file user_interface.h.

◆ anonymous enum

anonymous enum
Enumerator
REASON_UNSPECIFIED 
REASON_AUTH_EXPIRE 
REASON_AUTH_LEAVE 
REASON_ASSOC_EXPIRE 
REASON_ASSOC_TOOMANY 
REASON_NOT_AUTHED 
REASON_NOT_ASSOCED 
REASON_ASSOC_LEAVE 
REASON_ASSOC_NOT_AUTHED 
REASON_DISASSOC_PWRCAP_BAD 
REASON_DISASSOC_SUPCHAN_BAD 
REASON_IE_INVALID 
REASON_MIC_FAILURE 
REASON_4WAY_HANDSHAKE_TIMEOUT 
REASON_GROUP_KEY_UPDATE_TIMEOUT 
REASON_IE_IN_4WAY_DIFFERS 
REASON_GROUP_CIPHER_INVALID 
REASON_PAIRWISE_CIPHER_INVALID 
REASON_AKMP_INVALID 
REASON_UNSUPP_RSN_IE_VERSION 
REASON_INVALID_RSN_IE_CAP 
REASON_802_1X_AUTH_FAILED 
REASON_CIPHER_SUITE_REJECTED 
REASON_BEACON_TIMEOUT 
REASON_NO_AP_FOUND 
REASON_AUTH_FAIL 
REASON_ASSOC_FAIL 
REASON_HANDSHAKE_TIMEOUT 

Definition at line 402 of file user_interface.h.

402  {
403  REASON_UNSPECIFIED = 1,
404  REASON_AUTH_EXPIRE = 2,
405  REASON_AUTH_LEAVE = 3,
408  REASON_NOT_AUTHED = 6,
409  REASON_NOT_ASSOCED = 7,
410  REASON_ASSOC_LEAVE = 8,
412  REASON_DISASSOC_PWRCAP_BAD = 10, /* 11h */
413  REASON_DISASSOC_SUPCHAN_BAD = 11, /* 11h */
414  REASON_IE_INVALID = 13, /* 11i */
415  REASON_MIC_FAILURE = 14, /* 11i */
416  REASON_4WAY_HANDSHAKE_TIMEOUT = 15, /* 11i */
417  REASON_GROUP_KEY_UPDATE_TIMEOUT = 16, /* 11i */
418  REASON_IE_IN_4WAY_DIFFERS = 17, /* 11i */
419  REASON_GROUP_CIPHER_INVALID = 18, /* 11i */
420  REASON_PAIRWISE_CIPHER_INVALID = 19, /* 11i */
421  REASON_AKMP_INVALID = 20, /* 11i */
422  REASON_UNSUPP_RSN_IE_VERSION = 21, /* 11i */
423  REASON_INVALID_RSN_IE_CAP = 22, /* 11i */
424  REASON_802_1X_AUTH_FAILED = 23, /* 11i */
425  REASON_CIPHER_SUITE_REJECTED = 24, /* 11i */
426 
427  REASON_BEACON_TIMEOUT = 200,
428  REASON_NO_AP_FOUND = 201,
429  REASON_AUTH_FAIL = 202,
430  REASON_ASSOC_FAIL = 203,
432 };

◆ anonymous enum

anonymous enum
Enumerator
USER_IE_BEACON 
USER_IE_PROBE_REQ 
USER_IE_PROBE_RESP 
USER_IE_ASSOC_REQ 
USER_IE_ASSOC_RESP 
USER_IE_MAX 

Definition at line 615 of file user_interface.h.

◆ _auth_mode

enum _auth_mode
Enumerator
AUTH_OPEN 
AUTH_WEP 
AUTH_WPA_PSK 
AUTH_WPA2_PSK 
AUTH_WPA_WPA2_PSK 
AUTH_MAX 

Definition at line 172 of file user_interface.h.

◆ dhcp_status

Enumerator
DHCP_STOPPED 
DHCP_STARTED 

Definition at line 256 of file user_interface.h.

◆ dhcps_offer_option

Enumerator
OFFER_START 
OFFER_ROUTER 
OFFER_END 

Definition at line 312 of file user_interface.h.

312  {
313  OFFER_START = 0x00,
314  OFFER_ROUTER = 0x01,
315  OFFER_END
316 };

◆ FIXED_RATE

enum FIXED_RATE
Enumerator
PHY_RATE_48 
PHY_RATE_24 
PHY_RATE_12 
PHY_RATE_6 
PHY_RATE_54 
PHY_RATE_36 
PHY_RATE_18 
PHY_RATE_9 

Definition at line 527 of file user_interface.h.

527  {
528  PHY_RATE_48 = 0x8,
529  PHY_RATE_24 = 0x9,
530  PHY_RATE_12 = 0xA,
531  PHY_RATE_6 = 0xB,
532  PHY_RATE_54 = 0xC,
533  PHY_RATE_36 = 0xD,
534  PHY_RATE_18 = 0xE,
535  PHY_RATE_9 = 0xF,
536 };

◆ flash_size_map

Enumerator
FLASH_SIZE_4M_MAP_256_256 
FLASH_SIZE_2M 
FLASH_SIZE_8M_MAP_512_512 
FLASH_SIZE_16M_MAP_512_512 
FLASH_SIZE_32M_MAP_512_512 
FLASH_SIZE_16M_MAP_1024_1024 
FLASH_SIZE_32M_MAP_1024_1024 

Definition at line 141 of file user_interface.h.

◆ phy_mode

enum phy_mode
Enumerator
PHY_MODE_11B 
PHY_MODE_11G 
PHY_MODE_11N 

Definition at line 360 of file user_interface.h.

360  {
361  PHY_MODE_11B = 1,
362  PHY_MODE_11G = 2,
363  PHY_MODE_11N = 3
364 };

◆ RATE_11B_ID

Enumerator
RATE_11B_B11M 
RATE_11B_B5M 
RATE_11B_B2M 
RATE_11B_B1M 

Definition at line 563 of file user_interface.h.

◆ RATE_11G_ID

Enumerator
RATE_11G_G54M 
RATE_11G_G48M 
RATE_11G_G36M 
RATE_11G_G24M 
RATE_11G_G18M 
RATE_11G_G12M 
RATE_11G_G9M 
RATE_11G_G6M 
RATE_11G_B5M 
RATE_11G_B2M 
RATE_11G_B1M 

Definition at line 570 of file user_interface.h.

◆ RATE_11N_ID

Enumerator
RATE_11N_MCS7S 
RATE_11N_MCS7 
RATE_11N_MCS6 
RATE_11N_MCS5 
RATE_11N_MCS4 
RATE_11N_MCS3 
RATE_11N_MCS2 
RATE_11N_MCS1 
RATE_11N_MCS0 
RATE_11N_B5M 
RATE_11N_B2M 
RATE_11N_B1M 

Definition at line 584 of file user_interface.h.

◆ rst_reason

enum rst_reason
Enumerator
REASON_DEFAULT_RST 
REASON_WDT_RST 
REASON_EXCEPTION_RST 
REASON_SOFT_WDT_RST 
REASON_SOFT_RESTART 
REASON_DEEP_SLEEP_AWAKE 
REASON_EXT_SYS_RST 

Definition at line 45 of file user_interface.h.

◆ sleep_type

enum sleep_type
Enumerator
NONE_SLEEP_T 
LIGHT_SLEEP_T 
MODEM_SLEEP_T 

Definition at line 369 of file user_interface.h.

◆ support_rate

Enumerator
RATE_11B5M 
RATE_11B11M 
RATE_11B1M 
RATE_11B2M 
RATE_11G6M 
RATE_11G12M 
RATE_11G24M 
RATE_11G48M 
RATE_11G54M 
RATE_11G9M 
RATE_11G18M 
RATE_11G36M 

Definition at line 546 of file user_interface.h.

◆ wps_cb_status

Enumerator
WPS_CB_ST_SUCCESS 
WPS_CB_ST_FAILED 
WPS_CB_ST_TIMEOUT 
WPS_CB_ST_WEP 

Definition at line 501 of file user_interface.h.

◆ wps_type

enum wps_type
Enumerator
WPS_TYPE_DISABLE 
WPS_TYPE_PBC 
WPS_TYPE_PIN 
WPS_TYPE_DISPLAY 
WPS_TYPE_MAX 

Definition at line 493 of file user_interface.h.

Function Documentation

◆ system_adc_read()

uint16 system_adc_read ( void  )

◆ system_adc_read_fast()

void system_adc_read_fast ( uint16 adc_addr,
uint16  adc_num,
uint8  adc_clk_div 
)

◆ system_deep_sleep()

void system_deep_sleep ( uint32  time_in_us)

◆ system_deep_sleep_set_option()

bool system_deep_sleep_set_option ( uint8  option)

◆ system_get_boot_mode()

uint8 system_get_boot_mode ( void  )

◆ system_get_boot_version()

uint8 system_get_boot_version ( void  )

◆ system_get_chip_id()

uint32 system_get_chip_id ( void  )

Referenced by cfg_load().

Here is the caller graph for this function:

◆ system_get_cpu_freq()

uint8 system_get_cpu_freq ( void  )

◆ system_get_flash_size_map()

enum flash_size_map system_get_flash_size_map ( void  )

Referenced by __attribute__().

Here is the caller graph for this function:

◆ system_get_free_heap_size()

uint32 system_get_free_heap_size ( void  )

Referenced by en61107_received_task(), espconn_server_recv(), kmp_received_task(), kmp_request_send(), and parse_msg().

Here is the caller graph for this function:

◆ system_get_os_print()

uint8 system_get_os_print ( )

◆ system_get_rst_info()

struct rst_info* system_get_rst_info ( void  )

◆ system_get_rtc_time()

uint32 system_get_rtc_time ( void  )

◆ system_get_sdk_version()

const char* system_get_sdk_version ( void  )

◆ system_get_time()

uint32 system_get_time ( void  )

◆ system_get_userbin_addr()

uint32 system_get_userbin_addr ( void  )

◆ system_get_vdd33()

uint16 system_get_vdd33 ( void  )

◆ system_init_done_cb()

void system_init_done_cb ( init_done_cb_t  cb)

◆ system_mktime()

uint64 system_mktime ( uint32  year,
uint32  mon,
uint32  day,
uint32  hour,
uint32  min,
uint32  sec 
)

◆ system_os_post()

bool system_os_post ( uint8  prio,
os_signal_t  sig,
os_param_t  par 
)

◆ system_os_task()

bool system_os_task ( os_task_t  task,
uint8  prio,
os_event_t queue,
uint8  qlen 
)

Referenced by en61107_request_init(), kmp_request_init(), and MQTT_InitClient().

Here is the caller graph for this function:

◆ system_param_load()

bool system_param_load ( uint16  start_sec,
uint16  offset,
void *  param,
uint16  len 
)

Referenced by cfg_load().

Here is the caller graph for this function:

◆ system_param_save_with_protect()

bool system_param_save_with_protect ( uint16  start_sec,
void *  param,
uint16  len 
)

Referenced by cfg_save().

Here is the caller graph for this function:

◆ system_phy_set_max_tpw()

void system_phy_set_max_tpw ( uint8  max_tpw)

Referenced by __attribute__().

Here is the caller graph for this function:

◆ system_phy_set_powerup_option()

void system_phy_set_powerup_option ( uint8  option)

◆ system_phy_set_rfoption()

void system_phy_set_rfoption ( uint8  option)

Referenced by __attribute__().

Here is the caller graph for this function:

◆ system_phy_set_tpw_via_vdd33()

void system_phy_set_tpw_via_vdd33 ( uint16  vdd33)

◆ system_print_meminfo()

void system_print_meminfo ( void  )

◆ system_restart()

void system_restart ( void  )

Referenced by cgiWifiSetMode(), resetTimerCb(), and watchdog_timer_func().

Here is the caller graph for this function:

◆ system_restart_enhance()

bool system_restart_enhance ( uint8  bin_type,
uint32  bin_addr 
)

◆ system_restore()

void system_restore ( void  )

◆ system_rtc_clock_cali_proc()

uint32 system_rtc_clock_cali_proc ( void  )

◆ system_rtc_mem_read()

bool system_rtc_mem_read ( uint8  src_addr,
void *  des_addr,
uint16  load_size 
)

◆ system_rtc_mem_write()

bool system_rtc_mem_write ( uint8  des_addr,
const void *  src_addr,
uint16  save_size 
)

◆ system_set_os_print()

void system_set_os_print ( uint8  onoff)

◆ system_show_malloc()

void system_show_malloc ( void  )

◆ system_soft_wdt_feed()

void system_soft_wdt_feed ( void  )

◆ system_soft_wdt_restart()

void system_soft_wdt_restart ( void  )

Referenced by init_aes_hmac_combined().

Here is the caller graph for this function:

◆ system_soft_wdt_stop()

void system_soft_wdt_stop ( void  )

Referenced by init_aes_hmac_combined().

Here is the caller graph for this function:

◆ system_timer_reinit()

void system_timer_reinit ( void  )

◆ system_uart_de_swap()

void system_uart_de_swap ( void  )

◆ system_uart_swap()

void system_uart_swap ( void  )

◆ system_update_cpu_freq()

bool system_update_cpu_freq ( uint8  freq)

◆ system_upgrade_flag_check()

uint8 system_upgrade_flag_check ( )

◆ system_upgrade_flag_set()

void system_upgrade_flag_set ( uint8  flag)

◆ system_upgrade_reboot()

void system_upgrade_reboot ( void  )

◆ system_upgrade_userbin_check()

uint8 system_upgrade_userbin_check ( void  )

◆ wifi_disable_gpio_wakeup()

void wifi_disable_gpio_wakeup ( void  )

◆ wifi_enable_gpio_wakeup()

void wifi_enable_gpio_wakeup ( uint32  i,
GPIO_INT_TYPE  intr_status 
)

◆ wifi_fpm_auto_sleep_set_in_null_mode()

void wifi_fpm_auto_sleep_set_in_null_mode ( uint8  req)

◆ wifi_fpm_close()

void wifi_fpm_close ( void  )

◆ wifi_fpm_do_sleep()

sint8 wifi_fpm_do_sleep ( uint32  sleep_time_in_us)

◆ wifi_fpm_do_wakeup()

void wifi_fpm_do_wakeup ( void  )

◆ wifi_fpm_get_sleep_type()

enum sleep_type wifi_fpm_get_sleep_type ( void  )

◆ wifi_fpm_open()

void wifi_fpm_open ( void  )

◆ wifi_fpm_set_sleep_type()

void wifi_fpm_set_sleep_type ( enum sleep_type  type)

◆ wifi_fpm_set_wakeup_cb()

void wifi_fpm_set_wakeup_cb ( fpm_wakeup_cb  cb)

◆ wifi_get_broadcast_if()

uint8 wifi_get_broadcast_if ( void  )

◆ wifi_get_channel()

uint8 wifi_get_channel ( void  )

◆ wifi_get_ip_info()

bool wifi_get_ip_info ( uint8  if_index,
struct ip_info info 
)

Referenced by add_offer_options(), captdnsRecv(), espconn_connect(), espconn_udp_recv(), and wifi_softap_set_dhcps_lease().

Here is the caller graph for this function:

◆ wifi_get_macaddr()

bool wifi_get_macaddr ( uint8  if_index,
uint8 macaddr 
)

◆ wifi_get_opmode()

uint8 wifi_get_opmode ( void  )

Referenced by espconn_connect(), espconn_udp_recv(), espconn_udp_sendto(), espconn_udp_sent(), tplSetup(), wifi_reconnect_timer_func(), wifi_softap_get_dhcps_lease(), wifi_softap_reset_dhcps_lease_time(), wifi_softap_set_dhcps_lease(), and wifi_softap_set_dhcps_lease_time().

Here is the caller graph for this function:

◆ wifi_get_opmode_default()

uint8 wifi_get_opmode_default ( void  )

◆ wifi_get_phy_mode()

enum phy_mode wifi_get_phy_mode ( void  )

◆ wifi_get_sleep_type()

enum sleep_type wifi_get_sleep_type ( void  )

◆ wifi_get_user_fixed_rate()

int wifi_get_user_fixed_rate ( uint8 enable_mask,
uint8 rate 
)

◆ wifi_get_user_limit_rate_mask()

uint8 wifi_get_user_limit_rate_mask ( void  )

◆ wifi_promiscuous_enable()

void wifi_promiscuous_enable ( uint8  promiscuous)

◆ wifi_promiscuous_set_mac()

void wifi_promiscuous_set_mac ( const uint8_t *  address)

◆ wifi_register_rfid_locp_recv_cb()

int wifi_register_rfid_locp_recv_cb ( rfid_locp_cb_t  cb)

◆ wifi_register_send_pkt_freedom_cb()

int wifi_register_send_pkt_freedom_cb ( freedom_outside_cb_t  cb)

◆ wifi_register_user_ie_manufacturer_recv_cb()

int wifi_register_user_ie_manufacturer_recv_cb ( user_ie_manufacturer_recv_cb_t  cb)

◆ wifi_rfid_locp_recv_close()

void wifi_rfid_locp_recv_close ( void  )

◆ wifi_rfid_locp_recv_open()

int wifi_rfid_locp_recv_open ( void  )

◆ wifi_send_pkt_freedom()

int wifi_send_pkt_freedom ( uint8 buf,
int  len,
bool  sys_seq 
)

◆ wifi_set_broadcast_if()

bool wifi_set_broadcast_if ( uint8  interface)

◆ wifi_set_channel()

bool wifi_set_channel ( uint8  channel)

◆ wifi_set_event_handler_cb()

void wifi_set_event_handler_cb ( wifi_event_handler_cb_t  cb)

Referenced by wifi_connect().

Here is the caller graph for this function:

◆ wifi_set_ip_info()

bool wifi_set_ip_info ( uint8  if_index,
struct ip_info info 
)

Referenced by wifi_softap_ip_config().

Here is the caller graph for this function:

◆ wifi_set_macaddr()

bool wifi_set_macaddr ( uint8  if_index,
uint8 macaddr 
)

◆ wifi_set_opmode()

bool wifi_set_opmode ( uint8  opmode)

Referenced by cgiWifiSetMode().

Here is the caller graph for this function:

◆ wifi_set_opmode_current()

bool wifi_set_opmode_current ( uint8  opmode)

Referenced by watchdog_timer_func(), wifi_connect(), wifi_default(), wifi_fallback(), and wifi_reconnect_timer_func().

Here is the caller graph for this function:

◆ wifi_set_phy_mode()

bool wifi_set_phy_mode ( enum phy_mode  mode)

◆ wifi_set_promiscuous_rx_cb()

void wifi_set_promiscuous_rx_cb ( wifi_promiscuous_cb_t  cb)

◆ wifi_set_sleep_type()

bool wifi_set_sleep_type ( enum sleep_type  type)

◆ wifi_set_user_fixed_rate()

int wifi_set_user_fixed_rate ( uint8  enable_mask,
uint8  rate 
)

◆ wifi_set_user_ie()

bool wifi_set_user_ie ( bool  enable,
uint8 m_oui,
uint8  type,
uint8 user_ie,
uint8  len 
)

◆ wifi_set_user_limit_rate_mask()

bool wifi_set_user_limit_rate_mask ( uint8  enable_mask)

◆ wifi_set_user_rate_limit()

bool wifi_set_user_rate_limit ( uint8  mode,
uint8  ifidx,
uint8  max,
uint8  min 
)

◆ wifi_set_user_sup_rate()

int wifi_set_user_sup_rate ( uint8  min,
uint8  max 
)

◆ wifi_set_wps_cb()

bool wifi_set_wps_cb ( wps_st_cb_t  cb)

◆ wifi_softap_dhcps_start()

bool wifi_softap_dhcps_start ( void  )

Referenced by wifi_softap_ip_config().

Here is the caller graph for this function:

◆ wifi_softap_dhcps_status()

enum dhcp_status wifi_softap_dhcps_status ( void  )

Referenced by wifi_softap_get_dhcps_lease(), wifi_softap_reset_dhcps_lease_time(), wifi_softap_set_dhcps_lease(), wifi_softap_set_dhcps_lease_time(), and wifi_softap_set_dhcps_offer_option().

Here is the caller graph for this function:

◆ wifi_softap_dhcps_stop()

bool wifi_softap_dhcps_stop ( void  )

Referenced by wifi_softap_ip_config().

Here is the caller graph for this function:

◆ wifi_softap_free_station_info()

void wifi_softap_free_station_info ( void  )

◆ wifi_softap_get_config()

bool wifi_softap_get_config ( struct softap_config config)

Referenced by wifi_softap_config().

Here is the caller graph for this function:

◆ wifi_softap_get_config_default()

bool wifi_softap_get_config_default ( struct softap_config config)

◆ wifi_softap_get_dhcps_lease()

bool wifi_softap_get_dhcps_lease ( struct dhcps_lease please)

Definition at line 1007 of file dhcpserver.c.

References ip_addr::addr, DHCP_STOPPED, dhcps_lease::enable, dhcps_lease::end_ip, FALSE, NULL, NULL_MODE, dhcps_lease::start_ip, STATION_MODE, wifi_get_opmode(), and wifi_softap_dhcps_status().

1008 {
1009  uint8 opmode = wifi_get_opmode();
1010 
1011  if (opmode == STATION_MODE || opmode == NULL_MODE) {
1012  return false;
1013  }
1014 
1015  if (NULL == please)
1016  return false;
1017 
1018 // if (dhcps_lease_flag){
1019  if (dhcps_lease.enable == FALSE){
1021  return false;
1022  } else {
1023 // os_bzero(please, sizeof(dhcps_lease));
1024 // if (wifi_softap_dhcps_status() == DHCP_STOPPED){
1025 // please->start_ip.addr = htonl(dhcps_lease.start_ip.addr);
1026 // please->end_ip.addr = htonl(dhcps_lease.end_ip.addr);
1027 // }
1028  }
1029 
1030 // if (wifi_softap_dhcps_status() == DHCP_STARTED){
1031 // os_bzero(please, sizeof(dhcps_lease));
1032 // please->start_ip.addr = dhcps_lease.start_ip.addr;
1033 // please->end_ip.addr = dhcps_lease.end_ip.addr;
1034 // }
1036  please->end_ip.addr = dhcps_lease.end_ip.addr;
1037  return true;
1038 }
#define NULL_MODE
#define NULL
Definition: def.h:47
struct ip_addr end_ip
#define FALSE
Definition: c_types.h:111
uint8 wifi_get_opmode(void)
enum dhcp_status wifi_softap_dhcps_status(void)
unsigned char uint8
Definition: c_types.h:45
struct ip_addr start_ip
#define STATION_MODE
u32_t addr
Definition: ip_addr.h:45
Here is the call graph for this function:

◆ wifi_softap_get_dhcps_lease_time()

uint32 wifi_softap_get_dhcps_lease_time ( void  )

Definition at line 1150 of file dhcpserver.c.

References dhcps_lease_time.

1151 {
1152  return dhcps_lease_time;
1153 }
uint32 dhcps_lease_time
Definition: dhcpserver.c:38

◆ wifi_softap_get_station_info()

struct station_info* wifi_softap_get_station_info ( void  )

◆ wifi_softap_get_station_num()

uint8 wifi_softap_get_station_num ( void  )

◆ wifi_softap_reset_dhcps_lease_time()

bool wifi_softap_reset_dhcps_lease_time ( void  )

Definition at line 1135 of file dhcpserver.c.

References DHCP_STARTED, dhcps_lease_time, DHCPS_LEASE_TIME_DEF, NULL_MODE, STATION_MODE, wifi_get_opmode(), and wifi_softap_dhcps_status().

1136 {
1137  uint8 opmode = wifi_get_opmode();
1138 
1139  if (opmode == STATION_MODE || opmode == NULL_MODE) {
1140  return false;
1141  }
1142 
1144  return false;
1145  }
1147  return true;
1148 }
#define NULL_MODE
uint8 wifi_get_opmode(void)
enum dhcp_status wifi_softap_dhcps_status(void)
unsigned char uint8
Definition: c_types.h:45
#define DHCPS_LEASE_TIME_DEF
Definition: dhcpserver.c:37
#define STATION_MODE
uint32 dhcps_lease_time
Definition: dhcpserver.c:38
Here is the call graph for this function:

◆ wifi_softap_set_config()

bool wifi_softap_set_config ( struct softap_config config)

Referenced by wifi_softap_config().

Here is the caller graph for this function:

◆ wifi_softap_set_config_current()

bool wifi_softap_set_config_current ( struct softap_config config)

◆ wifi_softap_set_dhcps_lease()

bool wifi_softap_set_dhcps_lease ( struct dhcps_lease please)

Definition at line 952 of file dhcpserver.c.

References ip_addr::addr, DHCP_STARTED, DHCPS_MAX_LEASE, dhcps_lease::enable, dhcps_lease::end_ip, htonl, ip_info::ip, NULL, NULL_MODE, os_bzero, SOFTAP_IF, dhcps_lease::start_ip, STATION_MODE, wifi_get_ip_info(), wifi_get_opmode(), and wifi_softap_dhcps_status().

Referenced by wifi_softap_ip_config().

953 {
954  struct ip_info info;
955  uint32 softap_ip = 0;
956  uint32 start_ip = 0;
957  uint32 end_ip = 0;
958 
959  uint8 opmode = wifi_get_opmode();
960 
961  if (opmode == STATION_MODE || opmode == NULL_MODE) {
962  return false;
963  }
964 
965  if (please == NULL || wifi_softap_dhcps_status() == DHCP_STARTED)
966  return false;
967 
968  if(please->enable) {
969  os_bzero(&info, sizeof(struct ip_info));
970  wifi_get_ip_info(SOFTAP_IF, &info);
971  softap_ip = htonl(info.ip.addr);
972  start_ip = htonl(please->start_ip.addr);
973  end_ip = htonl(please->end_ip.addr);
974 
975  /*config ip information can't contain local ip*/
976  if ((start_ip <= softap_ip) && (softap_ip <= end_ip))
977  return false;
978 
979  /*config ip information must be in the same segment as the local ip*/
980  softap_ip >>= 8;
981  if ((start_ip >> 8 != softap_ip)
982  || (end_ip >> 8 != softap_ip)) {
983  return false;
984  }
985 
986  if (end_ip - start_ip > DHCPS_MAX_LEASE)
987  return false;
988 
989  os_bzero(&dhcps_lease, sizeof(dhcps_lease));
990 // dhcps_lease.start_ip.addr = start_ip;
991 // dhcps_lease.end_ip.addr = end_ip;
993  dhcps_lease.end_ip.addr = please->end_ip.addr;
994  }
995  dhcps_lease.enable = please->enable;
996 // dhcps_lease_flag = false;
997  return true;
998 }
#define SOFTAP_IF
#define NULL_MODE
#define NULL
Definition: def.h:47
struct ip_addr end_ip
bool wifi_get_ip_info(uint8 if_index, struct ip_info *info)
uint8 wifi_get_opmode(void)
enum dhcp_status wifi_softap_dhcps_status(void)
unsigned char uint8
Definition: c_types.h:45
unsigned int uint32
Definition: c_types.h:54
struct ip_addr start_ip
#define STATION_MODE
#define DHCPS_MAX_LEASE
Definition: dhcpserver.h:52
#define os_bzero
Definition: osapi.h:31
u32_t addr
Definition: ip_addr.h:45
#define htonl(x)
Definition: def.h:83
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wifi_softap_set_dhcps_lease_time()

bool wifi_softap_set_dhcps_lease_time ( uint32  minute)

Definition at line 1116 of file dhcpserver.c.

References DHCP_STARTED, dhcps_lease_time, NULL_MODE, STATION_MODE, wifi_get_opmode(), and wifi_softap_dhcps_status().

1117 {
1118  uint8 opmode = wifi_get_opmode();
1119 
1120  if (opmode == STATION_MODE || opmode == NULL_MODE) {
1121  return false;
1122  }
1123 
1125  return false;
1126  }
1127 
1128  if(minute == 0) {
1129  return false;
1130  }
1131  dhcps_lease_time = minute;
1132  return true;
1133 }
#define NULL_MODE
uint8 wifi_get_opmode(void)
enum dhcp_status wifi_softap_dhcps_status(void)
unsigned char uint8
Definition: c_types.h:45
#define STATION_MODE
uint32 dhcps_lease_time
Definition: dhcpserver.c:38
Here is the call graph for this function:

◆ wifi_softap_set_dhcps_offer_option()

bool wifi_softap_set_dhcps_offer_option ( uint8  level,
void *  optarg 
)

Definition at line 1094 of file dhcpserver.c.

References NULL, offer, OFFER_END, OFFER_ROUTER, and wifi_softap_dhcps_status().

1095 {
1096  bool offer_flag = true;
1097  uint8 option = 0;
1098  if (optarg == NULL && wifi_softap_dhcps_status() == false)
1099  return false;
1100 
1101  if (level <= OFFER_START || level >= OFFER_END)
1102  return false;
1103 
1104  switch (level){
1105  case OFFER_ROUTER:
1106  offer = (*(uint8 *)optarg) & 0x01;
1107  offer_flag = true;
1108  break;
1109  default :
1110  offer_flag = false;
1111  break;
1112  }
1113  return offer_flag;
1114 }
#define NULL
Definition: def.h:47
enum dhcp_status wifi_softap_dhcps_status(void)
unsigned char uint8
Definition: c_types.h:45
static uint8 offer
Definition: dhcpserver.c:35
Here is the call graph for this function:

◆ wifi_station_ap_change()

bool wifi_station_ap_change ( uint8  current_ap_id)

◆ wifi_station_ap_number_set()

bool wifi_station_ap_number_set ( uint8  ap_number)

◆ wifi_station_clear_cert_key()

void wifi_station_clear_cert_key ( void  )

◆ wifi_station_clear_username()

void wifi_station_clear_username ( void  )

◆ wifi_station_connect()

bool wifi_station_connect ( void  )

Referenced by wifi_connect(), wifi_default(), wifi_fallback(), wifi_handle_event_cb(), and wifi_reconnect_timer_func().

Here is the caller graph for this function:

◆ wifi_station_dhcpc_set_maxtry()

bool wifi_station_dhcpc_set_maxtry ( uint8  num)

◆ wifi_station_dhcpc_start()

bool wifi_station_dhcpc_start ( void  )

◆ wifi_station_dhcpc_status()

enum dhcp_status wifi_station_dhcpc_status ( void  )

◆ wifi_station_dhcpc_stop()

bool wifi_station_dhcpc_stop ( void  )

◆ wifi_station_disconnect()

bool wifi_station_disconnect ( void  )

Referenced by watchdog_timer_func(), wifi_connect(), wifi_default(), and wifi_fallback().

Here is the caller graph for this function:

◆ wifi_station_get_ap_info()

uint8 wifi_station_get_ap_info ( struct station_config  config[])

◆ wifi_station_get_auto_connect()

uint8 wifi_station_get_auto_connect ( void  )

◆ wifi_station_get_config()

bool wifi_station_get_config ( struct station_config config)

Referenced by wifi_default(), wifi_fallback(), and wifi_handle_event_cb().

Here is the caller graph for this function:

◆ wifi_station_get_config_default()

bool wifi_station_get_config_default ( struct station_config config)

◆ wifi_station_get_connect_status()

uint8 wifi_station_get_connect_status ( void  )

Referenced by espconn_connect(), wifi_handle_event_cb(), and wifi_scan_done_cb().

Here is the caller graph for this function:

◆ wifi_station_get_current_ap_id()

uint8 wifi_station_get_current_ap_id ( void  )

◆ wifi_station_get_hostname()

char* wifi_station_get_hostname ( void  )

◆ wifi_station_get_rssi()

sint8 wifi_station_get_rssi ( void  )

Referenced by wifi_get_rssi_timer_func().

Here is the caller graph for this function:

◆ wifi_station_scan()

bool wifi_station_scan ( struct scan_config config,
scan_done_cb_t  cb 
)

Referenced by wifi_scan_timer_func(), and wifiStartScan().

Here is the caller graph for this function:

◆ wifi_station_set_auto_connect()

bool wifi_station_set_auto_connect ( uint8  set)

Referenced by wifi_handle_event_cb().

Here is the caller graph for this function:

◆ wifi_station_set_cert_key()

int wifi_station_set_cert_key ( uint8 client_cert,
int  client_cert_len,
uint8 private_key,
int  private_key_len,
uint8 private_key_passwd,
int  private_key_passwd_len 
)

◆ wifi_station_set_config()

bool wifi_station_set_config ( struct station_config config)

Referenced by wifi_connect().

Here is the caller graph for this function:

◆ wifi_station_set_config_current()

bool wifi_station_set_config_current ( struct station_config config)

Referenced by wifi_default(), and wifi_fallback().

Here is the caller graph for this function:

◆ wifi_station_set_hostname()

bool wifi_station_set_hostname ( char *  name)

◆ wifi_station_set_reconnect_policy()

bool wifi_station_set_reconnect_policy ( bool  set)

◆ wifi_station_set_username()

int wifi_station_set_username ( uint8 username,
int  len 
)

◆ wifi_status_led_install()

void wifi_status_led_install ( uint8  gpio_id,
uint32  gpio_name,
uint8  gpio_func 
)

◆ wifi_status_led_uninstall()

void wifi_status_led_uninstall ( )

◆ wifi_unregister_rfid_locp_recv_cb()

void wifi_unregister_rfid_locp_recv_cb ( void  )

◆ wifi_unregister_send_pkt_freedom_cb()

void wifi_unregister_send_pkt_freedom_cb ( void  )

◆ wifi_unregister_user_ie_manufacturer_recv_cb()

void wifi_unregister_user_ie_manufacturer_recv_cb ( void  )

◆ wifi_wps_disable()

bool wifi_wps_disable ( void  )

◆ wifi_wps_enable()

bool wifi_wps_enable ( WPS_TYPE_t  wps_type)

◆ wifi_wps_start()

bool wifi_wps_start ( void  )