objc2-io-bluetooth 0.3.2

Bindings to the IOBluetooth framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-foundation")]
use objc2_foundation::*;

use crate::*;

/// Hands free superclass. Superclass of IOBluetoothHandsFreeDevice or IOBluetoothHandsFreeAudioGateway.
/// Contains the common code used to support the Bluetoooth hands free profile.
///
/// (c) 2010 by Apple Inc. All rights reserved.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreedevicefeatures?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct IOBluetoothHandsFreeDeviceFeatures(pub u32);
impl IOBluetoothHandsFreeDeviceFeatures {
    #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureECAndOrNRFunction")]
    pub const ECAndOrNRFunction: Self = Self(1 << 0);
    #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureThreeWayCalling")]
    pub const ThreeWayCalling: Self = Self(1 << 1);
    #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureCLIPresentation")]
    pub const CLIPresentation: Self = Self(1 << 2);
    #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureVoiceRecognition")]
    pub const VoiceRecognition: Self = Self(1 << 3);
    #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureRemoteVolumeControl")]
    pub const RemoteVolumeControl: Self = Self(1 << 4);
    #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureEnhancedCallStatus")]
    pub const EnhancedCallStatus: Self = Self(1 << 5);
    #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureEnhancedCallControl")]
    pub const EnhancedCallControl: Self = Self(1 << 6);
    #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureCodecNegotiation")]
    pub const CodecNegotiation: Self = Self(1 << 7);
}

unsafe impl Encode for IOBluetoothHandsFreeDeviceFeatures {
    const ENCODING: Encoding = u32::ENCODING;
}

unsafe impl RefEncode for IOBluetoothHandsFreeDeviceFeatures {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeaudiogatewayfeatures?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct IOBluetoothHandsFreeAudioGatewayFeatures(pub u32);
impl IOBluetoothHandsFreeAudioGatewayFeatures {
    #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureThreeWayCalling")]
    pub const ThreeWayCalling: Self = Self(1 << 0);
    #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureECAndOrNRFunction")]
    pub const ECAndOrNRFunction: Self = Self(1 << 1);
    #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureVoiceRecognition")]
    pub const VoiceRecognition: Self = Self(1 << 2);
    #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureInBandRingTone")]
    pub const InBandRingTone: Self = Self(1 << 3);
    #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureAttachedNumberToVoiceTag")]
    pub const AttachedNumberToVoiceTag: Self = Self(1 << 4);
    #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureRejectCallCapability")]
    pub const RejectCallCapability: Self = Self(1 << 5);
    #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureEnhancedCallStatus")]
    pub const EnhancedCallStatus: Self = Self(1 << 6);
    #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureEnhancedCallControl")]
    pub const EnhancedCallControl: Self = Self(1 << 7);
    #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureExtendedErrorResultCodes")]
    pub const ExtendedErrorResultCodes: Self = Self(1 << 8);
    #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureCodecNegotiation")]
    pub const CodecNegotiation: Self = Self(1 << 9);
}

unsafe impl Encode for IOBluetoothHandsFreeAudioGatewayFeatures {
    const ENCODING: Encoding = u32::ENCODING;
}

unsafe impl RefEncode for IOBluetoothHandsFreeAudioGatewayFeatures {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallholdmodes?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct IOBluetoothHandsFreeCallHoldModes(pub NSUInteger);
impl IOBluetoothHandsFreeCallHoldModes {
    #[doc(alias = "IOBluetoothHandsFreeCallHoldMode0")]
    pub const Mode0: Self = Self(1 << 0);
    #[doc(alias = "IOBluetoothHandsFreeCallHoldMode1")]
    pub const Mode1: Self = Self(1 << 1);
    #[doc(alias = "IOBluetoothHandsFreeCallHoldMode1idx")]
    pub const Mode1idx: Self = Self(1 << 2);
    #[doc(alias = "IOBluetoothHandsFreeCallHoldMode2")]
    pub const Mode2: Self = Self(1 << 3);
    #[doc(alias = "IOBluetoothHandsFreeCallHoldMode2idx")]
    pub const Mode2idx: Self = Self(1 << 4);
    #[doc(alias = "IOBluetoothHandsFreeCallHoldMode3")]
    pub const Mode3: Self = Self(1 << 5);
    #[doc(alias = "IOBluetoothHandsFreeCallHoldMode4")]
    pub const Mode4: Self = Self(1 << 6);
}

unsafe impl Encode for IOBluetoothHandsFreeCallHoldModes {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for IOBluetoothHandsFreeCallHoldModes {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecodecid?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct IOBluetoothHandsFreeCodecID(pub u8);
impl IOBluetoothHandsFreeCodecID {
    #[doc(alias = "IOBluetoothHandsFreeCodecIDCVSD")]
    pub const IDCVSD: Self = Self(0x01);
    #[doc(alias = "IOBluetoothHandsFreeCodecIDmSBC")]
    pub const IDmSBC: Self = Self(0x02);
    #[doc(alias = "IOBluetoothHandsFreeCodecIDAACELD")]
    pub const IDAACELD: Self = Self(0x80);
}

unsafe impl Encode for IOBluetoothHandsFreeCodecID {
    const ENCODING: Encoding = u8::ENCODING;
}

unsafe impl RefEncode for IOBluetoothHandsFreeCodecID {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorservice?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeIndicatorService: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorcall?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeIndicatorCall: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorcallsetup?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeIndicatorCallSetup: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorcallheld?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeIndicatorCallHeld: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorsignal?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeIndicatorSignal: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorroam?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeIndicatorRoam: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorbattchg?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeIndicatorBattChg: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallindex?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeCallIndex: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecalldirection?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeCallDirection: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallstatus?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeCallStatus: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallmode?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeCallMode: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallmultiparty?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeCallMultiparty: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallnumber?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeCallNumber: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecalltype?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeCallType: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallname?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothHandsFreeCallName: Option<&'static NSString>;
}

/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothsmsmode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct IOBluetoothSMSMode(pub NSUInteger);
impl IOBluetoothSMSMode {
    #[doc(alias = "IOBluetoothSMSModePDU")]
    pub const PDU: Self = Self(0);
    #[doc(alias = "IOBluetoothSMSModeText")]
    pub const Text: Self = Self(1);
}

unsafe impl Encode for IOBluetoothSMSMode {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for IOBluetoothSMSMode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreesmssupport?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct IOBluetoothHandsFreeSMSSupport(pub NSUInteger);
impl IOBluetoothHandsFreeSMSSupport {
    #[doc(alias = "IOBluetoothHandsFreePhase2SMSSupport")]
    pub const Phase2SMSSupport: Self = Self(1 << 0);
    #[doc(alias = "IOBluetoothHandsFreePhase2pSMSSupport")]
    pub const Phase2pSMSSupport: Self = Self(1 << 1);
    #[doc(alias = "IOBluetoothHandsFreeManufactureSpecificSMSSupport")]
    pub const ManufactureSpecificSMSSupport: Self = Self(1 << 2);
}

unsafe impl Encode for IOBluetoothHandsFreeSMSSupport {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for IOBluetoothHandsFreeSMSSupport {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreepdumessagestatus?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct IOBluetoothHandsFreePDUMessageStatus(pub NSUInteger);
impl IOBluetoothHandsFreePDUMessageStatus {
    #[doc(alias = "IOBluetoothHandsFreePDUStatusRecUnread")]
    pub const StatusRecUnread: Self = Self(0);
    #[doc(alias = "IOBluetoothHandsFreePDUStatusRecRead")]
    pub const StatusRecRead: Self = Self(1);
    #[doc(alias = "IOBluetoothHandsFreePDUStatusStoUnsent")]
    pub const StatusStoUnsent: Self = Self(2);
    #[doc(alias = "IOBluetoothHandsFreePDUStatusStoSent")]
    pub const StatusStoSent: Self = Self(3);
    #[doc(alias = "IOBluetoothHandsFreePDUStatusAll")]
    pub const StatusAll: Self = Self(4);
}

unsafe impl Encode for IOBluetoothHandsFreePDUMessageStatus {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for IOBluetoothHandsFreePDUMessageStatus {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduserviccenteraddress?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothPDUServicCenterAddress: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduservicecenteraddresstype?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothPDUServiceCenterAddressType: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpdutype?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothPDUType: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduoriginatingaddress?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothPDUOriginatingAddress: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduoriginatingaddresstype?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothPDUOriginatingAddressType: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduprotocolid?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothPDUProtocolID: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpdutimestamp?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothPDUTimestamp: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduencoding?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothPDUEncoding: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduuserdata?language=objc)
    #[cfg(feature = "objc2-foundation")]
    pub static IOBluetoothPDUUserData: Option<&'static NSString>;
}

extern_class!(
    /// Hands free profile class.
    ///
    /// Superclass of IOBluetoothHandsFreeDevice and IOBluetoothHandsFreeAudioGateway classes.
    /// Contains the common code used to support the bluetoooth hands free profile.
    ///
    /// IOBluetoothHandsFreeDevice
    ///
    /// IOBluetoothHandsFreeAudioGateway
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfree?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct IOBluetoothHandsFree;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for IOBluetoothHandsFree {}
);

impl IOBluetoothHandsFree {
    extern_methods!(
        /// Return supported features
        ///
        /// Returns the supported features bitmap. The values are described in “IOBluetoothHandsFreeDeviceFeatures and IOBluetoothHandsFreeAudioGatewayFeatures.”
        ///
        /// Returns: The supported features bitmap
        ///
        ///
        ///
        /// Set the supported features
        ///
        /// Sets the supported features bitmap. The values are described in “IOBluetoothHandsFreeDeviceFeatures and IOBluetoothHandsFreeAudioGatewayFeatures.”
        ///
        /// Parameter `featuresBitmap`: The features bitmap
        #[unsafe(method(supportedFeatures))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportedFeatures(&self) -> u32;

        /// Setter for [`supportedFeatures`][Self::supportedFeatures].
        #[unsafe(method(setSupportedFeatures:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSupportedFeatures(&self, supported_features: u32);

        /// Return the input volume
        ///
        /// Returns the input volume between 0 and 1. 0 is the same as mute.
        ///
        /// Returns: The input volume
        ///
        ///
        ///
        /// Set the input volume
        ///
        /// Sets the input volume between 0 and 1. 0 is the same as mute.
        ///
        /// Parameter `newVolume`: The new input volume
        #[unsafe(method(inputVolume))]
        #[unsafe(method_family = none)]
        pub unsafe fn inputVolume(&self) -> c_float;

        /// Setter for [`inputVolume`][Self::inputVolume].
        #[unsafe(method(setInputVolume:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setInputVolume(&self, input_volume: c_float);

        /// Return the input mute state.
        ///
        /// Returns the inputs mute state.
        ///
        /// Returns: YES if muted; otherwise NO.
        ///
        ///
        ///
        /// Set the input mute state.
        ///
        /// Sets the inputs mute state.
        ///
        /// Parameter `muted`: YES if muted; otherwise NO.
        #[unsafe(method(isInputMuted))]
        #[unsafe(method_family = none)]
        pub unsafe fn isInputMuted(&self) -> bool;

        /// Setter for [`isInputMuted`][Self::isInputMuted].
        #[unsafe(method(setInputMuted:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setInputMuted(&self, input_muted: bool);

        /// Return the output volume
        ///
        /// Returns the output volume between 0 and 1. 0 is the same as mute.
        ///
        /// Returns: The output volume
        ///
        ///
        ///
        /// Set the output volume
        ///
        /// Sets the output volume between 0 and 1. 0 is the same as mute.
        ///
        /// Parameter `newVolume`: The new output volume
        #[unsafe(method(outputVolume))]
        #[unsafe(method_family = none)]
        pub unsafe fn outputVolume(&self) -> c_float;

        /// Setter for [`outputVolume`][Self::outputVolume].
        #[unsafe(method(setOutputVolume:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setOutputVolume(&self, output_volume: c_float);

        /// Return the output mute state.
        ///
        /// Returns the outputs mute state.
        ///
        /// Returns: YES if muted; otherwise NO.
        ///
        ///
        ///
        /// Set the output mute state.
        ///
        /// Sets the outputs mute state.
        ///
        /// Parameter `muted`: YES if muted; otherwise NO.
        #[unsafe(method(isOutputMuted))]
        #[unsafe(method_family = none)]
        pub unsafe fn isOutputMuted(&self) -> bool;

        /// Setter for [`isOutputMuted`][Self::isOutputMuted].
        #[unsafe(method(setOutputMuted:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setOutputMuted(&self, output_muted: bool);

        #[cfg(all(feature = "IOBluetoothDevice", feature = "IOBluetoothObject"))]
        /// Return the IOBluetoothDevice.
        ///
        /// Returns the IOBluetoothDevice to connect with.
        ///
        /// Returns: The IOBluetoothDevice object
        #[unsafe(method(device))]
        #[unsafe(method_family = none)]
        pub unsafe fn device(&self) -> Option<Retained<IOBluetoothDevice>>;

        /// Return the device's supported features.
        ///
        /// Returns the device's supported features bitmap. The values are described in “IOBluetoothHandsFreeDeviceFeatures and IOBluetoothHandsFreeAudioGatewayFeatures.”
        ///
        /// Returns: The device features bitmap
        #[unsafe(method(deviceSupportedFeatures))]
        #[unsafe(method_family = none)]
        pub unsafe fn deviceSupportedFeatures(&self) -> u32;

        /// Return the device's supported SMS services.
        ///
        /// Returns the device's supported SMS services bitmap. The values are described in “IOBluetoothHandsFreeSMSSupport.”
        ///
        /// Returns: The SMS services supported
        #[unsafe(method(deviceSupportedSMSServices))]
        #[unsafe(method_family = none)]
        pub unsafe fn deviceSupportedSMSServices(&self) -> u32;

        /// Return the device's supported call hold modes.
        ///
        /// Returns the device's supported call hold modes bitmap. The values are described in “IOBluetoothHandsFreeCallHoldModes.”
        ///
        /// Returns: The SMS services supported
        #[unsafe(method(deviceCallHoldModes))]
        #[unsafe(method_family = none)]
        pub unsafe fn deviceCallHoldModes(&self) -> u32;

        /// Return the device's SMS mode.
        ///
        /// Returns the device's SMS mode. The values are described in “IOBluetoothSMSMode.”
        ///
        /// Returns: The SMS mode
        #[unsafe(method(SMSMode))]
        #[unsafe(method_family = none)]
        pub unsafe fn SMSMode(&self) -> IOBluetoothSMSMode;

        /// Return YES if the device has SMS enabled.
        ///
        /// Returns YES if the device has SMS enabled (by responding to a CMGF command). NO if the device has not set an SMS mode or doesn't support SMS.
        ///
        /// Returns: YES if the device has SMSEnabled; otherwise, NO.
        #[unsafe(method(isSMSEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn isSMSEnabled(&self) -> bool;

        /// Return the delegate
        ///
        /// Returns the hands free object's delegate.
        ///
        /// Returns: The delegate for the hands free object or nil if it doesn't have a delegate.
        ///
        ///
        ///
        /// Sets the hands free object’s delegate to a given object or removes an existing delegate.
        ///
        /// A IOBluetoothHandsFree delegate can optionally respond to any of the delegate methods in IOBluetoothHandsFreeDelegate and any subclasses delegates.
        ///
        /// Parameter `newDelegate`: The delegate for the hands free object. Pass nil to remove an existing delegate.
        ///
        /// # Safety
        ///
        /// This is not retained internally, you must ensure the object is still alive.
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn IOBluetoothHandsFreeDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// # Safety
        ///
        /// - `delegate` might not allow `None`.
        /// - This is unretained, you must ensure the object is kept alive while in use.
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn IOBluetoothHandsFreeDelegate>>,
        );

        #[cfg(feature = "objc2-foundation")]
        /// Return an indicator's value
        ///
        /// Returns an indicator's value.
        ///
        /// Parameter `indicatorName`: See  “Hands free indicator constants," for standard indicator names.
        ///
        /// # Safety
        ///
        /// `indicator_name` might not allow `None`.
        #[unsafe(method(indicator:))]
        #[unsafe(method_family = none)]
        pub unsafe fn indicator(&self, indicator_name: Option<&NSString>) -> c_int;

        #[cfg(feature = "objc2-foundation")]
        /// Set an indicator's value
        ///
        /// Sets an indicator's value.
        ///
        /// Parameter `indicatorName`: See  “Hands free indicator constants," for standard indicator names.
        ///
        /// Parameter `indicatorValue`: Will set the indicator value as long as it is within the min and max values allowed.
        ///
        /// # Safety
        ///
        /// `indicator_name` might not allow `None`.
        #[unsafe(method(setIndicator:value:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIndicator_value(
            &self,
            indicator_name: Option<&NSString>,
            indicator_value: c_int,
        );

        #[cfg(all(feature = "IOBluetoothDevice", feature = "IOBluetoothObject"))]
        /// Create a new IOBluetoothHandsFree object
        ///
        /// This method should be called on a subclass (IOBluetoothHandsFreeDevice or IOBluetoothHandsFreeAudioGateway) to get full functionality.
        ///
        /// Parameter `device`: An IOBluetoothDevice
        ///
        /// Parameter `inDelegate`: An object to act as delegate that implements the IOBluetoothHandsFreeDelegate protocol.
        ///
        /// Returns: A newly created IOBluetoothHandsFreeAudioGateway object on success, nil on failure
        ///
        /// # Safety
        ///
        /// - `device` might not allow `None`.
        /// - `in_delegate` might not allow `None`.
        #[unsafe(method(initWithDevice:delegate:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithDevice_delegate(
            this: Allocated<Self>,
            device: Option<&IOBluetoothDevice>,
            in_delegate: Option<&ProtocolObject<dyn IOBluetoothHandsFreeDelegate>>,
        ) -> Option<Retained<Self>>;

        /// Connect to the device
        ///
        /// Connects to the device and sets up a service level connection (RFCOMM channel).
        /// Delegate methods will be called once the connection is complete or a failure occurs.
        #[unsafe(method(connect))]
        #[unsafe(method_family = none)]
        pub unsafe fn connect(&self);

        /// Disconnect from the device
        ///
        /// Disconnects from the device, closes the SCO and service level connection if they are connected.
        /// Delegate methods will be called once the disconnection is complete.
        #[unsafe(method(disconnect))]
        #[unsafe(method_family = none)]
        pub unsafe fn disconnect(&self);

        /// Determine if there is a serivice level connection to the device
        ///
        /// Determines if there is a serivice level connection to the device.
        ///
        /// Returns: YES if there is a serivice level connection to the device; otherwise, NO.
        #[unsafe(method(isConnected))]
        #[unsafe(method_family = none)]
        pub unsafe fn isConnected(&self) -> bool;

        /// Open a SCO connection with the device
        ///
        /// Opens a SCO connection with the device. The device must already have a service level connection or this will return immediately.
        /// Delegate methods will be called once the connection is complete of a failure occurs.
        #[unsafe(method(connectSCO))]
        #[unsafe(method_family = none)]
        pub unsafe fn connectSCO(&self);

        /// Disconnect the SCO connection with the device
        ///
        /// Disconnects the SCO connection with the device (if one exists).
        /// Delegate methods will be called once the disconnection is complete.
        #[unsafe(method(disconnectSCO))]
        #[unsafe(method_family = none)]
        pub unsafe fn disconnectSCO(&self);

        /// Determine if there is a SCO connection to the device
        ///
        /// Determines if there is a SCO connection to the device.
        ///
        /// Returns: YES if there is a SCO connection to the device; otherwise, NO.
        #[unsafe(method(isSCOConnected))]
        #[unsafe(method_family = none)]
        pub unsafe fn isSCOConnected(&self) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl IOBluetoothHandsFree {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreedelegate?language=objc)
    pub unsafe trait IOBluetoothHandsFreeDelegate: NSObjectProtocol {
        #[cfg(feature = "objc2-foundation")]
        /// Tells the delegate that the hands free service level connection is complete.
        ///
        /// Parameter `device`: The IOBluetoothHandsFree object that was being connected
        ///
        /// Parameter `status`: The result of the connection attempt. An IOReturn result returned in an NSNumber object.
        ///
        /// # Safety
        ///
        /// - `device` might not allow `None`.
        /// - `status` might not allow `None`.
        #[optional]
        #[unsafe(method(handsFree:connected:))]
        #[unsafe(method_family = none)]
        unsafe fn handsFree_connected(
            &self,
            device: Option<&IOBluetoothHandsFree>,
            status: Option<&NSNumber>,
        );

        #[cfg(feature = "objc2-foundation")]
        /// Tells the delegate that the hands free service level connection was disconnected.
        ///
        /// Parameter `device`: The IOBluetoothHandsFree object whose service level connection was disconnected
        ///
        /// Parameter `status`: The result of the disconnection attempt. An IOReturn result returned in an NSNumber object.
        ///
        /// # Safety
        ///
        /// - `device` might not allow `None`.
        /// - `status` might not allow `None`.
        #[optional]
        #[unsafe(method(handsFree:disconnected:))]
        #[unsafe(method_family = none)]
        unsafe fn handsFree_disconnected(
            &self,
            device: Option<&IOBluetoothHandsFree>,
            status: Option<&NSNumber>,
        );

        #[cfg(feature = "objc2-foundation")]
        /// Tells the delegate that the SCO connection is complete.
        ///
        /// Parameter `device`: The IOBluetoothHandsFree object that was being connected
        ///
        /// Parameter `status`: The result of the connection attempt. An IOReturn result returned in an NSNumber object.
        ///
        /// # Safety
        ///
        /// - `device` might not allow `None`.
        /// - `status` might not allow `None`.
        #[optional]
        #[unsafe(method(handsFree:scoConnectionOpened:))]
        #[unsafe(method_family = none)]
        unsafe fn handsFree_scoConnectionOpened(
            &self,
            device: Option<&IOBluetoothHandsFree>,
            status: Option<&NSNumber>,
        );

        #[cfg(feature = "objc2-foundation")]
        /// Tells the delegate that the SCO connection was closed.
        ///
        /// Parameter `device`: The IOBluetoothHandsFree object whose SCO connection was closed
        ///
        /// Parameter `status`: The result of the disconnection attempt. An IOReturn result returned in an NSNumber object.
        ///
        /// # Safety
        ///
        /// - `device` might not allow `None`.
        /// - `status` might not allow `None`.
        #[optional]
        #[unsafe(method(handsFree:scoConnectionClosed:))]
        #[unsafe(method_family = none)]
        unsafe fn handsFree_scoConnectionClosed(
            &self,
            device: Option<&IOBluetoothHandsFree>,
            status: Option<&NSNumber>,
        );
    }
);

/// HandsFreeDeviceAdditions.
#[cfg(all(feature = "IOBluetoothDevice", feature = "IOBluetoothObject"))]
impl IOBluetoothDevice {
    extern_methods!(
        #[cfg(feature = "objc2-foundation")]
        /// Return the hands free gateway driver ID
        ///
        /// Returns the hands free gateway driver ID which is unique based on BT Address.
        ///
        /// Returns: The hands free gateway driver ID
        #[deprecated]
        #[unsafe(method(handsFreeAudioGatewayDriverID))]
        #[unsafe(method_family = none)]
        pub unsafe fn handsFreeAudioGatewayDriverID(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "IOBluetoothSDPServiceRecord")]
        /// Return the hands free gateway SDP record
        ///
        /// Returns the hands free gateway SDP record.
        ///
        /// Returns: The hands free gateway SDP record
        #[unsafe(method(handsFreeAudioGatewayServiceRecord))]
        #[unsafe(method_family = none)]
        pub unsafe fn handsFreeAudioGatewayServiceRecord(
            &self,
        ) -> Option<Retained<IOBluetoothSDPServiceRecord>>;

        /// Return the devices support for hands free gateway
        ///
        /// Returns the devices support for hands free gateway (obtained from the devices SDP record).
        ///
        /// Returns: YES if the device supports hands free gateway; otherwise, NO.
        #[unsafe(method(isHandsFreeAudioGateway))]
        #[unsafe(method_family = none)]
        pub unsafe fn isHandsFreeAudioGateway(&self) -> bool;

        #[cfg(feature = "objc2-foundation")]
        /// Return the hands free device driver ID
        ///
        /// Returns the hands free device driver ID which is unique based on BT Address.
        ///
        /// Returns: The hands free device driver ID
        #[deprecated]
        #[unsafe(method(handsFreeDeviceDriverID))]
        #[unsafe(method_family = none)]
        pub unsafe fn handsFreeDeviceDriverID(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "IOBluetoothSDPServiceRecord")]
        /// Return the hands free device SDP record
        ///
        /// Returns the hands free device SDP record.
        ///
        /// Returns: The hands free device SDP record
        #[unsafe(method(handsFreeDeviceServiceRecord))]
        #[unsafe(method_family = none)]
        pub unsafe fn handsFreeDeviceServiceRecord(
            &self,
        ) -> Option<Retained<IOBluetoothSDPServiceRecord>>;

        /// Return the devices support for hands free device
        ///
        /// Returns the devices support for hands free device (obtained from the devices SDP record).
        ///
        /// Returns: YES if the device supports hands free device; otherwise, NO.
        #[unsafe(method(isHandsFreeDevice))]
        #[unsafe(method_family = none)]
        pub unsafe fn isHandsFreeDevice(&self) -> bool;
    );
}

/// HandsFreeSDPServiceRecordAdditions.
#[cfg(feature = "IOBluetoothSDPServiceRecord")]
impl IOBluetoothSDPServiceRecord {
    extern_methods!(
        /// Return the hands free supported features
        ///
        /// Returns the hands free supported features bitmap stored in the SDP record. See “IOBluetoothHandsFreeDeviceFeatures and IOBluetoothHandsFreeAudioGatewayFeatures.”
        ///
        /// Returns: The supported features bitmap.
        #[unsafe(method(handsFreeSupportedFeatures))]
        #[unsafe(method_family = none)]
        pub unsafe fn handsFreeSupportedFeatures(&self) -> u16;
    );
}