【发布时间】:2020-10-19 20:08:23
【问题描述】:
我正在尝试对蓝牙设备进行逆向工程,以便创建可以与之通信的自己的应用程序。
我已经设法从我的 Android 手机获取蓝牙日志,并且还能够通过网络连接到蓝牙设备。
不幸的是,每当我尝试向特征写入值时,都会收到错误消息:
bluetooth.html:1 Uncaught (in promise) DOMException: GATT operation failed for unknown reason.
在 Wireshark 中,我在写请求中找到的值为:
0120030000000000
如何在 Javascript 中发送此内容? 我尝试了以下方法,但都不起作用:
characteristic.writeValue(0x0120030000000000)
characteristic.writeValue(new Uint16Array([0x0120030000000000]));
characteristic.writeValue(new Uint8Array([0x0120030000000000]));
characteristic.writeValue(new Uint16Array([0x0120030000000000]));
characteristic.writeValue(new TextEncoder("utf-16").encode(0x0120030000000000));
我知道原始值为 0120030000000000,如何通过 ArrayBuffer 发送?
【问题讨论】:
标签: javascript reverse-engineering web-bluetooth