了解UUID的长短形式 [英] Understanding long and short form of UUID

查看:180
本文介绍了了解UUID的长短形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在android中学习一些蓝牙编程
我已经能够制作一个基本程序,该程序可以发现并连接到具有内置蓝牙功能的(目前只有一个)开发板.
我希望能够使用RFCOMM
向板发送命令并从板接收消息 有人告诉我,在不知道开发板和电话的UUID的情况下,我可能将无法进一步前进
在进行深入研究时,我发现开发板使用了0xFFFF的UUID作为自定义服务冲突协议,并且我从这里还发现,在SDP中可以仅使用16位来表示UUID的某些选定范围 ,但可以将其扩展为128位,但是我无法找出如何进行此扩展,页面中给出的链接似乎已损坏
能否请您简单地解释一下什么是UUID(就蓝牙而言,特别是就RFCOMM而言),它们对我在蓝牙编程中的意义是什么,以及如何从16位中获得128位的uuid董事会使用的版本?
提前致谢.

I am trying to learn some bluetooth programming in android
I have been able to make a rudimentary program that discovers and connects to a (currently just a single) development board with Bluetooth features built in
I want to be able to send commands to the board as well as receive messages from it using RFCOMM
I have been told that I will probably not be able to move any further without knowing the UUID for the board as well as the phone
While digging around for this, I found out that the board uses a UUID of 0xFFFF foir it's custom Service Disocvery Protocol, and I also found from here that it is possible in SDP to represent some selected range of UUID's using only 16 bits, which can be expanded to 128-bits, but I am not able to find out how to do this expansion and the link given in the page seems to be broken
Could some one please provide an easy explanation of what UUID's are (in terms of Bluetooth and specifically in terms of RFCOMM), what is their significance for me in bluetooth programming, and how can I get a 128-bit uuid from the 16-bit version that my board uses?
Thanks in advance.

推荐答案

通用唯一标识符主要用于低功耗蓝牙(BLE)中,以便访问例如电子套件中的硬件传感器的功能.例如,如果我们有一个带有集成加速度计传感器和陀螺仪传感器的套件,并且可以通过智能手机设备通过蓝牙启用它(已连接套件),那么您必须使用UUID来告知套件您实际要访问的套件该套件的加速度计服务.

Universally Unique Identifiers are mainly used in Bluetooth Low Energy (BLE) in order to access a functionality of a hardware sensor in an electronic kit for instance. As an example, if we have a kit with an integrated Accelerometer Sensor and Gyroscope Sensor that can be enabled using Bluetooth with a Smartphone device (connected to the kit), then you have to use UUIDs to tell the kit that you actually want to access the Accelerometer Service of the kit.

UUID是128位值.以下UUID是SensorTag设备的示例:

UUIDs are 128-bit values. Following UUID is an example of the SensorTag device:

F000 AAAA -0451-4000-B000-000000000000

F000AAAA-0451-4000-B000-000000000000

其中 AAAA 是重要的16位(0xAAAA),用作每个服务的"ID".

where AAAA is the important 16 bits (0xAAAA) that is used as an "ID" for every service.

该套件中的加速度计服务具有以下UUID:

The accelerometer service in the kit has following UUID:

F000 AA10 -0451-4000-B000-000000000000

F000AA10-0451-4000-B000-000000000000

并且陀螺仪传感器需要遵循UUID才能访问其服务

and the gyroscope sensor requires following UUID to access its service

F000 AA50 -0451-4000-B000-000000000000

F000AA50-0451-4000-B000-000000000000

如果您随后使用这些UUID之一对远程设备执行任何蓝牙操作,则它将知道您要访问的服务.

If you then perform any Bluetooth operation to the remote device with one of those UUIDs, then it will know, which service you're trying to access.

这篇关于了解UUID的长短形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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