Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
21228117
Unverified
Commit
21228117
authored
Jun 03, 2024
by
Me No Dev
Committed by
GitHub
Jun 03, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(scan): Allow setting scan timeout in milliseconds (#9738)
parent
58e61efa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
libraries/WiFi/src/WiFiScan.cpp
libraries/WiFi/src/WiFiScan.cpp
+6
-3
libraries/WiFi/src/WiFiScan.h
libraries/WiFi/src/WiFiScan.h
+2
-0
No files found.
libraries/WiFi/src/WiFiScan.cpp
View file @
21228117
...
...
@@ -44,10 +44,14 @@ extern "C" {
bool
WiFiScanClass
::
_scanAsync
=
false
;
uint32_t
WiFiScanClass
::
_scanStarted
=
0
;
uint32_t
WiFiScanClass
::
_scanTimeout
=
1
0000
;
uint32_t
WiFiScanClass
::
_scanTimeout
=
6
0000
;
uint16_t
WiFiScanClass
::
_scanCount
=
0
;
void
*
WiFiScanClass
::
_scanResult
=
0
;
void
WiFiScanClass
::
setScanTimeout
(
uint32_t
ms
)
{
WiFiScanClass
::
_scanTimeout
=
ms
;
}
/**
* Start scan WiFi networks available
* @param async run in async mode
...
...
@@ -60,7 +64,6 @@ int16_t
return
WIFI_SCAN_RUNNING
;
}
WiFiScanClass
::
_scanTimeout
=
max_ms_per_chan
*
20
;
WiFiScanClass
::
_scanAsync
=
async
;
WiFi
.
enableSTA
(
true
);
...
...
@@ -92,7 +95,7 @@ int16_t
if
(
WiFiScanClass
::
_scanAsync
)
{
return
WIFI_SCAN_RUNNING
;
}
if
(
WiFiGenericClass
::
waitStatusBits
(
WIFI_SCAN_DONE_BIT
,
10000
))
{
if
(
WiFiGenericClass
::
waitStatusBits
(
WIFI_SCAN_DONE_BIT
,
_scanTimeout
))
{
return
(
int16_t
)
WiFiScanClass
::
_scanCount
;
}
}
...
...
libraries/WiFi/src/WiFiScan.h
View file @
21228117
...
...
@@ -31,6 +31,8 @@
class
WiFiScanClass
{
public:
void
setScanTimeout
(
uint32_t
ms
);
int16_t
scanNetworks
(
bool
async
=
false
,
bool
show_hidden
=
false
,
bool
passive
=
false
,
uint32_t
max_ms_per_chan
=
300
,
uint8_t
channel
=
0
,
const
char
*
ssid
=
nullptr
,
const
uint8_t
*
bssid
=
nullptr
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment