Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

CBCentralManagerMBS.cancelPeripheralConnection(Peripheral as CBPeripheralMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.1 Yes No No Yes, macOS only No
Function: Cancels an active or pending local connection to a peripheral.
Notes:
peripheral: The peripheral to which the central manager is either trying to connect or has already connected.

This method is nonblocking, and any CBPeripheral class commands that are still pending to peripheral may or may not complete. Because other apps may still have a connection to the peripheral, canceling a local connection does not guarantee that the underlying physical link is immediately disconnected. From the app’s perspective, however, the peripheral is considered disconnected, and the central manager object calls the didDisconnectPeripheral event.

Feedback, Comments & Corrections

CBCentralManagerMBS.connectPeripheral(peripheral as CBPeripheralMBS, options as Dictionary = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.1 Yes No No Yes, macOS only No
Function: Establishes a local connection to a peripheral.
Notes:
peripheral: The peripheral to which the central is attempting to connect.
options: A dictionary to customize the behavior of the connection. For available options, see Peripheral Connection Options.

If a local connection to a peripheral is successfully established, the central manager object calls the centralManager:didConnectPeripheral: method of its delegate object. If the connection attempt fails, the central manager object calls the didFailToConnectPeripheral event. Attempts to connect to a peripheral do not time out. To explicitly cancel a pending connection to a peripheral, call the cancelPeripheralConnection method. The cancelPeripheralConnection method is implicitly called when peripheral is deallocated.

Feedback, Comments & Corrections

CBCentralManagerMBS.Constructor(options as dictionary = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.1 Yes No No Yes, macOS only No
Function: Initializes the central manager.
Notes: options: An optional dictionary containing initialization options for a central manager.

Feedback, Comments & Corrections

CBCentralManagerMBS.Destructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.1 Yes No No Yes, macOS only No
Function: The destructor.

Feedback, Comments & Corrections

CBCentralManagerMBS.retrieveConnectedPeripheralsWithServices(serviceUUIDs() as CBUUIDMBS) as CBPeripheralMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.1 Yes No No Yes, macOS only No
Function: Returns a list of the peripherals (containing any of the specified services) currently connected to the system.
Notes:
serviceUUIDs: A list of service UUIDs (represented by CBUUID objects).

Returns a list of the peripherals that are currently connected to the system and that contain any of the services specified in the serviceUUID parameter.

The list of connected peripherals can include those that are connected by other apps and that will need to be connected locally using the connectPeripheral method before they can be used.

Feedback, Comments & Corrections

CBCentralManagerMBS.retrievePeripheralsWithIdentifiers(identifiers() as NSUUIDMBS) as CBPeripheralMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.1 Yes No No Yes, macOS only No
Function: Returns a list of known peripherals by their identifiers.
Notes:
identifiers: A list of peripheral identifiers (represented by NSUUID objects) from which CBPeripheral objects can be retrieved.

Returns a list of peripherals that the central manager is able to match to the provided identifiers.

Feedback, Comments & Corrections

CBCentralManagerMBS.scanForPeripheralsWithServices(serviceUUIDs() as CBUUIDMBS = nil, options as Dictionary = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.1 Yes No No Yes, macOS only No
Function: Scans for peripherals that are advertising services.
Notes:
serviceUUIDs: An array of CBUUID objects that the app is interested in. In this case, each CBUUID object represents the UUID of a service that a peripheral is advertising.
options: An optional dictionary specifying options to customize the scan. For available options, see Peripheral Scanning Options.

You can provide an array of CBUUID objects—representing service UUIDs—in the serviceUUIDs parameter. When you do, the central manager returns only peripherals that advertise the services you specify (recommended). If the serviceUUIDs parameter is nil, all discovered peripherals are returned regardless of their supported services (not recommended). If the central manager is already scanning with different parameters, the provided parameters replace them. When the central manager object discovers a peripheral, it calls the didDiscoverPeripheral event.
Apps that have specified the bluetooth-central background mode are allowed to scan while in the background. That said, they must explicitly scan for one or more services by specifying them in the serviceUUIDs parameter. The CBCentralManager scan option is ignored while scanning in the background.

Feedback, Comments & Corrections

CBCentralManagerMBS.stopScan
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Bluetooth MBS Bluetooth Plugin 18.1 Yes No No Yes, macOS only No
Function: Asks the central manager to stop scanning for peripherals.

Feedback, Comments & Corrections

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




Links
MBS Xojo PDF Plugins