如何在Windows 10下用Delphi实现GATT Server?
在Windows 10下用Delphi实现GATT Server的替代方案(模拟蓝牙键盘适配Android)
我需要在Windows 10系统下使用Delphi实现GATT Server,以此模拟蓝牙键盘适配Android设备。尝试用Delphi 10.2运行以下示例代码:
procedure TForm1.FormCreate(Sender: TObject); var ggs: TBluetoothGattServer; service: TBluetoothGattService; pp: TBluetoothPropertyFlags; chara: TBluetoothGattCharacteristic; begin btLE.Enabled := True; ggs := btLE.GetGattServer; if ggs <> nil then Begin service := ggs.CreateService (StringToGUID('{27EFDF1D-2D6F-4AB2-9783-E288DB80D5F1}'), TBluetoothServiceType.Primary); chara := ggs.CreateCharacteristic(service, StringToGUID('{90C16494-5AD1-48AD-B567-952359AAB3F1}'), [TBluetoothProperty.Notify, TBluetoothProperty.Indicate, TBluetoothProperty.Read, TBluetoothProperty.Write], 'RemodeLEServer'); ggs.AddService(service); btLE.Enabled := True; end else showmessage('impossibile creare il service '); end;
但调用CreateService函数时抛出异常:
Not supported on this platform
微软表示Windows 10创意者更新起已支持GATT Server,但Embarcadero官方说明:
Note: WinRT Bluetooth API provides support for BLE advertising data through the manufacturer-specific data field, but it does not fully implement GATT Server functionalities.
可见Delphi自带的TBluetoothLE在Windows 10下不支持GATT Server,请问是否有其他实现途径?
内容的提问来源于stack exchange,提问作者user3431569
相关产品推荐
相关产品推荐

