|
@@ -87,7 +87,14 @@ class BleUtil {
|
|
|
const hex_util = require('./../../utils/hex_util');
|
|
|
that.manager.onBLECharacteristicValueChange(function (value) {
|
|
|
var receiveText = hex_util.buf2string(value);
|
|
|
- console.log('接收到数据文字:' + receiveText)
|
|
|
+ console.log('接收到数据文字:' + receiveText);
|
|
|
+
|
|
|
+ var buffer = new DataView(value);
|
|
|
+ var result = []
|
|
|
+ for (let i = 0; i < buffer.byteLength; i++) {
|
|
|
+ result.push(buffer.getUint8(i))
|
|
|
+ }
|
|
|
+ BtParse.parseTLV(result);
|
|
|
});
|
|
|
},
|
|
|
function () {
|