objc2_core_bluetooth/generated/CBCentralManager.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// Represents the current state of a CBCentralManager.
13///
14/// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbcentralmanagerstate?language=objc)
15// NS_ENUM
16#[deprecated = "Use CBManagerState instead"]
17#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct CBCentralManagerState(pub NSInteger);
20impl CBCentralManagerState {
21 #[cfg(feature = "CBManager")]
22 #[deprecated = "Use CBManagerState instead"]
23 #[doc(alias = "CBCentralManagerStateUnknown")]
24 pub const Unknown: Self = Self(CBManagerState::Unknown.0);
25 #[cfg(feature = "CBManager")]
26 #[deprecated = "Use CBManagerState instead"]
27 #[doc(alias = "CBCentralManagerStateResetting")]
28 pub const Resetting: Self = Self(CBManagerState::Resetting.0);
29 #[cfg(feature = "CBManager")]
30 #[deprecated = "Use CBManagerState instead"]
31 #[doc(alias = "CBCentralManagerStateUnsupported")]
32 pub const Unsupported: Self = Self(CBManagerState::Unsupported.0);
33 #[cfg(feature = "CBManager")]
34 #[deprecated = "Use CBManagerState instead"]
35 #[doc(alias = "CBCentralManagerStateUnauthorized")]
36 pub const Unauthorized: Self = Self(CBManagerState::Unauthorized.0);
37 #[cfg(feature = "CBManager")]
38 #[deprecated = "Use CBManagerState instead"]
39 #[doc(alias = "CBCentralManagerStatePoweredOff")]
40 pub const PoweredOff: Self = Self(CBManagerState::PoweredOff.0);
41 #[cfg(feature = "CBManager")]
42 #[deprecated = "Use CBManagerState instead"]
43 #[doc(alias = "CBCentralManagerStatePoweredOn")]
44 pub const PoweredOn: Self = Self(CBManagerState::PoweredOn.0);
45}
46
47unsafe impl Encode for CBCentralManagerState {
48 const ENCODING: Encoding = NSInteger::ENCODING;
49}
50
51unsafe impl RefEncode for CBCentralManagerState {
52 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
53}
54
55/// Represents the connection state of a peer.
56///
57/// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbconnectionevent?language=objc)
58// NS_ENUM
59#[repr(transparent)]
60#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
61pub struct CBConnectionEvent(pub NSInteger);
62impl CBConnectionEvent {
63 #[doc(alias = "CBConnectionEventPeerDisconnected")]
64 pub const PeerDisconnected: Self = Self(0);
65 #[doc(alias = "CBConnectionEventPeerConnected")]
66 pub const PeerConnected: Self = Self(1);
67}
68
69unsafe impl Encode for CBConnectionEvent {
70 const ENCODING: Encoding = NSInteger::ENCODING;
71}
72
73unsafe impl RefEncode for CBConnectionEvent {
74 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
75}
76
77/// The set of device specific features.
78///
79/// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbcentralmanagerfeature?language=objc)
80// NS_OPTIONS
81#[repr(transparent)]
82#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
83pub struct CBCentralManagerFeature(pub NSUInteger);
84bitflags::bitflags! {
85 impl CBCentralManagerFeature: NSUInteger {
86 #[doc(alias = "CBCentralManagerFeatureExtendedScanAndConnect")]
87 const ExtendedScanAndConnect = 1<<0;
88 }
89}
90
91unsafe impl Encode for CBCentralManagerFeature {
92 const ENCODING: Encoding = NSUInteger::ENCODING;
93}
94
95unsafe impl RefEncode for CBCentralManagerFeature {
96 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
97}
98
99extern_class!(
100 /// Entry point to the central role. Commands should only be issued when its state is
101 /// <code>
102 /// CBCentralManagerStatePoweredOn
103 /// </code>
104 /// .
105 ///
106 /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbcentralmanager?language=objc)
107 #[unsafe(super(CBManager, NSObject))]
108 #[derive(Debug, PartialEq, Eq, Hash)]
109 #[cfg(feature = "CBManager")]
110 pub struct CBCentralManager;
111);
112
113#[cfg(feature = "CBManager")]
114unsafe impl NSObjectProtocol for CBCentralManager {}
115
116#[cfg(feature = "CBManager")]
117impl CBCentralManager {
118 extern_methods!(
119 /// The delegate object that will receive central events.
120 #[unsafe(method(delegate))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn delegate(
123 &self,
124 ) -> Option<Retained<ProtocolObject<dyn CBCentralManagerDelegate>>>;
125
126 /// This is a [weak property][objc2::topics::weak_property].
127 /// Setter for [`delegate`][Self::delegate].
128 #[unsafe(method(setDelegate:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn setDelegate(
131 &self,
132 delegate: Option<&ProtocolObject<dyn CBCentralManagerDelegate>>,
133 );
134
135 /// Whether or not the central is currently scanning.
136 #[unsafe(method(isScanning))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn isScanning(&self) -> bool;
139
140 /// Parameter `features`: One or more features you would like to check if supported.
141 ///
142 ///
143 /// Returns a boolean value representing the support for the provided features.
144 #[unsafe(method(supportsFeatures:))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn supportsFeatures(features: CBCentralManagerFeature) -> bool;
147
148 #[unsafe(method(init))]
149 #[unsafe(method_family = init)]
150 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
151
152 #[cfg(all(feature = "CBPeer", feature = "CBPeripheral"))]
153 /// Parameter `identifiers`: A list of
154 /// <code>
155 /// NSUUID
156 /// </code>
157 /// objects.
158 ///
159 ///
160 /// Attempts to retrieve the
161 /// <code>
162 /// CBPeripheral
163 /// </code>
164 /// object(s) with the corresponding
165 /// <i>
166 /// identifiers
167 /// </i>
168 /// .
169 ///
170 ///
171 /// Returns: A list of
172 /// <code>
173 /// CBPeripheral
174 /// </code>
175 /// objects.
176 #[unsafe(method(retrievePeripheralsWithIdentifiers:))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn retrievePeripheralsWithIdentifiers(
179 &self,
180 identifiers: &NSArray<NSUUID>,
181 ) -> Retained<NSArray<CBPeripheral>>;
182
183 #[cfg(all(feature = "CBPeer", feature = "CBPeripheral", feature = "CBUUID"))]
184 /// Retrieves all peripherals that are connected to the system and implement any of the services listed in
185 /// <i>
186 /// serviceUUIDs
187 /// </i>
188 /// .
189 /// Note that this set can include peripherals which were connected by other applications, which will need to be connected locally
190 /// via {
191 ///
192 /// ```text
193 /// connectPeripheral:options:} before they can be used.
194 ///
195 /// @return A list of <code>CBPeripheral</code> objects.
196 ///
197 ///
198 ///
199 /// ```
200 #[unsafe(method(retrieveConnectedPeripheralsWithServices:))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn retrieveConnectedPeripheralsWithServices(
203 &self,
204 service_uui_ds: &NSArray<CBUUID>,
205 ) -> Retained<NSArray<CBPeripheral>>;
206
207 #[cfg(feature = "CBUUID")]
208 /// Parameter `serviceUUIDs`: A list of
209 /// <code>
210 /// CBUUID
211 /// </code>
212 /// objects representing the service(s) to scan for.
213 ///
214 /// Parameter `options`: An optional dictionary specifying options for the scan.
215 ///
216 ///
217 /// Starts scanning for peripherals that are advertising any of the services listed in
218 /// <i>
219 /// serviceUUIDs
220 /// </i>
221 /// . Although strongly discouraged,
222 /// if
223 /// <i>
224 /// serviceUUIDs
225 /// </i>
226 /// is
227 /// <i>
228 /// nil
229 /// </i>
230 /// all discovered peripherals will be returned. If the central is already scanning with different
231 /// <i>
232 /// serviceUUIDs
233 /// </i>
234 /// or
235 /// <i>
236 /// options
237 /// </i>
238 /// , the provided parameters will replace them.
239 /// Applications that have specified the
240 /// <code>
241 /// bluetooth-central
242 /// </code>
243 /// background mode are allowed to scan while backgrounded, with two
244 /// caveats: the scan must specify one or more service types in
245 /// <i>
246 /// serviceUUIDs
247 /// </i>
248 /// , and the
249 /// <code>
250 /// CBCentralManagerScanOptionAllowDuplicatesKey
251 /// </code>
252 /// scan option will be ignored.
253 ///
254 ///
255 /// See: centralManager:didDiscoverPeripheral:advertisementData:RSSI:
256 ///
257 /// See also: CBCentralManagerScanOptionAllowDuplicatesKey
258 ///
259 /// See also: CBCentralManagerScanOptionSolicitedServiceUUIDsKey
260 #[unsafe(method(scanForPeripheralsWithServices:options:))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn scanForPeripheralsWithServices_options(
263 &self,
264 service_uui_ds: Option<&NSArray<CBUUID>>,
265 options: Option<&NSDictionary<NSString, AnyObject>>,
266 );
267
268 /// Stops scanning for peripherals.
269 #[unsafe(method(stopScan))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn stopScan(&self);
272
273 #[cfg(all(feature = "CBPeer", feature = "CBPeripheral"))]
274 /// Parameter `peripheral`: The
275 /// <code>
276 /// CBPeripheral
277 /// </code>
278 /// to be connected.
279 ///
280 /// Parameter `options`: An optional dictionary specifying connection behavior options.
281 ///
282 ///
283 /// Initiates a connection to
284 /// <i>
285 /// peripheral
286 /// </i>
287 /// . Connection attempts never time out and, depending on the outcome, will result
288 /// in a call to either {
289 ///
290 /// ```text
291 /// centralManager:didConnectPeripheral:} or {@link centralManager:didFailToConnectPeripheral:error:}.
292 /// Pending attempts are cancelled automatically upon deallocation of <i>peripheral</i>, and explicitly via {@link cancelPeripheralConnection}.
293 ///
294 /// @see centralManager:didConnectPeripheral:
295 /// @see centralManager:didFailToConnectPeripheral:error:
296 /// @seealso CBConnectPeripheralOptionNotifyOnConnectionKey
297 /// @seealso CBConnectPeripheralOptionNotifyOnDisconnectionKey
298 /// @seealso CBConnectPeripheralOptionNotifyOnNotificationKey
299 /// @seealso CBConnectPeripheralOptionEnableTransportBridgingKey
300 /// @seealso CBConnectPeripheralOptionRequiresANCS
301 /// @seealso CBConnectPeripheralOptionEnableAutoReconnect
302 ///
303 ///
304 ///
305 /// ```
306 #[unsafe(method(connectPeripheral:options:))]
307 #[unsafe(method_family = none)]
308 pub unsafe fn connectPeripheral_options(
309 &self,
310 peripheral: &CBPeripheral,
311 options: Option<&NSDictionary<NSString, AnyObject>>,
312 );
313
314 #[cfg(all(feature = "CBPeer", feature = "CBPeripheral"))]
315 /// Parameter `peripheral`: A
316 /// <code>
317 /// CBPeripheral
318 /// </code>
319 /// .
320 ///
321 ///
322 /// Cancels an active or pending connection to
323 /// <i>
324 /// peripheral
325 /// </i>
326 /// . Note that this is non-blocking, and any
327 /// <code>
328 /// CBPeripheral
329 /// </code>
330 /// commands that are still pending to
331 /// <i>
332 /// peripheral
333 /// </i>
334 /// may or may not complete.
335 ///
336 ///
337 /// See: centralManager:didDisconnectPeripheral:error:
338 #[unsafe(method(cancelPeripheralConnection:))]
339 #[unsafe(method_family = none)]
340 pub unsafe fn cancelPeripheralConnection(&self, peripheral: &CBPeripheral);
341
342 #[cfg(feature = "CBCentralManagerConstants")]
343 /// Parameter `options`: A dictionary specifying connection event options.
344 ///
345 ///
346 /// Calls {
347 ///
348 /// ```text
349 /// centralManager:connectionEventDidOccur:forPeripheral:} when a connection event occurs matching any of the given options.
350 /// Passing nil in the option parameter clears any prior registered matching options.
351 ///
352 /// @see centralManager:connectionEventDidOccur:forPeripheral:
353 /// @seealso CBConnectionEventMatchingOptionServiceUUIDs
354 /// @seealso CBConnectionEventMatchingOptionPeripheralUUIDs
355 ///
356 ///
357 /// ```
358 #[unsafe(method(registerForConnectionEventsWithOptions:))]
359 #[unsafe(method_family = none)]
360 pub unsafe fn registerForConnectionEventsWithOptions(
361 &self,
362 options: Option<&NSDictionary<CBConnectionEventMatchingOption, AnyObject>>,
363 );
364 );
365}
366
367/// Methods declared on superclass `NSObject`.
368#[cfg(feature = "CBManager")]
369impl CBCentralManager {
370 extern_methods!(
371 #[unsafe(method(new))]
372 #[unsafe(method_family = new)]
373 pub unsafe fn new() -> Retained<Self>;
374 );
375}
376
377extern_protocol!(
378 /// The delegate of a {
379 ///
380 /// ```text
381 /// CBCentralManager} object must adopt the <code>CBCentralManagerDelegate</code> protocol. The
382 /// single required method indicates the availability of the central manager, while the optional methods allow for the discovery and
383 /// connection of peripherals.
384 ///
385 ///
386 ///
387 /// ```
388 ///
389 /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbcentralmanagerdelegate?language=objc)
390 pub unsafe trait CBCentralManagerDelegate: NSObjectProtocol {
391 #[cfg(feature = "CBManager")]
392 /// Parameter `central`: The central manager whose state has changed.
393 ///
394 ///
395 /// Invoked whenever the central manager's state has been updated. Commands should only be issued when the state is
396 /// <code>
397 /// CBCentralManagerStatePoweredOn
398 /// </code>
399 /// . A state below
400 /// <code>
401 /// CBCentralManagerStatePoweredOn
402 /// </code>
403 /// implies that scanning has stopped and any connected peripherals have been disconnected. If the state moves below
404 /// <code>
405 /// CBCentralManagerStatePoweredOff
406 /// </code>
407 /// , all
408 /// <code>
409 /// CBPeripheral
410 /// </code>
411 /// objects obtained from this central
412 /// manager become invalid and must be retrieved or discovered again.
413 ///
414 ///
415 /// See: state
416 #[unsafe(method(centralManagerDidUpdateState:))]
417 #[unsafe(method_family = none)]
418 unsafe fn centralManagerDidUpdateState(&self, central: &CBCentralManager);
419
420 #[cfg(feature = "CBManager")]
421 /// Parameter `central`: The central manager providing this information.
422 ///
423 /// Parameter `dict`: A dictionary containing information about
424 /// <i>
425 /// central
426 /// </i>
427 /// that was preserved by the system at the time the app was terminated.
428 ///
429 ///
430 /// For apps that opt-in to state preservation and restoration, this is the first method invoked when your app is relaunched into
431 /// the background to complete some Bluetooth-related task. Use this method to synchronize your app's state with the state of the
432 /// Bluetooth system.
433 ///
434 ///
435 /// See also: CBCentralManagerRestoredStatePeripheralsKey;
436 ///
437 /// See also: CBCentralManagerRestoredStateScanServicesKey;
438 ///
439 /// See also: CBCentralManagerRestoredStateScanOptionsKey;
440 #[optional]
441 #[unsafe(method(centralManager:willRestoreState:))]
442 #[unsafe(method_family = none)]
443 unsafe fn centralManager_willRestoreState(
444 &self,
445 central: &CBCentralManager,
446 dict: &NSDictionary<NSString, AnyObject>,
447 );
448
449 #[cfg(all(feature = "CBManager", feature = "CBPeer", feature = "CBPeripheral"))]
450 /// Parameter `central`: The central manager providing this update.
451 ///
452 /// Parameter `peripheral`: A
453 /// <code>
454 /// CBPeripheral
455 /// </code>
456 /// object.
457 ///
458 /// Parameter `advertisementData`: A dictionary containing any advertisement and scan response data.
459 ///
460 /// Parameter `RSSI`: The current RSSI of
461 /// <i>
462 /// peripheral
463 /// </i>
464 /// , in dBm. A value of
465 /// <code>
466 /// 127
467 /// </code>
468 /// is reserved and indicates the RSSI
469 /// was not available.
470 ///
471 ///
472 /// This method is invoked while scanning, upon the discovery of
473 /// <i>
474 /// peripheral
475 /// </i>
476 /// by
477 /// <i>
478 /// central
479 /// </i>
480 /// . A discovered peripheral must
481 /// be retained in order to use it; otherwise, it is assumed to not be of interest and will be cleaned up by the central manager. For
482 /// a list of
483 /// <i>
484 /// advertisementData
485 /// </i>
486 /// keys, see {
487 ///
488 /// ```text
489 /// CBAdvertisementDataLocalNameKey} and other similar constants.
490 ///
491 /// @seealso CBAdvertisementData.h
492 ///
493 ///
494 ///
495 /// ```
496 #[optional]
497 #[unsafe(method(centralManager:didDiscoverPeripheral:advertisementData:RSSI:))]
498 #[unsafe(method_family = none)]
499 unsafe fn centralManager_didDiscoverPeripheral_advertisementData_RSSI(
500 &self,
501 central: &CBCentralManager,
502 peripheral: &CBPeripheral,
503 advertisement_data: &NSDictionary<NSString, AnyObject>,
504 rssi: &NSNumber,
505 );
506
507 #[cfg(all(feature = "CBManager", feature = "CBPeer", feature = "CBPeripheral"))]
508 /// Parameter `central`: The central manager providing this information.
509 ///
510 /// Parameter `peripheral`: The
511 /// <code>
512 /// CBPeripheral
513 /// </code>
514 /// that has connected.
515 ///
516 ///
517 /// This method is invoked when a connection initiated by {
518 ///
519 /// ```text
520 /// connectPeripheral:options:} has succeeded.
521 ///
522 ///
523 ///
524 /// ```
525 #[optional]
526 #[unsafe(method(centralManager:didConnectPeripheral:))]
527 #[unsafe(method_family = none)]
528 unsafe fn centralManager_didConnectPeripheral(
529 &self,
530 central: &CBCentralManager,
531 peripheral: &CBPeripheral,
532 );
533
534 #[cfg(all(feature = "CBManager", feature = "CBPeer", feature = "CBPeripheral"))]
535 /// Parameter `central`: The central manager providing this information.
536 ///
537 /// Parameter `peripheral`: The
538 /// <code>
539 /// CBPeripheral
540 /// </code>
541 /// that has failed to connect.
542 ///
543 /// Parameter `error`: The cause of the failure.
544 ///
545 ///
546 /// This method is invoked when a connection initiated by {
547 ///
548 /// ```text
549 /// connectPeripheral:options:} has failed to complete. As connection attempts do not
550 /// timeout, the failure of a connection is atypical and usually indicative of a transient issue.
551 ///
552 ///
553 ///
554 /// ```
555 #[optional]
556 #[unsafe(method(centralManager:didFailToConnectPeripheral:error:))]
557 #[unsafe(method_family = none)]
558 unsafe fn centralManager_didFailToConnectPeripheral_error(
559 &self,
560 central: &CBCentralManager,
561 peripheral: &CBPeripheral,
562 error: Option<&NSError>,
563 );
564
565 #[cfg(all(feature = "CBManager", feature = "CBPeer", feature = "CBPeripheral"))]
566 /// Parameter `central`: The central manager providing this information.
567 ///
568 /// Parameter `peripheral`: The
569 /// <code>
570 /// CBPeripheral
571 /// </code>
572 /// that has disconnected.
573 ///
574 /// Parameter `error`: If an error occurred, the cause of the failure.
575 ///
576 ///
577 /// This method is invoked upon the disconnection of a peripheral that was connected by {
578 ///
579 /// ```text
580 /// connectPeripheral:options:}. If the disconnection
581 /// was not initiated by {@link cancelPeripheralConnection}, the cause will be detailed in the <i>error</i> parameter. Once this method has been
582 /// called, no more methods will be invoked on <i>peripheral</i>'s <code>CBPeripheralDelegate</code>.
583 ///
584 ///
585 ///
586 /// ```
587 #[optional]
588 #[unsafe(method(centralManager:didDisconnectPeripheral:error:))]
589 #[unsafe(method_family = none)]
590 unsafe fn centralManager_didDisconnectPeripheral_error(
591 &self,
592 central: &CBCentralManager,
593 peripheral: &CBPeripheral,
594 error: Option<&NSError>,
595 );
596
597 #[cfg(all(
598 feature = "CBManager",
599 feature = "CBPeer",
600 feature = "CBPeripheral",
601 feature = "objc2-core-foundation"
602 ))]
603 /// Parameter `central`: The central manager providing this information.
604 ///
605 /// Parameter `peripheral`: The
606 /// <code>
607 /// CBPeripheral
608 /// </code>
609 /// that has disconnected.
610 ///
611 /// Parameter `timestamp`: Timestamp of the disconnection, it can be now or a few seconds ago.
612 ///
613 /// Parameter `isReconnecting`: If reconnect was triggered upon disconnection.
614 ///
615 /// Parameter `error`: If an error occurred, the cause of the failure.
616 ///
617 ///
618 /// This method is invoked upon the disconnection of a peripheral that was connected by {
619 ///
620 /// ```text
621 /// connectPeripheral:options:}. If perihperal is
622 /// connected with connect option {@link CBConnectPeripheralOptionEnableAutoReconnect}, once this method has been called, the system
623 /// will automatically invoke connect to the peripheral. And if connection is established with the peripheral afterwards,
624 /// {@link centralManager:didConnectPeripheral:} can be invoked. If perihperal is connected without option
625 /// CBConnectPeripheralOptionEnableAutoReconnect, once this method has been called, no more methods will be invoked on
626 /// <i>peripheral</i>'s <code>CBPeripheralDelegate</code> .
627 ///
628 ///
629 ///
630 /// ```
631 #[optional]
632 #[unsafe(method(centralManager:didDisconnectPeripheral:timestamp:isReconnecting:error:))]
633 #[unsafe(method_family = none)]
634 unsafe fn centralManager_didDisconnectPeripheral_timestamp_isReconnecting_error(
635 &self,
636 central: &CBCentralManager,
637 peripheral: &CBPeripheral,
638 timestamp: CFAbsoluteTime,
639 is_reconnecting: bool,
640 error: Option<&NSError>,
641 );
642
643 #[cfg(all(feature = "CBManager", feature = "CBPeer", feature = "CBPeripheral"))]
644 /// Parameter `central`: The central manager providing this information.
645 ///
646 /// Parameter `event`: The
647 /// <code>
648 /// CBConnectionEvent
649 /// </code>
650 /// that has occurred.
651 ///
652 /// Parameter `peripheral`: The
653 /// <code>
654 /// CBPeripheral
655 /// </code>
656 /// that caused the event.
657 ///
658 ///
659 /// This method is invoked upon the connection or disconnection of a peripheral that matches any of the options provided in {
660 ///
661 /// ```text
662 /// registerForConnectionEventsWithOptions:}.
663 ///
664 ///
665 ///
666 /// ```
667 #[optional]
668 #[unsafe(method(centralManager:connectionEventDidOccur:forPeripheral:))]
669 #[unsafe(method_family = none)]
670 unsafe fn centralManager_connectionEventDidOccur_forPeripheral(
671 &self,
672 central: &CBCentralManager,
673 event: CBConnectionEvent,
674 peripheral: &CBPeripheral,
675 );
676
677 #[cfg(all(feature = "CBManager", feature = "CBPeer", feature = "CBPeripheral"))]
678 /// Parameter `central`: The central manager providing this information.
679 ///
680 /// Parameter `peripheral`: The
681 /// <code>
682 /// CBPeripheral
683 /// </code>
684 /// that caused the event.
685 ///
686 ///
687 /// This method is invoked when the authorization status changes for a peripheral connected with {
688 ///
689 /// ```text
690 /// connectPeripheral:} option {@link CBConnectPeripheralOptionRequiresANCS}.
691 ///
692 ///
693 ///
694 /// ```
695 #[optional]
696 #[unsafe(method(centralManager:didUpdateANCSAuthorizationForPeripheral:))]
697 #[unsafe(method_family = none)]
698 unsafe fn centralManager_didUpdateANCSAuthorizationForPeripheral(
699 &self,
700 central: &CBCentralManager,
701 peripheral: &CBPeripheral,
702 );
703 }
704);