Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
20130d19
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
20130d19
编写于
7月 25, 2019
作者:
B
Bernard Xiong
提交者:
GitHub
7月 25, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2894 from enkiller/wlan
[components][drivers][wlan] 自动连接周期可配置,可指定扫描通道
上级
7278bcb5
6fbc7494
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
7 deletion
+21
-7
components/drivers/Kconfig
components/drivers/Kconfig
+6
-0
components/drivers/wlan/wlan_dev.c
components/drivers/wlan/wlan_dev.c
+10
-2
components/drivers/wlan/wlan_mgnt.c
components/drivers/wlan/wlan_mgnt.c
+1
-5
components/drivers/wlan/wlan_mgnt.h
components/drivers/wlan/wlan_mgnt.h
+4
-0
未找到文件。
components/drivers/Kconfig
浏览文件 @
20130d19
...
...
@@ -471,6 +471,12 @@ menuconfig RT_USING_WIFI
select RT_WLAN_CFG_ENABLE
select RT_WLAN_WORK_THREAD_ENABLE
default y
if RT_WLAN_AUTO_CONNECT_ENABLE
config AUTO_CONNECTION_PERIOD_MS
int "Auto connect period(ms)"
default 2000
endif
endif
config RT_WLAN_CFG_ENABLE
...
...
components/drivers/wlan/wlan_dev.c
浏览文件 @
20130d19
...
...
@@ -535,8 +535,16 @@ rt_err_t rt_wlan_dev_scan(struct rt_wlan_device *device, struct rt_wlan_info *in
}
rt_memcpy
(
&
scan_info
.
ssid
,
&
info
->
ssid
,
sizeof
(
rt_wlan_ssid_t
));
rt_memcpy
(
scan_info
.
bssid
,
info
->
bssid
,
RT_WLAN_BSSID_MAX_LENGTH
);
scan_info
.
channel_min
=
-
1
;
scan_info
.
channel_max
=
-
1
;
if
(
info
->
channel
>
0
)
{
scan_info
.
channel_min
=
info
->
channel
;
scan_info
.
channel_max
=
info
->
channel
;
}
else
{
scan_info
.
channel_min
=
-
1
;
scan_info
.
channel_max
=
-
1
;
}
p_scan_info
=
&
scan_info
;
}
result
=
rt_device_control
(
RT_DEVICE
(
device
),
RT_WLAN_CMD_SCAN
,
p_scan_info
);
...
...
components/drivers/wlan/wlan_mgnt.c
浏览文件 @
20130d19
...
...
@@ -58,10 +58,6 @@
#define TIME_START()
#endif
#ifndef DISCONNECT_RESPONSE_MS
#define DISCONNECT_RESPONSE_MS (2000)
#endif
#if RT_WLAN_EBOX_NUM < 1
#error "event box num Too few"
#endif
...
...
@@ -2020,7 +2016,7 @@ int rt_wlan_init(void)
rt_mutex_init
(
&
complete_mutex
,
"complete"
,
RT_IPC_FLAG_FIFO
);
#ifdef RT_WLAN_AUTO_CONNECT_ENABLE
rt_timer_init
(
&
reconnect_time
,
"wifi_tim"
,
rt_wlan_cyclic_check
,
RT_NULL
,
rt_tick_from_millisecond
(
DISCONNECT_RESPONSE
_MS
),
rt_tick_from_millisecond
(
AUTO_CONNECTION_PERIOD
_MS
),
RT_TIMER_FLAG_PERIODIC
|
RT_TIMER_FLAG_SOFT_TIMER
);
#endif
_init_flag
=
1
;
...
...
components/drivers/wlan/wlan_mgnt.h
浏览文件 @
20130d19
...
...
@@ -41,6 +41,10 @@ extern "C" {
#define RT_WLAN_SCAN_RETRY_CNT (3)
#endif
#ifndef AUTO_CONNECTION_PERIOD_MS
#define AUTO_CONNECTION_PERIOD_MS (2000)
#endif
/*state fot station*/
#define RT_WLAN_STATE_CONNECT (1UL << 0)
#define RT_WLAN_STATE_CONNECTING (1UL << 1)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录