2017-03-05 70 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); } 
);