首页 > 其他 > 详细

ESP8266学习笔记3:建立自定义的softAP

时间:2015-07-09 16:17:13      阅读:489      评论:0      收藏:0      [点我收藏+]

刚才在乐鑫官网看到了配置AP的例程,于是做了第一次代码修改尝试。DEMO虽然也支持额外配置,但商用的时候厂家们估计都想烧完程序,AP就直接展示自己的信息吧。

官网例程连接:http://bbs.espressif.com/viewtopic.php?f=21&t=227&sid=352ff16f67ee80289e08145c0a5f281b

转载请注明:http://write.blog.csdn.net/postedit/46816277


1.函数如下,就修改了SSID。

/******************************************************************************
 * FunctionName : user_set_softap_config
 * Description  : set SSID and password of ESP8266 softAP
 * Parameters   : none
 * Returns      : none
*******************************************************************************/
void ICACHE_FLASH_ATTR
user_set_softap_config(void)
{
   struct softap_config config;

   wifi_softap_get_config(&config); // Get config first.
   
   os_memset(config.ssid, 0, 32);
   os_memset(config.password, 0, 64);
   os_memcpy(config.ssid, "DD_GO", 7);
   os_memcpy(config.password, "12345678", 8);
   config.authmode = AUTH_WPA_WPA2_PSK;
   config.ssid_len = 0;// or its actual length
   config.max_connection = 4; // how many stations can connect to ESP8266 softAP at most.

   wifi_softap_set_config(&config);// Set ESP8266 softap config .
   
}

2.在user_esp_platform_init(void)中进行调用。


3.make download reboot.................

技术分享


版权声明:本文为博主原创文章,未经博主允许不得转载。

ESP8266学习笔记3:建立自定义的softAP

原文:http://blog.csdn.net/sadshen/article/details/46816277

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!