BLE执行写入后读取响应

时间:2017-12-08 19:18:12

标签: cordova typescript ionic-framework bluetooth bluetooth-lowenergy

我正在Ionic中写一个蓝牙功能。我必须通过蓝牙写一些字节,并在完成后读取响应。跟随id在typescript中写入代码:

let bufferArray = [1,5,3,9,4,1];
for (var a = 0; a < bufferArray.length; a++) {
  this.ble.write(this.peripheral.id
                  , "0x0018" 
                  , "wbi"
                  , new Uint8Array([bufferArray[a]]).buffer
                ).then(
    (buffer) => {

    }
  )
}

当我看到接收设备日志时,日志显示接收,接受和处理的字节。现在,我的问题是,当这样做时,我必须阅读回复。我道歉,如果我没有意义,因为我以前没有在蓝牙工作,我很困惑。

感谢您阅读我的帖子。

0 个答案:

没有答案