在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
TBluetoothLE 控件 TBluetoothLE.FManager: TBluetoothLEManager; class constructor TBluetoothLEManager.Create; begin FBluetoothManagerClass := TPlatformBluetoothLEManager; end; FManager: TBluetoothLEManager; FManager.StartDiscovery(10000); BluetoothLE1.CurrentManager. () 有3个例子,没有用控件,用的是创建的方式 Bluetooth\Beacons\BLE_BeaconScanner Bluetooth\ExploreDevicesLE Bluetooth\ProximityClientServer 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;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论