我正在使用这个mbed 解决方案,在 C++ 中创建自定义 GATT 服务。但是,此代码仅使用 UUID 创建特征:
uint16_t customServiceUUID = 0xA000;
uint16_t readCharUUID = 0xA001;
uint16_t writeCharUUID = 0xA002
然而,在连接到基于 mbed 的设备的智能手机上的 C# 代码中,我试图访问标准配置文件中的标准特征具有的Characteristic.ID
和属性,但我没有。Characteristic.Name
如何将此信息添加到特征中?
在我的 C# 代码中,我有以下内容:
try {
foreach(var data in services)
{
if (data!=null && data.ID == 0xA001.UuidFromPartial()){ GasSenseService = data; }
Debug.WriteLineIf (data!=null, "data not null");
Debug.WriteLine ("Name:", data.Name);
Debug.WriteLine ("ID:", data.ID);
}
}
catch {
...