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;
  • 相关阅读:
    布局
    JS基础回顾_滚动条
    JS基础回顾_Dom
    JS语法_其他
    JS语法_类型
    一些免费的API
    CSS特效(一)
    博客园在Markdown中使用JS
    C# 聊一聊屏保的设置 第一步 注册表
    2019 力扣杯-全国高校春季编程大赛 最长重复子串
  • 原文地址:https://www.cnblogs.com/cb168/p/5099138.html
Copyright © 2011-2022 走看看