Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

CBPeripheralManagerMBS.DidAddService(service as CBServiceMBS, 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 you publish a service, and any of its associated characteristics and characteristic descriptors, to the local Generic Attribute Profile (GATT) database.
Notes:
service: The service that was added to the local GATT database.
error: If an error occurred, the cause of the failure.

This event is invoked when your app calls the addService method to publish a service to the local peripheral’s GATT database. If the service is successfully published to the local database, the error parameter is nil. If unsuccessful, the error parameter returns the cause of the failure.

Feedback, Comments & Corrections

CBPeripheralManagerMBS.DidOpenL2CAPChannel(channel as CBL2CAPChannelMBS, 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: Did open L2CAP channel.

Feedback, Comments & Corrections

CBPeripheralManagerMBS.DidPublishL2CAPChannel(PSM as Integer, 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: This event is the response to a publishL2CAPChannel call.
Notes:
PSM: The PSM of the channel that was published.
error: If an error occurred, the cause of the failure.

The PSM will contain the PSM that was assigned for the published channel

Feedback, Comments & Corrections

CBPeripheralManagerMBS.DidReceiveReadRequest(Request as CBATTRequestMBS)
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 local peripheral device receives an Attribute Protocol (ATT) read request for a characteristic that has a dynamic value.
Notes:
request: A CBATTRequest object that represents a request to read a characteristic’s value.

Each time this method is invoked, you call the respondToRequest method of the CBPeripheralManager class exactly once to respond to the read request.

Feedback, Comments & Corrections

CBPeripheralManagerMBS.DidReceiveWriteRequests(requests() as CBATTRequestMBS)
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 local peripheral device receives an Attribute Protocol (ATT) write request for a characteristic that has a dynamic value.
Notes:
requests: A list of one or more CBATTRequest objects, each representing a request to write the value of a characteristic.

In the same way that you respond to a read request, each time this method is invoked, you call the respondToRequest:withResult: method of the CBPeripheralManager class exactly once. If the requests parameter contains multiple requests, treat them as you would a single request—if any individual request cannot be fulfilled, you should not fulfill any of them. Instead, call the respondToRequest method immediately, and provide a result that indicates the cause of the failure.

When you respond to a write request, note that the first parameter of the respondToRequest method expects a single CBATTRequest object, even though you received an array of them from the didReceiveWriteRequests event. To respond properly, pass in the first request of the requests array.

Feedback, Comments & Corrections

CBPeripheralManagerMBS.DidStartAdvertising(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: Adverising did start.
Notes:
error: If an error occurred, the cause of the failure.

This event returns the result of a startAdvertising call. If advertisement could not be started, the cause will be detailed in the error parameter.

Feedback, Comments & Corrections

CBPeripheralManagerMBS.DidSubscribeToCharacteristic(central as CBCentralMBS, characteristic as CBCharacteristicMBS)
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 remote central device subscribes to a characteristic’s value.
Notes:
central: The remote central device that subscribed to the characteristic’s value.
characteristic: The characteristic whose value has been subscribed to.

This method is invoked when a remote central device subscribes to the value of one of the local peripheral’s characteristics, by enabling notifications or indications on the characteristic’s value. You should use the invocation of this method as a cue to start sending the subscribed central updates as the characteristic’s value changes. To send updated characteristic values to subscribed centrals, use the updateValue method of the CBPeripheralManager class.

Feedback, Comments & Corrections

CBPeripheralManagerMBS.DidUnpublishL2CAPChannel(PSM as Integer, 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: This event is the response to a unpublishL2CAPChannel call.
Notes:
PSM: The PSM of the channel that was published.
error: If an error occurred, the cause of the failure.

Feedback, Comments & Corrections

CBPeripheralManagerMBS.DidUnsubscribeFromCharacteristic(central as CBCentralMBS, characteristic as CBCharacteristicMBS)
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 remote central device unsubscribes from a characteristic’s value.
Notes:
central: The remote central device that subscribed to the characteristic’s value.
characteristic: The characteristic whose value has been unsubscribed from.

This method is invoked when a remote central device unsubscribes from the value of one of the local peripheral’s characteristics, by disabling notifications or indications on the characteristic’s value. You should use the invocation of this method as a cue to stop sending the subscribed central updates as the characteristic’s value changes.

Feedback, Comments & Corrections

CBPeripheralManagerMBS.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 peripheral 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 local peripheral device. Issue commands to the peripheral manager only when the state of the peripheral manager is powered on, as indicated by the kStatePoweredOn constant. A state with a value lower than CBPeripheralManagerStatePoweredOn implies that advertising has stopped and that any connected centrals have been disconnected. If the state moves below CBPeripheralManagerStatePoweredOff, advertising has stopped and must be explicitly restarted. In addition, the local database is cleared and all services must be explicitly added again. For a complete list and discussion of the possible values representing the state of the peripheral manager, see the CBPeripheralManagerState enumeration in CBPeripheralManager.

Feedback, Comments & Corrections

CBPeripheralManagerMBS.IsReadyToUpdateSubscribers
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 local peripheral device is again ready to send characteristic value updates.
Notes: When a call to the updateValue method fails because the underlying queue used to transmit the updated characteristic value is full, the peripheralManagerIsReadyToUpdateSubscribers: method is invoked when more space in the transmit queue becomes available. You can then implement this event to resend the value.

Feedback, Comments & Corrections

CBPeripheralManagerMBS.WillRestoreState(dic 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 peripheral manager is about to be restored by the system.
Notes:
dict: A dictionary containing information about the peripheral manager that was preserved by the system at the time the app was terminated. For the available keys to this dictionary, see Peripheral 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 FileMaker blog