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 ...
随机推荐
- get、post接口测试-java
public class HttpClient { //get请求方法 public String sendGet(String url, String data) { Date date = new ...
- 让Apache支持URL重写
第一步: 添加.htaccess文件 Rewrite 规则 <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_ ...
- 【spring源码学习】spring的task配置
=================spring线程池的配置策略含义========================== id:当配置多个executor时,被@Async("id" ...
- psd文件导出为图片教程
美术给过来PSD文件好多层啊.怎么挨个把需要的图片导出来呢. 1. 选中 要导出的图片的图层 2.ctrl+N 新建个文档 然后把图片拉到 新的里面 然后点图像-裁剪 确定就行了,然后ctrl+s保 ...
- 【转】VC 模式对话框和非模式对话框的创建,销毁和区别
原文网址:http://blog.csdn.net/mycaibo/article/details/6002151 VC 模式对话框和非模式对话框的创建,销毁和区别 在WIN32中,模式对话框的创 ...
- DB time VS. DB CPU
如何行之有效地展示系统负载在做系统调优的时候是必不可少的技巧.通常我们会使用Oracle提供的Time Model,比如我们需要作出类似于下面这样的趋势图来展示系统负载的高低. 这样的趋势图可以直接使 ...
- poj 1637 Sightseeing tour——最大流+欧拉回路
题目:http://poj.org/problem?id=1637 先给无向边随便定向,如果一个点的入度大于出度,就从源点向它连 ( 入度 - 出度 / 2 ) 容量的边,意为需要流出去这么多:流出去 ...
- 运维命令:tcpdump
tcpdump命令 tcpdump 命令是一款sniffer工具,它可以打印所有经过网络接口的数据包的头信息,也可以使用 -w 选项将数据包保存到文件中,方便以后分析. 常用参数: -a:尝试将网络 ...
- Oracle存储过程记录异常日志
一般我们会将一些涉及到数据库的定时任务直接用存储过程搞定,省去了后端代码的开发.部署,简单.快速,但这种方式存在一个弊端——当存储过程执行出错了,我们无法感知.解决办法也简单,学代码那样去捕获异常.打 ...
- HDOJ4763(KMP原理理解)
Theme Section Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tot ...