/* hfupdate.h * * Copyright (C) 2017 ShangHai High-flying Electronics Technology Co.,Ltd. * * This file is part of HSF. * */ #ifndef _HF_WIFI_H_ #define _HF_WIFI_H_ #define DEBUG_WIFI DEBUG_LEVEL_LOW #define AUTH_TYPE_OPEN 0 #define AUTH_TYPE_SHARED 1 #define AUTH_TYPE_WPAPSK 2 #define AUTH_TYPE_WPA2PSK 3 #define AUTH_TYPE_WPAPSKWPA2PSK 4 #define AUTH_TYPE_WPAENT 5 #define AUTH_TYPE_WPA3SAE 6 #define AUTH_TYPE_WPA2PSKWPA3SAE 7 #define ENC_TYPE_NONE 0 #define ENC_TYPE_WEP 1 #define ENC_TYPE_TKIP 2 #define ENC_TYPE_AES 3 #define ENC_TYPE_TKIPAES 4 #define ENC_TYPE_CCMP 5 #define ENC_TYPE_INVALID 255 #define WIFI_MODE_AP 0 #define WIFI_MODE_STA 1 #define WIFI_MODE_APSTA 2 #define WIFI_MODE_NOSTART 0xFF #define WIFI_STATE_UNINIT 0 #define WIFI_STATE_START 1 #define WIFI_STATE_STOPPING 2 #define WIFI_STATE_STOPPED 3 #define MAX_WIFI_SCAN_RESULT 50 typedef struct { char ssid[65]; uint8_t mac[20]; char enc[25]; char channl; int sco; int rssi; }ScanResult_t; typedef struct _WIFI_SCAN_RESULT_ITEM { uint8_t auth; uint8_t encry; uint8_t channel; uint8_t rssi; char ssid[32+1]; uint8_t mac[6]; int rssi_dbm; int sco; }WIFI_SCAN_RESULT_ITEM,*PWIFI_SCAN_RESULT_ITEM; enum { HFWIFI_SCAN_EXIT=0, HFWIFI_SCANING=1 }; typedef int (*hfwifi_scan_callback_ex_t)(PWIFI_SCAN_RESULT_ITEM,void*); void wifi_auto_connect(void* arg); void product_wifi_thread(void* arg); int HSF_API hfwifi_transform_rssi(int rssi_dbm); int HSF_API hfwifi_scan_ex(hfwifi_scan_callback_ex_t p_callback, void *ctx, unsigned char ch, unsigned char scan_time); int HSF_API hfwifi_sta_get_current_rssi(int *dBm); int HSF_API hf_get_wifi_state(void); void HSF_API hf_set_wifi_state(int state); #endif