您如何获得蓝牙低能耗设备的实际名称? [英] How do you get the actual name of a bluetooth low energy device?

查看:63
本文介绍了您如何获得蓝牙低能耗设备的实际名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从ble传感器获取友好的设备名称.例如,我想找到设备并告诉用户它们已连接到我的家庭传感器".我可以找到设备,但是我不知道如何找到该数据.

I need to get the friendly device name from a ble sensor. I want to find the device and tell the user they are connected to "My Home Sensor" for example. I can find the device, but I don't know how to find that data.

在常规的蓝牙中,我相信我可以使用BLUETOOTH_DEVICE_INFO或winsock.是否有与蓝牙的BLUETOOTH_DEVICE_INFO等效的蓝牙低能耗?如果可能,请提供一个示例来说明如何获取信息(即设备名称)吗?

In regular bluetooth, I believe I can use BLUETOOTH_DEVICE_INFO or winsock. Is there a bluetooth low energy equivalent to bluetooth's BLUETOOTH_DEVICE_INFO? If possible, could you please provide an example for how to get the information (i.e. device name)?

我正在使用Windows 8.1,c ++和Visual Studio2013.我一直在引用Windows开发文档,但是我还没有发现任何有用的东西.

I'm using Windows 8.1, c++ and visual studio 2013. I've been referencing windows dev docs, but I haven't found anything useful yet.

谢谢!

推荐答案

假设您能够与GATT服务器建立连接,则在解析设备的GAP配置文件时,您将在通用"下找到设备名称"的属性访问配置文件(GAP).

Assuming that you are able to get connected with the GATT Server, when you parse the GAP profile of the device, you will find an attribute for Device Name under Generic Access Profile (GAP).

是所有标准GATT服务及其UUID的列表.GAP的UUID为0x1800.
是所有标准特征及其UUID的列表.对于设备名称特征",它是0x2A00.
此页面解释了设备名称特征是GAP的一部分.

This is a list of all the standard GATT Services and their UUIDs. UUID for GAP is 0x1800.
This is a list of all the standard Characteristics and their UUIDs. For the Device Name Characterstic it is 0x2A00.
This page explains that the Device Name characteristic is a part of the GAP.

这篇关于您如何获得蓝牙低能耗设备的实际名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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