Author Topic: read "Devices[I].Address" is normal, but read "aName" is empty the contents ?  (Read 891 times)

Offline parparpar

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
aName : Without name 

I use Delphi7\WCL671\VCL\demo\Delphi\BluetoothOPP example of a successful compile run.
In the run to the "Res:= Devices.GetName(Radio, aName);" After this line, read "Devices.Address" is normal, but it reads "aName" is empty the contents  ???, "Res " is WCL_E_SUCCESS

Why?

Thanks

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2467
  • Karma: 1000
    • Wireless Communication Library
Hi,
Read name few time until it return valid name (let say 5)
WCL - Wireless Communication Library
TextBlue - Bluetooth Proximity Marketing Software
WCL Phone Explorer - Free Phone Content Manager

Offline parparpar

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Thank you for your reply !

        while Cnt < 5 do begin
          Sleep(100);            //    So?         
          Res := Devices.GetName(Radio, aName);
          if (aName <> '') or (Res <> WCL_E_SUCCESS) then Break;
          Inc(Cnt);
        end;

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2467
  • Karma: 1000
    • Wireless Communication Library
Yes, something like that.
WCL - Wireless Communication Library
TextBlue - Bluetooth Proximity Marketing Software
WCL Phone Explorer - Free Phone Content Manager