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
//! 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::*;
extern_class!(
/// An NSData subclass that represents a UUID as defined in the Bluetooth SDP spec.
///
/// The IOBluetoothSDPUUID class can represent a UUID of any valid size (16, 32 or 128 bits).
/// It provides the ability to compare two UUIDs no matter what their size as well as the ability
/// to promote the size of a UUID to a larger one.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothsdpuuid?language=objc)
#[unsafe(super(NSData, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2-foundation")]
pub struct IOBluetoothSDPUUID;
);
#[cfg(feature = "objc2-foundation")]
extern_conformance!(
unsafe impl NSCoding for IOBluetoothSDPUUID {}
);
#[cfg(feature = "objc2-foundation")]
extern_conformance!(
unsafe impl NSObjectProtocol for IOBluetoothSDPUUID {}
);
#[cfg(feature = "objc2-foundation")]
extern_conformance!(
unsafe impl NSSecureCoding for IOBluetoothSDPUUID {}
);
#[cfg(feature = "objc2-foundation")]
impl IOBluetoothSDPUUID {
extern_methods!(
/// Creates a new IOBluetoothSDPUUID object with the given bytes of the given length.
///
/// If the length is invalid for a UUID, nil is returned.
///
/// Parameter `bytes`: An array of bytes representing the UUID.
///
/// Parameter `length`: The length of the array of bytes.
///
/// Returns: Returns the new IOBluetoothSDPUUID object or nil on failure.
///
/// # Safety
///
/// `bytes` must be a valid pointer.
#[unsafe(method(uuidWithBytes:length:))]
#[unsafe(method_family = none)]
pub unsafe fn uuidWithBytes_length(
bytes: *const c_void,
length: c_uint,
) -> Option<Retained<Self>>;
/// Creates a new IOBluetoothSDPUUID object from the given NSData.
///
/// If the length of the NSData is invalid for a UUID, nil is returned.
///
/// Parameter `data`: The NSData containing the UUID bytes.
///
/// Returns: Returns the new IOBluetoothSDPUUID object or nil on failure.
///
/// # Safety
///
/// `data` might not allow `None`.
#[unsafe(method(uuidWithData:))]
#[unsafe(method_family = none)]
pub unsafe fn uuidWithData(data: Option<&NSData>) -> Option<Retained<Self>>;
#[cfg(feature = "Bluetooth")]
/// Creates a new 16-bit IOBluetoothSDPUUID with the given UUID16
///
/// Parameter `uuid16`: A scalar representing a 16-bit UUID
///
/// Returns: Returns the new IOBluetoothSDPUUID object.
#[unsafe(method(uuid16:))]
#[unsafe(method_family = none)]
pub unsafe fn uuid16(uuid16: BluetoothSDPUUID16) -> Option<Retained<Self>>;
#[cfg(feature = "Bluetooth")]
/// Creates a new 32-bit IOBluetoothSDPUUID with the given UUID32
///
/// Parameter `uuid32`: A scalar representing a 32-bit UUID
///
/// Returns: Returns the new IOBluetoothSDPUUID object.
#[unsafe(method(uuid32:))]
#[unsafe(method_family = none)]
pub unsafe fn uuid32(uuid32: BluetoothSDPUUID32) -> Option<Retained<Self>>;
#[cfg(feature = "IOBluetoothUserLib")]
/// Method call to convert an IOBluetoothSDPUUIDRef into an IOBluetoothSDPUUID *.
///
/// Parameter `sdpUUIDRef`: IOBluetoothSDPUUIDRef for which an IOBluetoothSDPUUID * is desired.
///
/// Returns: Returns the IOBluetoothSDPUUID * for the given IOBluetoothSDPUUIDRef.
///
/// # Safety
///
/// `sdp_uuid_ref` might not allow `None`.
#[deprecated]
#[unsafe(method(withSDPUUIDRef:))]
#[unsafe(method_family = none)]
pub unsafe fn withSDPUUIDRef(
sdp_uuid_ref: Option<&IOBluetoothSDPUUIDRef>,
) -> Option<Retained<Self>>;
#[cfg(feature = "Bluetooth")]
/// Initializes a new 16-bit IOBluetoothSDPUUID with the given UUID16
///
/// Parameter `uuid16`: A scalar representing a 16-bit UUID
///
/// Returns: Returns self.
#[unsafe(method(initWithUUID16:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithUUID16(
this: Allocated<Self>,
uuid16: BluetoothSDPUUID16,
) -> Option<Retained<Self>>;
#[cfg(feature = "Bluetooth")]
/// Creates a new 32-bit IOBluetoothSDPUUID with the given UUID32
///
/// Parameter `uuid32`: A scalar representing a 32-bit UUID
///
/// Returns: Returns self.
#[unsafe(method(initWithUUID32:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithUUID32(
this: Allocated<Self>,
uuid32: BluetoothSDPUUID32,
) -> Option<Retained<Self>>;
#[cfg(feature = "IOBluetoothUserLib")]
/// Returns an IOBluetoothSDPUUIDRef representation of the target IOBluetoothSDPUUID object.
///
/// Returns: Returns an IOBluetoothSDPUUIDRef representation of the target IOBluetoothSDPUUID object.
#[deprecated]
#[unsafe(method(getSDPUUIDRef))]
#[unsafe(method_family = none)]
pub unsafe fn getSDPUUIDRef(&self) -> Option<Retained<IOBluetoothSDPUUIDRef>>;
/// Returns an IOBluetoothSDPUUID object matching the target UUID, but with the given number of bytes.
///
/// If the target object is the same length as newLength, it returns self. If newLength is greater
/// it creates a new IOBluetoothSDPUUID object with the correct value for the given length. If
/// newLength is smaller, it will attempt to create a new IOBluetoothSDPUUID that is smaller if
/// the data matches the Bluetooth UUID base. This downconversion is currently unimplemented.
///
/// Parameter `newLength`: The desired length for the UUID.
///
/// Returns: Returns an IOBluetoothSDPUUID object with the same data as the target but with the given length if it
/// is possible to do so. Otherwise, nil is returned.
#[unsafe(method(getUUIDWithLength:))]
#[unsafe(method_family = none)]
pub unsafe fn getUUIDWithLength(&self, new_length: c_uint) -> Option<Retained<Self>>;
/// Compares the target IOBluetoothSDPUUID object with the given otherUUID object.
///
/// This method will compare the two UUID values independent of their length.
///
/// Parameter `otherUUID`: The UUID object to be compared with the target.
///
/// Returns: Returns true if the UUID values of each object are equal. This includes the case where the sizes are different
/// but the data itself is the same when the Bluetooth UUID base is applied.
///
/// # Safety
///
/// `other_uuid` might not allow `None`.
#[unsafe(method(isEqualToUUID:))]
#[unsafe(method_family = none)]
pub unsafe fn isEqualToUUID(&self, other_uuid: Option<&IOBluetoothSDPUUID>) -> bool;
#[unsafe(method(classForCoder))]
#[unsafe(method_family = none)]
pub unsafe fn classForCoder(&self) -> Option<&'static AnyClass>;
#[unsafe(method(classForArchiver))]
#[unsafe(method_family = none)]
pub unsafe fn classForArchiver(&self) -> Option<&'static AnyClass>;
#[unsafe(method(classForPortCoder))]
#[unsafe(method_family = none)]
pub unsafe fn classForPortCoder(&self) -> Option<&'static AnyClass>;
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(feature = "objc2-foundation")]
impl IOBluetoothSDPUUID {
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>;
);
}