java怎么与蓝牙交互数据_使用Web蓝牙API与蓝牙设备进行交互

本文介绍了如何通过Web蓝牙API来实现Java应用程序与蓝牙设备之间的数据交互,主要关注在物联网场景下的应用。
摘要由CSDN通过智能技术生成

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。

Image for post
Getting a device’s battery level with 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

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值