|
u16 server_connect_status_value=0x0000; //WIFI状态
u16read_add_array[0]=0x00;
u16read_add_array[1]=0x5A;
sys_write_vp(0x04B0,"CMCC-wuchao",sizeof("CMCC-wuchao")/2);//WIFI 名称
sys_write_vp(0x04C0,"wuchao123456",sizeof("wuchao123456")/2);//WIFI密码
while(1)
{
sys_read_vp(0x4A2,(u8*)&server_connect_status_value,1);//判断wifi状态重连,这里可以优化下用定时器不用在while1里一直判断占用处理器
if ((server_connect_status_value & 0xff) == 0x00) {//00未连接
sys_write_vp(0x498,read_add_array,1);
}
else if ((server_connect_status_value & 0xff) == 0x0f) {//0f连接失败
sys_write_vp(0x498,(u8*)&read_add_array,1);
}else{
}
}
参考了这代码,编译后烧录,还是会被清空。
wifi-20版本号:107V1
|
|