Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re860_factory
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
waterword
re860_factory
Commits
c93b03fb
Commit
c93b03fb
authored
Sep 28, 2025
by
lyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:更换wifi测试方案
parent
ea58ae9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
53 deletions
+47
-53
factoryTest_plugin/factory_autoFactoryTest.js
factoryTest_plugin/factory_autoFactoryTest.js
+19
-16
factoryTest_plugin/factory_autoFactoryTestUtil.js
factoryTest_plugin/factory_autoFactoryTestUtil.js
+28
-37
No files found.
factoryTest_plugin/factory_autoFactoryTest.js
View file @
c93b03fb
...
...
@@ -67,22 +67,25 @@ function doVersion(fd) {
}
function
doDutStart
(
fd
,
recvBuf
)
{
console
.
log
(
"
doDutStart
"
);
if
(
doDutStart
.
_scanTimerOut
===
undefined
)
{
doDutStart
.
_scanTimerOut
=
null
;
}
if
(
doDutStart
.
_scanTimerOut
!=
null
)
{
clearTimeout
(
doDutStart
.
_scanTimerOut
);
doDutStart
.
_scanTimerOut
=
null
;
}
autoUtil
.
startWifiScan
();
autoUtil
.
AnalyzeATSearchSsid
(
recvBuf
);
send
(
fd
,
'
+OK
'
);
autoUtil
.
setSsid
(
recvBuf
);
doDutStart
.
_scanTimerOut
=
setTimeout
(
function
()
{
send
(
fd
,
'
+OK
'
);
},
5000
);
}
function
doScan
(
fd
)
{
var
value
=
autoUtil
.
getWifiScan
()
||
""
;
// if (value != "null") {
// var value = "01,name:Midea_test,rssi:-43,mac:02-b1-f7-70-1d-a2;02,name:HUAWEI_B311_A736,rssi:-41,mac:42-53-0f-36-a7-3d;03,name:MIDEA_B311_A74E,rssi:-47,mac:02-8e-97-4e-a7-3d;"
// 02,name:HUAWEI_B311_A736,rssi:-41,mac:42-53-0f-36-a7-3d;03,name:MIDEA_B311_A74E,rssi:-47,mac:02-8e-97-4e-a7-3d;04,name:360\xe5\x85\x8d\xe8\xb4\xb9WiFi-8A,rssi:-39,mac:b2-95-9d-82-0b-28;05,name:HUAWEI-888,rssi:-48,mac:22-7e-45-7e-03-a4"
// 06,name:\x00\x00\x00\x00\x00\x00\x00\x00,rssi:-52,mac:b4-86-55-1e-e9-2d;07,name:BYT_HS,rssi:-48,mac:30-89-d3-2f-a5-a3;08,name:\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00,rssi:-50,mac:fc-60-9b-7a-8e-50;09,name:Midea_test,rssi:-49,mac:8e-21-70-c1-69-c8;10,name:HUAWEI-0E1G4D,rssi:-51,mac:d4-8f-a2-42-26-90;"
var
scanList
=
"
+
"
+
value
;
// console.log("scanList: " + scanList);
send
(
fd
,
scanList
);
// }
function
doScan
(
fd
,
recvBuf
)
{
var
chekssid
=
autoUtil
.
getssid
()
var
value
=
autoUtil
.
getWifiScan
(
chekssid
);
// if (value != "null") {
var
scanList
=
"
+
"
+
value
;
send
(
fd
,
scanList
);
}
function
doOtg
(
fd
)
{
if
(
autoUtil
.
checkUsbDeviceExist
()
==
true
)
{
...
...
@@ -131,8 +134,8 @@ function doGetCrc(fd) {
function
doEnd
(
fd
)
{
send
(
fd
,
'
+OK
'
);
autoUtil
.
exitAutoFactoryPage
();
exitAutoFactory
();
//
autoUtil.exitAutoFactoryPage();
//
exitAutoFactory();
}
function
doWriteMac
(
fd
,
recvBuf
)
{
...
...
@@ -318,7 +321,7 @@ function getCountdownStatus() {
}
function
send
(
fd
,
cmd
)
{
var
cmdBuf
=
cmd
+
"
\r\
r\n\
n
"
;
var
cmdBuf
=
cmd
+
"
\r\n
"
;
var
len
=
cmdBuf
.
length
;
// 返回 8
console
.
log
(
"
!!TX:
"
+
cmdBuf
+
"
(len):
"
+
cmdBuf
.
length
);
return
uart
.
uart_send
(
fd
,
cmdBuf
,
len
);
...
...
factoryTest_plugin/factory_autoFactoryTestUtil.js
View file @
c93b03fb
...
...
@@ -8,7 +8,7 @@ var handleSNDataBinFile = require("handleSNDataBinFile.js");
var
router
=
require
(
"
@system.router
"
);
var
bglight
=
require
(
"
bglight.js
"
);
var
envTemp
=
require
(
"
environmentTemperature.js
"
);
var
resultsWifiList
=
"
null
"
;
var
resultsWifiList
=
[]
;
var
SECURE_APP_PATH
=
"
/mnt/app/eOpteeCtrl
"
var
that
;
var
scanFlag
=
true
;
...
...
@@ -46,7 +46,7 @@ function checkUsbDeviceExist() {
// /sys/devices/platform/soc@3000000/4200000.ehci1-controller/usb1/1-1doOtg
var
usbPath
=
"
/sys/devices/platform/soc@3000000/4200000.ehci1-controller/usb1/1-1
"
var
ret
=
devExist
(
usbPath
);
// console.log("checkUsbDeviceExist ret: " + ret)
// console.log("checkUsbDeviceExist ret: " + ret)
if
(
devExist
(
usbPath
))
return
true
return
false
;
}
...
...
@@ -100,46 +100,36 @@ function startWifiScan() {
}
var
checkSsidName
=
"
null
"
function
getCheckSsid
()
{
return
checkSsidName
function
setSsid
(
value
)
{
checkSsidName
=
value
}
function
setCheckSsid
(
value
)
{
checkSsidName
=
valu
e
;
function
getssid
(
)
{
return
checkSsidNam
e
;
}
function
AnalyzeATSearchSsid
(
value
)
{
// AT+DUT_START=Midea_test\r\r\n\n
let
line
=
value
;
/* 1. 只有出现 \r 或 \n 时才去删,否则保持原样 */
if
(
/
(?:\r
|
\n)
/
.
test
(
line
))
{
line
=
line
.
replace
(
/
[\r\n]
/g
,
''
);
}
/* 2. 取 SSID */
if
(
!
value
)
return
''
;
// 1. 只取第一行
const
firstLine
=
value
.
split
(
/
[\r\n]
/
)[
0
];
// 2. 去掉首尾不可见字符
const
line
=
firstLine
.
replace
(
/
[^\x
20-
\x
7E
]
/g
,
''
).
trim
();
const
prefix
=
'
AT+DUT_START=
'
;
const
idx
=
line
.
indexOf
(
prefix
);
if
(
idx
===
-
1
)
return
;
// 格式不对直接放弃
const
ssid
=
line
.
slice
(
idx
+
prefix
.
length
).
trim
();
setCheckSsid
(
ssid
);
if
(
idx
===
-
1
)
return
''
;
return
line
.
slice
(
idx
+
prefix
.
length
).
trim
();
}
function
getWifiScan
()
{
// console.log("getWifiScan")
if
(
resultsWifiList
==
"
null
"
||
resultsWifiList
.
length
==
0
)
return
"
null
"
;
// console.log("getWifiScan--------2")
function
getWifiScan
(
value
)
{
if
(
!
Array
.
isArray
(
resultsWifiList
)
||
resultsWifiList
.
length
<
1
)
return
"
FAIL
"
;
var
result
=
JSON
.
stringify
(
resultsWifiList
);
console
.
log
(
result
)
// var rel = resultsWifiList.map(ap => `${ap.idx},name:${ap.name},rssi:${ap.rssi},mac:${ap.mac}`)
// .join(';');
// console.log("!getWifiScan:"+ rel)
// return rel;
const
first
=
resultsWifiList
.
find
(
ap
=>
ap
.
name
==
getCheckSsid
());
if
(
first
)
{
/* 只要 01 号这一条 */
return
`01,name:
${
first
.
name
}
,rssi:
${
first
.
rssi
}
,mac:
${
first
.
mac
}
`
;
console
.
log
(
"
getWifiScan
"
+
result
)
console
.
log
(
"
value:
"
+
value
)
var
ssid
=
AnalyzeATSearchSsid
(
value
);
console
.
log
(
"
check ssid :
"
+
ssid
+
"
------
"
)
var
found
=
resultsWifiList
.
find
(
ap
=>
ap
.
name
==
ssid
);
if
(
found
)
{
return
`name:
${
found
.
name
}
,rssi:
${
found
.
rssi
}
,mac:
${
found
.
mac
}
`
;
}
else
{
return
"
FAIL
"
;
...
...
@@ -495,6 +485,7 @@ module.exports = {
initUartPWM
:
initUartPWM
,
devExist
:
devExist
,
checkUsbDeviceExist
:
checkUsbDeviceExist
,
AnalyzeATSearchSsid
:
AnalyzeATSearchSsid
,
getRtcTimer
:
getRtcTimer
getRtcTimer
:
getRtcTimer
,
setSsid
:
setSsid
,
getssid
:
getssid
}
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