Einzelnen Beitrag anzeigen

elmar.faber

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

AW: Bluetooth LE unter Windows 11 funktioniert nicht mehr

  Alt 17. Aug 2023, 07:05
Hallo,

so ich habe mal versucht den Code umzusetzen, aber ich bekomme an der Stelle einen Integerüberlauf...


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
    if TAsyncOperation<IAsyncOperation_1__GenericAttributeProfile_IGattDescriptorsResult>.Wait(
                    characteristic3.GetDescriptorsAsync(BluetoothCacheMode.Uncached), descriptorRes3) = AsyncStatus.Completed then
    begin
      descrRes := descriptorRes3.GetResults;
      LGattDescriptors := descrRes.Descriptors;
      for I := 0 to LGattDescriptors.Size - 1 do <-------------------------------- Hier gibt es einen Integerüberlauf
        FDescriptors.Add(TWinRTBluetoothGattDescriptor.Create(Self, LGattDescriptors.GetAt(I)));
    end;
  end
Ich bin mir allerdings nicht sicher, ob ich es korrekt umgesetzt habe... ich habe die Datei System.Win.BluetoothWinRT.pas in dem Ordner
C:\Program Files (x86)\Embarcadero\Studio\22.0\source\rtl\net ausgetauscht und das Ganze dann unter Delphi als Admin kompiliert und die
Komponente BluetoothLE im Hauptprogramm ausgetauscht...
Elmar Faber
  Mit Zitat antworten Zitat