Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
ce2313d2
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
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看板
未验证
提交
ce2313d2
编写于
10月 18, 2018
作者:
B
Bernard Xiong
提交者:
GitHub
10月 18, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1906 from enkiller/wlan-dev
[components][wlan] 修复某些情况下模式初始化两遍的bug
上级
29b49f46
1e0e221d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
5 deletion
+10
-5
components/drivers/wlan/wlan_mgnt.c
components/drivers/wlan/wlan_mgnt.c
+10
-5
未找到文件。
components/drivers/wlan/wlan_mgnt.c
浏览文件 @
ce2313d2
...
...
@@ -495,7 +495,7 @@ static void rt_wlan_event_dispatch(struct rt_wlan_device *device, rt_wlan_dev_ev
{
user_buff
=
*
buff
;
}
/*
事件处理
*/
/*
Event Handle
*/
switch
(
event
)
{
case
RT_WLAN_DEV_EVT_CONNECT
:
...
...
@@ -737,9 +737,12 @@ rt_err_t rt_wlan_set_mode(const char *dev_name, rt_wlan_mode_t mode)
RT_WLAN_LOG_E
(
"not find device, set mode failed! name:%s"
,
dev_name
);
return
-
RT_EIO
;
}
MGNT_LOCK
();
if
(
RT_WLAN_DEVICE
(
device
)
->
mode
==
mode
)
{
RT_WLAN_LOG_D
(
"L:%d this device mode is set"
);
MGNT_UNLOCK
();
return
RT_EOK
;
}
...
...
@@ -747,19 +750,21 @@ rt_err_t rt_wlan_set_mode(const char *dev_name, rt_wlan_mode_t mode)
(
RT_WLAN_DEVICE
(
device
)
->
flags
&
RT_WLAN_FLAG_AP_ONLY
))
{
RT_WLAN_LOG_I
(
"this device ap mode only"
);
MGNT_UNLOCK
();
return
-
RT_ERROR
;
}
else
if
((
mode
==
RT_WLAN_AP
)
&&
(
RT_WLAN_DEVICE
(
device
)
->
flags
&
RT_WLAN_FLAG_STA_ONLY
))
{
RT_WLAN_LOG_I
(
"this device sta mode only"
);
MGNT_UNLOCK
();
return
-
RT_ERROR
;
}
/*
* device == sta and change to ap, should deinit
* device == ap and change to sta, should deinit
*/
MGNT_LOCK
();
if
(((
mode
==
RT_WLAN_STATION
)
&&
(
RT_WLAN_DEVICE
(
device
)
==
AP_DEVICE
()))
||
((
mode
==
RT_WLAN_AP
)
&&
(
RT_WLAN_DEVICE
(
device
)
==
STA_DEVICE
())))
{
...
...
@@ -1627,12 +1632,12 @@ struct rt_wlan_scan_result *rt_wlan_scan_with_info(struct rt_wlan_info *info)
return
&
scan_result
;
}
/* run sc
na
*/
/* run sc
an
*/
err
=
rt_wlan_dev_scan
(
STA_DEVICE
(),
info
);
if
(
err
!=
RT_EOK
)
{
rt_wlan_complete_delete
(
complete
);
RT_WLAN_LOG_E
(
"sc
na
sync fail"
);
RT_WLAN_LOG_E
(
"sc
an
sync fail"
);
MGNT_UNLOCK
();
return
RT_NULL
;
}
...
...
@@ -1646,7 +1651,7 @@ struct rt_wlan_scan_result *rt_wlan_scan_with_info(struct rt_wlan_info *info)
set
=
0x1
<<
RT_WLAN_DEV_EVT_SCAN_DONE
;
if
(
!
(
recved
&
set
))
{
RT_WLAN_LOG_E
(
"sc
na
wait timeout!"
);
RT_WLAN_LOG_E
(
"sc
an
wait timeout!"
);
MGNT_UNLOCK
();
return
&
scan_result
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录