当前位置:网站首页>Uniapp determines whether the user's Bluetooth is turned on
Uniapp determines whether the user's Bluetooth is turned on
2022-07-21 20:44:00 【Go to the front end】
First initialize the Bluetooth module :
uni.openBluetoothAdapter()
Then decide whether to turn on Bluetooth
/* Determine whether to turn on Bluetooth */
uni.getBluetoothAdapterState({
success(res) {
// If res.avaliable==false It means that Bluetooth is not turned on On the contrary
if(res.available==false){
uni.$u.toast(" Please turn on Bluetooth ")
return
}else{
// This is my business
/* Set the protection mode */
this.setTerminalMode({
workMode: 1
}, 0)
}
}
})
边栏推荐
- Nvm、Nrm使用教程
- Dynamically listen for the height of DOM elements
- xml解析
- 使用tailwind在谷歌浏览器上,button会出现蓝色背景的问题
- 用大白话让你理解TypeScript的要点.(三)
- sonarLint使用、介绍
- 微信小程序request:fail -2:net::ERR_FAILED
- flutter 报错记录:navigator.dart‘: Failed assertion: line 4041 pos 12: ‘!_debugLocked‘: is not true.
- 11. [binary writing and writing of documents]
- Vs, MATLAB, leetcode annotation shortcut key
猜你喜欢
oh-my-zsh 效率插件
自定义MVC框架实现
Difference between controlled and uncontrolled components
[C language] please fly the detailed ability functions and arrays back to the country of light
The fifth Bureau, akali teaching Bureau
Relationship between prototype, prototype chain, constructor and instance
Don't pull it today, don't pull it, read it in pieces
Cannot read property mode of undefined
微信小程序request:fail -2:net::ERR_FAILED
Solve the problem that Safari browser blocks window open
随机推荐
Upload pictures and avatars
Custom MVC framework implementation
Analysis of matching data under the fourth game
Read the manuscript in pieces
[recursive] Ackerman function
uniapp 下拉刷新、上拉加载更多、最常见的节流场景
Custom MVC principle
增删改查~
The feeling of an elegant "interview"
General paging 01
12. [i/o flow get() and getline() and put() functions]
Understand the three mountains of JS
How to view your own edition of eigen
【好文记录】嵌入式框架Zorb Framework搭建过程
Don't pull it today, don't pull it, read it in pieces
Realization of serpentine digital lattice Write a cube function with the input parameter of num. the requirements are as follows through JS: when num=3, the output table effect is: [[1,2,3] [6,5,4] [7
User defined MVC addition, deletion, modification and query
[c language] light rises in the dull days, the initial stage and the final battle
利用vscode插件 coderunner 编译运行 typescript,当输出有中文的时候,出现乱码
Recommander un éditeur de markdown facile à utiliser Mark Text