2017-03-05 76 views
0

我想编辑一个通过蓝牙发送信息的程序,我的源代码就在这里,即使我在我的设备上尝试它,它仍然给我“无法启用蓝牙”。ionic 2 BluetoothSerial不会工作

+0

你有没有提醒(err)? –

回答

0

这是解决方案,我必须使用功能BluetoothSerial.list(),选择我的设备的蓝牙接口,从那里我想发送信息。

/** Select bluetooth interface from where i should be connected **/ 
BluetoothSerial.list().then(
    (devices) => { JSON.stringify(devices); }, 
    (err) => { alert(" cant list devices" + err); } 
);