Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

CBCentralManagerMBS.DidConnectPeripheral(peripheral as CBPeripheralMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
event Bluetooth MBS Bluetooth Plugin 18.1 Yes No No No No
Function: Invoked when a connection is successfully created with a peripheral.
Notes:
peripheral: The peripheral that has been connected to the system.

This method is invoked when a call to connectPeripheral is successful. You typically implement this method to set the peripheral’s delegate and to discover its services.

Feedback, Comments & Corrections

CBCentralManagerMBS.DidDisconnectPeripheral(peripheral as CBPeripheralMBS, error as NSErrorMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
event Bluetooth MBS Bluetooth Plugin 18.1 Yes No No No No
Function: Invoked when an existing connection with a peripheral is torn down.
Notes:
peripheral: The peripheral that has been disconnected.
error: If an error occurred, the cause of the failure.

This method is invoked when a peripheral connected via the connectPeripheral method is disconnected. If the disconnection was not initiated by cancelPeripheralConnection, the cause is detailed in error. After this method is called, no more methods are invoked on the peripheral device’s CBPeripheralDelegate object.
Note that when a peripheral is disconnected, all of its services, characteristics, and characteristic descriptors are invalidated.

Feedback, Comments & Corrections

CBCentralManagerMBS.DidDiscoverPeripheral(peripheral as CBPeripheralMBS, advertisementData as Dictionary, RSSI as String)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
event Bluetooth MBS Bluetooth Plugin 18.1 Yes No No No No
Function: Invoked when the central manager discovers a peripheral while scanning.
Notes:
peripheral: The discovered peripheral.
advertisementData: A dictionary containing any advertisement data.
RSSI: The current received signal strength indicator (RSSI) of the peripheral, in decibels.

The advertisement data can be accessed through the keys listed in Advertisement Data Retrieval Keys. You must retain a local copy of the peripheral if any command is to be performed on it. In use cases where it makes sense for your app to automatically connect to a peripheral that is located within a certain range, you can use RSSI data to determine the proximity of a discovered peripheral device.

Feedback, Comments & Corrections

CBCentralManagerMBS.DidFailToConnectPeripheral(peripheral as CBPeripheralMBS, error as NSErrorMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
event Bluetooth MBS Bluetooth Plugin 18.1 Yes No No No No
Function: Invoked when the central manager fails to create a connection with a peripheral.
Notes:
peripheral: The peripheral that failed to connect.
error: The cause of the failure.

This method is invoked when a connection initiated via the connectPeripheral method fails to complete. Because connection attempts do not time out, a failed connection usually indicates a transient issue, in which case you may attempt to connect to the peripheral again.

Feedback, Comments & Corrections

CBCentralManagerMBS.DidUpdateState
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
event Bluetooth MBS Bluetooth Plugin 18.1 Yes No No No No
Function: Invoked when the central manager’s state is updated.
Notes: You implement this required method to ensure that Bluetooth low energy is supported and available to use on the central device. You should issue commands to the central manager only when the state of the central manager is powered on, as indicated by the CBCentralManagerStatePoweredOn constant. A state with a value lower than CBCentralManagerStatePoweredOn implies that scanning has stopped and that any connected peripherals have been disconnected. If the state moves below CBCentralManagerStatePoweredOff, all CBPeripheral objects obtained from this central manager become invalid and must be retrieved or discovered again. For a complete list and discussion of the possible values representing the state of the central manager, see the CBCentralManagerState enumeration in CBCentralManager.

Feedback, Comments & Corrections

CBCentralManagerMBS.WillRestoreState(dict as dictionary)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
event Bluetooth MBS Bluetooth Plugin 18.1 Yes No No No No
Function: Invoked when the central manager is about to be restored by the system.
Notes:
dict: A dictionary containing information about the central manager that was preserved by the system at the time the app was terminated. For the available keys to this dictionary, see Central Manager State Restoration Options.

For apps that opt in to the state preservation and restoration feature of Core Bluetooth, this is the first method invoked when your app is relaunched into the background to complete some Bluetooth-related task. Use this method to synchronize the state of your app with the state of the Bluetooth system.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Bluetooth Plugin.





Links
MBS Xojo Chart Plugins