欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 1961|回復: 1
打印 上一主題 下一主題
收起左側

ESP8266掃描周圍WiFi源程序

[復制鏈接]
跳轉到指定樓層
樓主
ESP8266掃描周圍WiFi的APP


源程序如下:
  1. #include "scanwifi.h"
  2. #include "ets_sys.h"
  3. #include "os_type.h"
  4. #include "osapi.h"
  5. #include "mem.h"
  6. #include "user_interface.h"
  7. #include "gpio.h"
  8. #include "uart.h"
  9. /******************************************************************************
  10. *此區域為編輯區,請需要添加設計的請到此區域編輯!
  11. *******************************************************************************/
  12. at_recvTask(){}//此函數在所有工程中只能創建一次,可插入任意地方
  13. /******************************************************************************/
  14. struct scan_config *scanwifi;
  15. static void ICACHE_FLASH_ATTR
  16. scan_done(void *arg, STATUS status) {
  17. uint8 ssid[33];char temp[128];   
  18. if (status == OK) {
  19.      struct bss_info *bss_link = (struct bss_info *)arg;
  20.     while (bss_link != NULL)
  21.     {os_memset(ssid, 0, 33);
  22.       if (os_strlen(bss_link->ssid) <= 32)
  23.       {os_memcpy(ssid, bss_link->ssid, os_strlen(bss_link->ssid));}
  24.       else
  25.       {os_memcpy(ssid, bss_link->ssid, 32);}
  26.       os_sprintf(temp,"ssid:\"%s\",authmode:%d,通道:%d,mac:\""MACSTR"\",信號:%d\r\n",ssid,bss_link->authmode,bss_link->channel,MAC2STR(bss_link->bssid),bss_link->rssi);
  27.       uart0_sendStr(temp);
  28.       bss_link = bss_link->next.stqe_next; }}
  29. }
  30. void ICACHE_FLASH_ATTR
  31. scanssid(){  //掃描SSID調用函數
  32. wifi_station_scan(scanwifi,scan_done);
  33. }
  34. /******************************************************************************/


  35. /******************************************************************************/
  36. os_timer_t  cyctimer;
  37. void ICACHE_FLASH_ATTR
  38. //時鐘周期處理函數
  39. cyctimer_exe(void)
  40. {



  41. scanssid();


  42. }
  43. //時鐘周期處理函數結尾
  44. void ICACHE_FLASH_ATTR
  45. cyctimer_stop(void) //停止時鐘
  46. {
  47. os_timer_disarm (&cyctimer) ;
  48. }

  49. void ICACHE_FLASH_ATTR
  50. cyctimer_star(void) //啟用時鐘
  51. {
  52. os_timer_setfn(&cyctimer, (os_timer_func_t *)cyctimer_exe, NULL);
  53. os_timer_arm(&cyctimer,10000,1);
  54. }
  55. /******************************************************************************/

  56. /******************************************************************************
  57. *編輯區結尾,下面是唯一個子程序,也叫接口程序,請不要動其位置!
  58. *******************************************************************************/
  59. void ICACHE_FLASH_ATTR
  60. scanwifi_init(void)
  61. {

  62. cyctimer_star();



  63. }
復制代碼

所有資料51hei提供下載:
掃描周圍wifi.rar (870.39 KB, 下載次數: 19)

評分

參與人數 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎勵!

查看全部評分

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏5 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:352458 發表于 2020-4-1 22:36 | 只看該作者
感謝分享
回復

使用道具 舉報

無效樓層,該帖已經被刪除
您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表