自己作为广播方,连接我的设备断开收到的事件。

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的更多相关文章

  1. delphi 蓝牙 TBluetoothLE

    delphi 蓝牙 TBluetoothLE.TBluetoothLEManager BLE http://docwiki.embarcadero.com/RADStudio/Seattle/en/U ...

  2. TBluetoothLE

    delphi 蓝牙技术 D:\Users\Public\Documents\Embarcadero\Studio\17.0\Samples\Object Pascal\Multi-Device Sam ...

  3. RAD Studio 10 自带Demo代码汇总说明

    大家好,好多朋友来信咨询Delphi和C++Builder的移动开发.DataSnap架构等问题,希望能有Demo代码学习.其实Delphi和C++Builder本身自带有很多示例代码,已经覆盖了大部 ...

  4. delphi 演示数据路径

    链接里默认的--------------------------- Error --------------------------- I/O error for file "C:\Prog ...

  5. delphi BLE 学习

    TBluetoothLE 控件 TBluetoothLE.FManager: TBluetoothLEManager; class constructor TBluetoothLEManager.Cr ...

  6. Delphi IOS 蓝牙锁屏后台运行

    Delphi IOS 后台运行 同样的程序,编译成android,锁屏后继续运行正常,蓝牙通讯正常,但在IOS下锁屏后程序的蓝牙就中断通讯了? IOS的机制就是这样,锁屏就关闭了. 音乐播放器是怎么做 ...

  7. RAD 10 蓝牙

    http://docwiki.embarcadero.com/Libraries/Seattle/en/System.Bluetooth.TBluetoothLEManager.StartDiscov ...

随机推荐

  1. 博客迁移至“零一积流|it-refer.com”

    虽然在博客园写了没几篇文章,考虑到个人发展,自己还是建立一个独立的站点:零一积流. 以后直接在自己网站上写东西了,此处只用做文章收藏.

  2. onenote的笔记本在windows10保存的路径

    onenote挺好用的,支持windows,android,mac等操作系统,完全符合我的需求,并且还没有广告.但是,在删除笔记本的时候,感觉比较费事,因为他没有配置告诉我们文件具体放在哪个路径下了, ...

  3. 颜色叠加模式:mix-blend-mode

    文章转自叠加模式 http://www.cgspread.com/3551.html 注释:1.混合模式的数学计算公式,另外还介绍了不透明度.2.这些公式仅适用于RGB图像,对于Lab颜色图像而言,这 ...

  4. 自动化测试时Ios设备无法调出键盘问题

  5. pip 在windows下的更新升级

    1. pip 在 PyCharm 无法自动更新 2.   https://pip.pypa.io/en/latest/installing.html 官方网页要求在 cmd中输入以下命令进行 pip的 ...

  6. 《DSP using MATLAB》示例 Example 9.6

    代码: %% ------------------------------------------------------------------------ %% Output Info about ...

  7. 【数据库】sql连表查询

    SQL总结 连表查询 连接查询包括合并.内连接.外连接和交叉连接,如果涉及多表查询,了解这些连接的特点很重要. 只有真正了解它们之间的区别,才能正确使用. 1.Union UNION 操作符用于合并两 ...

  8. bzoj 3671 [Noi2014]随机数生成器——贪心(时间复杂度分配)

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3671 设 x 为一个点的行号, y 为一个点的列号:原本想着判断一个点能不能选就是看选了的点 ...

  9. pandas之Dataframe转成dict+过滤+index去重

    转成字典a = ['key1', 'key2', 'key3']b = ['1', '2', '3']data = pd.DataFrame(zip(a, b), columns=['project' ...

  10. GOF23设计模式之中介者模式(mediator)

    一.中介者模式概述 如果一个系统中对象之间的联系呈现网状结构,对象之间存在大量多对多的关系,导致关系及其复杂,这时可以引入一个中介者对象,使得各个对象只跟中介者对象打交道,从而将复杂的网络结构化为星型 ...