我试图了解如何在Windows上使用C#或C ++访问蓝牙(不是LE)连接的RSSI。
我的理解是,没有直接的“ GetRSSI()”类型命令,但是有任何间接方法可以访问它吗?
到目前为止,我发现的所有内容似乎都针对LE连接。
编辑: 我研究了AEP,并尝试从连接的BT设备获取SignalStrength AEP。
foreach (var key in deviceInformation.Properties.Keys)
{
Debug.WriteLine($"{key}: {deviceInformation.Properties.GetValueOrDefault(key)}");
}
礼物:
System.ItemNameDisplay: <ommitted>
System.Devices.DeviceInstanceId:
System.Devices.Icon: C:\Windows\System32\DDORes.dll,-2001
System.Devices.GlyphIcon: C:\Windows\System32\DDORes.dll,-3001
System.Devices.InterfaceEnabled:
System.Devices.IsDefault:
System.Devices.PhysicalDeviceLocation:
System.Devices.ContainerId:
我省略了项目名称。
因此,除非我缺少某些东西,否则看起来好像没有AEP?
答案 0 :(得分:0)
我知道这已经晚了,但我刚刚开始了一个新项目,我还想了解有关蓝牙(非 LE)设备 SignalStrength 的信息。
@Mike-Petrichenko 给了你一些很好的提示。按照他搜索“System.Devices.Aep.SignalStrength”的建议后,我找到了this post
在抛出 OPs 代码并稍微调试之后,我想出了这个解决方案:
private const string SignalStrengthProperty = "System.Devices.Aep.SignalStrength";
var additionalProperties = new[] { SignalStrengthProperty };
DeviceWatcher mWatcher = DeviceInformation.CreateWatcher(BluetoothDevice.GetDeviceSelector(), additionalProperties);
var rssi = Convert.ToInt16(deviceInformation.Properties[SignalStrengthProperty]);