6155部分功能
This commit is contained in:
@ -20,7 +20,7 @@ let connected = false
|
||||
//测试
|
||||
|
||||
let service_uuid = "0000AE30-0000-1000-8000-00805F9B34FB"
|
||||
let write_characteristic = "0000AE03-0000-1000-8000-00805F9B34FB"
|
||||
let write_characteristic = "0000AE03-0000-1000-8000-00805F9B34FB"
|
||||
let notify_characteristic = "0000AE03-0000-1000-8000-00805F9B34FB"
|
||||
let notify_characteristic_2 = "0000AE02-0000-1000-8000-00805F9B34FB"//获取设备电量和设备mac地址
|
||||
|
||||
@ -123,15 +123,18 @@ String.prototype.transFloat = function() {
|
||||
return str.indexOf('.') != -1 ? parseFloat(str).toFixed(1) : str
|
||||
}
|
||||
|
||||
// //uni
|
||||
uni.onBluetoothAdapterStateChange(function(res) {
|
||||
if (!res.available) {
|
||||
isOpen = false
|
||||
isBleOn = false
|
||||
} else {
|
||||
isBleOn = true
|
||||
}
|
||||
})
|
||||
//
|
||||
|
||||
if (uni.getSystemInfoSync().platform){
|
||||
uni.onBluetoothAdapterStateChange(function(res) {
|
||||
if (!res.available) {
|
||||
isOpen = false
|
||||
isBleOn = false
|
||||
} else {
|
||||
isBleOn = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user