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
77655e7f
Commit
77655e7f
authored
Sep 04, 2025
by
martin hou
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v20250816' into device-mgr
parents
7befde52
afe92752
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
jensen.d.ts
jensen.d.ts
+1
-1
jensen.js
src/utils/jensen.js
+20
-5
No files found.
jensen.d.ts
View file @
77655e7f
...
...
@@ -226,7 +226,7 @@ declare class Jensen {
setNotification
:
(
state
:
boolean
,
time
?:
number
)
=>
Promise
<
ReturnStruct
[
'common'
]
>
;
// 获取录音中的文件信息,当它从null -> non-null -> null转变时就表示已经有一个新的录音产生了
getRecordingFile
:
()
=>
Promise
<
{
recording
:
null
|
string
;
createTime
:
string
;
createDate
:
string
}
>
;
getRecordingFile
:
(
time
?:
number
)
=>
Promise
<
{
recording
:
null
|
string
;
createTime
:
string
;
createDate
:
string
}
>
;
// 获取内部存储卡信息
// used:已使用,capacity:总容量(单位为M),status:900表示正常,其它表示异常
...
...
src/utils/jensen.js
View file @
77655e7f
...
...
@@ -87,6 +87,8 @@ function Jensen(log, conn) {
let
totalBytes
=
0
;
let
handlers
=
{};
let
pid
=
0
;
// 表示通道通信是否正常,只要能够接收一次应答消息即可
let
channelHealthy
=
false
;
let
self
=
this
;
this
.
data
=
{};
...
...
@@ -357,6 +359,7 @@ function Jensen(log, conn) {
const
trigger
=
function
(
resp
,
msgid
)
{
if
(
current
==
null
)
return
;
channelHealthy
=
true
;
Logger
.
debug
(
'jensen'
,
'trigger'
,
pid
+
':trigger - '
+
current
+
' <---> cmd-'
+
(
msgid
||
'err'
));
if
(
current
.
substring
(
0
,
current
.
lastIndexOf
(
'-'
))
!=
'cmd-'
+
msgid
)
{
// current = null;
...
...
@@ -405,7 +408,7 @@ function Jensen(log, conn) {
receive
(
r
);
}).
catch
((
e
)
=>
{
console
.
log
(
'tryReceive error'
,
e
)
self
.
onerror
?.(
e
);
if
(
!
channelHealthy
)
self
.
onerror
?.(
e
);
});
};
...
...
@@ -764,11 +767,18 @@ Jensen.prototype.listFiles = async function () {
}
let
ftime
=
fname
.
join
(
''
);
let
duration
=
0
;
if
(
ftime
.
match
(
/^
\d{14}
REC
\d
+
\.
wav$/gi
))
{
ftime
=
ftime
.
replace
(
/^
(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})
REC.*$/gi
,
'$1-$2-$3 $4:$5:$6'
);
let
mode
=
'room'
;
if
(
ftime
.
match
(
/^
\d{14}(
REC|WHSP|ROOM|CALL|WIP
)\d
+
\.
wav$/gi
))
{
mode
=
ftime
.
replace
(
/^
(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(
REC|WHIP|ROOM|CALL|WIP
)
.*$/gi
,
'$7'
).
toLowerCase
();
if
(
mode
==
'REC'
)
mode
=
'room'
;
else
if
(
mode
==
'WHSP'
||
mode
==
'WIP'
)
mode
=
'whisper'
;
else
if
(
mode
==
'ROOM'
)
mode
=
'room'
;
else
if
(
mode
==
'CALL'
)
mode
=
'call'
;
ftime
=
ftime
.
replace
(
/^
(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(
REC|WHIP|ROOM|CALL|WIP
)
.*$/gi
,
'$1-$2-$3 $4:$5:$6'
);
ftime
=
new
Date
(
ftime
);
duration
=
flen
/
32
;
}
else
if
(
ftime
.
match
(
/^
(\d{2})?(\d{2})(\w{3})(\d{2})
-
(\d{2})(\d{2})(\d{2})
-.*
\.(
hda|wav
)
$/gi
))
{
}
else
if
(
ftime
.
match
(
/^
(\d{2})?(\d{2})(\w{3})(\d{2})
-
(\d{2})(\d{2})(\d{2})
-.*
\.(
hda|wav
)
$/gi
))
{
// 2024Mar19-110932-Rec00.hda
ftime
=
ftime
.
replace
(
/^
(\d{2})?(\d{2})(\w{3})(\d{2})
-
(\d{2})(\d{2})(\d{2})
-.*
\.(
hda|wav
)
$/gi
,
'20$2 $3 $4 $5:$6:$7'
);
ftime
=
new
Date
(
ftime
);
...
...
@@ -794,6 +804,10 @@ Jensen.prototype.listFiles = async function () {
{
duration
=
flen
/
12
;
}
else
if
(
ver
==
6
)
{
duration
=
flen
/
16
;
}
let
createDate
=
''
;
let
createTime
=
''
;
if
(
ftime
)
{
...
...
@@ -808,6 +822,7 @@ Jensen.prototype.listFiles = async function () {
duration
:
duration
,
version
:
ver
,
length
:
flen
,
mode
:
mode
,
signature
:
sign
.
join
(
''
)
});
}
...
...
@@ -1116,7 +1131,7 @@ Jensen.prototype.formatCard = function (seconds) {
Jensen
.
prototype
.
getRecordingFile
=
function
(
seconds
)
{
if
((
this
.
model
==
'hidock-h1'
||
this
.
model
==
'hidock-h1e'
)
&&
this
.
versionNumber
<
327733
)
return
null
;
return
this
.
send
(
new
Command
(
GET_RECORDING_FILE
),
seconds
);
return
this
.
send
(
new
Command
(
GET_RECORDING_FILE
),
seconds
||
0.5
);
};
Jensen
.
prototype
.
recordTestStart
=
async
function
(
type
,
seconds
)
{
...
...
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