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
cf2eaa4b
Commit
cf2eaa4b
authored
Sep 18, 2025
by
martin hou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 调整为英文版的测试页面
parent
b9be3f07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
29 deletions
+31
-29
index.tsx
src/index.tsx
+31
-29
No files found.
src/index.tsx
View file @
cf2eaa4b
...
...
@@ -15,7 +15,7 @@ export function Home() {
jensen
.
onconnect
=
()
=>
{
console
.
log
(
'connect successfully'
);
jensen
.
addWakeupListener
(
function
()
{
console
.
log
(
'
从休眠中恢复过来了?
'
);
console
.
log
(
'
Wake up from sleep?
'
);
});
jensen
.
getDeviceInfo
().
then
((
info
)
=>
{
console
.
log
(
'getDeviceInfo'
,
info
);
...
...
@@ -65,7 +65,7 @@ export function Home() {
let
jensen
=
new
Jensen
(
Logger
,
conn
);
jensen
.
onerror
=
(
e
)
=>
{
console
.
log
(
'onerror'
,
e
);
alert
(
'
此设备已经在其它已打开的HiNotes网页上建立连接
'
);
alert
(
'
This device has already been connected to another HiNotes webpage
'
);
};
await
jensen
.
initialize
();
let
dinfo
=
await
jensen
.
getDeviceInfo
();
...
...
@@ -131,20 +131,20 @@ export function Home() {
}
const
readFilePartial
=
async
()
=>
{
if
(
files
.
length
==
0
)
return
alert
(
'
你没有录音文件,或是还没有查询过文件列表
'
);
let
s0
=
prompt
(
'
请输入需要读取的文件序号,从0开始:
'
,
'0'
);
let
s1
=
prompt
(
'
请输入开始位置,从0开始:
'
,
'0'
);
let
s2
=
prompt
(
'
请输入读取字节数量
'
,
'32'
);
if
(
files
.
length
==
0
)
return
alert
(
'
You don
\'
t have any recording files, or you haven
\'
t queried the file list
'
);
let
s0
=
prompt
(
'
Please Input the File Index (Start from 0):
'
,
'0'
);
let
s1
=
prompt
(
'
Please Input the Start Position (Start from 0):
'
,
'0'
);
let
s2
=
prompt
(
'
Please Input the Read Byte Count
'
,
'32'
);
if
(
s0
&&
s1
&&
s2
)
console
.
log
();
else
return
;
let
index
=
parseInt
(
s0
);
let
offset
=
parseInt
(
s1
);
let
length
=
parseInt
(
s2
);
if
(
isNaN
(
index
)
&&
isNaN
(
offset
)
||
isNaN
(
length
))
return
;
if
(
index
>=
files
.
length
)
return
alert
(
'
请输入正确的文件序号
'
);
if
(
index
>=
files
.
length
)
return
alert
(
'
Please Input the Correct File Index
'
);
let
file
=
files
[
index
];
if
(
offset
<
0
||
offset
>
file
.
length
)
return
alert
(
'
请输入正确的读取开始位置
'
);
if
(
length
<=
0
)
return
alert
(
'
请输入正确的文件读取长度
'
);
if
(
offset
<
0
||
offset
>
file
.
length
)
return
alert
(
'
Please Input the Correct Read Start Position
'
);
if
(
length
<=
0
)
return
alert
(
'
Please Input the Correct Read Byte Count
'
);
let
data
=
await
jensen
.
readFile
(
file
.
name
,
offset
,
length
);
console
.
log
(
data
);
}
...
...
@@ -196,11 +196,11 @@ export function Home() {
let
filename
=
''
;
let
filelength
=
0
;
const
transferFile
=
async
()
=>
{
if
(
files
==
null
||
files
.
length
==
0
)
return
alert
(
'
请先点击List Files
'
);
let
idx
=
prompt
(
'
请输入需要获取的文件序号(从0开始):
'
,
'0'
);
if
(
files
==
null
||
files
.
length
==
0
)
return
alert
(
'
Please Click "List Files" first
'
);
let
idx
=
prompt
(
'
Please Input the File Index (Start from 0):
'
,
'0'
);
if
(
idx
===
undefined
||
idx
===
null
)
return
;
let
num
=
parseInt
(
idx
);
if
(
isNaN
(
num
)
||
num
<
0
||
num
>=
files
.
length
)
return
alert
(
'
请输入正确的序号
'
);
if
(
isNaN
(
num
)
||
num
<
0
||
num
>=
files
.
length
)
return
alert
(
'
Please Input the Correct Index
'
);
let
file
=
files
[
num
];
// 2025Jun24-165914-Wip00.hda, 232704 @ 19392
filename
=
file
.
name
;
...
...
@@ -210,8 +210,15 @@ export function Home() {
}
const
get_file
=
()
=>
{
let
recvBytes
=
0
;
let
stime
=
new
Date
().
getTime
();
jensen
.
getFile
(
filename
,
filelength
,
function
(
data
)
{
// console.log('data', data.length);
recvBytes
+=
data
.
length
;
if
(
recvBytes
>=
filelength
)
{
let
cost
=
new
Date
().
getTime
()
-
stime
;
alert
(
'File Transfer Complete, Cost: '
+
cost
+
' ms'
);
}
},
function
(
recvBytes
)
{
let
percent
=
Math
.
floor
(
recvBytes
/
filelength
*
100
);
// console.log('progress', percent);
...
...
@@ -219,7 +226,7 @@ export function Home() {
}
const
writeSN
=
async
()
=>
{
let
nsn
=
prompt
(
'
请输入新的SN号
'
,
''
);
let
nsn
=
prompt
(
'
Please Input the New SN:
'
,
''
);
if
(
nsn
&&
nsn
.
match
(
/^HD
(
H1|1E|P1|PM
)\w{9}
$/gi
))
{
let
rst
=
await
jensen
.
writeSerialNumber
(
nsn
);
...
...
@@ -249,27 +256,22 @@ export function Home() {
await
jensen
.
reconnect
();
let
rst
=
await
jensen
.
getDeviceInfo
();
if
(
rst
)
alert
(
rst
.
sn
+
' reconnected...'
);
else
alert
(
'
what the fuck????
'
);
else
alert
(
'
Something went wrong...
'
);
}
return
(
<>
<
div
style=
{
{
display
:
'flex'
,
flexDirection
:
'row'
,
gap
:
'16px'
,
padding
:
'16px'
,
alignItems
:
'center'
,
flexWrap
:
'wrap'
}
}
>
<
button
onClick=
{
connecty
}
>
连接新设备
</
button
>
<
button
onClick=
{
connect
}
>
连接
</
button
>
<
button
onClick=
{
getFilePart
}
>
获取文件
</
button
>
<
button
onClick=
{
writeSN
}
>
SN写号
</
button
>
<
button
onClick=
{
getTime
}
>
获取时间
</
button
>
<
button
onClick=
{
listFiles
}
>
文件列表
</
button
>
<
button
onClick=
{
transferFile
}
>
传输文件
</
button
>
<
button
onClick=
{
batteryStatus
}
>
电池电量
</
button
>
<
button
onClick=
{
getBluetoothStatus
}
>
蓝牙连接状态
</
button
>
<
button
onClick=
{
bluetoothScan
}
>
蓝牙扫描
</
button
>
<
button
onClick=
{
disconnectBTDevice
}
>
蓝牙断开
</
button
>
<
button
onClick=
{
readFilePartial
}
>
Read File Partial
</
button
>
<
button
onClick=
{
updateDeviceTone
}
>
更新提示音
</
button
>
<
button
onClick=
{
updateUAC
}
>
更新UAC
</
button
>
<
button
onClick=
{
test
}
>
测试重连
</
button
>
<
button
onClick=
{
connecty
}
>
Connect
</
button
>
<
button
onClick=
{
getTime
}
>
Get Time
</
button
>
<
button
onClick=
{
listFiles
}
>
List Files
</
button
>
<
button
onClick=
{
transferFile
}
>
Transfer
</
button
>
<
button
onClick=
{
batteryStatus
}
>
Battery
</
button
>
<
button
onClick=
{
getBluetoothStatus
}
>
Bluetooth Status
</
button
>
<
button
onClick=
{
bluetoothScan
}
>
Bluetooth Scan
</
button
>
<
button
onClick=
{
disconnectBTDevice
}
>
Bluetooth Disconnect
</
button
>
<
button
onClick=
{
updateDeviceTone
}
>
Update Tone
</
button
>
<
button
onClick=
{
updateUAC
}
>
Update UAC
</
button
>
</
div
>
<
div
id=
"files"
style=
{
{
padding
:
'0px 0px 0px 30px'
,
marginBottom
:
'20px'
}
}
>
<
h3
>
Files:
</
h3
>
...
...
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