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
d53d61f8
Commit
d53d61f8
authored
Dec 16, 2025
by
martin hou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加进入U盘模式的测试指令
parent
703c7560
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
jensen.d.ts
jensen.d.ts
+3
-0
index.tsx
src/index.tsx
+8
-0
jensen.js
src/utils/jensen.js
+5
-1
No files found.
jensen.d.ts
View file @
d53d61f8
...
...
@@ -242,6 +242,9 @@ declare class Jensen {
// 恢复出厂设置,MTT阶段添加,不建议使用
factoryReset
:
(
seconds
?:
number
)
=>
Promise
<
ReturnStruct
[
'common'
]
>
;
// 进入MassStorage模式
enterMassStorageMode
:
(
seconds
?:
number
)
=>
Promise
<
ReturnStruct
[
'common'
]
>
;
// 恢复出厂设置,内部存储格式化,设置项恢复默认值,蓝牙配对信息清空等
restoreFactorySettings
:
(
seconds
?:
number
)
=>
Promise
<
ReturnStruct
[
'common'
]
>
;
...
...
src/index.tsx
View file @
d53d61f8
...
...
@@ -724,6 +724,13 @@ export function Home() {
Logger
.
info
(
'jensen'
,
'live'
,
'Send Key: '
+
JSON
.
stringify
(
rst
));
}
const
enterMassStorageMode
=
async
()
=>
{
let
jensen
=
getJensen
();
if
(
jensen
==
null
)
return
;
let
rst
=
await
jensen
.
enterMassStorageMode
(
5
);
Logger
.
info
(
'jensen'
,
'live'
,
'Enter MassStorage Mode: '
+
JSON
.
stringify
(
rst
));
}
return
(
<>
<
div
className=
"btn-container"
style=
{
{
display
:
'flex'
,
flexDirection
:
'row'
,
gap
:
'16px'
,
padding
:
'16px'
,
alignItems
:
'center'
,
flexWrap
:
'wrap'
}
}
>
...
...
@@ -760,6 +767,7 @@ export function Home() {
<
button
onClick=
{
()
=>
sendKey
(
0x01
,
0x04
)
}
>
Mute (Click)
</
button
>
<
button
onClick=
{
()
=>
sendKey
(
0x02
,
0x03
)
}
>
Record (Long Click)
</
button
>
<
button
onClick=
{
()
=>
sendKey
(
0x03
,
0x05
)
}
>
Playback (Dbl Press)
</
button
>
<
button
onClick=
{
enterMassStorageMode
}
>
MassStorage Mode
</
button
>
<
span
style=
{
{
marginLeft
:
'8px'
}
}
>
Interval(ms):
</
span
>
<
input
type=
"number"
...
...
src/utils/jensen.js
View file @
d53d61f8
...
...
@@ -1344,6 +1344,10 @@ Jensen.prototype.sendScheduleInfo = function (infos) {
}
};
Jensen
.
prototype
.
enterMassStorageMode
=
async
function
(
seconds
)
{
return
this
.
send
(
new
Command
(
0xf00f
).
body
([
0x01
]),
seconds
);
};
Jensen
.
prototype
.
getRealtimeSettings
=
async
function
()
{
return
this
.
send
(
new
Command
(
REALTIME_READ_SETTING
));
};
...
...
@@ -1688,7 +1692,7 @@ Jensen.registerHandler(READ_WEBUSB_TIMEOUT, (msg) => {
let
timeout
=
((
msg
.
body
[
0
]
&
0xff
)
<<
24
)
|
((
msg
.
body
[
1
]
&
0xff
)
<<
16
)
|
((
msg
.
body
[
2
]
&
0xff
)
<<
8
)
|
(
msg
.
body
[
3
]
&
0xff
);
return
{
timeout
:
timeout
};
});
Jensen
.
registerHandler
(
0xf00f
,
commonMessageParser
);
Jensen
.
registerHandler
(
BT_SCAN
,
commonMessageParser
);
Jensen
.
registerHandler
(
BT_REMOVE_PAIRED_DEV
,
commonMessageParser
);
Jensen
.
registerHandler
(
BT_DEV_LIST
,
(
msg
,
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