Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jensen
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Skye Yu
jensen
Commits
660d5803
Commit
660d5803
authored
Aug 23, 2024
by
Skye Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添åå½ 添加录音测试api
parent
5a815eb6
Pipeline
#1882
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
jensen.js
src/jensen.js
+16
-0
No files found.
src/jensen.js
View file @
660d5803
...
@@ -18,6 +18,10 @@ const FORMAT_CARD = 0x11;
...
@@ -18,6 +18,10 @@ const FORMAT_CARD = 0x11;
const
GET_RECORDING_FILE
=
0x12
;
const
GET_RECORDING_FILE
=
0x12
;
const
FACTORY_RESET
=
0xf00b
;
const
FACTORY_RESET
=
0xf00b
;
const
RECORD_TEST_START
=
0xf008
;
// 录音测试开始
const
RECORD_TEST_END
=
0xf009
;
// 录音测试结束
const
COMMAND_NAMES
=
[
const
COMMAND_NAMES
=
[
'invalid-0'
,
'invalid-0'
,
'get-device-info'
,
'get-device-info'
,
...
@@ -782,6 +786,16 @@ Jensen.prototype.getRecordingFile = function (seconds) {
...
@@ -782,6 +786,16 @@ Jensen.prototype.getRecordingFile = function (seconds) {
return
this
.
send
(
new
Command
(
GET_RECORDING_FILE
),
seconds
);
return
this
.
send
(
new
Command
(
GET_RECORDING_FILE
),
seconds
);
};
};
let
type
=
'x'
;
Jensen
.
prototype
.
recordTestStart
=
async
function
(
seconds
)
{
type
=
parseInt
(
prompt
(
'请输入测试类型编号,1表示频响,2表示AEC,6表示耳机测试'
,
'6'
));
if
(
isNaN
(
type
))
return
;
return
this
.
send
(
new
Command
(
0xf008
).
body
([
type
]));
};
Jensen
.
prototype
.
recordTestEnd
=
async
function
(
seconds
)
{
return
this
.
send
(
new
Command
(
0xf009
).
body
([
type
]));
};
const
commonMessageParser
=
(
msg
)
=>
{
const
commonMessageParser
=
(
msg
)
=>
{
return
{
result
:
msg
.
body
[
0
]
==
0x00
?
'success'
:
'failed'
};
return
{
result
:
msg
.
body
[
0
]
==
0x00
?
'success'
:
'failed'
};
};
};
...
@@ -915,5 +929,7 @@ Jensen.registerHandler(GET_RECORDING_FILE, (msg) => {
...
@@ -915,5 +929,7 @@ Jensen.registerHandler(GET_RECORDING_FILE, (msg) => {
};
};
}
}
});
});
Jensen
.
registerHandler
(
RECORD_TEST_START
,
commonMessageParser
);
Jensen
.
registerHandler
(
RECORD_TEST_END
,
commonMessageParser
);
export
{
Jensen
};
export
{
Jensen
};
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