TBluetoothLE.OnDisconnectDevice
自己作为广播方,连接我的设备断开收到的事件。
TBluetoothLE.OnDisconnectDevice
TBluetoothLEDevice
BluetoothLE1->DiscoveredDevices->Items[i]->DisposeOf();
BluetoothLE1.DiscoveredDevices[0].OnConnect;
BluetoothLE1.DiscoveredDevices[0].OnDisconnect;
procedure TForm7.myDisConnect( Sender : TObject );
begin end; procedure TForm7.FormCreate( Sender : TObject );
begin
BluetoothLE1.DiscoveredDevices[ ].OnDisconnect := myDisConnect;
end;
和下面这个是相反的。
System.Mac.Bluetooth.pas
{ TInternalBluetoothLEManager }
procedure TInternalBluetoothLEManager.centralManagerDidConnectPeripheral(central: CBCentralManager; peripheral: CBPeripheral);
begin
FLastError := ;
FConnected := True;
if Assigned(FOnDeviceConnect) then
FOnDeviceConnect(Self, peripheral);
end;
procedure TInternalBluetoothLEManager.centralManagerdidDisconnectPeripheral(central: CBCentralManager; peripheral: CBPeripheral;
error: NSError);
begin
FLastError := error.code;
FConnected := True;
if Assigned(FOnDeviceDisconnect) then
FOnDeviceDisconnect(Self, peripheral);
end;
property OnDeviceDisconnect: TDeviceConnectionChangeEvent read FOnDeviceDisconnect write FOnDeviceDisconnect;
property OnDeviceConnect: TDeviceConnectionChangeEvent read FOnDeviceConnect write FOnDeviceConnect;
FOnConnect: TNotifyEvent;
FOnDisconnect: TNotifyEvent;
所以可以用TNotifyEvent自定义通知事件来解决。
TNotifyEvent is used for events that do not require parameters.
The TNotifyEvent type is the type for events that have no event-specific parameters. These events simply notify the component that a specific event occurred. For example, OnClick, which is of type TNotifyEvent, notifies the control that a click event occurred on the control.
The Sender parameter is the object whose event handler is called. For example, with the OnClick event of a button, the Sender parameter is the button component that is clicked.
property OnDisconnect: TNotifyEvent read FOnDisconnect write FOnDisconnect;
// will be invoked once disconnected -(void)centralManager:(CBCentralManager *)central
didDisconnectPeripheral:(CBPeripheral *)peripheral
error:(NSError *)error;
TBluetoothLE.OnDisconnectDevice的更多相关文章
- delphi 蓝牙 TBluetoothLE
delphi 蓝牙 TBluetoothLE.TBluetoothLEManager BLE http://docwiki.embarcadero.com/RADStudio/Seattle/en/U ...
- TBluetoothLE
delphi 蓝牙技术 D:\Users\Public\Documents\Embarcadero\Studio\17.0\Samples\Object Pascal\Multi-Device Sam ...
- RAD Studio 10 自带Demo代码汇总说明
大家好,好多朋友来信咨询Delphi和C++Builder的移动开发.DataSnap架构等问题,希望能有Demo代码学习.其实Delphi和C++Builder本身自带有很多示例代码,已经覆盖了大部 ...
- delphi 演示数据路径
链接里默认的--------------------------- Error --------------------------- I/O error for file "C:\Prog ...
- delphi BLE 学习
TBluetoothLE 控件 TBluetoothLE.FManager: TBluetoothLEManager; class constructor TBluetoothLEManager.Cr ...
- Delphi IOS 蓝牙锁屏后台运行
Delphi IOS 后台运行 同样的程序,编译成android,锁屏后继续运行正常,蓝牙通讯正常,但在IOS下锁屏后程序的蓝牙就中断通讯了? IOS的机制就是这样,锁屏就关闭了. 音乐播放器是怎么做 ...
- RAD 10 蓝牙
http://docwiki.embarcadero.com/Libraries/Seattle/en/System.Bluetooth.TBluetoothLEManager.StartDiscov ...
随机推荐
- 安装伪分布式hbase 0.99.0
查看是否启动成功,输入jps,看到有HMaster和HQuorumPeer,浏览器输入http://localhost:16030/master-status,能打开说明成功 hbase(main): ...
- nodejs调用百度统计api摆脱人肉数据统计
var http = require("https"); var url = require('url'); var postData = JSON.stringify( { &q ...
- CF 148D D. Bag of mice (概率DP||数学期望)
The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests ...
- springboot项目启动之后初始化自定义配置类
前言 今天在写项目的时候,需要再springboot项目启动之后,加载我自定义的配置类的一些方法,百度了之后特此记录下. 正文 方法有两种: 1. 创建自定义类实现 CommandLineRunner ...
- bootstrap 折叠菜单
首先从 左侧的折叠菜单 开始.看图. 2. CSS 代码 以下是自定义的css代码,由于系统是内部使用,所以优先考虑chrome,firefox 不考虑IE了. #main-nav { margin- ...
- (1/2) 为了理解 UWP 的启动流程,我从零开始创建了一个 UWP 程序
每次使用 Visual Studio 的模板创建一个 UWP 程序,我们会在项目中发现大量的项目文件.配置.应用启动流程代码和界面代码.然而这些文件在 UWP 程序中到底是如何工作起来的? 我从零开始 ...
- mysql 关联左表不存在数据 并 根据身份证计算查找大于65岁以上老人
--- //查找左边不存在数据,不能用 = '' SELECT m.uid FROM es_members m LEFT JOIN es_user_self_care_assessment u ON ...
- 重温CLR(十六) CLR寄宿和AppDomain
寄宿(hosting)使任何应用程序都能利用clr的功能.特别要指出的是,它使现有应用程序至少能部分使用托管代码编写.另外,寄宿还为应用程序提供了通过编程来进行自定义和扩展的能力. 允许可扩展性意味着 ...
- 使用 Git 对原理图和线路板时行版本控制
使用 Git 对原理图和线路板时行版本控制 由于之前一直用 Git 管理代码,我又开始试用 git 来对原理图和线路板时行版本控制. 由于 原理图和 PCB 的文件都是二进制文件,git 管理并不怎么 ...
- CSS内容简单归纳
具体内容请查阅<CSS参考手册> 一.CSS模块介绍 1.1 CSS1中定义了网页基本属性 字体.颜色.补白.基本选择器等 1.2 CSS2中在CSS1的基础上添加了高级功能 浮动和定位. ...