【发布时间】:2022-11-04 22:40:34
【问题描述】:
我正在将蓝牙框架 VCL 用于蓝牙 LE 项目。 我创建了一个这样的特征:
var
Service: TwclGattLocalService;
Params: TwclGattLocalCharacteristicParameters;
Characteristic: TwclGattLocalCharacteristic;
begin
Uuid.ShortUuid := $FFF1;
Params.Props := [cpReadable, cpNotifiable];
Res := Service.AddCharacteristic(Uuid, Params, Characteristic);
Service.AddDescriptor() ?????
我想为我创建的特征创建一个描述符。但是没有办法。我在 Gatt 客户端类中看到了读写描述符方法。但不在服务器/服务或特性类中。
var
wclGattClient: TwclGattClient;
Characteristic: TwclGattCharacteristic;
FDescriptors: TwclGattDescriptors;
begin
wclGattClient.ReadDescriptors(Characteristic, OpFlag, FDescriptors);
wclGattClient.WriteDescriptorValue(Descriptor, val);
我不能使用 Delphi 默认的 BluetoothLE 组件,因为 Gatt 服务器功能没有为 Windows 实现。
【问题讨论】:
标签: delphi bluetooth bluetooth-lowenergy vcl bluetooth-gatt