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;
  • 相关阅读:
    英语长难句
    服务器部署 halo博客项目
    11月迟来的总结
    10月总结
    9月总结
    python根据字符串导入模块
    RestFul(番外):类视图更适合restful
    Django-基础 Meta自定义
    (垃圾代码)修改同目录下面的xml文件标签数值
    Django-templatetags设置(在templates中使用自定义变量)
  • 原文地址:https://www.cnblogs.com/cb168/p/5099138.html
Copyright © 2011-2022 走看看