-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoreBluetooth.framework.h
More file actions
2579 lines (2266 loc) · 97.2 KB
/
CoreBluetooth.framework.h
File metadata and controls
2579 lines (2266 loc) · 97.2 KB
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
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ========== CoreBluetooth.framework/Headers/CBManager.h
/*
* @file CBManager.h
* @framework CoreBluetooth
*
* @discussion Entry point to the central role.
*
* @copyright 2016 Apple, Inc. All rights reserved.
*/
#import <CoreBluetooth/CBDefines.h>
#import <Foundation/Foundation.h>
NS_CLASS_AVAILABLE(10_13, 10_0)
CB_EXTERN_CLASS @interface CBManager : NSObject
- (instancetype)init NS_UNAVAILABLE;
/*!
* @enum CBManagerState
*
* @discussion Represents the current state of a CBManager.
*
* @constant CBManagerStateUnknown State unknown, update imminent.
* @constant CBManagerStateResetting The connection with the system service was momentarily lost, update imminent.
* @constant CBManagerStateUnsupported The platform doesn't support the Bluetooth Low Energy Central/Client role.
* @constant CBManagerStateUnauthorized The application is not authorized to use the Bluetooth Low Energy role.
* @constant CBManagerStatePoweredOff Bluetooth is currently powered off.
* @constant CBManagerStatePoweredOn Bluetooth is currently powered on and available to use.
*
* @seealso authorization
*/
typedef NS_ENUM(NSInteger, CBManagerState) {
CBManagerStateUnknown = 0,
CBManagerStateResetting,
CBManagerStateUnsupported,
CBManagerStateUnauthorized,
CBManagerStatePoweredOff,
CBManagerStatePoweredOn,
} NS_ENUM_AVAILABLE(10_13, 10_0);
/*!
* @property state
*
* @discussion The current state of the manager, initially set to <code>CBManagerStateUnknown</code>.
* Updates are provided by required delegate method {@link managerDidUpdateState:}.
*
*/
@property(nonatomic, assign, readonly) CBManagerState state;
/*!
* @enum CBManagerAuthorization
*
* @discussion Represents the current authorization state of a CBManager.
*
* @constant CBManagerAuthorizationStatusNotDetermined User has not yet made a choice with regards to this application.
* @constant CBManagerAuthorizationStatusRestricted This application is not authorized to use bluetooth. The user cannot change this application’s status,
* possibly due to active restrictions such as parental controls being in place.
* @constant CBManagerAuthorizationStatusDenied User has explicitly denied this application from using bluetooth.
* @constant CBManagerAuthorizationStatusAuthorizedAlways User has authorized this application to use bluetooth always.
*
*/
typedef NS_ENUM(NSInteger, CBManagerAuthorization) {
CBManagerAuthorizationNotDetermined = 0,
CBManagerAuthorizationRestricted,
CBManagerAuthorizationDenied,
CBManagerAuthorizationAllowedAlways
} NS_ENUM_AVAILABLE(10_15, 13_0);
/*!
* @property authorization
*
* @discussion The current authorization of the manager, initially set to <code>CBManagerAuthorizationNotDetermined</code>.
* Updates are provided by required delegate method {@link managerDidUpdateState:}.
* @seealso state
*/
@property(nonatomic, assign, readonly) CBManagerAuthorization authorization;
@end
// ========== CoreBluetooth.framework/Headers/CBPeer.h
/*
* @file CBPeer.h
* @framework CoreBluetooth
*
* @copyright 2014 Apple, Inc. All rights reserved.
*/
#import <CoreBluetooth/CBDefines.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
NS_CLASS_AVAILABLE(10_13, 8_0)
CB_EXTERN_CLASS @interface CBPeer : NSObject <NSCopying>
- (instancetype)init NS_UNAVAILABLE;
/*!
* @property identifier
*
* @discussion The unique, persistent identifier associated with the peer.
*/
@property(readonly, nonatomic) NSUUID *identifier NS_AVAILABLE(10_13, 7_0);
@end
NS_ASSUME_NONNULL_END
// ========== CoreBluetooth.framework/Headers/CoreBluetooth.h
/*!
* @header
* @file CoreBluetooth.h
* @framework CoreBluetooth
*
* @discussion Bluetooth Low Energy framework
*
* @copyright 2011 Apple, Inc. All rights reserved.
*/
#ifndef _CORE_BLUETOOTH_H_
#define _CORE_BLUETOOTH_H_
#endif
#import <CoreBluetooth/CBCentralManager.h>
#import <CoreBluetooth/CBPeripheralManager.h>
#import <CoreBluetooth/CBPeripheral.h>
#import <CoreBluetooth/CBCentral.h>
#import <CoreBluetooth/CBService.h>
#import <CoreBluetooth/CBCharacteristic.h>
#import <CoreBluetooth/CBDescriptor.h>
#import <CoreBluetooth/CBError.h>
#import <CoreBluetooth/CBUUID.h>
#import <CoreBluetooth/CBAdvertisementData.h>
#import <CoreBluetooth/CBATTRequest.h>
// ========== CoreBluetooth.framework/Headers/CBDefines.h
/*
* CBDefines.h
* CoreBluetooth
*
* Copyright 2011 Apple, Inc. All rights reserved.
*/
#ifndef CB_EXTERN
#ifdef __cplusplus
#define CB_EXTERN extern "C" __attribute__((visibility ("default")))
#else
#define CB_EXTERN extern __attribute__((visibility ("default")))
#endif
#endif
#define CB_EXTERN_CLASS __attribute__((visibility("default")))
// ========== CoreBluetooth.framework/Headers/CBUUID.h
/*
* @file CBUUID.h
* @framework CoreBluetooth
*
* @discussion The CBUUID class represents bluetooth LE UUIDs. It automatically handles
* transformations of 16 and 32 bit UUIDs into 128 bit UUIDs.
*
* @copyright 2011 Apple, Inc. All rights reserved.
*/
#ifndef _CORE_BLUETOOTH_H_
#warning Please do not import this header file directly. Use <CoreBluetooth/CoreBluetooth.h> instead.
#endif
#import <CoreBluetooth/CBDefines.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/*!
* @const CBUUIDCharacteristicExtendedPropertiesString
* @discussion The string representation of the UUID for the extended properties descriptor.
* The corresponding value for this descriptor is an <code>NSNumber</code> object.
*/
CB_EXTERN NSString * const CBUUIDCharacteristicExtendedPropertiesString;
/*!
* @const CBUUIDCharacteristicUserDescriptionString
* @discussion The string representation of the UUID for the user description descriptor.
* The corresponding value for this descriptor is an <code>NSString</code> object.
*/
CB_EXTERN NSString * const CBUUIDCharacteristicUserDescriptionString;
/*!
* @const CBUUIDClientCharacteristicConfigurationString
* @discussion The string representation of the UUID for the client configuration descriptor.
* The corresponding value for this descriptor is an <code>NSNumber</code> object.
*/
CB_EXTERN NSString * const CBUUIDClientCharacteristicConfigurationString;
/*!
* @const CBUUIDServerCharacteristicConfigurationString
* @discussion The string representation of the UUID for the server configuration descriptor.
* The corresponding value for this descriptor is an <code>NSNumber</code> object.
*/
CB_EXTERN NSString * const CBUUIDServerCharacteristicConfigurationString;
/*!
* @const CBUUIDCharacteristicFormatString
* @discussion The string representation of the UUID for the presentation format descriptor.
* The corresponding value for this descriptor is an <code>NSData</code> object.
*/
CB_EXTERN NSString * const CBUUIDCharacteristicFormatString;
/*!
* @const CBUUIDCharacteristicAggregateFormatString
* @discussion The string representation of the UUID for the aggregate descriptor.
*/
CB_EXTERN NSString * const CBUUIDCharacteristicAggregateFormatString;
/*!
* @const CBUUIDCharacteristicValidRangeString
* @discussion Data representing the valid min/max values accepted for a characteristic.
*/
CB_EXTERN NSString * const CBUUIDCharacteristicValidRangeString;
/*!
* @const CBUUIDL2CAPPSMCharacteristicString
* @discussion The PSM (a little endian uint16_t) of an L2CAP Channel associated with the GATT service
* containing this characteristic. Servers can publish this characteristic with the UUID
* ABDD3056-28FA-441D-A470-55A75A52553A
*/
CB_EXTERN NSString * const CBUUIDL2CAPPSMCharacteristicString NS_AVAILABLE(10_13, 11_0);
/*!
* @class CBUUID
*
* @discussion
* A 16-bit, 32-bit, or 128-bit Bluetooth UUID.
* 16-bit and 32-bit UUIDs are implicitly pre-filled with the Bluetooth Base UUID.
*
*/
NS_CLASS_AVAILABLE(10_7, 5_0)
CB_EXTERN_CLASS @interface CBUUID : NSObject <NSCopying>
/*!
* @property data
*
* @discussion
* The UUID as NSData.
*
*/
@property(nonatomic, readonly) NSData *data;
/*!
* @property UUIDString
*
* @discussion
* The UUID as NSString.
*
*/
@property(nonatomic, readonly) NSString *UUIDString NS_AVAILABLE(10_10, 7_1);
/*!
* @method UUIDWithString:
*
* @discussion
* Creates a CBUUID with a 16-bit, 32-bit, or 128-bit UUID string representation.
* The expected format for 128-bit UUIDs is a string punctuated by hyphens, for example 68753A44-4D6F-1226-9C60-0050E4C00067.
*
*/
+ (CBUUID *)UUIDWithString:(NSString *)theString;
/*!
* @method UUIDWithData:
*
* @discussion
* Creates a CBUUID with a 16-bit, 32-bit, or 128-bit UUID data container.
*
*/
+ (CBUUID *)UUIDWithData:(NSData *)theData;
/*!
* @method UUIDWithCFUUID:
*
* @discussion
* Creates a CBUUID with a CFUUIDRef.
*
*/
+ (CBUUID *)UUIDWithCFUUID:(CFUUIDRef)theUUID NS_DEPRECATED(10_7, 10_13, 5_0, 9_0);
/*!
* @method UUIDWithNSUUID:
*
* @discussion
* Creates a CBUUID with an NSUUID.
*
*/
+ (CBUUID *)UUIDWithNSUUID:(NSUUID *)theUUID NS_AVAILABLE(10_9, 7_0);
@end
NS_ASSUME_NONNULL_END
// ========== CoreBluetooth.framework/Headers/CBCentralManagerConstants.h
/*
* @file CBCentralManagerConstants.h
* @framework CoreBluetooth
*
* @copyright 2013 Apple, Inc. All rights reserved.
*/
#import <CoreBluetooth/CBDefines.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/*!
* @const CBCentralManagerOptionShowPowerAlertKey
*
* @discussion An NSNumber (Boolean) indicating that the system should, if Bluetooth is powered off when <code>CBCentralManager</code> is instantiated, display
* a warning dialog to the user.
*
* @see initWithDelegate:queue:options:
*
*/
CB_EXTERN NSString * const CBCentralManagerOptionShowPowerAlertKey NS_AVAILABLE(10_9, 7_0);
/*!
* @const CBCentralManagerOptionRestoreIdentifierKey
*
* @discussion An NSString containing a unique identifier (UID) for the <code>CBCentralManager</code> that is being instantiated. This UID is used
* by the system to identify a specific <code>CBCentralManager</code> instance for restoration and, therefore, must remain the same for
* subsequent application executions in order for the manager to be restored.
*
* @see initWithDelegate:queue:options:
* @seealso centralManager:willRestoreState:
*
*/
CB_EXTERN NSString * const CBCentralManagerOptionRestoreIdentifierKey NS_AVAILABLE(10_13, 7_0);
/*!
* @const CBCentralManagerScanOptionAllowDuplicatesKey
*
* @discussion An NSNumber (Boolean) indicating that the scan should run without duplicate filtering. By default, multiple discoveries of the
* same peripheral are coalesced into a single discovery event. Specifying this option will cause a discovery event to be generated
* every time the peripheral is seen, which may be many times per second. This can be useful in specific situations, such as making
* a connection based on a peripheral's RSSI, but may have an adverse affect on battery-life and application performance.
*
* @see scanForPeripheralsWithServices:options:
*
*/
CB_EXTERN NSString * const CBCentralManagerScanOptionAllowDuplicatesKey;
/*!
* @const CBCentralManagerScanOptionSolicitedServiceUUIDsKey
*
* @discussion An NSArray of <code>CBUUID</code> objects respresenting service UUIDs. Causes the scan to also look for peripherals soliciting
* any of the services contained in the list.
*
* @see scanForPeripheralsWithServices:options:
*
*/
CB_EXTERN NSString * const CBCentralManagerScanOptionSolicitedServiceUUIDsKey NS_AVAILABLE(10_9, 7_0);
/*!
* @const CBConnectPeripheralOptionNotifyOnConnectionKey
*
* @discussion An NSNumber (Boolean) indicating that the system should display a connection alert for a given peripheral, if the application is suspended
* when a successful connection is made.
* This is useful for applications that have not specified the <code>bluetooth-central</code> background mode and cannot display their
* own alert. If more than one application has requested notification for a given peripheral, the one that was most recently in the foreground
* will receive the alert.
*
* @see connectPeripheral:
*
*/
CB_EXTERN NSString * const CBConnectPeripheralOptionNotifyOnConnectionKey NS_AVAILABLE(10_13, 6_0);
/*!
* @const CBConnectPeripheralOptionNotifyOnDisconnectionKey
*
* @discussion An NSNumber (Boolean) indicating that the system should display a disconnection alert for a given peripheral, if the application
* is suspended at the time of the disconnection.
* This is useful for applications that have not specified the <code>bluetooth-central</code> background mode and cannot display their
* own alert. If more than one application has requested notification for a given peripheral, the one that was most recently in the foreground
* will receive the alert.
*
* @see connectPeripheral:
*
*/
CB_EXTERN NSString * const CBConnectPeripheralOptionNotifyOnDisconnectionKey;
/*!
* @const CBConnectPeripheralOptionNotifyOnNotificationKey
*
* @discussion An NSNumber (Boolean) indicating that the system should display an alert for all notifications received from a given peripheral, if
* the application is suspended at the time.
* This is useful for applications that have not specified the <code>bluetooth-central</code> background mode and cannot display their
* own alert. If more than one application has requested notification for a given peripheral, the one that was most recently in the foreground
* will receive the alert.
*
* @see connectPeripheral:
*
*/
CB_EXTERN NSString * const CBConnectPeripheralOptionNotifyOnNotificationKey NS_AVAILABLE(10_13, 6_0);
/*!
* @const CBConnectPeripheralOptionStartDelayKey
*
* @discussion An NSNumber indicating the number of seconds for the system to wait before starting a connection.
*
* @see connectPeripheral:
*
*/
CB_EXTERN NSString * const CBConnectPeripheralOptionStartDelayKey NS_AVAILABLE(10_13, 6_0);
/*!
* @const CBConnectPeripheralOptionEnableTransportBridgingKey
*
* @discussion An NSNumber (Boolean) indicating that the system will bring up classic transport profiles when low energy transport for peripheral is connected.
*
* @see connectPeripheral:
*
*/
CB_EXTERN NSString * const CBConnectPeripheralOptionEnableTransportBridgingKey NS_AVAILABLE_IOS(13_0);
/*!
* @const CBConnectPeripheralOptionRequiresANCS
*
* @discussion An NSNumber (Boolean) indicating that the ANCS (Apple Notification Center Service) is required for the peripheral is connected.
*
* @see connectPeripheral:
*
*/
CB_EXTERN NSString * const CBConnectPeripheralOptionRequiresANCS NS_AVAILABLE_IOS(13_0);
/*!
* @const CBCentralManagerRestoredStatePeripheralsKey
*
* @discussion An NSArray of <code>CBPeripheral</code> objects containing all peripherals that were connected or pending connection at the time the
* application was terminated by the system. When possible, all known information for each peripheral will be restored, including any discovered
* services, characteristics and descriptors, as well as characteristic notification states.
*
* @see centralManager:willRestoreState:
* @seealso connectPeripheral:options:
*
*/
CB_EXTERN NSString * const CBCentralManagerRestoredStatePeripheralsKey NS_AVAILABLE(10_13, 7_0);
/*!
* @const CBCentralManagerRestoredStateScanServicesKey
*
* @discussion An NSArray of <code>CBUUID</code> objects containing the service(s) being scanned for at the time the application was terminated by the system.
*
* @see centralManager:willRestoreState:
* @seealso scanForPeripheralsWithServices:options:
*
*/
CB_EXTERN NSString * const CBCentralManagerRestoredStateScanServicesKey NS_AVAILABLE(10_13, 7_0);
/*!
* @const CBCentralManagerRestoredStateScanOptionsKey
*
* @discussion An NSDictionary containing the scan options at the time the application was terminated by the system.
*
* @see centralManager:willRestoreState:
* @seealso scanForPeripheralsWithServices:options:
*
*/
CB_EXTERN NSString * const CBCentralManagerRestoredStateScanOptionsKey NS_AVAILABLE(10_13, 7_0);
typedef NSString * CBConnectionEventMatchingOption NS_TYPED_ENUM;
/*!
* @const CBConnectionEventMatchingOptionServiceUUIDs
*
* @discussion An NSArray of <code>CBUUID</code> objects respresenting service UUIDs. A connected peer with any matching service UUIDs will result
* in a call to {@link centralManager:connectionEventDidOccur:}.
* A maximum of 4 services can be registered.
*
* @see centralManager:connectionEventDidOccur:forPeripheral:
* @seealso registerForConnectionEventsWithOptions:
*
*/
CB_EXTERN CBConnectionEventMatchingOption const CBConnectionEventMatchingOptionServiceUUIDs NS_AVAILABLE_IOS(13_0);
/*!
* @const CBConnectionEventMatchingOptionPeripheralUUIDs
*
* @discussion An NSArray of <code>NSUUID</code> objects respresenting <i>peripheral</i> identifiers. A connected peer with any matching identifier(s) will result
* in a call to {@link centralManager:connectionEventDidOccur:}.
*
* @see centralManager:connectionEventDidOccur:forPeripheral:
* @seealso registerForConnectionEventsWithOptions:
*
*/
CB_EXTERN CBConnectionEventMatchingOption const CBConnectionEventMatchingOptionPeripheralUUIDs NS_AVAILABLE_IOS(13_0);
NS_ASSUME_NONNULL_END
// ========== CoreBluetooth.framework/Headers/CBCentral.h
/*
* @file CBCentral.h
* @framework CoreBluetooth
*
* @discussion Representation of a remote central.
*
* @copyright 2012 Apple, Inc. All rights reserved.
*/
#ifndef _CORE_BLUETOOTH_H_
#warning Please do not import this header file directly. Use <CoreBluetooth/CoreBluetooth.h> instead.
#endif
#import <CoreBluetooth/CBDefines.h>
#import <CoreBluetooth/CBPeer.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/*!
* @class CBCentral
*
* @discussion Represents a remote central.
*
*/
NS_CLASS_AVAILABLE(10_9, 6_0)
CB_EXTERN_CLASS @interface CBCentral : CBPeer
/*!
* @property maximumUpdateValueLength
*
* @discussion The maximum amount of data, in bytes, that can be received by the central in a single notification or indication.
*
* @see updateValue:forCharacteristic:onSubscribedCentrals:
*/
@property(readonly, nonatomic) NSUInteger maximumUpdateValueLength;
@end
NS_ASSUME_NONNULL_END
// ========== CoreBluetooth.framework/Headers/CBDescriptor.h
/*
* @file CBDescriptor.h
* @framework CoreBluetooth
*
* @copyright 2011 Apple, Inc. All rights reserved.
*/
#ifndef _CORE_BLUETOOTH_H_
#warning Please do not import this header file directly. Use <CoreBluetooth/CoreBluetooth.h> instead.
#endif
#import <CoreBluetooth/CBAttribute.h>
NS_ASSUME_NONNULL_BEGIN
/*!
* @class CBDescriptor
*
* @discussion
* Represents a characteristic's descriptor.
*
*/
NS_CLASS_AVAILABLE(10_7, 5_0)
CB_EXTERN_CLASS @interface CBDescriptor : CBAttribute
/*!
* @property characteristic
*
* @discussion
* A back-pointer to the characteristic this descriptor belongs to.
*
*/
@property(assign, readonly, nonatomic) CBCharacteristic *characteristic;
/*!
* @property value
*
* @discussion
* The value of the descriptor. The corresponding value types for the various descriptors are detailed in @link CBUUID.h @/link.
*
*/
@property(retain, readonly, nullable) id value;
@end
/*!
* @class CBMutableDescriptor
*
* @discussion
* Used to create a local characteristic descriptor, which can be added to the local database via <code>CBPeripheralManager</code>.
* Once a descriptor is published, it is cached and can no longer be changed.
* Descriptor types are detailed in @link CBUUID.h @/link, but only the <code>Characteristic User Description</code> and <code>Characteristic Presentation
* Format</code> descriptors are currently supported. The <code>Characteristic Extended Properties</code> and <code>Client Characteristic
* Configuration</code> descriptors will be created automatically upon publication of the parent service, depending on the properties of the characteristic itself.
*/
NS_CLASS_AVAILABLE(10_9, 6_0)
CB_EXTERN_CLASS @interface CBMutableDescriptor : CBDescriptor
/*!
* @method initWithType:value:
*
* @param UUID The Bluetooth UUID of the descriptor.
* @param value The value of the descriptor.
*
* @discussion Returns a decriptor, initialized with a service type and value. The <i>value</i> is required and cannot be updated dynamically
* once the parent service has been published.
*
*/
- (instancetype)initWithType:(CBUUID *)UUID value:(nullable id)value NS_DESIGNATED_INITIALIZER __TVOS_PROHIBITED __WATCHOS_PROHIBITED;
@end
NS_ASSUME_NONNULL_END
// ========== CoreBluetooth.framework/Headers/CBService.h
/*
* @file CBService.h
* @framework CoreBluetooth
*
* @discussion A Bluetooth LE service representation. A LE Service provides a number of
* characteristics and may also reference other services.
*
* @copyright 2011 Apple, Inc. All rights reserved.
*/
#ifndef _CORE_BLUETOOTH_H_
#warning Please do not import this header file directly. Use <CoreBluetooth/CoreBluetooth.h> instead.
#endif
#import <CoreBluetooth/CBAttribute.h>
NS_ASSUME_NONNULL_BEGIN
/*!
* @class CBService
*
* @discussion
* Represents a peripheral's service or a service's included service.
*
*/
NS_CLASS_AVAILABLE(10_7, 5_0)
CB_EXTERN_CLASS @interface CBService : CBAttribute
/*!
* @property peripheral
*
* @discussion
* A back-pointer to the peripheral this service belongs to.
*
*/
@property(assign, readonly, nonatomic) CBPeripheral *peripheral;
/*!
* @property isPrimary
*
* @discussion
* The type of the service (primary or secondary).
*
*/
@property(readonly, nonatomic) BOOL isPrimary;
/*!
* @property includedServices
*
* @discussion
* A list of included CBServices that have so far been discovered in this service.
*
*/
@property(retain, readonly, nullable) NSArray<CBService *> *includedServices;
/*!
* @property characteristics
*
* @discussion
* A list of CBCharacteristics that have so far been discovered in this service.
*
*/
@property(retain, readonly, nullable) NSArray<CBCharacteristic *> *characteristics;
@end
/*!
* @class CBMutableService
*
* @discussion
* Used to create a local service or included service, which can be added to the local database via <code>CBPeripheralManager</code>.
* Once a service is published, it is cached and can no longer be changed. This class adds write access to all properties in the
* @link CBService @/link class.
*
*/
NS_CLASS_AVAILABLE(10_9, 6_0)
CB_EXTERN_CLASS @interface CBMutableService : CBService
@property(retain, readwrite, nullable) NSArray<CBService *> *includedServices;
@property(retain, readwrite, nullable) NSArray<CBCharacteristic *> *characteristics;
/*!
* @method initWithType:primary:
*
* @param UUID The Bluetooth UUID of the service.
* @param isPrimary The type of the service (primary or secondary).
*
* @discussion Returns a service, initialized with a service type and UUID.
*
*/
- (instancetype)initWithType:(CBUUID *)UUID primary:(BOOL)isPrimary NS_DESIGNATED_INITIALIZER __TVOS_PROHIBITED __WATCHOS_PROHIBITED;
@end
NS_ASSUME_NONNULL_END
// ========== CoreBluetooth.framework/Headers/CBPeripheralManagerConstants.h
/*
* @file CBPeripheralManagerConstants.h
* @framework CoreBluetooth
*
* @copyright 2013 Apple, Inc. All rights reserved.
*/
#import <CoreBluetooth/CBDefines.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/*!
* @const CBPeripheralManagerOptionShowPowerAlertKey
*
* @discussion An NSNumber (Boolean) indicating that the system should, if Bluetooth is powered off when <code>CBPeripheralManager</code> is instantiated, display
* a warning dialog to the user.
*
* @see initWithDelegate:queue:options:
*
*/
CB_EXTERN NSString * const CBPeripheralManagerOptionShowPowerAlertKey NS_AVAILABLE(10_9, 7_0);
/*!
* @const CBPeripheralManagerOptionRestoreIdentifierKey
*
* @discussion An NSString containing a unique identifier (UID) for the <code>CBPeripheralManager</code> that is being instantiated. This UID is used
* by the system to identify a specific <code>CBPeripheralManager</code> instance for restoration and, therefore, must remain the same for
* subsequent application executions in order for the manager to be restored.
*
* @see initWithDelegate:queue:options:
* @seealso centralManager:willRestoreState:
*
*/
CB_EXTERN NSString * const CBPeripheralManagerOptionRestoreIdentifierKey NS_AVAILABLE(10_9, 7_0);
/*!
* @const CBPeripheralManagerRestoredStateServicesKey
*
* @discussion An NSArray of <code>CBMutableService</code> objects containing all services that were published to the local database at the time the
* application was terminated by the system. All information for each service will be restored, including all discovered
* services, characteristics and descriptors, as well as characteristic notification states.
*
* @see peripheralManager:willRestoreState:
* @seealso addService:
*
*/
CB_EXTERN NSString * const CBPeripheralManagerRestoredStateServicesKey NS_AVAILABLE(10_9, 7_0);
/*!
* @const CBPeripheralManagerRestoredStateAdvertisementDataKey
*
* @discussion An NSDictionary containing the data being advertised at the time the application was terminated by the system.
*
* @see peripheralManager:willRestoreState:
* @seealso startAdvertising:
*
*/
CB_EXTERN NSString * const CBPeripheralManagerRestoredStateAdvertisementDataKey NS_AVAILABLE(10_9, 7_0);
NS_ASSUME_NONNULL_END
// ========== CoreBluetooth.framework/Headers/CBAdvertisementData.h
/*
* @file CBAdvertisementData.h
* @framework CoreBluetooth
*
* @copyright 2012 Apple, Inc. All rights reserved.
*/
#ifndef _CORE_BLUETOOTH_H_
#warning Please do not import this header file directly. Use <CoreBluetooth/CoreBluetooth.h> instead.
#endif
#import <CoreBluetooth/CBDefines.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/*!
* @constant CBAdvertisementDataLocalNameKey
*
* @discussion A <code>NSString</code> containing the local name of a peripheral.
*
*/
CB_EXTERN NSString * const CBAdvertisementDataLocalNameKey;
/*!
* @constant CBAdvertisementDataTxPowerLevelKey
*
* @discussion A <code>NSNumber</code> containing the transmit power of a peripheral.
*
*/
CB_EXTERN NSString * const CBAdvertisementDataTxPowerLevelKey;
/*!
* @constant CBAdvertisementDataServiceUUIDsKey
*
* @discussion A list of one or more <code>CBUUID</code> objects, representing <code>CBService</code> UUIDs.
*
*/
CB_EXTERN NSString * const CBAdvertisementDataServiceUUIDsKey;
/*!
* @constant CBAdvertisementDataServiceDataKey
*
* @discussion A dictionary containing service-specific advertisement data. Keys are <code>CBUUID</code> objects, representing
* <code>CBService</code> UUIDs. Values are <code>NSData</code> objects.
*
*/
CB_EXTERN NSString * const CBAdvertisementDataServiceDataKey;
/*!
* @constant CBAdvertisementDataManufacturerDataKey
*
* @discussion A <code>NSData</code> object containing the manufacturer data of a peripheral.
*
*/
CB_EXTERN NSString * const CBAdvertisementDataManufacturerDataKey;
/*!
* @constant CBAdvertisementDataOverflowServiceUUIDsKey
*
* @discussion A list of one or more <code>CBUUID</code> objects, representing <code>CBService</code> UUIDs that were
* found in the "overflow" area of the advertising data. Due to the nature of the data stored in this area,
* UUIDs listed here are "best effort" and may not always be accurate.
*
* @see startAdvertising:
*
*/
CB_EXTERN NSString * const CBAdvertisementDataOverflowServiceUUIDsKey NS_AVAILABLE(10_9, 6_0);
/*!
* @constant CBAdvertisementDataIsConnectable
*
* @discussion An NSNumber (Boolean) indicating whether or not the advertising event type was connectable. This can be used to determine
* whether or not a peripheral is connectable in that instant.
*
*/
CB_EXTERN NSString * const CBAdvertisementDataIsConnectable NS_AVAILABLE(10_9, 7_0);
/*!
* @constant CBAdvertisementDataSolicitedServiceUUIDsKey
*
* @discussion A list of one or more <code>CBUUID</code> objects, representing <code>CBService</code> UUIDs.
*
*/
CB_EXTERN NSString * const CBAdvertisementDataSolicitedServiceUUIDsKey NS_AVAILABLE(10_9, 7_0);
NS_ASSUME_NONNULL_END
// ========== CoreBluetooth.framework/Headers/CBCentralManager.h
/*
* @file CBCentralManager.h
* @framework CoreBluetooth
*
* @discussion Entry point to the central role.
*
* @copyright 2011 Apple, Inc. All rights reserved.
*/
#ifndef _CORE_BLUETOOTH_H_
#warning Please do not import this header file directly. Use <CoreBluetooth/CoreBluetooth.h> instead.
#endif
#import <CoreBluetooth/CBAdvertisementData.h>
#import <CoreBluetooth/CBCentralManagerConstants.h>
#import <CoreBluetooth/CBDefines.h>
#import <CoreBluetooth/CBManager.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/*!
* @enum CBCentralManagerState
*
* @discussion Represents the current state of a CBCentralManager.
*
* @constant CBCentralManagerStateUnknown State unknown, update imminent.
* @constant CBCentralManagerStateResetting The connection with the system service was momentarily lost, update imminent.
* @constant CBCentralManagerStateUnsupported The platform doesn't support the Bluetooth Low Energy Central/Client role.
* @constant CBCentralManagerStateUnauthorized The application is not authorized to use the Bluetooth Low Energy Central/Client role.
* @constant CBCentralManagerStatePoweredOff Bluetooth is currently powered off.
* @constant CBCentralManagerStatePoweredOn Bluetooth is currently powered on and available to use.
*
*/
typedef NS_ENUM(NSInteger, CBCentralManagerState) {
CBCentralManagerStateUnknown = CBManagerStateUnknown,
CBCentralManagerStateResetting = CBManagerStateResetting,
CBCentralManagerStateUnsupported = CBManagerStateUnsupported,
CBCentralManagerStateUnauthorized = CBManagerStateUnauthorized,
CBCentralManagerStatePoweredOff = CBManagerStatePoweredOff,
CBCentralManagerStatePoweredOn = CBManagerStatePoweredOn,
} NS_DEPRECATED(10_7, 10_13, 5_0, 10_0, "Use CBManagerState instead");
/*!
* @enum CBConnectionEvent
*
* @discussion Represents the connection state of a peer.
*
* @constant CBConnectionEventPeerDisconnected Peer is disconnected.
* @constant CBConnectionEventPeerConnected Peer is connected.
*
*/
typedef NS_ENUM(NSInteger, CBConnectionEvent) {
CBConnectionEventPeerDisconnected = 0,
CBConnectionEventPeerConnected = 1,
};
/*!
* @enum CBCentralManagerFeature
*
* @discussion The set of device specific features.
*
* @constant CBCentralManagerFeatureExtendedScanAndConnect The hardware supports extended scans and enhanced connection creation
*
*/
typedef NS_OPTIONS(NSUInteger, CBCentralManagerFeature) {
CBCentralManagerFeatureExtendedScanAndConnect = 1UL << 0,
} NS_ENUM_AVAILABLE_IOS(13_0) NS_SWIFT_NAME(CBCentralManager.Feature);
@protocol CBCentralManagerDelegate;
@class CBUUID, CBPeripheral;
/*!
* @class CBCentralManager
*
* @discussion Entry point to the central role. Commands should only be issued when its state is <code>CBCentralManagerStatePoweredOn</code>.
*
*/
NS_CLASS_AVAILABLE(10_7, 5_0)
CB_EXTERN_CLASS @interface CBCentralManager : CBManager
/*!
* @property delegate
*
* @discussion The delegate object that will receive central events.
*
*/
@property(nonatomic, weak, nullable) id<CBCentralManagerDelegate> delegate;
/*!
* @property isScanning
*
* @discussion Whether or not the central is currently scanning.
*
*/
@property(nonatomic, assign, readonly) BOOL isScanning NS_AVAILABLE(10_13, 9_0);
/*!
* @method supportsFeatures
*
* @param features One or more features you would like to check if supported.
*
* @discussion Returns a boolean value representing the support for the provided features.
*
*/
+ (BOOL)supportsFeatures:(CBCentralManagerFeature)features NS_AVAILABLE_IOS(13_0) NS_SWIFT_NAME(supports(_:));
- (instancetype)init;
/*!
* @method initWithDelegate:queue:
*
* @param delegate The delegate that will receive central role events.
* @param queue The dispatch queue on which the events will be dispatched.
*
* @discussion The initialization call. The events of the central role will be dispatched on the provided queue.
* If <i>nil</i>, the main queue will be used.
*
*/
- (instancetype)initWithDelegate:(nullable id<CBCentralManagerDelegate>)delegate
queue:(nullable dispatch_queue_t)queue;
/*!
* @method initWithDelegate:queue:options:
*
* @param delegate The delegate that will receive central role events.
* @param queue The dispatch queue on which the events will be dispatched.
* @param options An optional dictionary specifying options for the manager.
*
* @discussion The initialization call. The events of the central role will be dispatched on the provided queue.
* If <i>nil</i>, the main queue will be used.
*
* @seealso CBCentralManagerOptionShowPowerAlertKey
* @seealso CBCentralManagerOptionRestoreIdentifierKey
*
*/
- (instancetype)initWithDelegate:(nullable id<CBCentralManagerDelegate>)delegate