zoukankan      html  css  js  c++  java
  • delphi BLE 学习

    TBluetoothLE 控件
    
    
    TBluetoothLE.FManager: TBluetoothLEManager;
    
    
    
    class constructor TBluetoothLEManager.Create;
    begin
      FBluetoothManagerClass := TPlatformBluetoothLEManager;
    end;
    
    
    
    FManager: TBluetoothLEManager;
    FManager.StartDiscovery(10000);
    
    BluetoothLE1.CurrentManager. ()
    
    
    有3个例子,没有用控件,用的是创建的方式
    BluetoothBeaconsBLE_BeaconScanner
    BluetoothExploreDevicesLE
    BluetoothProximityClientServer
    
    FBLEManager: TBluetoothLEManager;
    procedure TfrmProximityForm.FormShow(Sender: TObject);
    begin
      FBLEManager := TBluetoothLEManager.Current;
      FBLEManager.OnDiscoveryEnd := DoDiscoveryEndEvent;
      FCurrentPosition := poUnknown;
      DoScan;
    end;
    
    procedure TInternalBluetoothLEManager.CreateTimer(Interval: Integer);
    var
      LInterval: NSTimeInterval;
    begin
      if (Interval > 0) then
      begin
        FTimer := TInternalTimer.Create;
        try
          LInterval := Interval/1000;
          FTimer.SetNotifyEvent(OnDiscoveryTimeout);
          FTimer.FTimer := TNSTimer.Wrap(TNSTimer.OCClass.scheduledTimerWithTimeInterval(LInterval,
            FTimer.GetObjectID, sel_getUid('timerEvent'), FTimer.GetObjectID, False)); // Do not translate
    
        finally
          {user is retained (twice, because it's target), by the timer and }
          {released (twice) on timer invalidation}
          NSObject(FTimer.Super).release;
        end;
      end;
    end;
  • 相关阅读:
    bzoj 2216 Lightning Conductor
    一些有趣的问题合集
    Codeforces 40E Number Table
    Codeforces 37D Lesson Timetable
    bzoj 4289 Tax
    bzoj 2844 albus就是要第一个出场
    bzoj 2115 Xor
    luogu 3790 文艺数学题
    bzoj 1420 Discrete Root
    Lucas定理学习笔记
  • 原文地址:https://www.cnblogs.com/cb168/p/5099138.html
Copyright © 2011-2022 走看看