您的位置:首页 > 编程语言 > Delphi

delphi IOS BLE 代理

2016-01-10 10:50 555 查看
代理方法

centralManagerDidUpdateState:

peripheralManagerDidUpdateState:代理方法。

centralManager:willRestoreState

peripheralManager:willRestoreState:代理方法

- (void)centralManager:(CBCentralManager *)central willRestoreState:(NSDictionary *)state
{
NSArray *peripherals = state[CBCentralManagerRestoredStatePeripheralsKey];

// TODO: ...
}

D:\Program Files (x86)\Embarcadero\Studio\17.0\source\rtl\net\System.Mac.Bluetooth.pas
D:\Program Files (x86)\Embarcadero\Studio\17.0\source\rtl\osx\Macapi.Bluetooth.pas

\17.0\source\rtl\net\System.Mac.Bluetooth.pas(3481):
procedure centralManagerDidUpdateState(central: CBCentralManager); cdecl;
[MethodName('centralManager:willRestoreState:')]

procedure TInternalBluetoothLEManager.centralManagerDidUpdateState(central: CBCentralManager);

delphi在
System.Mac.Bluetooth.pas
实现了centralManagerDidUpdateState方法

procedure TInternalBluetoothLEManager.centralManagerDidUpdateState(central: CBCentralManager);
begin
if (central.state = CBCentralManagerStatePoweredOn) and FWaitingToDiscover then
begin
FWaitingToDiscover := False;
central.scanForPeripheralsWithServices(FFilterUUIDList, FScanOptions);
end;
end;


delphi也实现了 initWithDelegate方法

procedure TInternalBluetoothLEManager.centralManagerWillRestoreState(central: CBCentralManager; dict: NSDictionary);
begin

end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: