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
d55ba468
Commit
d55ba468
authored
Feb 27, 2026
by
martin hou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 增加对hidock-h1 lite的兼容支持
parent
20892c0b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
jensen.js
src/utils/jensen.js
+10
-10
No files found.
src/utils/jensen.js
View file @
d55ba468
...
@@ -768,12 +768,12 @@ Jensen.prototype.restoreFactorySettings = async function (seconds) {
...
@@ -768,12 +768,12 @@ Jensen.prototype.restoreFactorySettings = async function (seconds) {
};
};
Jensen
.
prototype
.
scanDevices
=
async
function
(
seconds
)
{
Jensen
.
prototype
.
scanDevices
=
async
function
(
seconds
)
{
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
)
return
null
;
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
&&
this
.
model
!==
'hidock-h1:lite'
)
return
null
;
return
this
.
send
(
new
Command
(
BLUETOOTH_SCAN
),
seconds
||
35
);
return
this
.
send
(
new
Command
(
BLUETOOTH_SCAN
),
seconds
||
35
);
};
};
Jensen
.
prototype
.
connectBTDevice
=
async
function
(
mac
,
seconds
)
{
Jensen
.
prototype
.
connectBTDevice
=
async
function
(
mac
,
seconds
)
{
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
)
return
null
;
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
&&
this
.
model
!==
'hidock-h1:lite'
)
return
null
;
let
marr
=
mac
.
split
(
'-'
);
let
marr
=
mac
.
split
(
'-'
);
if
(
marr
.
length
!=
6
)
throw
new
Error
(
'invalid mac'
);
if
(
marr
.
length
!=
6
)
throw
new
Error
(
'invalid mac'
);
let
addr
=
[];
let
addr
=
[];
...
@@ -782,50 +782,50 @@ Jensen.prototype.connectBTDevice = async function (mac, seconds) {
...
@@ -782,50 +782,50 @@ Jensen.prototype.connectBTDevice = async function (mac, seconds) {
};
};
Jensen
.
prototype
.
disconnectBTDevice
=
async
function
(
seconds
)
{
Jensen
.
prototype
.
disconnectBTDevice
=
async
function
(
seconds
)
{
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
)
return
null
;
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
&&
this
.
model
!==
'hidock-h1:lite'
)
return
null
;
return
this
.
send
(
new
Command
(
BLUETOOTH_CMD
).
body
([
0x01
]),
seconds
);
return
this
.
send
(
new
Command
(
BLUETOOTH_CMD
).
body
([
0x01
]),
seconds
);
};
};
Jensen
.
prototype
.
getBluetoothStatus
=
async
function
(
seconds
)
{
Jensen
.
prototype
.
getBluetoothStatus
=
async
function
(
seconds
)
{
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
)
return
null
;
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
&&
this
.
model
!==
'hidock-h1:lite'
)
return
null
;
if
(
this
.
isLiveMode
())
return
null
;
if
(
this
.
isLiveMode
())
return
null
;
return
this
.
send
(
new
Command
(
BLUETOOTH_STATUS
),
seconds
);
return
this
.
send
(
new
Command
(
BLUETOOTH_STATUS
),
seconds
);
};
};
// 发起蓝牙扫描请求
// 发起蓝牙扫描请求
Jensen
.
prototype
.
startBluetoothScan
=
async
function
(
count
,
seconds
)
{
Jensen
.
prototype
.
startBluetoothScan
=
async
function
(
count
,
seconds
)
{
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
)
return
null
;
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
&&
this
.
model
!==
'hidock-h1:lite'
)
return
null
;
count
=
count
&
0xff
;
count
=
count
&
0xff
;
return
this
.
send
(
new
Command
(
BT_SCAN
).
body
([
0x01
,
count
]),
seconds
);
return
this
.
send
(
new
Command
(
BT_SCAN
).
body
([
0x01
,
count
]),
seconds
);
};
};
// 停止蓝牙扫描
// 停止蓝牙扫描
Jensen
.
prototype
.
stopBluetoothScan
=
async
function
(
seconds
)
{
Jensen
.
prototype
.
stopBluetoothScan
=
async
function
(
seconds
)
{
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
)
return
null
;
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
&&
this
.
model
!==
'hidock-h1:lite'
)
return
null
;
return
this
.
send
(
new
Command
(
BT_SCAN
).
body
([
0x00
,
0x00
]),
seconds
);
return
this
.
send
(
new
Command
(
BT_SCAN
).
body
([
0x00
,
0x00
]),
seconds
);
};
};
// 获取蓝牙设备列表
// 获取蓝牙设备列表
Jensen
.
prototype
.
getScanResults
=
async
function
(
seconds
)
{
Jensen
.
prototype
.
getScanResults
=
async
function
(
seconds
)
{
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
)
return
null
;
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
&&
this
.
model
!==
'hidock-h1:lite'
)
return
null
;
return
this
.
send
(
new
Command
(
BT_DEV_LIST
),
seconds
);
return
this
.
send
(
new
Command
(
BT_DEV_LIST
),
seconds
);
};
};
// 获取已配对的蓝牙设备列表
// 获取已配对的蓝牙设备列表
Jensen
.
prototype
.
getPairedDevices
=
async
function
(
seconds
)
{
Jensen
.
prototype
.
getPairedDevices
=
async
function
(
seconds
)
{
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
)
return
null
;
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
&&
this
.
model
!==
'hidock-h1:lite'
)
return
null
;
return
this
.
send
(
new
Command
(
BT_GET_PAIRED_DEV_LIST
),
seconds
);
return
this
.
send
(
new
Command
(
BT_GET_PAIRED_DEV_LIST
),
seconds
);
};
};
// 清空已配对的蓝牙设备列表
// 清空已配对的蓝牙设备列表
Jensen
.
prototype
.
clearPairedDevices
=
async
function
(
seconds
)
{
Jensen
.
prototype
.
clearPairedDevices
=
async
function
(
seconds
)
{
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
)
return
null
;
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
&&
this
.
model
!==
'hidock-h1:lite'
)
return
null
;
return
this
.
send
(
new
Command
(
BT_REMOVE_PAIRED_DEV
).
body
([
0x00
]),
seconds
);
return
this
.
send
(
new
Command
(
BT_REMOVE_PAIRED_DEV
).
body
([
0x00
]),
seconds
);
}
}
// 设备回连
// 设备回连
Jensen
.
prototype
.
reconnectDevice
=
async
function
(
mac
,
seconds
)
{
Jensen
.
prototype
.
reconnectDevice
=
async
function
(
mac
,
seconds
)
{
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
)
return
null
;
if
(
this
.
model
.
indexOf
(
'hidock-p1'
)
==
-
1
&&
this
.
model
!==
'hidock-h1:lite'
)
return
null
;
let
marr
=
mac
.
split
(
'-'
);
let
marr
=
mac
.
split
(
'-'
);
if
(
marr
.
length
!=
6
)
throw
new
Error
(
'invalid mac'
);
if
(
marr
.
length
!=
6
)
throw
new
Error
(
'invalid mac'
);
let
addr
=
[];
let
addr
=
[];
...
...
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