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
1591ab36
Commit
1591ab36
authored
Oct 20, 2025
by
lyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加lcd返回tp版本号
parent
7eef828e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
3 deletions
+70
-3
factoryTest_plugin/factory_autoFactoryTest.js
factoryTest_plugin/factory_autoFactoryTest.js
+3
-1
factoryTest_plugin/factory_autoFactoryTestUtil.js
factoryTest_plugin/factory_autoFactoryTestUtil.js
+67
-2
No files found.
factoryTest_plugin/factory_autoFactoryTest.js
View file @
1591ab36
...
...
@@ -140,7 +140,9 @@ function doLcd(fd) {
autoUtil
.
initUI
();
autoUtil
.
setAutoModeUI
(
"
LCD
"
);
// autoUtil.ledTimerOut();
send
(
fd
,
'
+OK
'
);
var
tpId
=
"
+
"
+
autoUtil
.
getTPVersion
()
send
(
fd
,
tpId
);
}
...
...
factoryTest_plugin/factory_autoFactoryTestUtil.js
View file @
1591ab36
...
...
@@ -784,7 +784,71 @@ function calculateSumChecksum(dataString) {
return
"
0X00
"
;
// 或返回错误码/None
}
}
function
getTPVersion
()
{
var
versionVal
=
getTPVersionNew
();
console
.
log
(
"
getTPVersion 1:
"
+
versionVal
);
if
(
versionVal
==
"
FAIL
"
)
{
versionVal
=
getTPVersionOld
();
console
.
log
(
"
getTPVersion 2:
"
+
versionVal
);
}
return
versionVal
;
}
function
getTPVersionNew
()
{
// 执行系统命令,将设备信息保存到临时文件
var
checkVersionPath
=
"
../../../../..
"
+
"
/sys/devices/platform/soc@3000000/2502800.twi/i2c-2/2-0055/stinform
"
;
console
.
log
(
"
checkVersionPath:
"
+
checkVersionPath
);
if
(
!
fs
.
exists
(
checkVersionPath
))
{
return
"
FAIL
"
;
}
system
(
"
cat
"
+
checkVersionPath
+
"
> /tmp/tp_version1.txt
"
);
// 读取临时文件内容
const
infoStr
=
fs
.
read
(
"
/tmp/tp_version1.txt
"
,
"
r
"
);
if
(
infoStr
)
{
// 按行分割文件内容
const
infoLines
=
infoStr
.
split
(
'
\n
'
);
for
(
let
i
=
0
;
i
<
infoLines
.
length
;
i
++
)
{
const
line
=
infoLines
[
i
].
trim
();
// 检查是否包含 "FW Version" 信息
if
(
line
.
startsWith
(
"
FW Version
"
))
{
// 提取版本号
const
version
=
line
.
split
(
'
=
'
)[
1
].
trim
();
// 转换为10进制
const
decimalValue
=
parseInt
(
version
,
16
);
return
decimalValue
.
toString
();
}
}
}
return
"
FAIL
"
;
// 如果未找到版本信息,返回 "NG"
}
function
getTPVersionOld
()
{
// 执行系统命令,将设备信息保存到临时文件
var
checkVersionPath
=
"
../../../../..
"
+
"
/proc/gt1x_debug
"
;
console
.
log
(
"
checkVersionPath:
"
+
checkVersionPath
);
if
(
!
fs
.
exists
(
checkVersionPath
))
{
return
"
FAIL
"
;
}
console
.
log
(
"
getTPVersion 1
"
);
system
(
"
cat
"
+
checkVersionPath
+
"
> /tmp/gt1x_debug.txt
"
);
// 读取临时文件内容
const
debugStr
=
fs
.
read
(
"
/tmp/gt1x_debug.txt
"
,
"
r
"
);
if
(
debugStr
)
{
// 按行分割文件内容
const
debugLines
=
debugStr
.
split
(
'
\n
'
);
for
(
let
i
=
0
;
i
<
debugLines
.
length
;
i
++
)
{
const
line
=
debugLines
[
i
].
trim
();
// 检查是否包含有效数据
if
(
line
.
startsWith
(
"
0x
"
))
{
// 提取第一个值
const
firstValue
=
line
.
split
(
'
,
'
)[
0
].
trim
();
const
decimalValue
=
parseInt
(
firstValue
,
16
);
return
decimalValue
.
toString
();
}
}
}
return
"
FAIL
"
;
// 如果未找到有效数据,返回 "NG"
}
function
system
(
cmd
)
{
systemCtrl
.
executeSystemCommand
(
cmd
)
...
...
@@ -826,5 +890,6 @@ module.exports = {
getHostid
:
getHostid
,
readHostIdData
:
readHostIdData
,
gotoWriteHostIdData
:
gotoWriteHostIdData
,
verifyHostIDChecksum
:
verifyHostIDChecksum
verifyHostIDChecksum
:
verifyHostIDChecksum
,
getTPVersion
:
getTPVersion
}
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