打印
[STM32]

立创商城ATK_ESP8266模块atk_8266_wifiap_test函数讲解

[复制链接]
2047|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
小乐Tzz|  楼主 | 2018-8-15 10:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
atk_8266_wifiap_test函数
作用:ATK-ESP8266 WIFI AP 测试函数

/***********************************************************/
//ATK-ESP8266 WIFI AP 测试
//用于测试TCP/UDP 连接
//返回值:0,正常
//其他,错误代码
u8 atk_8266_wifiap_test(void)
{
  u8 netpro=0;        //网络模式
  u8 key;
  u8 timex=0;   
  u8 ipbuf[16];         //IP 缓存
  u8 *p;
  u16 t=999;        //加速第一次获取链接状态
  u8 res=0;
  u16 rlen=0;
  u8 constate=0;                       //连接状态
  p=mymalloc(SRAMIN,32);              //申请 32字节内存
  ……………                            //省略部分代码
  return res;
}
/***********************************************************/

以上代码,我们省略了大部分与串口 STA 模式类似的代码,仅列出了关键区别代码其中 AT+CWSAP 指令的参数:wifiap_ssid,wifiap_encryption,wifiap_password 等是在common.c里面定义的字符串,如下:

/***********************************************************/
//WIFI AP 模式,模块对外的无线参数,可自行修改.
const u8* wifiap_ssid="ATK-ESP8266";      //对外 SSID 号
const u8* wifiap_encryption="wpawpa2_aes";    //wpa/wpa2 aes加密方式
const u8* wifiap_password="12345678";        //连接密码
/***********************************************************/

以上配置,设置模块的对外无线参数,其中 SSID 为:ATK-ESP8266;加密方式为:WPA/WPA2_AES;密码为:12345678
整个代码实现了对模块串口无线 AP(COM-WIFI AP)模式各个子模式的测试(TCP 服务器、TCP 客户端、UDP)。这里,该函数根据不同的子模式,按照1.1.2节的3 个表格里面的指令来对模块进行配置,从而实现子模式配置。对于客户端模式,还会要求输入远端IP 地址,此时,可以通过触摸屏输入远端IP
剩下的处理,同串口 STA(COM-STA)模式的处理方式



相关帖子

沙发
zha1n| | 2018-8-16 23:34 | 只看该作者
顶个  过来点各赞​,kmkdpks.wikidot.com/,gy0851-sogou.wikidot.com/nav:side/,hhht0471-360.wikidot.com/talk:undefined/,whkdpks6.wikidot.com/,syfp.ccedisp.com/,szkzp0755.114my.cn/,shsklwp.wikidot.com/,cqskwfpi.wikidot.com/,ty0351p-360.wikidot.com/talk:undefined,cdppks028.wikidot.com/,syppks024p.wikidot.com/,fevvc6u.ccedisp.com/,jicai7057.114my.cn/,xn0971p-360.wikidot.com/,dalianppks.wikidot.com/,qdlianpps.wikidot.com/,xm0592p-360.wikidot.com/nav:side/,jnlianpps.wikidot.com/,tuizhuan.114my.cn/,gz020fp44w.wikidot.com/,nc0791p-360.wikidot.com/talk:undefined/,sz0755fplla.wikidot.com/,hcpnl.ccedisp.com/,dg0769fp6a.wikidot.com/,nuoshun5.114my.cn/,lzfp0931tp.wikidot.com/,bj010fpu8.wikidot.com/,hebfp0451ww.wikidot.com/,csfp0731ww.wikidot.com/,hk0898p-360.wikidot.com/,jl0432p-360.wikidot.com/,gfdg9fdg89.ccedip.com/,gy0851-sogou.wikidot.com/talk:undefined/,nb0574p-360.wikidot.com/,nj025p-baidu.wikidot.com/,sz0512p-baidu.wikidot.com/,wx0510p-baidu.wikidot.com/,yunqiang01.114my.cn/,hz0571p-baidu.wikidot.com/,nb0574p-baidu.wikidot.com/,xinwei9.114my.cn,ty0351p-360.wikidot.com/main:about,wz0577p-baidu.wikidot.com/,cc0431p-baidu.wikidot.com/,zhizhi25.114my.cn/,jl0432p-baidu.wikidot.com/,jufang439.114my.cn/,sjz0311p-baidu.wikidot.com/,ty0351p-baidu.wikidot.com/,taoshi3248.114my.cn/,xn0971p-baidu.wikidot.com/,hk0898p-baidu.wikidot.com/,szfp.ccedisp.com/,nn0771p-baidu.wikidot.com/,xm0592p-360.wikidot.com/talk:undefined/,xa029p-baidu.wikidot.com/,hhht0471-baidu.wikidot.com/,zz0371p-360.wikidot.com/nav:side/,bt0472p-baidu.wikidot.com/,bt0472p-360.wikidot.com/main:about/,nc0791p-baidu.wikidot.com/,nn0771p-360.wikidot.com/,hhht0471-360.wikidot.com/main:about/,fz0591p-baidu.wikidot.com/,whfp.ccedisp.com/,xa029p-360.wikidot.com/talk:undefined/,xm0592p-baidu.wikidot.com/,zz0371p-baidu.wikidot.com/,xa029p-360.wikidot.com/main:about/,tj022p-baidu.wikidot.com/,hf0511p-baidu.wikidot.com/,zz0371p-360.wikidot.com/nav:side/,hfw0511r-baidu.wikidot.com/,heb0451-360.wikidot.com/,wh027p-360.wikidot.com/,zz0371p-360.wikidot.com/talk:undefined/,sh021kp-360.wikidot.com/,bt0472p-360.wikidot.com/talk:undefined/,cq23kp-360.wikidot.com/,lacai35.qqzyw.com/,tj022p-360.wikidot.com/,muba3324.114my.cn/,nc0791p-360.wikidot.com/main:about/,cd028kp-360.wikidot.com/,gyfp.ccedisp.com/,sy024p-360.wikidot.com/,youhuan8.qqzyw.com/,zz0371p-360.wikidot.com/talk:undefined/,dalian0411-360.wikidot.com/,qdlian0532-360.wikidot.com/,nn0771p-360.wikidot.com/talk:undefined,jnlian0531-360.wikidot.com/,gz020-360.wikidot.com/,sz0755p-360.wikidot.com/,dg0769-360.wikidot.com/,fz0591p-360.wikidot.com/talk:undefined/,lzfp0931p-360.wikidot.com/,bj010-360.wikidot.com/,kaopai675.114my.cn/,km0851p-360.wikidot.com/,csfp0731-360.wikidot.com/,nj025p-360.wikidot.com/,sz0512p-360.wikidot.com/,shfp.ccedisp.com/,xn0971p-360.wikidot.com/talk:undefined,wx0510p-360.wikidot.com/,hz0571p-360.wikidot.com/,bjfp.ccedisp.com/,wz0577p-360.wikidot.com/,cc0431p-360.wikidot.com/,hfdkufpiao.wikidot.com/,shijian6.114my.cn/,sjz0311p-360.wikidot.com/,ty0351p-360.wikidot.com/,fz0591p-360.wikidot.com/nav:side/,sz0755-sogou.wikidot.com/nav:side/,sz0755-sogou.wikidot.com/talk:undefined/,sh021-sogou.wikidot.com/nav:side/,sh021-sogou.wikidot.com/talk:undefined/,gzfp020.ccedisp.com/,cq023-sogou.wikidot.com/nav:side/,cq023-sogou.wikidot.com/talk:undefined/,gz020-sogou.wikidot.com/nav:side/,gz020-sogou.wikidot.com/talk:undefined/,dg0769-sogou.wikidot.com/nav:side/,dg0769-sogou.wikidot.com/talk:undefined/,bj020-sogou.wikidot.com/nav:side/,shu1616142.114my.cn/,bj020-sogou.wikidot.com/talk:undefined/,km0871-sogou.wikidot.com/nav:side/,km0871-sogou.wikidot.com/talk:undefined/,xa028-sogou.wikidot.com/nav:side/,xa028-sogou.wikidot.com/talk:undefined/,dgslk0769.ccedisp.com/,nn0771-sogou.wikidot.com/nav:side/,shkfp021.cn.vlongbiz.com,nn0771-sogou.wikidot.com/talk:undefined/,xm0592-sogou.wikidot.com/nav:side/,zz00p.ccedisp.com/,xm0592-sogou.wikidot.com/talk:undefined/,zz0371-sogou.wikidot.com/nav:side/,zz0371-sogou.wikidot.com/talk:undefined/,jinghuai4.114my.cn/,cd028-sogou.wikidot.com/nav:side/,cd028-sogou.wikidot.com/talk:undefined/,hf0551-sogou.wikidot.com/nav:side/,hf0551-sogou.wikidot.com/talk:undefined/,hcpl65.ccedisp.com/,jn0531-sogou.wikidot.com/nav:side/,jn0531-sogou.wikidot.com/talk:undefined/,fdg987fgf.ccedip.com/,wh027-sogou.wikidot.com/nav:side/,wh027-sogou.wikidot.com/talk:undefined/,nj025-sogou.wikidot.com/nav:side/,zzt67r.ccedisp.com/,nj025-sogou.wikidot.com/talk:undefined/,qd0532-sogou.wikidot.com/nav:side/,zhanhuan94.114my.cn/,qd0532-sogou.wikidot.com/talk:undefined/,nb0574-sogou.wikidot.com/nav:side/,nb0574-sogou.wikidot.com/talk:undefined/,szjyp-360.wikidot.com/,szjyp0755-360.wikidot.com/,dgjyp0769-360.wikidot.com/,gzjyp020-360.wikidot.com/,shjyp021-360.wikidot.com/,sh-sogou.wikidot.com/,zzkfpw.wikidot.com/,njkfpw-025.wikidot.com/,jnkfpw-0531.wikidot.com/,wh027dji.wikidot.com/,hcpdq.wikidot.com/,hcpddqe5.wikidot.com/,hc6hgdd2.wikidot.com/,hcpbaox.wikidot.com/,bjhcd55d.wikidot.com/,bjhcd66d.wikidot.com/,szhc7ud.wikidot.com/,gzfjps3.wikidot.com/,syhcd7gh.wikidot.com/,gyhcd6hh.wikidot.com/,cshch55g.wikidot.com/,njhcdr99j.wikidot.com/,whhcd5f.wikidot.com/,kmhcd6hf.wikidot.com/,cdhchgd.wikidot.com/,jnhcdrfh.wikidot.com/

使用特权

评论回复
板凳
yulin3192| | 2018-11-17 21:31 | 只看该作者
完整的代码在哪里下载

使用特权

评论回复
地板
aa12355| | 2019-10-29 21:30 | 只看该作者
shanghaihs.ccedpw.com
hangzhou.ccedpw.com
chunguang.ccedpw.com
kemei075.51baohumo.com
hh112.ccedpw.com
gz111.51baohumo.com
gz332.51baohumo.com
sr12.51baohumo.com
tongl1.ecppn.com
ff8877.ecppn.com
ghq123.ecppn.com
ssz128.ecppn.com
shanghai021kfp.wikidot.com
shanghaipp.jimdofree.com
gzkff.51baohumo.com
gykff.51baohumo.com
fskff.51baohumo.com
kmkff.51baohumo.com
xakff.51baohumo.com
whkff.51baohumo.com
cskff.51baohumo.com

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

70

主题

70

帖子

0

粉丝