objc2_core_bluetooth/generated/CBUUID.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern "C" {
12 /// The string representation of the UUID for the extended properties descriptor.
13 /// The corresponding value for this descriptor is an
14 /// <code>
15 /// NSNumber
16 /// </code>
17 /// object.
18 ///
19 /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbuuidcharacteristicextendedpropertiesstring?language=objc)
20 pub static CBUUIDCharacteristicExtendedPropertiesString: &'static NSString;
21}
22
23extern "C" {
24 /// The string representation of the UUID for the user description descriptor.
25 /// The corresponding value for this descriptor is an
26 /// <code>
27 /// NSString
28 /// </code>
29 /// object.
30 ///
31 /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbuuidcharacteristicuserdescriptionstring?language=objc)
32 pub static CBUUIDCharacteristicUserDescriptionString: &'static NSString;
33}
34
35extern "C" {
36 /// The string representation of the UUID for the client configuration descriptor.
37 /// The corresponding value for this descriptor is an
38 /// <code>
39 /// NSNumber
40 /// </code>
41 /// object.
42 ///
43 /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbuuidclientcharacteristicconfigurationstring?language=objc)
44 pub static CBUUIDClientCharacteristicConfigurationString: &'static NSString;
45}
46
47extern "C" {
48 /// The string representation of the UUID for the server configuration descriptor.
49 /// The corresponding value for this descriptor is an
50 /// <code>
51 /// NSNumber
52 /// </code>
53 /// object.
54 ///
55 /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbuuidservercharacteristicconfigurationstring?language=objc)
56 pub static CBUUIDServerCharacteristicConfigurationString: &'static NSString;
57}
58
59extern "C" {
60 /// The string representation of the UUID for the presentation format descriptor.
61 /// The corresponding value for this descriptor is an
62 /// <code>
63 /// NSData
64 /// </code>
65 /// object.
66 ///
67 /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbuuidcharacteristicformatstring?language=objc)
68 pub static CBUUIDCharacteristicFormatString: &'static NSString;
69}
70
71extern "C" {
72 /// The string representation of the UUID for the aggregate descriptor.
73 ///
74 /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbuuidcharacteristicaggregateformatstring?language=objc)
75 pub static CBUUIDCharacteristicAggregateFormatString: &'static NSString;
76}
77
78extern "C" {
79 /// Data representing the valid min/max values accepted for a characteristic.
80 ///
81 /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbuuidcharacteristicvalidrangestring?language=objc)
82 pub static CBUUIDCharacteristicValidRangeString: &'static NSString;
83}
84
85extern "C" {
86 /// Data representing the observation schedule for a characteristic.
87 ///
88 /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbuuidcharacteristicobservationschedulestring?language=objc)
89 pub static CBUUIDCharacteristicObservationScheduleString: &'static NSString;
90}
91
92extern "C" {
93 /// The PSM (a little endian uint16_t) of an L2CAP Channel associated with the GATT service
94 /// containing this characteristic. Servers can publish this characteristic with the UUID
95 /// ABDD3056-28FA-441D-A470-55A75A52553A
96 ///
97 /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbuuidl2cappsmcharacteristicstring?language=objc)
98 pub static CBUUIDL2CAPPSMCharacteristicString: &'static NSString;
99}
100
101extern_class!(
102 /// A 16-bit, 32-bit, or 128-bit Bluetooth UUID.
103 /// 16-bit and 32-bit UUIDs are implicitly pre-filled with the Bluetooth Base UUID.
104 ///
105 /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbuuid?language=objc)
106 #[unsafe(super(NSObject))]
107 #[derive(Debug, PartialEq, Eq, Hash)]
108 pub struct CBUUID;
109);
110
111extern_conformance!(
112 unsafe impl NSCopying for CBUUID {}
113);
114
115unsafe impl CopyingHelper for CBUUID {
116 type Result = Self;
117}
118
119extern_conformance!(
120 unsafe impl NSObjectProtocol for CBUUID {}
121);
122
123impl CBUUID {
124 extern_methods!(
125 /// The UUID as NSData.
126 #[unsafe(method(data))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn data(&self) -> Retained<NSData>;
129
130 /// The UUID as NSString.
131 #[unsafe(method(UUIDString))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn UUIDString(&self) -> Retained<NSString>;
134
135 /// Creates a CBUUID with a 16-bit, 32-bit, or 128-bit UUID string representation.
136 /// The expected format for 128-bit UUIDs is a string punctuated by hyphens, for example 68753A44-4D6F-1226-9C60-0050E4C00067.
137 #[unsafe(method(UUIDWithString:))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn UUIDWithString(the_string: &NSString) -> Retained<CBUUID>;
140
141 /// Creates a CBUUID with a 16-bit, 32-bit, or 128-bit UUID data container.
142 #[unsafe(method(UUIDWithData:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn UUIDWithData(the_data: &NSData) -> Retained<CBUUID>;
145
146 #[cfg(feature = "objc2-core-foundation")]
147 /// Creates a CBUUID with a CFUUIDRef.
148 #[deprecated]
149 #[unsafe(method(UUIDWithCFUUID:))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn UUIDWithCFUUID(the_uuid: &CFUUID) -> Retained<CBUUID>;
152
153 /// Creates a CBUUID with an NSUUID.
154 #[unsafe(method(UUIDWithNSUUID:))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn UUIDWithNSUUID(the_uuid: &NSUUID) -> Retained<CBUUID>;
157 );
158}
159
160/// Methods declared on superclass `NSObject`.
161impl CBUUID {
162 extern_methods!(
163 #[unsafe(method(init))]
164 #[unsafe(method_family = init)]
165 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
166
167 #[unsafe(method(new))]
168 #[unsafe(method_family = new)]
169 pub unsafe fn new() -> Retained<Self>;
170 );
171}