Einzelnen Beitrag anzeigen

elmar.faber

Registriert seit: 10. Sep 2007
Ort: Neustadt (Hessen)
37 Beiträge
 
Delphi 10.2 Tokyo Architect
 
#11

AW: Bluetooth LE unter Windows 11 funktioniert nicht mehr

  Alt 17. Aug 2023, 11:50
Ich habe nun die komplette Datei ausgetauscht mit der hochgeladenen Version (https://quality.embarcadero.com/browse/RSP-42149)

Diesmal springt er bei der folgenden Funktion in den Elae-Zweig und bleibt da hängen:

Delphi-Quellcode:
function TWinRTBluetoothGattCharacteristic.DoGetDescriptors: TBluetoothGattDescriptorList;
var
  LGattDescriptors: IVectorView_1__GenericAttributeProfile_IGattDescriptor;
  I: Integer;
  characteristic3 : GenericAttributeProfile_IGattCharacteristic3;
  descriptorRes3 : IAsyncOperation_1__GenericAttributeProfile_IGattDescriptorsResult;
  descrRes : GenericAttributeProfile_IGattDescriptorsResult;
begin
  FDescriptors.Clear;

  if Supports(FGattCharacteristic, GenericAttributeProfile_IGattCharacteristic3, characteristic3) then
  begin
       // async
       if TAsyncOperation<IAsyncOperation_1__GenericAttributeProfile_IGattDescriptorsResult>.Wait(
                        characteristic3.GetDescriptorsAsync(BluetoothCacheMode.Uncached), descriptorRes3 ) = AsyncStatus.Completed then
       begin
            descrRes := descriptorRes3.GetResults;
            LGattDescriptors := descrRes.Descriptors;
            if LGattDescriptors.Size > 0 then
            begin
                 for I := 0 to LGattDescriptors.Size - 1 do
                     FDescriptors.Add(TWinRTBluetoothGattDescriptor.Create(Self, LGattDescriptors.GetAt(I)));
            end;
       end;
  end
  else
  begin
    // deprecated use only if not yet supported
    LGattDescriptors := (FGattCharacteristic as GenericAttributeProfile_IGattCharacteristic2).GetAllDescriptors;
    if LGattDescriptors.Size > 0 then
      for I := 0 to LGattDescriptors.Size - 1 do
        FDescriptors.Add(TWinRTBluetoothGattDescriptor.Create(Self, LGattDescriptors.GetAt(I))); <----------- bleibt hier hängen
  end;
  Result := FDescriptors;
end;
Elmar Faber
  Mit Zitat antworten Zitat