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
25754d9e
Commit
25754d9e
authored
Oct 17, 2025
by
lyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:增加自动化RTC写入
parent
c6c06710
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
5 deletions
+44
-5
factoryTest_plugin/factory_autoFactoryTest.js
factoryTest_plugin/factory_autoFactoryTest.js
+19
-1
factoryTest_plugin/factory_autoFactoryTestUtil.js
factoryTest_plugin/factory_autoFactoryTestUtil.js
+25
-4
No files found.
factoryTest_plugin/factory_autoFactoryTest.js
View file @
25754d9e
...
...
@@ -29,6 +29,7 @@ const cmdTable = [
{
kw
:
'
GET_CRC
'
,
fn
:
doGetCrc
},
{
kw
:
'
TEST_END
'
,
fn
:
doEnd
},
{
kw
:
'
RTC
'
,
fn
:
doGetRtc
},
{
kw
:
'
WRITE_RTC
'
,
fn
:
doSetRtc
},
];
const
cmdTableHex
=
[
{
kw
:
'
57524954455F4C4943
'
,
fn
:
doWriteLic
},
//WRITE_LIC
...
...
@@ -62,6 +63,23 @@ function doGetRtc(fd) {
console
.
log
(
'
RTC:
'
+
time
);
send
(
fd
,
time
);
}
function
doSetRtc
(
fd
,
recvBuf
)
{
console
.
log
(
"
doSetRtc
"
+
recvBuf
);
autoUtil
.
setRtc
(
recvBuf
);
if
(
doSetRtc
.
_rtcTimerOut
===
undefined
)
{
doSetRtc
.
_rtcTimerOut
=
null
;
}
if
(
doSetRtc
.
_rtcTimerOut
!=
null
)
{
clearTimeout
(
doSetRtc
.
_rtcTimerOut
);
doSetRtc
.
_rtcTimerOut
=
null
;
}
doSetRtc
.
_rtcTimerOut
=
setTimeout
(
function
()
{
send
(
fd
,
'
+OK
'
);
},
500
);
}
function
doVersion
(
fd
)
{
var
version
=
"
+
"
+
userData
.
softwareVersion
...
...
@@ -165,7 +183,7 @@ function doEnd(fd) {
function
doWriteMac
(
fd
,
recvBuf
)
{
// const mac = recvBuf.split('=')[1].trim();
console
.
log
(
'
write mac:
'
+
mac
);
send
(
fd
,
'
+
OK
'
);
send
(
fd
,
'
+
FAIL
'
);
}
function
doWriteSn
(
fd
,
recvBuf
)
{
const
sn
=
recvBuf
.
split
(
'
=
'
)[
1
].
trim
();
...
...
factoryTest_plugin/factory_autoFactoryTestUtil.js
View file @
25754d9e
...
...
@@ -233,8 +233,8 @@ function getTempHum() {
function
writeLic
(
hexStr
)
{
var
filePath1
=
"
/tmp/operation_license
"
;
// var filePath2 = "/tmp/sn_data.bin";
const
SECURE_APP_PATH
=
"
/mnt/app/eOpteeCtrl
"
// var filePath2 = "/tmp/sn_data.bin";
//
const SECURE_APP_PATH = "/mnt/app/eOpteeCtrl"
console
.
log
(
'
Full license written:
'
+
hexStr
);
...
...
@@ -247,7 +247,7 @@ function writeLic(hexStr) {
}
system
(
"
sync
"
);
system
(
SECURE_APP_PATH
+
"
-b
"
+
filePath1
);
// handleSNDataBinFile.writeInnerSNDataToBinFile(lic)
system
(
"
cp /tmp/operation_license /mnt/userdataA/files/
"
);
system
(
"
/mnt/app/eMideaSetMac
"
);
...
...
@@ -594,6 +594,26 @@ function getMacAddressFromLicenseFile() {
return
"
FAIL
"
;
}
function
setRtc
(
iso
)
{
console
.
log
(
"
setRtc:
"
+
iso
);
// const iso = "1999-10-03 19:50:00";
// 一次性解析
const
[
datePart
,
timePart
]
=
iso
.
split
(
'
'
);
const
[
year
,
month
,
day
]
=
datePart
.
split
(
'
-
'
).
map
(
Number
);
const
[
hour
,
minute
,
sec
]
=
timePart
.
split
(
'
:
'
).
map
(
Number
);
console
.
log
(
"
!!-----
"
+
year
+
"
,
"
+
month
+
"
,
"
+
day
+
"
,
"
+
hour
+
"
,
"
+
minute
+
"
,
"
+
sec
);
// 写入 RTC
var
librtc
=
require
(
"
rtc.js
"
);
librtc
.
ctrl
(
"
set
"
,
{
year
:
year
,
month
:
month
,
day
:
day
,
hour
:
hour
,
minute
:
minute
,
second
:
sec
// 这里用解析出来的秒(示例 00)
});
}
function
system
(
cmd
)
{
systemCtrl
.
executeSystemCommand
(
cmd
)
}
...
...
@@ -629,5 +649,6 @@ module.exports = {
initautoFactorySetting
:
initautoFactorySetting
,
getWifiInfo
:
getWifiInfo
,
gotoWriteLic
:
gotoWriteLic
,
getMacAddressFromLicenseFile
:
getMacAddressFromLicenseFile
getMacAddressFromLicenseFile
:
getMacAddressFromLicenseFile
,
setRtc
:
setRtc
}
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