Trait CBPeripheralDelegate

Source
pub unsafe trait CBPeripheralDelegate: NSObjectProtocol {
Show 15 methods // Provided methods unsafe fn peripheralDidUpdateName(&self, peripheral: &CBPeripheral) where Self: Sized + Message { ... } unsafe fn peripheral_didModifyServices( &self, peripheral: &CBPeripheral, invalidated_services: &NSArray<CBService>, ) where Self: Sized + Message { ... } unsafe fn peripheralDidUpdateRSSI_error( &self, peripheral: &CBPeripheral, error: Option<&NSError>, ) where Self: Sized + Message { ... } unsafe fn peripheral_didReadRSSI_error( &self, peripheral: &CBPeripheral, rssi: &NSNumber, error: Option<&NSError>, ) where Self: Sized + Message { ... } unsafe fn peripheral_didDiscoverServices( &self, peripheral: &CBPeripheral, error: Option<&NSError>, ) where Self: Sized + Message { ... } unsafe fn peripheral_didDiscoverIncludedServicesForService_error( &self, peripheral: &CBPeripheral, service: &CBService, error: Option<&NSError>, ) where Self: Sized + Message { ... } unsafe fn peripheral_didDiscoverCharacteristicsForService_error( &self, peripheral: &CBPeripheral, service: &CBService, error: Option<&NSError>, ) where Self: Sized + Message { ... } unsafe fn peripheral_didUpdateValueForCharacteristic_error( &self, peripheral: &CBPeripheral, characteristic: &CBCharacteristic, error: Option<&NSError>, ) where Self: Sized + Message { ... } unsafe fn peripheral_didWriteValueForCharacteristic_error( &self, peripheral: &CBPeripheral, characteristic: &CBCharacteristic, error: Option<&NSError>, ) where Self: Sized + Message { ... } unsafe fn peripheral_didUpdateNotificationStateForCharacteristic_error( &self, peripheral: &CBPeripheral, characteristic: &CBCharacteristic, error: Option<&NSError>, ) where Self: Sized + Message { ... } unsafe fn peripheral_didDiscoverDescriptorsForCharacteristic_error( &self, peripheral: &CBPeripheral, characteristic: &CBCharacteristic, error: Option<&NSError>, ) where Self: Sized + Message { ... } unsafe fn peripheral_didUpdateValueForDescriptor_error( &self, peripheral: &CBPeripheral, descriptor: &CBDescriptor, error: Option<&NSError>, ) where Self: Sized + Message { ... } unsafe fn peripheral_didWriteValueForDescriptor_error( &self, peripheral: &CBPeripheral, descriptor: &CBDescriptor, error: Option<&NSError>, ) where Self: Sized + Message { ... } unsafe fn peripheralIsReadyToSendWriteWithoutResponse( &self, peripheral: &CBPeripheral, ) where Self: Sized + Message { ... } unsafe fn peripheral_didOpenL2CAPChannel_error( &self, peripheral: &CBPeripheral, channel: Option<&CBL2CAPChannel>, error: Option<&NSError>, ) where Self: Sized + Message { ... }
}
Available on crate feature CBPeripheral only.
Expand description

Delegate for CBPeripheral.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn peripheralDidUpdateName(&self, peripheral: &CBPeripheral)
where Self: Sized + Message,

Available on crate feature CBPeer only.

Parameter peripheral: The peripheral providing this update.

This method is invoked when the

 name

of peripheral changes.

Source

unsafe fn peripheral_didModifyServices( &self, peripheral: &CBPeripheral, invalidated_services: &NSArray<CBService>, )
where Self: Sized + Message,

Available on crate features CBAttribute and CBPeer and CBService only.

Parameter peripheral: The peripheral providing this update.

Parameter invalidatedServices: The services that have been invalidated

This method is invoked when the

 services

of peripheral have been changed. At this point, the designated CBService objects have been invalidated. Services can be re-discovered via

 discoverServices:

.

Source

unsafe fn peripheralDidUpdateRSSI_error( &self, peripheral: &CBPeripheral, error: Option<&NSError>, )
where Self: Sized + Message,

👎Deprecated
Available on crate feature CBPeer only.

Parameter peripheral: The peripheral providing this update.

Parameter error: If an error occurred, the cause of the failure.

This method returns the result of a

 readRSSI:

call.

 peripheral:didReadRSSI:error:} instead.
  
Source

unsafe fn peripheral_didReadRSSI_error( &self, peripheral: &CBPeripheral, rssi: &NSNumber, error: Option<&NSError>, )
where Self: Sized + Message,

Available on crate feature CBPeer only.

Parameter peripheral: The peripheral providing this update.

Parameter RSSI: The current RSSI of the link.

Parameter error: If an error occurred, the cause of the failure.

This method returns the result of a

 readRSSI:

call.

Source

unsafe fn peripheral_didDiscoverServices( &self, peripheral: &CBPeripheral, error: Option<&NSError>, )
where Self: Sized + Message,

Available on crate feature CBPeer only.

Parameter peripheral: The peripheral providing this information.

Parameter error: If an error occurred, the cause of the failure.

This method returns the result of a

 discoverServices:

call. If the service(s) were read successfully, they can be retrieved via peripheral ’s

 services

property.

Source

unsafe fn peripheral_didDiscoverIncludedServicesForService_error( &self, peripheral: &CBPeripheral, service: &CBService, error: Option<&NSError>, )
where Self: Sized + Message,

Available on crate features CBAttribute and CBPeer and CBService only.

Parameter peripheral: The peripheral providing this information.

Parameter service: The CBService object containing the included services.

Parameter error: If an error occurred, the cause of the failure.

This method returns the result of a

 discoverIncludedServices:forService:

call. If the included service(s) were read successfully, they can be retrieved via service ’s includedServices property.

Source

unsafe fn peripheral_didDiscoverCharacteristicsForService_error( &self, peripheral: &CBPeripheral, service: &CBService, error: Option<&NSError>, )
where Self: Sized + Message,

Available on crate features CBAttribute and CBPeer and CBService only.

Parameter peripheral: The peripheral providing this information.

Parameter service: The CBService object containing the characteristic(s).

Parameter error: If an error occurred, the cause of the failure.

This method returns the result of a

 discoverCharacteristics:forService:

call. If the characteristic(s) were read successfully, they can be retrieved via service ’s characteristics property.

Source

unsafe fn peripheral_didUpdateValueForCharacteristic_error( &self, peripheral: &CBPeripheral, characteristic: &CBCharacteristic, error: Option<&NSError>, )
where Self: Sized + Message,

Available on crate features CBAttribute and CBCharacteristic and CBPeer only.

Parameter peripheral: The peripheral providing this information.

Parameter characteristic: A CBCharacteristic object.

Parameter error: If an error occurred, the cause of the failure.

This method is invoked after a

 readValueForCharacteristic:

call, or upon receipt of a notification/indication.

Source

unsafe fn peripheral_didWriteValueForCharacteristic_error( &self, peripheral: &CBPeripheral, characteristic: &CBCharacteristic, error: Option<&NSError>, )
where Self: Sized + Message,

Available on crate features CBAttribute and CBCharacteristic and CBPeer only.

Parameter peripheral: The peripheral providing this information.

Parameter characteristic: A CBCharacteristic object.

Parameter error: If an error occurred, the cause of the failure.

This method returns the result of a {

 writeValue:forCharacteristic:type:} call, when the <code>CBCharacteristicWriteWithResponse</code> type is used.
  
Source

unsafe fn peripheral_didUpdateNotificationStateForCharacteristic_error( &self, peripheral: &CBPeripheral, characteristic: &CBCharacteristic, error: Option<&NSError>, )
where Self: Sized + Message,

Available on crate features CBAttribute and CBCharacteristic and CBPeer only.

Parameter peripheral: The peripheral providing this information.

Parameter characteristic: A CBCharacteristic object.

Parameter error: If an error occurred, the cause of the failure.

This method returns the result of a

 setNotifyValue:forCharacteristic:

call.

Source

unsafe fn peripheral_didDiscoverDescriptorsForCharacteristic_error( &self, peripheral: &CBPeripheral, characteristic: &CBCharacteristic, error: Option<&NSError>, )
where Self: Sized + Message,

Available on crate features CBAttribute and CBCharacteristic and CBPeer only.

Parameter peripheral: The peripheral providing this information.

Parameter characteristic: A CBCharacteristic object.

Parameter error: If an error occurred, the cause of the failure.

This method returns the result of a

 discoverDescriptorsForCharacteristic:

call. If the descriptors were read successfully, they can be retrieved via characteristic ’s descriptors property.

Source

unsafe fn peripheral_didUpdateValueForDescriptor_error( &self, peripheral: &CBPeripheral, descriptor: &CBDescriptor, error: Option<&NSError>, )
where Self: Sized + Message,

Available on crate features CBAttribute and CBDescriptor and CBPeer only.

Parameter peripheral: The peripheral providing this information.

Parameter descriptor: A CBDescriptor object.

Parameter error: If an error occurred, the cause of the failure.

This method returns the result of a

 readValueForDescriptor:

call.

Source

unsafe fn peripheral_didWriteValueForDescriptor_error( &self, peripheral: &CBPeripheral, descriptor: &CBDescriptor, error: Option<&NSError>, )
where Self: Sized + Message,

Available on crate features CBAttribute and CBDescriptor and CBPeer only.

Parameter peripheral: The peripheral providing this information.

Parameter descriptor: A CBDescriptor object.

Parameter error: If an error occurred, the cause of the failure.

This method returns the result of a

 writeValue:forDescriptor:

call.

Source

unsafe fn peripheralIsReadyToSendWriteWithoutResponse( &self, peripheral: &CBPeripheral, )
where Self: Sized + Message,

Available on crate feature CBPeer only.

Parameter peripheral: The peripheral providing this update.

This method is invoked after a failed call to

 writeValue:forCharacteristic:type:

, when peripheral is again ready to send characteristic value updates.

Source

unsafe fn peripheral_didOpenL2CAPChannel_error( &self, peripheral: &CBPeripheral, channel: Option<&CBL2CAPChannel>, error: Option<&NSError>, )
where Self: Sized + Message,

Available on crate features CBL2CAPChannel and CBPeer only.

Parameter peripheral: The peripheral providing this information.

Parameter channel: A CBL2CAPChannel object.

Parameter error: If an error occurred, the cause of the failure.

This method returns the result of a

 openL2CAPChannel: @link call.
  

Trait Implementations§

Source§

impl ProtocolType for dyn CBPeripheralDelegate

Source§

const NAME: &'static str = "CBPeripheralDelegate"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn CBPeripheralDelegate

Implementations on Foreign Types§

Source§

impl<T> CBPeripheralDelegate for ProtocolObject<T>

Implementors§