【发布时间】:2017-12-14 13:56:43
【问题描述】:
我编写了以下代码以在应用程序的警报消息中显示接收到的蓝牙数据。
open(item: any){
alert("Selected ");
this.bluetoothSerial.connectInsecure("XX:XX:X4:X6:1X:2X").subscribe((data) =>{
alert(JSON.stringify(data));
this.bluetoothSerial.subscribeRawData().subscribe((data) => { alert("Subscription : " + JSON.stringify(data))});
});
setTimeout(() => {
this.bluetoothSerial.read().then((data) => { alert("read data : " +JSON.stringify(data))});
}, 2000);
}
发送蓝牙信号时,“订阅”提示框和“读取数据”提示框均显示空字符串,不显示实际发送的数据。如何配置 Ionic 蓝牙串行包以显示接收到的蓝牙数据?
【问题讨论】:
标签: android cordova typescript ionic-framework bluetooth