Tag: gatt

Windows UWP在发现后连接到BLE设备

我正在使用BluetoothLEAdvertisementWatcher查找附近的BLE设备,它运行良好。 找到它们后,我想通过GATT连接和读/写数据。 但在获取BluetoothLEAdvertisement后,我无法弄清楚如何使用API​​( https://msdn.microsoft.com/de-de/library/windows/apps/windows.devices.bluetooth.genericattributeprofile )。 public class Adapter { private readonly BluetoothLEAdvertisementWatcher _bleWatcher = new BluetoothLEAdvertisementWatcher(); public Adapter() { _bleWatcher.Received += BleWatcherOnReceived; } private void BleWatcherOnReceived(BluetoothLEAdvertisementWatcher sender, BluetoothLEAdvertisementReceivedEventArgs args) { // how to connect? // I know, it’s the wrong place to to this, but this is just an example } public void StartScanningForDevices(Guid[] serviceUuids) […]