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
26be443f
Commit
26be443f
authored
Nov 10, 2025
by
martin hou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 增加scanning/connecting的设备状态识别
parent
eb2facdd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
index.tsx
src/index.tsx
+6
-0
jensen.js
src/utils/jensen.js
+2
-0
No files found.
src/index.tsx
View file @
26be443f
...
...
@@ -247,6 +247,11 @@ export function Home() {
else
alert
(
'what the fuck????'
);
}
const
getPairedDevices
=
async
()
=>
{
let
devices
=
await
jensen
.
getPairedDevices
();
alert
(
JSON
.
stringify
(
devices
));
}
return
(
<>
<
div
style=
{
{
display
:
'flex'
,
flexDirection
:
'row'
,
gap
:
'16px'
,
padding
:
'16px'
,
alignItems
:
'center'
,
flexWrap
:
'wrap'
}
}
>
...
...
@@ -261,6 +266,7 @@ export function Home() {
<
button
onClick=
{
getBluetoothStatus
}
>
蓝牙连接状态
</
button
>
<
button
onClick=
{
bluetoothScan
}
>
蓝牙扫描
</
button
>
<
button
onClick=
{
disconnectBTDevice
}
>
蓝牙断开
</
button
>
<
button
onClick=
{
getPairedDevices
}
>
Paired
</
button
>
<
button
onClick=
{
readFilePartial
}
>
Read File Partial
</
button
>
<
button
onClick=
{
updateDeviceTone
}
>
更新提示音
</
button
>
<
button
onClick=
{
updateUAC
}
>
更新UAC
</
button
>
...
...
src/utils/jensen.js
View file @
26be443f
...
...
@@ -1546,6 +1546,8 @@ Jensen.registerHandler(BLUETOOTH_STATUS, (msg) => {
if
(
msg
.
body
.
length
==
0
)
return
{
status
:
'disconnected'
};
let
status
=
msg
.
body
[
0
];
if
(
status
==
1
)
return
{
status
:
'disconnected'
};
if
(
status
==
2
)
return
{
status
:
'scanning'
};
if
(
status
==
3
)
return
{
status
:
'connecting'
};
let
flen
=
((
msg
.
body
[
1
]
&
0xff
)
<<
8
)
|
(
msg
.
body
[
2
]
&
0xff
);
let
decoder
=
new
TextDecoder
(
'UTF-8'
);
let
sname
=
new
Uint8Array
(
flen
);
...
...
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