You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.26 00:43:26