java怎么与蓝牙交互数据
TL;DR: Try the Web Bluetooth API in the browser or check out the sample React app: https://github.com/rdeprey/web-bluetooth-starter.
TL; DR: 在浏览器中尝试Web蓝牙API 或查看示例React应用程序: https : //github.com/rdeprey/web-bluetooth-starter 。
If you have smart home devices, you’ve likely interacted with them over Bluetooth from a native app on your phone. Did you know that you can also interact with Bluetooth devices through a website? You can using the Web Bluetooth API.
如果您有智能家居设备,则可能已经通过手机上的本机应用程序通过蓝牙与它们进行了交互。 您知道您还可以通过网站与蓝牙设备进行交互吗? 您可以使用Web Bluetooth API。
Although this API is still considered experimental technology, it has decent support in Google Chrome, Edge, and Opera. Some of the things you can do with the Web Bluetooth API include:
尽管此API仍被认为是实验性技术, 但它在Google Chrome,Edge和Opera中具有不错的支持 。 您可以使用Web Bluetooth API进行的一些操作包括:
- Requesting and connecting to nearby devices 请求并连接到附近的设备
- Reading and writing Bluetooth characteristics 读写蓝牙特性
- Receiving GATT notifications 接收关贸总协定通知
- Receiving notifications when a device is disconnected 断开设备时接收通知
- Reading and writing Bluetooth descriptors 读写蓝牙描述符
If you’re new to how Bluetooth devices work, I’ll explain some of the concepts above. Otherwise, feel free to skip ahead.
如果您不了解蓝牙设备的工作原理,那么我将解释上面的一些概念。 否则,请随时跳过 。
蓝牙关键概念 (Bluetooth Key Concepts)
Here are a few key concepts you’re likely to come across as you start working with the Web Bluetooth API.
在开始使用Web Bluetooth API时,可能会遇到一些关键概念。
GATT(通用属性配置文件) (GATT (Generic Attribute Profile))
GATT plays an integral role in defining how data is shared over a Bluetooth connection. It describes the data transfer processes and