Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2301_76519099
rt-thread
提交
77ce9148
R
rt-thread
项目概览
2301_76519099
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
3
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
77ce9148
编写于
7月 26, 2019
作者:
还_没_想_好
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[components][drivers][wlan] 修复自动连接 32 密码长度失败的问题,增强代码稳定性
上级
767ea2ab
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
10 deletion
+27
-10
components/drivers/wlan/wlan_cmd.c
components/drivers/wlan/wlan_cmd.c
+4
-0
components/drivers/wlan/wlan_lwip.c
components/drivers/wlan/wlan_lwip.c
+22
-9
components/drivers/wlan/wlan_mgnt.c
components/drivers/wlan/wlan_mgnt.c
+1
-1
未找到文件。
components/drivers/wlan/wlan_cmd.c
浏览文件 @
77ce9148
...
...
@@ -468,6 +468,10 @@ static int wifi_debug_set_mode(int argc, char *argv[])
{
mode
=
RT_WLAN_AP
;
}
else
if
(
rt_strcmp
(
"none"
,
argv
[
1
])
==
0
)
{
mode
=
RT_WLAN_NONE
;
}
else
return
-
1
;
...
...
components/drivers/wlan/wlan_lwip.c
浏览文件 @
77ce9148
...
...
@@ -56,12 +56,16 @@ static void netif_is_ready(struct rt_work *work, void *parameter)
ip_addr_t
ip_addr_zero
=
{
0
};
struct
rt_wlan_device
*
wlan
=
parameter
;
struct
lwip_prot_des
*
lwip_prot
=
(
struct
lwip_prot_des
*
)
wlan
->
prot
;
struct
eth_device
*
eth_dev
=
&
lwip_prot
->
eth
;
struct
eth_device
*
eth_dev
;
rt_base_t
level
;
struct
rt_wlan_buff
buff
;
rt_uint32_t
ip_addr
[
4
];
char
str
[
IPADDR_STRLEN_MAX
];
if
(
lwip_prot
==
RT_NULL
)
return
;
eth_dev
=
&
lwip_prot
->
eth
;
rt_timer_stop
(
&
lwip_prot
->
timer
);
if
(
ip_addr_cmp
(
&
(
eth_dev
->
netif
->
ip_addr
),
&
ip_addr_zero
)
!=
0
)
{
...
...
@@ -122,9 +126,13 @@ static void timer_callback(void *parameter)
struct
rt_workqueue
*
workqueue
;
struct
rt_wlan_device
*
wlan
=
parameter
;
struct
lwip_prot_des
*
lwip_prot
=
(
struct
lwip_prot_des
*
)
wlan
->
prot
;
struct
rt_work
*
work
=
&
lwip_prot
->
work
;
struct
rt_work
*
work
;
rt_base_t
level
;
if
(
lwip_prot
==
RT_NULL
)
return
;
work
=
&
lwip_prot
->
work
;
workqueue
=
rt_wlan_get_workqueue
();
if
(
workqueue
!=
RT_NULL
)
{
...
...
@@ -148,7 +156,12 @@ static void netif_set_connected(void *parameter)
{
struct
rt_wlan_device
*
wlan
=
parameter
;
struct
lwip_prot_des
*
lwip_prot
=
wlan
->
prot
;
struct
eth_device
*
eth_dev
=
&
lwip_prot
->
eth
;
struct
eth_device
*
eth_dev
;
if
(
lwip_prot
==
RT_NULL
)
return
;
eth_dev
=
&
lwip_prot
->
eth
;
if
(
lwip_prot
->
connected_flag
)
{
...
...
@@ -209,6 +222,9 @@ static void rt_wlan_lwip_event_handle(struct rt_wlan_prot *port, struct rt_wlan_
struct
lwip_prot_des
*
lwip_prot
=
(
struct
lwip_prot_des
*
)
wlan
->
prot
;
rt_bool_t
flag_old
;
if
(
lwip_prot
==
RT_NULL
)
return
;
flag_old
=
lwip_prot
->
connected_flag
;
switch
(
event
)
...
...
@@ -472,12 +488,9 @@ static struct rt_wlan_prot *rt_wlan_lwip_protocol_register(struct rt_wlan_prot *
return
RT_NULL
;
}
rt_memcpy
(
&
lwip_prot
->
prot
,
prot
,
sizeof
(
struct
rt_wlan_prot
));
if
(
wlan
->
mode
==
RT_WLAN_STATION
)
{
rt_sprintf
(
timer_name
,
"timer_%s"
,
eth_name
);
rt_timer_init
(
&
lwip_prot
->
timer
,
timer_name
,
timer_callback
,
wlan
,
rt_tick_from_millisecond
(
1000
),
RT_TIMER_FLAG_SOFT_TIMER
|
RT_TIMER_FLAG_ONE_SHOT
);
}
rt_sprintf
(
timer_name
,
"timer_%s"
,
eth_name
);
rt_timer_init
(
&
lwip_prot
->
timer
,
timer_name
,
timer_callback
,
wlan
,
rt_tick_from_millisecond
(
1000
),
RT_TIMER_FLAG_SOFT_TIMER
|
RT_TIMER_FLAG_ONE_SHOT
);
netif_set_up
(
eth
->
netif
);
LOG_I
(
"eth device init ok name:%s"
,
eth_name
);
#ifdef RT_USING_NETDEV
...
...
components/drivers/wlan/wlan_mgnt.c
浏览文件 @
77ce9148
...
...
@@ -528,7 +528,7 @@ static void rt_wlan_auto_connect_run(struct rt_work *work, void *parameter)
if
(
id
>=
rt_wlan_cfg_get_num
())
id
=
0
;
if
((
cfg_info
.
key
.
len
>
0
)
&&
(
cfg_info
.
key
.
len
<
RT_WLAN_PASSWORD_MAX_LENGTH
))
if
((
cfg_info
.
key
.
len
>
0
)
&&
(
cfg_info
.
key
.
len
<
=
RT_WLAN_PASSWORD_MAX_LENGTH
))
{
cfg_info
.
key
.
val
[
cfg_info
.
key
.
len
]
=
'\0'
;
password
=
(
char
*
)(
&
cfg_info
.
key
.
val
[
0
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录