是否可以在Electron中检测PC (Mac或Linux)是否连接了蓝牙适配器?我正在使用" Bluetooth -serial-port“库进行蓝牙通信。如果BT适配器未连接到PC,应用程序将继续重新加载。
这就是该应用程序试图查找设备的方式。
var btSerial = new (require('bluetooth-serial-port')).BluetoothSerialPort();
try {
btSerial.inquire();
}
catch (e) {
callback(new Error('something bad