Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
blue-update
Overview
Overview
Details
Activity
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
iambtr
blue-update
Commits
eb64af1f
Commit
eb64af1f
authored
May 28, 2020
by
王榕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
蓝牙开锁工具修改
parent
446d2267
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
22 deletions
+24
-22
index.js
pages/index/index.js
+23
-21
project.config.json
project.config.json
+1
-1
No files found.
pages/index/index.js
View file @
eb64af1f
...
...
@@ -84,7 +84,7 @@ Page({
alertTip
(
'请输入固件编号'
)
return
}
Api
.
get
(
'http://yadi-upgrade.zhuzhux.com/download/getFileHex?typeHex='
+
firmwareNo
)
Api
.
get
(
'http
s
://yadi-upgrade.zhuzhux.com/download/getFileHex?typeHex='
+
firmwareNo
)
.
then
(
res
=>
{
this
.
setData
({
hexStr
:
res
,
...
...
@@ -179,32 +179,32 @@ Page({
let
devices
=
res
.
devices
// 设备列表
console
.
log
(
'onBluetoothDeviceFound获取到设备'
,
res
.
devices
)
res
.
devices
.
forEach
(
elt
=>
{
if
(
/^
c1/gi
.
test
(
elt
.
deviceId
))
{
if
(
/^
yd/gi
.
test
(
elt
.
name
))
{
deviceSet
.
add
(
elt
)
}
})
that
.
setData
({
deviceList
:
[...
deviceSet
]
})
if
(
e
)
{
return
}
if
(
devices
.
length
>
0
)
{
for
(
let
i
in
devices
)
{
let
mac
=
ab2str
(
devices
[
i
].
advertisData
).
toLowerCase
()
let
deviceId
=
devices
[
i
].
deviceId
let
mac2
=
deviceId
.
split
(
':'
).
join
(
''
).
toLowerCase
()
// // console.log('解析苹果上的advertisData', mac, 'devicesId', deviceId)
if
(
mac
.
indexOf
(
blueAddress
.
toLowerCase
())
!=
-
1
)
{
// // console.log('找到对应的车辆', mac)
if
(
deviceId
)
{
if
(
!
that
.
data
.
blueConnect
)
{
that
.
connectBlue
(
deviceId
)
}
}
}
}
}
//
if (e) {
//
return
//
}
//
if (devices.length > 0) {
//
for (let i in devices) {
//
let mac = ab2str(devices[i].advertisData).toLowerCase()
//
let deviceId = devices[i].deviceId
//
let mac2 = deviceId.split(':').join('').toLowerCase()
//
// // console.log('解析苹果上的advertisData', mac, 'devicesId', deviceId)
//
if (mac.indexOf(blueAddress.toLowerCase()) != -1) {
//
// // console.log('找到对应的车辆', mac)
//
if (deviceId) {
//
if (!that.data.blueConnect) {
//
that.connectBlue(deviceId)
//
}
//
}
//
}
//
}
//
}
})
wx
.
startBluetoothDevicesDiscovery
({
allowDuplicatesKey
:
false
,
...
...
@@ -247,6 +247,8 @@ Page({
title
:
'连接中'
,
mask
:
true
})
console
.
log
(
'连接中'
,
deviceId
)
let
that
=
this
that
.
setData
({
deviceId
:
deviceId
,
...
...
project.config.json
View file @
eb64af1f
...
...
@@ -22,7 +22,7 @@
},
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.7.2"
,
"appid"
:
"wx9
18b041f12491a2b
"
,
"appid"
:
"wx9
e03f17405a7b412
"
,
"projectname"
:
"%E8%93%9D%E7%89%99%E5%BC%80%E9%94%81%E5%B7%A5%E5%85%B7"
,
"debugOptions"
:
{
"hidedInDevtools"
:
[]
...
...
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