如何克服蓝牙远程设备的序列号? [英] How to get the Serial Number of the Remote Device over Bluetooth?

查看:402
本文介绍了如何克服蓝牙远程设备的序列号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的申请,我发现了蓝牙设备,从而得到如下---


  • 蓝牙设备的名称。

  • 蓝牙设备的硬件地址。

这是通过获取完成的 BluetoothDevice类对象为每个发现的设备和呼叫
object.getName() object.getAddress()

我也希望得到每个发现的蓝牙设备的序列号

我知道我自己的设备的序列号---

  android.os.Build.SERIAL


解决方案

许多蓝牙低功耗配置文件提供的服务的名为设备信息。< BR>
分配UUID: 0x180A 结果
<一href=\"https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.device_information.xml\" rel=\"nofollow\">https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.device_information.xml

在此的服务的有一个序号字符串特性的可容纳特定蓝牙序列号低功耗设备。结果
分配UUID: 0x2A25 结果
<一href=\"https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.serial_number_string.xml\" rel=\"nofollow\">https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.serial_number_string.xml

这是可选的,但并没有全部BLE配置文件将拥有它,你必须连接到该设备检索此信息。

In my application, I discovered bluetooth devices and thus got the following ---

  • Name of Bluetooth Device.
  • Hardware address of Bluetooth Device.

This is done by getting BluetoothDevice object for each discovered device and calling object.getName() and object.getAddress().

I also want to get the Serial number of each discovered bluetooth device.

I know to get the serial number of my own device as ---

android.os.Build.SERIAL

解决方案

Many bluetooth low energy profiles provide a service called Device Information.
Assigned UUID: 0x180A
https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.device_information.xml

Under this service there is a Serial Number String characteristic which can hold a serial number specific to the Bluetooth low energy device.
Assigned UUID: 0x2A25
https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.serial_number_string.xml

This is optional though and not all BLE profiles will have it, and you have to connect to the device to retrieve this information.

这篇关于如何克服蓝牙远程设备的序列号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆