Connect via Bluetooth with Delphi XE7 using portable printer

后端 未结 2 1953
天命终不由人
天命终不由人 2021-02-05 09:35

I\'m trying to communicate with a Sewoo LK-P32 printer via Bluetooth. For this, I am using Delphi XE7. I made a few examples that come with Del

2条回答
  •  余生分开走
    2021-02-05 09:53

    In your loop, you keep assigning to lDevice. If there is a second unpaired device then lDevice is pointing to that. You need top Exit once you have detected that it is paired.

    Also, I personally don't like raising exceptions deliberately. If a class instance is nil then you should exit, nolt drill down into it..

    For instance

    if FBluetoothManager = nil then
    begin
      Memo1.Lines.Add('FBluetoothManager esta nulo');
      Exit;
    end;
    

提交回复
热议问题