【文件属性】:
文件名称:bluetooth:获取或设置蓝牙状态
文件大小:4KB
文件格式:ZIP
更新时间:2021-04-30 09:37:43
JavaScript
蓝牙
获取或设置蓝牙状态。
当前仅OS X系统
安装
$ npm install --save bluetooth
用法
const bluetooth = require ( 'bluetooth' ) ;
bluetooth . isOn ( ) . then ( state => {
console . log ( state ) ;
//=> false
} ) ;
bluetooth . on ( ) . then ( state => {
console . log ( 'Bluetooth state changed to on' ) ;
} ) ;
bluetooth . off ( ) . then ( state => {
console . log ( 'Bluetooth state changed to off' ) ;
} ) ;
bluetooth
【文件预览】:
bluetooth-master
----.gitattributes(12B)
----test.js(263B)
----license(1KB)
----.travis.yml(72B)
----.editorconfig(231B)
----.gitignore(13B)
----index.js(57B)
----readme.md(1KB)
----cli.js(758B)
----package.json(763B)