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
b4133679
Commit
b4133679
authored
Jul 12, 2025
by
martin hou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
9c551795
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
index.tsx
src/index.tsx
+1
-1
jensen.js
src/utils/jensen.js
+12
-3
No files found.
src/index.tsx
View file @
b4133679
...
@@ -86,7 +86,7 @@ export function Home() {
...
@@ -86,7 +86,7 @@ export function Home() {
const
listFiles
=
async
()
=>
{
const
listFiles
=
async
()
=>
{
let
fc
=
await
jensen
.
getFileCount
();
let
fc
=
await
jensen
.
getFileCount
();
alert
(
fc
?.
count
);
//
alert(fc?.count);
let
files
=
await
jensen
.
listFiles
();
let
files
=
await
jensen
.
listFiles
();
setFiles
(
files
)
setFiles
(
files
)
}
}
...
...
src/utils/jensen.js
View file @
b4133679
...
@@ -89,6 +89,7 @@ function Jensen(log, conn) {
...
@@ -89,6 +89,7 @@ function Jensen(log, conn) {
let
self
=
this
;
let
self
=
this
;
this
.
data
=
{};
this
.
data
=
{};
this
.
sqidx
=
new
Date
().
getTime
();
// 消息
// 消息
this
.
decodeTimeout
=
0
;
this
.
decodeTimeout
=
0
;
this
.
timewait
=
1
;
this
.
timewait
=
1
;
...
@@ -161,6 +162,10 @@ function Jensen(log, conn) {
...
@@ -161,6 +162,10 @@ function Jensen(log, conn) {
return
true
;
return
true
;
}
}
this
.
sequence
=
function
()
{
return
this
.
sqidx
++
;
}
this
.
reconnect
=
async
function
()
{
this
.
reconnect
=
async
function
()
{
try
try
{
{
...
@@ -441,10 +446,10 @@ function Jensen(log, conn) {
...
@@ -441,10 +446,10 @@ function Jensen(log, conn) {
let
handler
=
handlers
[
msg
.
id
];
let
handler
=
handlers
[
msg
.
id
];
if
(
!
handler
)
handler
=
Jensen
.
handlers
[
msg
.
id
];
if
(
!
handler
)
handler
=
Jensen
.
handlers
[
msg
.
id
];
let
r
=
handler
(
msg
,
self
);
let
r
=
handler
(
msg
,
self
);
if
(
r
)
trigger
(
r
,
msg
.
id
);
if
(
r
)
console
.
log
(
'x111111111111'
),
trigger
(
r
,
msg
.
id
);
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
error
(
e
);
console
.
error
(
e
);
trigger
(
e
);
console
.
log
(
'x22222222222222'
),
trigger
(
e
);
Logger
.
error
(
'jensen'
,
'receive'
,
pid
+
'-recv: '
+
msg
.
id
+
', seq: '
+
msg
.
sequence
+
', error: '
+
String
(
e
));
Logger
.
error
(
'jensen'
,
'receive'
,
pid
+
'-recv: '
+
msg
.
id
+
', seq: '
+
msg
.
sequence
+
', error: '
+
String
(
e
));
}
}
sendNext
();
sendNext
();
...
@@ -459,9 +464,12 @@ function Jensen(log, conn) {
...
@@ -459,9 +464,12 @@ function Jensen(log, conn) {
if
(
!
handler
)
handler
=
Jensen
.
handlers
[
msgid
];
if
(
!
handler
)
handler
=
Jensen
.
handlers
[
msgid
];
handler
(
null
,
self
);
handler
(
null
,
self
);
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
'x3333333333333333'
);
console
.
error
(
e
);
trigger
(
e
);
trigger
(
e
);
Logger
.
error
(
'jensen'
,
'decode'
,
'decode error: '
+
String
(
e
));
Logger
.
error
(
'jensen'
,
'decode'
,
'decode error: '
+
String
(
e
));
}
}
console
.
log
(
'x44444444444444444444'
),
trigger
(
null
,
msgid
);
trigger
(
null
,
msgid
);
blocks
.
length
=
0
;
blocks
.
length
=
0
;
break
;
break
;
...
@@ -657,7 +665,7 @@ Jensen.prototype.getBluetoothStatus = async function (seconds) {
...
@@ -657,7 +665,7 @@ Jensen.prototype.getBluetoothStatus = async function (seconds) {
};
};
Jensen
.
prototype
.
listFiles
=
async
function
()
{
Jensen
.
prototype
.
listFiles
=
async
function
()
{
let
tag
=
'filelist-'
+
this
.
serialNumber
+
'-'
+
new
Date
().
getTim
e
();
let
tag
=
'filelist-'
+
this
.
serialNumber
+
'-'
+
this
.
sequenc
e
();
if
(
this
[
tag
]
!=
null
)
return
null
;
if
(
this
[
tag
]
!=
null
)
return
null
;
let
fc
=
null
;
let
fc
=
null
;
...
@@ -672,6 +680,7 @@ Jensen.prototype.listFiles = async function () {
...
@@ -672,6 +680,7 @@ Jensen.prototype.listFiles = async function () {
// let tag = 'data_' + new Date().getTime();
// let tag = 'data_' + new Date().getTime();
this
[
tag
]
=
[];
this
[
tag
]
=
[];
this
.
registerHandler
(
QUERY_FILE_LIST
,
(
msg
,
jensen
)
=>
{
this
.
registerHandler
(
QUERY_FILE_LIST
,
(
msg
,
jensen
)
=>
{
console
.
log
(
'tag'
,
tag
);
if
(
msg
.
body
.
length
==
0
)
{
if
(
msg
.
body
.
length
==
0
)
{
jensen
[
tag
]
=
null
;
jensen
[
tag
]
=
null
;
return
[];
return
[];
...
...
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