objc2_io_bluetooth/generated/
OBEX.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9#[cfg(feature = "objc2-core-foundation")]
10use objc2_core_foundation::*;
11
12use crate::*;
13
14/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kcharsetstringiso88591?language=objc)
15pub const kCharsetStringISO88591: &CStr =
16    unsafe { CStr::from_bytes_with_nul_unchecked(b"CHARSET=ISO-8859-1\0") };
17/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kcharsetstringutf8?language=objc)
18pub const kCharsetStringUTF8: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"UTF-8\0") };
19/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kencodingstringquotedprintable?language=objc)
20pub const kEncodingStringQuotedPrintable: &CStr =
21    unsafe { CStr::from_bytes_with_nul_unchecked(b"QUOTED-PRINTABLE\0") };
22/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kencodingstringbase64?language=objc)
23pub const kEncodingStringBase64: &CStr =
24    unsafe { CStr::from_bytes_with_nul_unchecked(b"BASE-64\0") };
25/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kencodingstring8bit?language=objc)
26pub const kEncodingString8Bit: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"8BIT\0") };
27/// Codes for OBEX errors. If the return value was not in the following range, then it is most likely resulting
28/// from kernel code/IOKit, and you should consult IOReturn.h for those codes.
29///
30/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexerror?language=objc)
31pub type OBEXError = i32;
32
33/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexerrorcodes?language=objc)
34#[repr(transparent)]
35#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
36pub struct OBEXErrorCodes(pub c_int);
37impl OBEXErrorCodes {
38    #[doc(alias = "kOBEXErrorRangeMin")]
39    pub const ErrorRangeMin: Self = Self(-21850);
40    #[doc(alias = "kOBEXErrorRangeMax")]
41    pub const ErrorRangeMax: Self = Self(-21899);
42    #[doc(alias = "kOBEXSuccess")]
43    pub const Success: Self = Self(0);
44    #[doc(alias = "kOBEXGeneralError")]
45    pub const GeneralError: Self = Self(-21850);
46    #[doc(alias = "kOBEXNoResourcesError")]
47    pub const NoResourcesError: Self = Self(-21851);
48    #[doc(alias = "kOBEXUnsupportedError")]
49    pub const UnsupportedError: Self = Self(-21852);
50    #[doc(alias = "kOBEXInternalError")]
51    pub const InternalError: Self = Self(-21853);
52    #[doc(alias = "kOBEXBadArgumentError")]
53    pub const BadArgumentError: Self = Self(-21854);
54    #[doc(alias = "kOBEXTimeoutError")]
55    pub const TimeoutError: Self = Self(-21855);
56    #[doc(alias = "kOBEXBadRequestError")]
57    pub const BadRequestError: Self = Self(-21856);
58    #[doc(alias = "kOBEXCancelledError")]
59    pub const CancelledError: Self = Self(-21857);
60    #[doc(alias = "kOBEXForbiddenError")]
61    pub const ForbiddenError: Self = Self(-21858);
62    #[doc(alias = "kOBEXUnauthorizedError")]
63    pub const UnauthorizedError: Self = Self(-21859);
64    #[doc(alias = "kOBEXNotAcceptableError")]
65    pub const NotAcceptableError: Self = Self(-21860);
66    #[doc(alias = "kOBEXConflictError")]
67    pub const ConflictError: Self = Self(-21861);
68    #[doc(alias = "kOBEXMethodNotAllowedError")]
69    pub const MethodNotAllowedError: Self = Self(-21862);
70    #[doc(alias = "kOBEXNotFoundError")]
71    pub const NotFoundError: Self = Self(-21863);
72    #[doc(alias = "kOBEXNotImplementedError")]
73    pub const NotImplementedError: Self = Self(-21864);
74    #[doc(alias = "kOBEXPreconditionFailedError")]
75    pub const PreconditionFailedError: Self = Self(-21865);
76    #[doc(alias = "kOBEXSessionBusyError")]
77    pub const SessionBusyError: Self = Self(-21875);
78    #[doc(alias = "kOBEXSessionNotConnectedError")]
79    pub const SessionNotConnectedError: Self = Self(-21876);
80    #[doc(alias = "kOBEXSessionBadRequestError")]
81    pub const SessionBadRequestError: Self = Self(-21877);
82    #[doc(alias = "kOBEXSessionBadResponseError")]
83    pub const SessionBadResponseError: Self = Self(-21878);
84    #[doc(alias = "kOBEXSessionNoTransportError")]
85    pub const SessionNoTransportError: Self = Self(-21879);
86    #[doc(alias = "kOBEXSessionTransportDiedError")]
87    pub const SessionTransportDiedError: Self = Self(-21880);
88    #[doc(alias = "kOBEXSessionTimeoutError")]
89    pub const SessionTimeoutError: Self = Self(-21881);
90    #[doc(alias = "kOBEXSessionAlreadyConnectedError")]
91    pub const SessionAlreadyConnectedError: Self = Self(-21882);
92}
93
94#[cfg(feature = "objc2")]
95unsafe impl Encode for OBEXErrorCodes {
96    const ENCODING: Encoding = c_int::ENCODING;
97}
98
99#[cfg(feature = "objc2")]
100unsafe impl RefEncode for OBEXErrorCodes {
101    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
102}
103
104/// Identifiers for OBEX Headers.
105///
106/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexheaderidentifiers?language=objc)
107#[repr(transparent)]
108#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
109pub struct OBEXHeaderIdentifiers(pub c_uint);
110impl OBEXHeaderIdentifiers {
111    #[doc(alias = "kOBEXHeaderIDName")]
112    pub const IDName: Self = Self(0x01);
113    #[doc(alias = "kOBEXHeaderIDDescription")]
114    pub const IDDescription: Self = Self(0x05);
115    #[doc(alias = "kOBEXHeaderIDReservedRangeStart")]
116    pub const IDReservedRangeStart: Self = Self(0x10);
117    #[doc(alias = "kOBEXHeaderIDReservedRangeEnd")]
118    pub const IDReservedRangeEnd: Self = Self(0x2F);
119    #[doc(alias = "kOBEXHeaderIDUserDefinedRangeStart")]
120    pub const IDUserDefinedRangeStart: Self = Self(0x30);
121    #[doc(alias = "kOBEXHeaderIDUserDefinedRangeEnd")]
122    pub const IDUserDefinedRangeEnd: Self = Self(0x3F);
123    #[doc(alias = "kOBEXHeaderIDType")]
124    pub const IDType: Self = Self(0x42);
125    #[doc(alias = "kOBEXHeaderIDTimeISO")]
126    pub const IDTimeISO: Self = Self(0x44);
127    #[doc(alias = "kOBEXHeaderIDTarget")]
128    pub const IDTarget: Self = Self(0x46);
129    #[doc(alias = "kOBEXHeaderIDHTTP")]
130    pub const IDHTTP: Self = Self(0x47);
131    #[doc(alias = "kOBEXHeaderIDBody")]
132    pub const IDBody: Self = Self(0x48);
133    #[doc(alias = "kOBEXHeaderIDEndOfBody")]
134    pub const IDEndOfBody: Self = Self(0x49);
135    #[doc(alias = "kOBEXHeaderIDWho")]
136    pub const IDWho: Self = Self(0x4A);
137    #[doc(alias = "kOBEXHeaderIDAppParameters")]
138    pub const IDAppParameters: Self = Self(0x4C);
139    #[doc(alias = "kOBEXHeaderIDAuthorizationChallenge")]
140    pub const IDAuthorizationChallenge: Self = Self(0x4D);
141    #[doc(alias = "kOBEXHeaderIDAuthorizationResponse")]
142    pub const IDAuthorizationResponse: Self = Self(0x4E);
143    #[doc(alias = "kOBEXHeaderIDObjectClass")]
144    pub const IDObjectClass: Self = Self(0x4F);
145    #[doc(alias = "kOBEXHeaderIDCount")]
146    pub const IDCount: Self = Self(0xC0);
147    #[doc(alias = "kOBEXHeaderIDLength")]
148    pub const IDLength: Self = Self(0xC3);
149    #[doc(alias = "kOBEXHeaderIDTime4Byte")]
150    pub const IDTime4Byte: Self = Self(0xC4);
151    #[doc(alias = "kOBEXHeaderIDConnectionID")]
152    pub const IDConnectionID: Self = Self(0xCB);
153    #[doc(alias = "kOBEXHeaderIDOBEX13WANUUID")]
154    pub const IDOBEX13WANUUID: Self = Self(0x50);
155    #[doc(alias = "kOBEXHeaderIDOBEX13ObjectClass")]
156    pub const IDOBEX13ObjectClass: Self = Self(0x51);
157    #[doc(alias = "kOBEXHeaderIDOBEX13SessionParameters")]
158    pub const IDOBEX13SessionParameters: Self = Self(0x52);
159    #[doc(alias = "kOBEXHeaderIDOBEX13SessionSequenceNumber")]
160    pub const IDOBEX13SessionSequenceNumber: Self = Self(0x93);
161    #[doc(alias = "kOBEXHeaderIDOBEX13CreatorID")]
162    pub const IDOBEX13CreatorID: Self = Self(0xCF);
163}
164
165#[cfg(feature = "objc2")]
166unsafe impl Encode for OBEXHeaderIdentifiers {
167    const ENCODING: Encoding = c_uint::ENCODING;
168}
169
170#[cfg(feature = "objc2")]
171unsafe impl RefEncode for OBEXHeaderIdentifiers {
172    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
173}
174
175/// Response opCode values.
176///
177/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexopcoderesponsevalues?language=objc)
178#[repr(transparent)]
179#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
180pub struct OBEXOpCodeResponseValues(pub c_uint);
181impl OBEXOpCodeResponseValues {
182    #[doc(alias = "kOBEXResponseCodeReservedRangeStart")]
183    pub const ResponseCodeReservedRangeStart: Self = Self(0x00);
184    #[doc(alias = "kOBEXResponseCodeReservedRangeEnd")]
185    pub const ResponseCodeReservedRangeEnd: Self = Self(0x0F);
186    #[doc(alias = "kOBEXResponseCodeContinue")]
187    pub const ResponseCodeContinue: Self = Self(0x10);
188    #[doc(alias = "kOBEXResponseCodeContinueWithFinalBit")]
189    pub const ResponseCodeContinueWithFinalBit: Self = Self(0x90);
190    #[doc(alias = "kOBEXResponseCodeSuccess")]
191    pub const ResponseCodeSuccess: Self = Self(0x20);
192    #[doc(alias = "kOBEXResponseCodeSuccessWithFinalBit")]
193    pub const ResponseCodeSuccessWithFinalBit: Self = Self(0xA0);
194    #[doc(alias = "kOBEXResponseCodeCreated")]
195    pub const ResponseCodeCreated: Self = Self(0x21);
196    #[doc(alias = "kOBEXResponseCodeCreatedWithFinalBit")]
197    pub const ResponseCodeCreatedWithFinalBit: Self = Self(0xA1);
198    #[doc(alias = "kOBEXResponseCodeAccepted")]
199    pub const ResponseCodeAccepted: Self = Self(0x22);
200    #[doc(alias = "kOBEXResponseCodeAcceptedWithFinalBit")]
201    pub const ResponseCodeAcceptedWithFinalBit: Self = Self(0xA2);
202    #[doc(alias = "kOBEXResponseCodeNonAuthoritativeInfo")]
203    pub const ResponseCodeNonAuthoritativeInfo: Self = Self(0x23);
204    #[doc(alias = "kOBEXResponseCodeNonAuthoritativeInfoWithFinalBit")]
205    pub const ResponseCodeNonAuthoritativeInfoWithFinalBit: Self = Self(0xA3);
206    #[doc(alias = "kOBEXResponseCodeNoContent")]
207    pub const ResponseCodeNoContent: Self = Self(0x24);
208    #[doc(alias = "kOBEXResponseCodeNoContentWithFinalBit")]
209    pub const ResponseCodeNoContentWithFinalBit: Self = Self(0xA4);
210    #[doc(alias = "kOBEXResponseCodeResetContent")]
211    pub const ResponseCodeResetContent: Self = Self(0x25);
212    #[doc(alias = "kOBEXResponseCodeResetContentWithFinalBit")]
213    pub const ResponseCodeResetContentWithFinalBit: Self = Self(0xA5);
214    #[doc(alias = "kOBEXResponseCodePartialContent")]
215    pub const ResponseCodePartialContent: Self = Self(0x26);
216    #[doc(alias = "kOBEXResponseCodePartialContentWithFinalBit")]
217    pub const ResponseCodePartialContentWithFinalBit: Self = Self(0xA6);
218    #[doc(alias = "kOBEXResponseCodeMultipleChoices")]
219    pub const ResponseCodeMultipleChoices: Self = Self(0x30);
220    #[doc(alias = "kOBEXResponseCodeMultipleChoicesWithFinalBit")]
221    pub const ResponseCodeMultipleChoicesWithFinalBit: Self = Self(0xB0);
222    #[doc(alias = "kOBEXResponseCodeMovedPermanently")]
223    pub const ResponseCodeMovedPermanently: Self = Self(0x31);
224    #[doc(alias = "kOBEXResponseCodeMovedPermanentlyWithFinalBit")]
225    pub const ResponseCodeMovedPermanentlyWithFinalBit: Self = Self(0xB1);
226    #[doc(alias = "kOBEXResponseCodeMovedTemporarily")]
227    pub const ResponseCodeMovedTemporarily: Self = Self(0x32);
228    #[doc(alias = "kOBEXResponseCodeMovedTemporarilyWithFinalBit")]
229    pub const ResponseCodeMovedTemporarilyWithFinalBit: Self = Self(0xB2);
230    #[doc(alias = "kOBEXResponseCodeSeeOther")]
231    pub const ResponseCodeSeeOther: Self = Self(0x33);
232    #[doc(alias = "kOBEXResponseCodeSeeOtherWithFinalBit")]
233    pub const ResponseCodeSeeOtherWithFinalBit: Self = Self(0xB3);
234    #[doc(alias = "kOBEXResponseCodeNotModified")]
235    pub const ResponseCodeNotModified: Self = Self(0x34);
236    #[doc(alias = "kOBEXResponseCodeNotModifiedWithFinalBit")]
237    pub const ResponseCodeNotModifiedWithFinalBit: Self = Self(0xB4);
238    #[doc(alias = "kOBEXResponseCodeUseProxy")]
239    pub const ResponseCodeUseProxy: Self = Self(0x35);
240    #[doc(alias = "kOBEXResponseCodeUseProxyWithFinalBit")]
241    pub const ResponseCodeUseProxyWithFinalBit: Self = Self(0xB5);
242    #[doc(alias = "kOBEXResponseCodeBadRequest")]
243    pub const ResponseCodeBadRequest: Self = Self(0x40);
244    #[doc(alias = "kOBEXResponseCodeBadRequestWithFinalBit")]
245    pub const ResponseCodeBadRequestWithFinalBit: Self = Self(0xC0);
246    #[doc(alias = "kOBEXResponseCodeUnauthorized")]
247    pub const ResponseCodeUnauthorized: Self = Self(0x41);
248    #[doc(alias = "kOBEXResponseCodeUnauthorizedWithFinalBit")]
249    pub const ResponseCodeUnauthorizedWithFinalBit: Self = Self(0xC1);
250    #[doc(alias = "kOBEXResponseCodePaymentRequired")]
251    pub const ResponseCodePaymentRequired: Self = Self(0x42);
252    #[doc(alias = "kOBEXResponseCodePaymentRequiredWithFinalBit")]
253    pub const ResponseCodePaymentRequiredWithFinalBit: Self = Self(0xC2);
254    #[doc(alias = "kOBEXResponseCodeForbidden")]
255    pub const ResponseCodeForbidden: Self = Self(0x43);
256    #[doc(alias = "kOBEXResponseCodeForbiddenWithFinalBit")]
257    pub const ResponseCodeForbiddenWithFinalBit: Self = Self(0xC3);
258    #[doc(alias = "kOBEXResponseCodeNotFound")]
259    pub const ResponseCodeNotFound: Self = Self(0x44);
260    #[doc(alias = "kOBEXResponseCodeNotFoundWithFinalBit")]
261    pub const ResponseCodeNotFoundWithFinalBit: Self = Self(0xC4);
262    #[doc(alias = "kOBEXResponseCodeMethodNotAllowed")]
263    pub const ResponseCodeMethodNotAllowed: Self = Self(0x45);
264    #[doc(alias = "kOBEXResponseCodeMethodNotAllowedWithFinalBit")]
265    pub const ResponseCodeMethodNotAllowedWithFinalBit: Self = Self(0xC5);
266    #[doc(alias = "kOBEXResponseCodeNotAcceptable")]
267    pub const ResponseCodeNotAcceptable: Self = Self(0x46);
268    #[doc(alias = "kOBEXResponseCodeNotAcceptableWithFinalBit")]
269    pub const ResponseCodeNotAcceptableWithFinalBit: Self = Self(0xC6);
270    #[doc(alias = "kOBEXResponseCodeProxyAuthenticationRequired")]
271    pub const ResponseCodeProxyAuthenticationRequired: Self = Self(0x47);
272    #[doc(alias = "kOBEXResponseCodeProxyAuthenticationRequiredWithFinalBit")]
273    pub const ResponseCodeProxyAuthenticationRequiredWithFinalBit: Self = Self(0xC7);
274    #[doc(alias = "kOBEXResponseCodeRequestTimeOut")]
275    pub const ResponseCodeRequestTimeOut: Self = Self(0x48);
276    #[doc(alias = "kOBEXResponseCodeRequestTimeOutWithFinalBit")]
277    pub const ResponseCodeRequestTimeOutWithFinalBit: Self = Self(0xC8);
278    #[doc(alias = "kOBEXResponseCodeConflict")]
279    pub const ResponseCodeConflict: Self = Self(0x49);
280    #[doc(alias = "kOBEXResponseCodeConflictWithFinalBit")]
281    pub const ResponseCodeConflictWithFinalBit: Self = Self(0xC9);
282    #[doc(alias = "kOBEXResponseCodeGone")]
283    pub const ResponseCodeGone: Self = Self(0x4A);
284    #[doc(alias = "kOBEXResponseCodeGoneWithFinalBit")]
285    pub const ResponseCodeGoneWithFinalBit: Self = Self(0xCA);
286    #[doc(alias = "kOBEXResponseCodeLengthRequired")]
287    pub const ResponseCodeLengthRequired: Self = Self(0x4B);
288    #[doc(alias = "kOBEXResponseCodeLengthRequiredFinalBit")]
289    pub const ResponseCodeLengthRequiredFinalBit: Self = Self(0xCB);
290    #[doc(alias = "kOBEXResponseCodePreconditionFailed")]
291    pub const ResponseCodePreconditionFailed: Self = Self(0x4C);
292    #[doc(alias = "kOBEXResponseCodePreconditionFailedWithFinalBit")]
293    pub const ResponseCodePreconditionFailedWithFinalBit: Self = Self(0xCC);
294    #[doc(alias = "kOBEXResponseCodeRequestedEntityTooLarge")]
295    pub const ResponseCodeRequestedEntityTooLarge: Self = Self(0x4D);
296    #[doc(alias = "kOBEXResponseCodeRequestedEntityTooLargeWithFinalBit")]
297    pub const ResponseCodeRequestedEntityTooLargeWithFinalBit: Self = Self(0xCD);
298    #[doc(alias = "kOBEXResponseCodeRequestURLTooLarge")]
299    pub const ResponseCodeRequestURLTooLarge: Self = Self(0x4E);
300    #[doc(alias = "kOBEXResponseCodeRequestURLTooLargeWithFinalBit")]
301    pub const ResponseCodeRequestURLTooLargeWithFinalBit: Self = Self(0xCE);
302    #[doc(alias = "kOBEXResponseCodeUnsupportedMediaType")]
303    pub const ResponseCodeUnsupportedMediaType: Self = Self(0x4F);
304    #[doc(alias = "kOBEXResponseCodeUnsupportedMediaTypeWithFinalBit")]
305    pub const ResponseCodeUnsupportedMediaTypeWithFinalBit: Self = Self(0xCF);
306    #[doc(alias = "kOBEXResponseCodeInternalServerError")]
307    pub const ResponseCodeInternalServerError: Self = Self(0x50);
308    #[doc(alias = "kOBEXResponseCodeInternalServerErrorWithFinalBit")]
309    pub const ResponseCodeInternalServerErrorWithFinalBit: Self = Self(0xD0);
310    #[doc(alias = "kOBEXResponseCodeNotImplemented")]
311    pub const ResponseCodeNotImplemented: Self = Self(0x51);
312    #[doc(alias = "kOBEXResponseCodeNotImplementedWithFinalBit")]
313    pub const ResponseCodeNotImplementedWithFinalBit: Self = Self(0xD1);
314    #[doc(alias = "kOBEXResponseCodeBadGateway")]
315    pub const ResponseCodeBadGateway: Self = Self(0x52);
316    #[doc(alias = "kOBEXResponseCodeBadGatewayWithFinalBit")]
317    pub const ResponseCodeBadGatewayWithFinalBit: Self = Self(0xD2);
318    #[doc(alias = "kOBEXResponseCodeServiceUnavailable")]
319    pub const ResponseCodeServiceUnavailable: Self = Self(0x53);
320    #[doc(alias = "kOBEXResponseCodeServiceUnavailableWithFinalBit")]
321    pub const ResponseCodeServiceUnavailableWithFinalBit: Self = Self(0xD3);
322    #[doc(alias = "kOBEXResponseCodeGatewayTimeout")]
323    pub const ResponseCodeGatewayTimeout: Self = Self(0x54);
324    #[doc(alias = "kOBEXResponseCodeGatewayTimeoutWithFinalBit")]
325    pub const ResponseCodeGatewayTimeoutWithFinalBit: Self = Self(0xD4);
326    #[doc(alias = "kOBEXResponseCodeHTTPVersionNotSupported")]
327    pub const ResponseCodeHTTPVersionNotSupported: Self = Self(0x55);
328    #[doc(alias = "kOBEXResponseCodeHTTPVersionNotSupportedWithFinalBit")]
329    pub const ResponseCodeHTTPVersionNotSupportedWithFinalBit: Self = Self(0xD5);
330    #[doc(alias = "kOBEXResponseCodeDatabaseFull")]
331    pub const ResponseCodeDatabaseFull: Self = Self(0x60);
332    #[doc(alias = "kOBEXResponseCodeDatabaseFullWithFinalBit")]
333    pub const ResponseCodeDatabaseFullWithFinalBit: Self = Self(0xE0);
334    #[doc(alias = "kOBEXResponseCodeDatabaseLocked")]
335    pub const ResponseCodeDatabaseLocked: Self = Self(0x61);
336    #[doc(alias = "kOBEXResponseCodeDatabaseLockedWithFinalBit")]
337    pub const ResponseCodeDatabaseLockedWithFinalBit: Self = Self(0xE1);
338}
339
340#[cfg(feature = "objc2")]
341unsafe impl Encode for OBEXOpCodeResponseValues {
342    const ENCODING: Encoding = c_uint::ENCODING;
343}
344
345#[cfg(feature = "objc2")]
346unsafe impl RefEncode for OBEXOpCodeResponseValues {
347    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
348}
349
350/// Operation OpCode values for commands.
351///
352/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexopcodecommandvalues?language=objc)
353#[repr(transparent)]
354#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
355pub struct OBEXOpCodeCommandValues(pub c_uint);
356impl OBEXOpCodeCommandValues {
357    #[doc(alias = "kOBEXOpCodeReserved")]
358    pub const Reserved: Self = Self(0x04);
359    #[doc(alias = "kOBEXOpCodeConnect")]
360    pub const Connect: Self = Self(0x80);
361    #[doc(alias = "kOBEXOpCodeDisconnect")]
362    pub const Disconnect: Self = Self(0x81);
363    #[doc(alias = "kOBEXOpCodePut")]
364    pub const Put: Self = Self(0x02);
365    #[doc(alias = "kOBEXOpCodePutWithHighBitSet")]
366    pub const PutWithHighBitSet: Self = Self(0x82);
367    #[doc(alias = "kOBEXOpCodeGet")]
368    pub const Get: Self = Self(0x03);
369    #[doc(alias = "kOBEXOpCodeGetWithHighBitSet")]
370    pub const GetWithHighBitSet: Self = Self(0x83);
371    #[doc(alias = "kOBEXOpCodeReservedWithHighBitSet")]
372    pub const ReservedWithHighBitSet: Self = Self(0x84);
373    #[doc(alias = "kOBEXOpCodeSetPath")]
374    pub const SetPath: Self = Self(0x85);
375    #[doc(alias = "kOBEXOpCodeAbort")]
376    pub const Abort: Self = Self(0xFF);
377    #[doc(alias = "kOBEXOpCodeReservedRangeStart")]
378    pub const ReservedRangeStart: Self = Self(0x06);
379    #[doc(alias = "kOBEXOpCodeReservedRangeEnd")]
380    pub const ReservedRangeEnd: Self = Self(0x0F);
381    #[doc(alias = "kOBEXOpCodeUserDefinedStart")]
382    pub const UserDefinedStart: Self = Self(0x10);
383    #[doc(alias = "kOBEXOpCodeUserDefinedEnd")]
384    pub const UserDefinedEnd: Self = Self(0x1F);
385}
386
387#[cfg(feature = "objc2")]
388unsafe impl Encode for OBEXOpCodeCommandValues {
389    const ENCODING: Encoding = c_uint::ENCODING;
390}
391
392#[cfg(feature = "objc2")]
393unsafe impl RefEncode for OBEXOpCodeCommandValues {
394    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
395}
396
397/// Flags for Connect command.
398///
399/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexconnectflagvalues?language=objc)
400#[repr(transparent)]
401#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
402pub struct OBEXConnectFlagValues(pub c_uint);
403impl OBEXConnectFlagValues {
404    #[doc(alias = "kOBEXConnectFlagNone")]
405    pub const FlagNone: Self = Self(0 << 0);
406    #[doc(alias = "kOBEXConnectFlagSupportMultipleItLMPConnections")]
407    pub const FlagSupportMultipleItLMPConnections: Self = Self(1 << 0);
408    #[doc(alias = "kOBEXConnectFlag1Reserved")]
409    pub const Flag1Reserved: Self = Self(1 << 1);
410    #[doc(alias = "kOBEXConnectFlag2Reserved")]
411    pub const Flag2Reserved: Self = Self(1 << 2);
412    #[doc(alias = "kOBEXConnectFlag3Reserved")]
413    pub const Flag3Reserved: Self = Self(1 << 3);
414    #[doc(alias = "kOBEXConnectFlag4Reserved")]
415    pub const Flag4Reserved: Self = Self(1 << 4);
416    #[doc(alias = "kOBEXConnectFlag5Reserved")]
417    pub const Flag5Reserved: Self = Self(1 << 5);
418    #[doc(alias = "kOBEXConnectFlag6Reserved")]
419    pub const Flag6Reserved: Self = Self(1 << 6);
420    #[doc(alias = "kOBEXConnectFlag7Reserved")]
421    pub const Flag7Reserved: Self = Self(1 << 7);
422}
423
424#[cfg(feature = "objc2")]
425unsafe impl Encode for OBEXConnectFlagValues {
426    const ENCODING: Encoding = c_uint::ENCODING;
427}
428
429#[cfg(feature = "objc2")]
430unsafe impl RefEncode for OBEXConnectFlagValues {
431    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
432}
433
434/// Flags for SetPath command. Not that these are called "PutFlags". That is a mistake, they are not used
435/// with a Put command. We are not changing the names to maintain backwards compatibility.
436///
437/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexputflagvalues?language=objc)
438#[repr(transparent)]
439#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
440pub struct OBEXPutFlagValues(pub c_uint);
441impl OBEXPutFlagValues {
442    #[doc(alias = "kOBEXPutFlagNone")]
443    pub const FlagNone: Self = Self(0 << 0);
444    #[doc(alias = "kOBEXPutFlagGoToParentDirFirst")]
445    pub const FlagGoToParentDirFirst: Self = Self(1 << 0);
446    #[doc(alias = "kOBEXPutFlagDontCreateDirectory")]
447    pub const FlagDontCreateDirectory: Self = Self(1 << 1);
448    #[doc(alias = "kOBEXPutFlag2Reserved")]
449    pub const Flag2Reserved: Self = Self(1 << 2);
450    #[doc(alias = "kOBEXPutFlag3Reserved")]
451    pub const Flag3Reserved: Self = Self(1 << 3);
452    #[doc(alias = "kOBEXPutFlag4Reserved")]
453    pub const Flag4Reserved: Self = Self(1 << 4);
454    #[doc(alias = "kOBEXPutFlag5Reserved")]
455    pub const Flag5Reserved: Self = Self(1 << 5);
456    #[doc(alias = "kOBEXPutFlag6Reserved")]
457    pub const Flag6Reserved: Self = Self(1 << 6);
458    #[doc(alias = "kOBEXPutFlag7Reserved")]
459    pub const Flag7Reserved: Self = Self(1 << 7);
460}
461
462#[cfg(feature = "objc2")]
463unsafe impl Encode for OBEXPutFlagValues {
464    const ENCODING: Encoding = c_uint::ENCODING;
465}
466
467#[cfg(feature = "objc2")]
468unsafe impl RefEncode for OBEXPutFlagValues {
469    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
470}
471
472/// Flags for Nonce command during digest challenge.
473///
474/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexnonceflagvalues?language=objc)
475#[repr(transparent)]
476#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
477pub struct OBEXNonceFlagValues(pub c_uint);
478impl OBEXNonceFlagValues {
479    #[doc(alias = "kOBEXNonceFlagNone")]
480    pub const FlagNone: Self = Self(0 << 0);
481    #[doc(alias = "kOBEXNonceFlagSendUserIDInResponse")]
482    pub const FlagSendUserIDInResponse: Self = Self(1 << 0);
483    #[doc(alias = "kOBEXNonceFlagAccessModeReadOnly")]
484    pub const FlagAccessModeReadOnly: Self = Self(1 << 1);
485    #[doc(alias = "kOBEXNonceFlag2Reserved")]
486    pub const Flag2Reserved: Self = Self(1 << 2);
487    #[doc(alias = "kOBEXNonceFlag3Reserved")]
488    pub const Flag3Reserved: Self = Self(1 << 3);
489    #[doc(alias = "kOBEXNonceFlag4Reserved")]
490    pub const Flag4Reserved: Self = Self(1 << 4);
491    #[doc(alias = "kOBEXNonceFlag5Reserved")]
492    pub const Flag5Reserved: Self = Self(1 << 5);
493    #[doc(alias = "kOBEXNonceFlag6Reserved")]
494    pub const Flag6Reserved: Self = Self(1 << 6);
495    #[doc(alias = "kOBEXNonceFlag7Reserved")]
496    pub const Flag7Reserved: Self = Self(1 << 7);
497}
498
499#[cfg(feature = "objc2")]
500unsafe impl Encode for OBEXNonceFlagValues {
501    const ENCODING: Encoding = c_uint::ENCODING;
502}
503
504#[cfg(feature = "objc2")]
505unsafe impl RefEncode for OBEXNonceFlagValues {
506    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
507}
508
509/// Values for Realm during digest response.
510///
511/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexrealmvalues?language=objc)
512#[repr(transparent)]
513#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
514pub struct OBEXRealmValues(pub c_uint);
515impl OBEXRealmValues {
516    #[doc(alias = "kOBEXRealmASCII")]
517    pub const ASCII: Self = Self(0x00);
518    #[doc(alias = "kOBEXRealmISO88591")]
519    pub const ISO88591: Self = Self(0x01);
520    #[doc(alias = "kOBEXRealmISO88592")]
521    pub const ISO88592: Self = Self(0x02);
522    #[doc(alias = "kOBEXRealmISO88593")]
523    pub const ISO88593: Self = Self(0x03);
524    #[doc(alias = "kOBEXRealmISO88594")]
525    pub const ISO88594: Self = Self(0x04);
526    #[doc(alias = "kOBEXRealmISO88595")]
527    pub const ISO88595: Self = Self(0x05);
528    #[doc(alias = "kOBEXRealmISO88596")]
529    pub const ISO88596: Self = Self(0x06);
530    #[doc(alias = "kOBEXRealmISO88597")]
531    pub const ISO88597: Self = Self(0x07);
532    #[doc(alias = "kOBEXRealmISO88598")]
533    pub const ISO88598: Self = Self(0x08);
534    #[doc(alias = "kOBEXRealmISO88599")]
535    pub const ISO88599: Self = Self(0x09);
536    #[doc(alias = "kOBEXRealmUNICODE")]
537    pub const UNICODE: Self = Self(0xFF);
538}
539
540#[cfg(feature = "objc2")]
541unsafe impl Encode for OBEXRealmValues {
542    const ENCODING: Encoding = c_uint::ENCODING;
543}
544
545#[cfg(feature = "objc2")]
546unsafe impl RefEncode for OBEXRealmValues {
547    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
548}
549
550/// Operation OpCode values for sessions. From the OBEX 1.3 specification.
551///
552/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexopcodesessionvalues?language=objc)
553#[repr(transparent)]
554#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
555pub struct OBEXOpCodeSessionValues(pub c_uint);
556impl OBEXOpCodeSessionValues {
557    #[doc(alias = "kOBEXOpCodeCreateSession")]
558    pub const CreateSession: Self = Self(0x00);
559    #[doc(alias = "kOBEXOpCodeCloseSession")]
560    pub const CloseSession: Self = Self(0x01);
561    #[doc(alias = "kOBEXOpCodeSuspendSession")]
562    pub const SuspendSession: Self = Self(0x02);
563    #[doc(alias = "kOBEXOpCodeResumeSession")]
564    pub const ResumeSession: Self = Self(0x03);
565    #[doc(alias = "kOBEXOpCodeSetTimeout")]
566    pub const SetTimeout: Self = Self(0x04);
567}
568
569#[cfg(feature = "objc2")]
570unsafe impl Encode for OBEXOpCodeSessionValues {
571    const ENCODING: Encoding = c_uint::ENCODING;
572}
573
574#[cfg(feature = "objc2")]
575unsafe impl RefEncode for OBEXOpCodeSessionValues {
576    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
577}
578
579/// Tags for SessionParameters.
580///
581/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexsessionparametertags?language=objc)
582#[repr(transparent)]
583#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
584pub struct OBEXSessionParameterTags(pub c_uint);
585impl OBEXSessionParameterTags {
586    #[doc(alias = "kOBEXSessionParameterTagDeviceAddress")]
587    pub const DeviceAddress: Self = Self(0x00);
588    #[doc(alias = "kOBEXSessionParameterTagNonce")]
589    pub const Nonce: Self = Self(0x01);
590    #[doc(alias = "kOBEXSessionParameterTagSessionID")]
591    pub const SessionID: Self = Self(0x02);
592    #[doc(alias = "kOBEXSessionParameterTagNextSequenceNumber")]
593    pub const NextSequenceNumber: Self = Self(0x03);
594    #[doc(alias = "kOBEXSessionParameterTagTimeout")]
595    pub const Timeout: Self = Self(0x04);
596    #[doc(alias = "kOBEXSessionParameterTagSessionOpcode")]
597    pub const SessionOpcode: Self = Self(0x05);
598}
599
600#[cfg(feature = "objc2")]
601unsafe impl Encode for OBEXSessionParameterTags {
602    const ENCODING: Encoding = c_uint::ENCODING;
603}
604
605#[cfg(feature = "objc2")]
606unsafe impl RefEncode for OBEXSessionParameterTags {
607    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
608}
609
610/// The available/supported OBEX versions.
611///
612/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexversions?language=objc)
613#[repr(transparent)]
614#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
615pub struct OBEXVersions(pub c_uint);
616impl OBEXVersions {
617    #[doc(alias = "kOBEXVersion10")]
618    pub const Version10: Self = Self(0x10);
619}
620
621#[cfg(feature = "objc2")]
622unsafe impl Encode for OBEXVersions {
623    const ENCODING: Encoding = c_uint::ENCODING;
624}
625
626#[cfg(feature = "objc2")]
627unsafe impl RefEncode for OBEXVersions {
628    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
629}
630
631/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexheaderidentifier?language=objc)
632pub type OBEXHeaderIdentifier = u8;
633
634/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexversion?language=objc)
635pub type OBEXVersion = u8;
636
637/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexflags?language=objc)
638pub type OBEXFlags = u8;
639
640/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexopcode?language=objc)
641pub type OBEXOpCode = u8;
642
643/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexconstants?language=objc)
644pub type OBEXConstants = u8;
645
646/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexmaxpacketlength?language=objc)
647pub type OBEXMaxPacketLength = u16;
648
649/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/opaqueobexsessionref?language=objc)
650#[repr(C)]
651#[derive(Debug)]
652pub struct OpaqueOBEXSessionRef {
653    inner: [u8; 0],
654    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
655}
656
657#[cfg(feature = "objc2")]
658unsafe impl RefEncode for OpaqueOBEXSessionRef {
659    const ENCODING_REF: Encoding =
660        Encoding::Pointer(&Encoding::Struct("OpaqueOBEXSessionRef", &[]));
661}
662
663/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexsessionref?language=objc)
664pub type OBEXSessionRef = *mut OpaqueOBEXSessionRef;
665
666/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexconnectcommandresponsedata?language=objc)
667#[repr(C)]
668#[derive(Clone, Copy, Debug, PartialEq)]
669pub struct OBEXConnectCommandResponseData {
670    pub serverResponseOpCode: OBEXOpCode,
671    pub headerDataPtr: *mut c_void,
672    pub headerDataLength: usize,
673    pub maxPacketSize: OBEXMaxPacketLength,
674    pub version: OBEXVersion,
675    pub flags: OBEXFlags,
676}
677
678#[cfg(feature = "objc2")]
679unsafe impl Encode for OBEXConnectCommandResponseData {
680    const ENCODING: Encoding = Encoding::Struct(
681        "OBEXConnectCommandResponseData",
682        &[
683            <OBEXOpCode>::ENCODING,
684            <*mut c_void>::ENCODING,
685            <usize>::ENCODING,
686            <OBEXMaxPacketLength>::ENCODING,
687            <OBEXVersion>::ENCODING,
688            <OBEXFlags>::ENCODING,
689        ],
690    );
691}
692
693#[cfg(feature = "objc2")]
694unsafe impl RefEncode for OBEXConnectCommandResponseData {
695    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
696}
697
698/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexdisconnectcommandresponsedata?language=objc)
699#[repr(C)]
700#[derive(Clone, Copy, Debug, PartialEq)]
701pub struct OBEXDisconnectCommandResponseData {
702    pub serverResponseOpCode: OBEXOpCode,
703    pub headerDataPtr: *mut c_void,
704    pub headerDataLength: usize,
705}
706
707#[cfg(feature = "objc2")]
708unsafe impl Encode for OBEXDisconnectCommandResponseData {
709    const ENCODING: Encoding = Encoding::Struct(
710        "OBEXDisconnectCommandResponseData",
711        &[
712            <OBEXOpCode>::ENCODING,
713            <*mut c_void>::ENCODING,
714            <usize>::ENCODING,
715        ],
716    );
717}
718
719#[cfg(feature = "objc2")]
720unsafe impl RefEncode for OBEXDisconnectCommandResponseData {
721    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
722}
723
724/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexputcommandresponsedata?language=objc)
725#[repr(C)]
726#[derive(Clone, Copy, Debug, PartialEq)]
727pub struct OBEXPutCommandResponseData {
728    pub serverResponseOpCode: OBEXOpCode,
729    pub headerDataPtr: *mut c_void,
730    pub headerDataLength: usize,
731}
732
733#[cfg(feature = "objc2")]
734unsafe impl Encode for OBEXPutCommandResponseData {
735    const ENCODING: Encoding = Encoding::Struct(
736        "OBEXPutCommandResponseData",
737        &[
738            <OBEXOpCode>::ENCODING,
739            <*mut c_void>::ENCODING,
740            <usize>::ENCODING,
741        ],
742    );
743}
744
745#[cfg(feature = "objc2")]
746unsafe impl RefEncode for OBEXPutCommandResponseData {
747    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
748}
749
750/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexgetcommandresponsedata?language=objc)
751#[repr(C)]
752#[derive(Clone, Copy, Debug, PartialEq)]
753pub struct OBEXGetCommandResponseData {
754    pub serverResponseOpCode: OBEXOpCode,
755    pub headerDataPtr: *mut c_void,
756    pub headerDataLength: usize,
757}
758
759#[cfg(feature = "objc2")]
760unsafe impl Encode for OBEXGetCommandResponseData {
761    const ENCODING: Encoding = Encoding::Struct(
762        "OBEXGetCommandResponseData",
763        &[
764            <OBEXOpCode>::ENCODING,
765            <*mut c_void>::ENCODING,
766            <usize>::ENCODING,
767        ],
768    );
769}
770
771#[cfg(feature = "objc2")]
772unsafe impl RefEncode for OBEXGetCommandResponseData {
773    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
774}
775
776/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexsetpathcommandresponsedata?language=objc)
777#[repr(C)]
778#[derive(Clone, Copy, Debug, PartialEq)]
779pub struct OBEXSetPathCommandResponseData {
780    pub serverResponseOpCode: OBEXOpCode,
781    pub headerDataPtr: *mut c_void,
782    pub headerDataLength: usize,
783    pub flags: OBEXFlags,
784    pub constants: OBEXConstants,
785}
786
787#[cfg(feature = "objc2")]
788unsafe impl Encode for OBEXSetPathCommandResponseData {
789    const ENCODING: Encoding = Encoding::Struct(
790        "OBEXSetPathCommandResponseData",
791        &[
792            <OBEXOpCode>::ENCODING,
793            <*mut c_void>::ENCODING,
794            <usize>::ENCODING,
795            <OBEXFlags>::ENCODING,
796            <OBEXConstants>::ENCODING,
797        ],
798    );
799}
800
801#[cfg(feature = "objc2")]
802unsafe impl RefEncode for OBEXSetPathCommandResponseData {
803    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
804}
805
806/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexabortcommandresponsedata?language=objc)
807#[repr(C)]
808#[derive(Clone, Copy, Debug, PartialEq)]
809pub struct OBEXAbortCommandResponseData {
810    pub serverResponseOpCode: OBEXOpCode,
811    pub headerDataPtr: *mut c_void,
812    pub headerDataLength: usize,
813}
814
815#[cfg(feature = "objc2")]
816unsafe impl Encode for OBEXAbortCommandResponseData {
817    const ENCODING: Encoding = Encoding::Struct(
818        "OBEXAbortCommandResponseData",
819        &[
820            <OBEXOpCode>::ENCODING,
821            <*mut c_void>::ENCODING,
822            <usize>::ENCODING,
823        ],
824    );
825}
826
827#[cfg(feature = "objc2")]
828unsafe impl RefEncode for OBEXAbortCommandResponseData {
829    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
830}
831
832/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexconnectcommanddata?language=objc)
833#[repr(C)]
834#[derive(Clone, Copy, Debug, PartialEq)]
835pub struct OBEXConnectCommandData {
836    pub headerDataPtr: *mut c_void,
837    pub headerDataLength: usize,
838    pub maxPacketSize: OBEXMaxPacketLength,
839    pub version: OBEXVersion,
840    pub flags: OBEXFlags,
841}
842
843#[cfg(feature = "objc2")]
844unsafe impl Encode for OBEXConnectCommandData {
845    const ENCODING: Encoding = Encoding::Struct(
846        "OBEXConnectCommandData",
847        &[
848            <*mut c_void>::ENCODING,
849            <usize>::ENCODING,
850            <OBEXMaxPacketLength>::ENCODING,
851            <OBEXVersion>::ENCODING,
852            <OBEXFlags>::ENCODING,
853        ],
854    );
855}
856
857#[cfg(feature = "objc2")]
858unsafe impl RefEncode for OBEXConnectCommandData {
859    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
860}
861
862/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexdisconnectcommanddata?language=objc)
863#[repr(C)]
864#[derive(Clone, Copy, Debug, PartialEq)]
865pub struct OBEXDisconnectCommandData {
866    pub headerDataPtr: *mut c_void,
867    pub headerDataLength: usize,
868}
869
870#[cfg(feature = "objc2")]
871unsafe impl Encode for OBEXDisconnectCommandData {
872    const ENCODING: Encoding = Encoding::Struct(
873        "OBEXDisconnectCommandData",
874        &[<*mut c_void>::ENCODING, <usize>::ENCODING],
875    );
876}
877
878#[cfg(feature = "objc2")]
879unsafe impl RefEncode for OBEXDisconnectCommandData {
880    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
881}
882
883/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexputcommanddata?language=objc)
884#[repr(C)]
885#[derive(Clone, Copy, Debug, PartialEq)]
886pub struct OBEXPutCommandData {
887    pub headerDataPtr: *mut c_void,
888    pub headerDataLength: usize,
889    pub bodyDataLeftToSend: usize,
890}
891
892#[cfg(feature = "objc2")]
893unsafe impl Encode for OBEXPutCommandData {
894    const ENCODING: Encoding = Encoding::Struct(
895        "OBEXPutCommandData",
896        &[
897            <*mut c_void>::ENCODING,
898            <usize>::ENCODING,
899            <usize>::ENCODING,
900        ],
901    );
902}
903
904#[cfg(feature = "objc2")]
905unsafe impl RefEncode for OBEXPutCommandData {
906    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
907}
908
909/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexgetcommanddata?language=objc)
910#[repr(C)]
911#[derive(Clone, Copy, Debug, PartialEq)]
912pub struct OBEXGetCommandData {
913    pub headerDataPtr: *mut c_void,
914    pub headerDataLength: usize,
915}
916
917#[cfg(feature = "objc2")]
918unsafe impl Encode for OBEXGetCommandData {
919    const ENCODING: Encoding = Encoding::Struct(
920        "OBEXGetCommandData",
921        &[<*mut c_void>::ENCODING, <usize>::ENCODING],
922    );
923}
924
925#[cfg(feature = "objc2")]
926unsafe impl RefEncode for OBEXGetCommandData {
927    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
928}
929
930/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexsetpathcommanddata?language=objc)
931#[repr(C)]
932#[derive(Clone, Copy, Debug, PartialEq)]
933pub struct OBEXSetPathCommandData {
934    pub headerDataPtr: *mut c_void,
935    pub headerDataLength: usize,
936    pub flags: OBEXFlags,
937    pub constants: OBEXConstants,
938}
939
940#[cfg(feature = "objc2")]
941unsafe impl Encode for OBEXSetPathCommandData {
942    const ENCODING: Encoding = Encoding::Struct(
943        "OBEXSetPathCommandData",
944        &[
945            <*mut c_void>::ENCODING,
946            <usize>::ENCODING,
947            <OBEXFlags>::ENCODING,
948            <OBEXConstants>::ENCODING,
949        ],
950    );
951}
952
953#[cfg(feature = "objc2")]
954unsafe impl RefEncode for OBEXSetPathCommandData {
955    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
956}
957
958/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexabortcommanddata?language=objc)
959#[repr(C)]
960#[derive(Clone, Copy, Debug, PartialEq)]
961pub struct OBEXAbortCommandData {
962    pub headerDataPtr: *mut c_void,
963    pub headerDataLength: usize,
964}
965
966#[cfg(feature = "objc2")]
967unsafe impl Encode for OBEXAbortCommandData {
968    const ENCODING: Encoding = Encoding::Struct(
969        "OBEXAbortCommandData",
970        &[<*mut c_void>::ENCODING, <usize>::ENCODING],
971    );
972}
973
974#[cfg(feature = "objc2")]
975unsafe impl RefEncode for OBEXAbortCommandData {
976    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
977}
978
979/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexerrordata?language=objc)
980#[repr(C)]
981#[derive(Clone, Copy, Debug, PartialEq)]
982pub struct OBEXErrorData {
983    pub error: OBEXError,
984    pub dataPtr: *mut c_void,
985    pub dataLength: usize,
986}
987
988#[cfg(feature = "objc2")]
989unsafe impl Encode for OBEXErrorData {
990    const ENCODING: Encoding = Encoding::Struct(
991        "OBEXErrorData",
992        &[
993            <OBEXError>::ENCODING,
994            <*mut c_void>::ENCODING,
995            <usize>::ENCODING,
996        ],
997    );
998}
999
1000#[cfg(feature = "objc2")]
1001unsafe impl RefEncode for OBEXErrorData {
1002    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1003}
1004
1005/// When a new session event occurs, your selector (or C callback) will be given an OBEXSessionEvent pointer,
1006/// and in it will be a 'type' field with one of the following types in it. Based on that type, you can then
1007/// read the corresponding field in the union to get out interesting data for that event type. For example,
1008/// if the type of an event is a 'kOBEXSessionEventTypeConnectCommandResponseReceived', you should look in
1009/// the 'OBEXConnectCommandResponseData' part of the structure's union to find more information pased to you
1010/// in the event. Note that some you will never see, depending on the type of session you are using - a client
1011/// or server. If you are a client (most likely case), you will never see the "Command" events, but instead
1012/// you will only receive the "CommandResponse" events since you will be the issuer oft he commands, not the
1013/// receiver of them. Both types of sessions will receive error type events.
1014///
1015/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexsessioneventtypes?language=objc)
1016#[repr(transparent)]
1017#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1018pub struct OBEXSessionEventTypes(pub c_uint);
1019impl OBEXSessionEventTypes {
1020    #[doc(alias = "kOBEXSessionEventTypeConnectCommandResponseReceived")]
1021    pub const ConnectCommandResponseReceived: Self = Self(0x4f434543);
1022    #[doc(alias = "kOBEXSessionEventTypeDisconnectCommandResponseReceived")]
1023    pub const DisconnectCommandResponseReceived: Self = Self(0x4f434544);
1024    #[doc(alias = "kOBEXSessionEventTypePutCommandResponseReceived")]
1025    pub const PutCommandResponseReceived: Self = Self(0x4f434550);
1026    #[doc(alias = "kOBEXSessionEventTypeGetCommandResponseReceived")]
1027    pub const GetCommandResponseReceived: Self = Self(0x4f434547);
1028    #[doc(alias = "kOBEXSessionEventTypeSetPathCommandResponseReceived")]
1029    pub const SetPathCommandResponseReceived: Self = Self(0x4f434553);
1030    #[doc(alias = "kOBEXSessionEventTypeAbortCommandResponseReceived")]
1031    pub const AbortCommandResponseReceived: Self = Self(0x4f434541);
1032    #[doc(alias = "kOBEXSessionEventTypeConnectCommandReceived")]
1033    pub const ConnectCommandReceived: Self = Self(0x4f534543);
1034    #[doc(alias = "kOBEXSessionEventTypeDisconnectCommandReceived")]
1035    pub const DisconnectCommandReceived: Self = Self(0x4f534544);
1036    #[doc(alias = "kOBEXSessionEventTypePutCommandReceived")]
1037    pub const PutCommandReceived: Self = Self(0x4f534550);
1038    #[doc(alias = "kOBEXSessionEventTypeGetCommandReceived")]
1039    pub const GetCommandReceived: Self = Self(0x4f534547);
1040    #[doc(alias = "kOBEXSessionEventTypeSetPathCommandReceived")]
1041    pub const SetPathCommandReceived: Self = Self(0x4f534553);
1042    #[doc(alias = "kOBEXSessionEventTypeAbortCommandReceived")]
1043    pub const AbortCommandReceived: Self = Self(0x4f534541);
1044    #[doc(alias = "kOBEXSessionEventTypeError")]
1045    pub const Error: Self = Self(0x4f474545);
1046}
1047
1048#[cfg(feature = "objc2")]
1049unsafe impl Encode for OBEXSessionEventTypes {
1050    const ENCODING: Encoding = c_uint::ENCODING;
1051}
1052
1053#[cfg(feature = "objc2")]
1054unsafe impl RefEncode for OBEXSessionEventTypes {
1055    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1056}
1057
1058/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexsessioneventtype?language=objc)
1059pub type OBEXSessionEventType = u32;
1060
1061/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexsessionevent_u?language=objc)
1062#[repr(C)]
1063#[derive(Clone, Copy)]
1064pub union OBEXSessionEvent_u {
1065    pub connectCommandResponseData: OBEXConnectCommandResponseData,
1066    pub disconnectCommandResponseData: OBEXDisconnectCommandResponseData,
1067    pub putCommandResponseData: OBEXPutCommandResponseData,
1068    pub getCommandResponseData: OBEXGetCommandResponseData,
1069    pub setPathCommandResponseData: OBEXSetPathCommandResponseData,
1070    pub abortCommandResponseData: OBEXAbortCommandResponseData,
1071    pub connectCommandData: OBEXConnectCommandData,
1072    pub disconnectCommandData: OBEXDisconnectCommandData,
1073    pub putCommandData: OBEXPutCommandData,
1074    pub getCommandData: OBEXGetCommandData,
1075    pub setPathCommandData: OBEXSetPathCommandData,
1076    pub abortCommandData: OBEXAbortCommandData,
1077    pub errorData: OBEXErrorData,
1078}
1079
1080#[cfg(feature = "objc2")]
1081unsafe impl Encode for OBEXSessionEvent_u {
1082    const ENCODING: Encoding = Encoding::Union(
1083        "?",
1084        &[
1085            <OBEXConnectCommandResponseData>::ENCODING,
1086            <OBEXDisconnectCommandResponseData>::ENCODING,
1087            <OBEXPutCommandResponseData>::ENCODING,
1088            <OBEXGetCommandResponseData>::ENCODING,
1089            <OBEXSetPathCommandResponseData>::ENCODING,
1090            <OBEXAbortCommandResponseData>::ENCODING,
1091            <OBEXConnectCommandData>::ENCODING,
1092            <OBEXDisconnectCommandData>::ENCODING,
1093            <OBEXPutCommandData>::ENCODING,
1094            <OBEXGetCommandData>::ENCODING,
1095            <OBEXSetPathCommandData>::ENCODING,
1096            <OBEXAbortCommandData>::ENCODING,
1097            <OBEXErrorData>::ENCODING,
1098        ],
1099    );
1100}
1101
1102#[cfg(feature = "objc2")]
1103unsafe impl RefEncode for OBEXSessionEvent_u {
1104    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1105}
1106
1107/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexsessionevent?language=objc)
1108#[repr(C)]
1109#[derive(Clone, Copy)]
1110pub struct OBEXSessionEvent {
1111    pub r#type: OBEXSessionEventType,
1112    pub session: OBEXSessionRef,
1113    pub refCon: *mut c_void,
1114    pub isEndOfEventData: Boolean,
1115    pub reserved1: *mut c_void,
1116    pub reserved2: *mut c_void,
1117    pub u: OBEXSessionEvent_u,
1118}
1119
1120#[cfg(feature = "objc2")]
1121unsafe impl Encode for OBEXSessionEvent {
1122    const ENCODING: Encoding = Encoding::Struct(
1123        "OBEXSessionEvent",
1124        &[
1125            <OBEXSessionEventType>::ENCODING,
1126            <OBEXSessionRef>::ENCODING,
1127            <*mut c_void>::ENCODING,
1128            <Boolean>::ENCODING,
1129            <*mut c_void>::ENCODING,
1130            <*mut c_void>::ENCODING,
1131            <OBEXSessionEvent_u>::ENCODING,
1132        ],
1133    );
1134}
1135
1136#[cfg(feature = "objc2")]
1137unsafe impl RefEncode for OBEXSessionEvent {
1138    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1139}
1140
1141/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/obexsessioneventcallback?language=objc)
1142pub type OBEXSessionEventCallback = Option<unsafe extern "C-unwind" fn(*const OBEXSessionEvent)>;
1143
1144extern "C-unwind" {
1145    /// Destroy an OBEX session. If connections are open, they will (eventually) be terminated for you.
1146    ///
1147    /// Parameter `inSessionRef`: A valid service reference.
1148    ///
1149    /// Returns: An error code value. 0 if successful.
1150    ///
1151    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1152    /// **        You should transition your code to Objective-C equivalents.
1153    /// **        This API may be removed any time in the future.
1154    #[deprecated]
1155    pub fn OBEXSessionDelete(in_session_ref: OBEXSessionRef) -> OBEXError;
1156}
1157
1158extern "C-unwind" {
1159    /// Allows you to test the session for an open OBEX connection for a particular session.
1160    ///
1161    /// Parameter `inSessionRef`: A valid session reference.
1162    ///
1163    /// Parameter `outIsConnected`: A valid ptr to an OBEXSessionRef; will contain the newly created session if return
1164    /// value is kOBEXSuccess.
1165    ///
1166    /// Returns: An error code value. 0 if successful.
1167    ///
1168    /// This method will return true only if (a) you are transport-connected to another OBEX target and
1169    /// (b) an OBEX Connect command has been issued and received successfully.
1170    ///
1171    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1172    /// **        You should transition your code to Objective-C equivalents.
1173    /// **        This API may be removed any time in the future.
1174    #[deprecated]
1175    pub fn OBEXSessionHasOpenOBEXConnection(
1176        in_session_ref: OBEXSessionRef,
1177        out_is_connected: *mut Boolean,
1178    ) -> OBEXError;
1179}
1180
1181extern "C-unwind" {
1182    /// Gets current max packet length.
1183    ///
1184    /// Parameter `inSessionRef`: A valid session reference.
1185    ///
1186    /// Parameter `outLength`: Max packet length.
1187    ///
1188    /// Returns: An error code value. 0 if successful.
1189    ///
1190    /// This value *could* change before and after a connect command has been sent or a connect
1191    /// command response has been received, since the recipient could negotiate a lower max packet size.
1192    ///
1193    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1194    /// **        You should transition your code to Objective-C equivalents.
1195    /// **        This API may be removed any time in the future.
1196    #[deprecated]
1197    pub fn OBEXSessionGetMaxPacketLength(
1198        in_session_ref: OBEXSessionRef,
1199        out_length: *mut OBEXMaxPacketLength,
1200    ) -> OBEXError;
1201}
1202
1203extern "C-unwind" {
1204    /// Gets space available for your data for a particular command you are trying to send.
1205    ///
1206    /// Parameter `inSessionRef`: A valid session reference.
1207    ///
1208    /// Parameter `inOpCode`: An opcode of what command you are trying to send.
1209    ///
1210    /// Parameter `outLength`: Space available for your header data in the payload area for a particular command.
1211    ///
1212    /// Returns: An error code value. 0 if successful.
1213    ///
1214    /// The OBEXSession takes care of packaging OBEX opcodes and other information into the proper packet format,
1215    /// allowing you to focus on sending the proper OBEX headers in your commands and command responses. This formatting
1216    /// and datas requires a small bit of information that varies depending on what command or response you are
1217    /// sending. Thus, you should call this function to find out how much space will be left for your headers
1218    /// before you send the command, allowing you to properly chop up your headers before sending them. This will
1219    /// guarantee that (a) you use up all the available space in a packet and (b) that you do not get an error
1220    /// trying to send too much information at once.
1221    ///
1222    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1223    /// **        You should transition your code to Objective-C equivalents.
1224    /// **        This API may be removed any time in the future.
1225    #[deprecated]
1226    pub fn OBEXSessionGetAvailableCommandPayloadLength(
1227        in_session_ref: OBEXSessionRef,
1228        in_op_code: OBEXOpCode,
1229        out_length: *mut OBEXMaxPacketLength,
1230    ) -> OBEXError;
1231}
1232
1233extern "C-unwind" {
1234    /// Gets space available for your data for a particular command response you are trying to send.
1235    ///
1236    /// Parameter `inSessionRef`: A valid session reference.
1237    ///
1238    /// Parameter `inOpCode`: A command opcode that you are responding to. For example, if you receiving a Put command,
1239    /// and want to send back a "bad request" response, you should still pass in the Put command
1240    /// opcode for that response.
1241    ///
1242    /// Parameter `outLength`: Space available for your header data in the payload area for a particular command.
1243    ///
1244    /// Returns: An error code value. 0 if successful.
1245    ///
1246    /// The OBEXSession takes care of packaging OBEX opcodes and other information into the proper packet format,
1247    /// allowing you to focus on sending the proper OBEX headers in your commands and command responses. This formatting
1248    /// and datas requires a small bit of information that varies depending on what command or response you are
1249    /// sending. Thus, you should call this function to find out how much space will be left for your headers
1250    /// before you send the command, allowing you to properly chop up your headers before sending them. This will
1251    /// guarantee that (a) you use up all the available space in a packet and (b) that you do not get an error
1252    /// trying to send too much information at once.
1253    ///
1254    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1255    /// **        You should transition your code to Objective-C equivalents.
1256    /// **        This API may be removed any time in the future.
1257    #[deprecated]
1258    pub fn OBEXSessionGetAvailableCommandResponsePayloadLength(
1259        in_session_ref: OBEXSessionRef,
1260        in_op_code: OBEXOpCode,
1261        out_length: *mut OBEXMaxPacketLength,
1262    ) -> OBEXError;
1263}
1264
1265extern "C-unwind" {
1266    /// Establishes an OBEX connection to the target device for the session. If a transport connection is not
1267    /// open yet, it will be opened if possible.
1268    ///
1269    /// Parameter `inSessionRef`: A valid session reference.
1270    ///
1271    /// Parameter `inFlags`: Flags, as defined in the OBEX spec for this command.
1272    ///
1273    /// Parameter `inMaxPacketLength`: Maximum packet length you wish to allow. May be negiotiated with host to be less
1274    /// or more than you specify.
1275    ///
1276    /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1277    /// pointer until you callback is called with a success.
1278    ///
1279    /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1280    ///
1281    /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1282    ///
1283    /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1284    /// callback just as you passed it.
1285    ///
1286    /// Returns: An error code value. 0 if successful.
1287    ///
1288    /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback parameter will
1289    /// result in an error. If you have already established an OBEX connection and you call this again you will
1290    /// get an 'kOBEXSessionAlreadyConnectedError' as a result.
1291    ///
1292    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1293    /// **        You should transition your code to Objective-C equivalents.
1294    /// **        This API may be removed any time in the future.
1295    #[deprecated]
1296    pub fn OBEXSessionConnect(
1297        in_session_ref: OBEXSessionRef,
1298        in_flags: OBEXFlags,
1299        in_max_packet_length: OBEXMaxPacketLength,
1300        in_optional_headers: *mut c_void,
1301        in_optional_headers_length: usize,
1302        in_callback: OBEXSessionEventCallback,
1303        in_user_ref_con: *mut c_void,
1304    ) -> OBEXError;
1305}
1306
1307extern "C-unwind" {
1308    /// Send a disconnect command to a remote OBEX server.
1309    ///
1310    /// Parameter `inSessionRef`: A valid session reference.
1311    ///
1312    /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1313    /// pointer until you callback is called with a success.
1314    ///
1315    /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1316    ///
1317    /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1318    ///
1319    /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1320    /// callback just as you passed it.
1321    ///
1322    /// Returns: An error code value. 0 if successful.
1323    ///
1324    /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1325    /// result in an error.
1326    ///
1327    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1328    /// **        You should transition your code to Objective-C equivalents.
1329    /// **        This API may be removed any time in the future.
1330    #[deprecated]
1331    pub fn OBEXSessionDisconnect(
1332        in_session_ref: OBEXSessionRef,
1333        in_optional_headers: *mut c_void,
1334        in_optional_headers_length: usize,
1335        in_callback: OBEXSessionEventCallback,
1336        in_user_ref_con: *mut c_void,
1337    ) -> OBEXError;
1338}
1339
1340/// Send a put command to a remote OBEX server.
1341///
1342/// Parameter `inSessionRef`: A valid session reference.
1343///
1344/// Parameter `inIsFinalChunk`: TRUE or FALSE - is this the last chunk of header data for this PUT.
1345///
1346/// Parameter `inHeadersData`: Headers containing data to PUT. Don't include your body header data here.
1347///
1348/// Parameter `inHeadersDataLength`: Size of header data. Don't include your body header data here.
1349///
1350/// Parameter `inBodyData`: Data for the BODY header to PUT. DO NOT package your data in an actual BODY header,
1351/// this will be done for you, based on the finalChunk flag you pass in above (since based on
1352/// this flag the header ID will be either a BODY or ENDOFBODY header).
1353///
1354/// Parameter `inBodyDataLength`: Size of Data for the BODY header to PUT.
1355///
1356/// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1357///
1358/// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your callback
1359/// just as you passed it.
1360///
1361/// Returns: An error code value. 0 if successful.
1362///
1363/// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1364/// result in an error.
1365///
1366/// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1367/// **        You should transition your code to Objective-C equivalents.
1368/// **        This API may be removed any time in the future.
1369#[deprecated]
1370#[inline]
1371pub unsafe extern "C-unwind" fn OBEXSessionPut(
1372    in_session_ref: OBEXSessionRef,
1373    in_is_final_chunk: bool,
1374    in_headers_data: *mut c_void,
1375    in_headers_data_length: usize,
1376    in_body_data: *mut c_void,
1377    in_body_data_length: usize,
1378    in_callback: OBEXSessionEventCallback,
1379    in_user_ref_con: *mut c_void,
1380) -> OBEXError {
1381    extern "C-unwind" {
1382        fn OBEXSessionPut(
1383            in_session_ref: OBEXSessionRef,
1384            in_is_final_chunk: Boolean,
1385            in_headers_data: *mut c_void,
1386            in_headers_data_length: usize,
1387            in_body_data: *mut c_void,
1388            in_body_data_length: usize,
1389            in_callback: OBEXSessionEventCallback,
1390            in_user_ref_con: *mut c_void,
1391        ) -> OBEXError;
1392    }
1393    unsafe {
1394        OBEXSessionPut(
1395            in_session_ref,
1396            in_is_final_chunk as _,
1397            in_headers_data,
1398            in_headers_data_length,
1399            in_body_data,
1400            in_body_data_length,
1401            in_callback,
1402            in_user_ref_con,
1403        )
1404    }
1405}
1406
1407/// Send a get command to a remote OBEX server.
1408///
1409/// Parameter `inSessionRef`: A valid session reference.
1410///
1411/// Parameter `inIsFinalChunk`: TRUE or FALSE - is this the last chunk of header data for this GET.
1412///
1413/// Parameter `inHeadersData`: Headers containing data to GET.
1414///
1415/// Parameter `inHeadersDataLength`: Size of header data.
1416///
1417/// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1418///
1419/// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your callback
1420/// just as you passed it.
1421///
1422/// Returns: An error code value. 0 if successful.
1423///
1424/// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1425/// result in an error.
1426///
1427/// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1428/// **        You should transition your code to Objective-C equivalents.
1429/// **        This API may be removed any time in the future.
1430#[deprecated]
1431#[inline]
1432pub unsafe extern "C-unwind" fn OBEXSessionGet(
1433    in_session_ref: OBEXSessionRef,
1434    in_is_final_chunk: bool,
1435    in_headers_data: *mut c_void,
1436    in_headers_data_length: usize,
1437    in_callback: OBEXSessionEventCallback,
1438    in_user_ref_con: *mut c_void,
1439) -> OBEXError {
1440    extern "C-unwind" {
1441        fn OBEXSessionGet(
1442            in_session_ref: OBEXSessionRef,
1443            in_is_final_chunk: Boolean,
1444            in_headers_data: *mut c_void,
1445            in_headers_data_length: usize,
1446            in_callback: OBEXSessionEventCallback,
1447            in_user_ref_con: *mut c_void,
1448        ) -> OBEXError;
1449    }
1450    unsafe {
1451        OBEXSessionGet(
1452            in_session_ref,
1453            in_is_final_chunk as _,
1454            in_headers_data,
1455            in_headers_data_length,
1456            in_callback,
1457            in_user_ref_con,
1458        )
1459    }
1460}
1461
1462extern "C-unwind" {
1463    /// Send an abort command to a remote OBEX server.
1464    ///
1465    /// Parameter `inSessionRef`: A valid session reference.
1466    ///
1467    /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1468    /// pointer until you callback is called with a success.
1469    ///
1470    /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1471    ///
1472    /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1473    ///
1474    /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1475    /// callback just as you passed it.
1476    ///
1477    /// Returns: An error code value. 0 if successful.
1478    ///
1479    /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1480    /// result in an error.
1481    ///
1482    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1483    /// **        You should transition your code to Objective-C equivalents.
1484    /// **        This API may be removed any time in the future.
1485    #[deprecated]
1486    pub fn OBEXSessionAbort(
1487        in_session_ref: OBEXSessionRef,
1488        in_optional_headers: *mut c_void,
1489        in_optional_headers_length: usize,
1490        in_callback: OBEXSessionEventCallback,
1491        in_user_ref_con: *mut c_void,
1492    ) -> OBEXError;
1493}
1494
1495extern "C-unwind" {
1496    /// Send a set path command to a remote OBEX server.
1497    ///
1498    /// Parameter `inSessionRef`: A valid session reference.
1499    ///
1500    /// Parameter `inFlags`: Flags, as defined in the OBEX spec for this command.
1501    ///
1502    /// Parameter `inConstants`: Constants, as defined in the OBEX spec for this command.
1503    ///
1504    /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1505    /// pointer until you callback is called with a success.
1506    ///
1507    /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1508    ///
1509    /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1510    ///
1511    /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1512    /// callback just as you passed it.
1513    ///
1514    /// Returns: An error code value. 0 if successful.
1515    ///
1516    /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1517    /// result in an error.
1518    ///
1519    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1520    /// **        You should transition your code to Objective-C equivalents.
1521    /// **        This API may be removed any time in the future.
1522    #[deprecated]
1523    pub fn OBEXSessionSetPath(
1524        in_session_ref: OBEXSessionRef,
1525        in_flags: OBEXFlags,
1526        in_constants: OBEXConstants,
1527        in_optional_headers: *mut c_void,
1528        in_optional_headers_length: usize,
1529        in_callback: OBEXSessionEventCallback,
1530        in_user_ref_con: *mut c_void,
1531    ) -> OBEXError;
1532}
1533
1534extern "C-unwind" {
1535    /// Send a response to a connect command to the remote client.
1536    ///
1537    /// Parameter `inSessionRef`: A valid session reference.
1538    ///
1539    /// Parameter `inResponseOpCode`: What response code you want to send to the remote client.
1540    ///
1541    /// Parameter `inFlags`: Flags, as defined in the OBEX spec for this command.
1542    ///
1543    /// Parameter `inMaxPacketLength`: Max packet length you want to support. Must be smaller or equal to the max packet
1544    /// length specified by the remote client.
1545    ///
1546    /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1547    /// pointer until you callback is called with a success.
1548    ///
1549    /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1550    ///
1551    /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1552    ///
1553    /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1554    /// callback just as you passed it.
1555    ///
1556    /// Returns: An error code value. 0 if successful.
1557    ///
1558    /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1559    /// result in an error.
1560    ///
1561    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1562    /// **        You should transition your code to Objective-C equivalents.
1563    /// **        This API may be removed any time in the future.
1564    #[deprecated]
1565    pub fn OBEXSessionConnectResponse(
1566        in_session_ref: OBEXSessionRef,
1567        in_response_op_code: OBEXOpCode,
1568        in_flags: OBEXFlags,
1569        in_max_packet_length: OBEXMaxPacketLength,
1570        in_optional_headers: *mut c_void,
1571        in_optional_headers_length: usize,
1572        in_callback: OBEXSessionEventCallback,
1573        in_user_ref_con: *mut c_void,
1574    ) -> OBEXError;
1575}
1576
1577extern "C-unwind" {
1578    /// Send a response to a disconnect command to the remote client.
1579    ///
1580    /// Parameter `inSessionRef`: A valid session reference.
1581    ///
1582    /// Parameter `inResponseOpCode`: What response code you want to send to the remote client.
1583    ///
1584    /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1585    /// pointer until you callback is called with a success.
1586    ///
1587    /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1588    ///
1589    /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1590    ///
1591    /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1592    /// callback just as you passed it.
1593    ///
1594    /// Returns: An error code value. 0 if successful.
1595    ///
1596    /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1597    /// result in an error.
1598    ///
1599    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1600    /// **        You should transition your code to Objective-C equivalents.
1601    /// **        This API may be removed any time in the future.
1602    #[deprecated]
1603    pub fn OBEXSessionDisconnectResponse(
1604        in_session_ref: OBEXSessionRef,
1605        in_response_op_code: OBEXOpCode,
1606        in_optional_headers: *mut c_void,
1607        in_optional_headers_length: usize,
1608        in_callback: OBEXSessionEventCallback,
1609        in_user_ref_con: *mut c_void,
1610    ) -> OBEXError;
1611}
1612
1613extern "C-unwind" {
1614    /// Send a response to a get command to the remote client.
1615    ///
1616    /// Parameter `inSessionRef`: A valid session reference.
1617    ///
1618    /// Parameter `inResponseOpCode`: What response code you want to send to the remote client.
1619    ///
1620    /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1621    /// pointer until you callback is called with a success.
1622    ///
1623    /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1624    ///
1625    /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1626    ///
1627    /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1628    /// callback just as you passed it.
1629    ///
1630    /// Returns: An error code value. 0 if successful.
1631    ///
1632    /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1633    /// result in an error.
1634    ///
1635    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1636    /// **        You should transition your code to Objective-C equivalents.
1637    /// **        This API may be removed any time in the future.
1638    #[deprecated]
1639    pub fn OBEXSessionGetResponse(
1640        in_session_ref: OBEXSessionRef,
1641        in_response_op_code: OBEXOpCode,
1642        in_optional_headers: *mut c_void,
1643        in_optional_headers_length: usize,
1644        in_callback: OBEXSessionEventCallback,
1645        in_user_ref_con: *mut c_void,
1646    ) -> OBEXError;
1647}
1648
1649extern "C-unwind" {
1650    /// Send a response to a put command to the remote client.
1651    ///
1652    /// Parameter `inSessionRef`: A valid session reference.
1653    ///
1654    /// Parameter `inResponseOpCode`: What response code you want to send to the remote client.
1655    ///
1656    /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1657    /// pointer until you callback is called with a success.
1658    ///
1659    /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1660    ///
1661    /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1662    ///
1663    /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1664    /// callback just as you passed it.
1665    ///
1666    /// Returns: An error code value. 0 if successful.
1667    ///
1668    /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1669    /// result in an error.
1670    ///
1671    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1672    /// **        You should transition your code to Objective-C equivalents.
1673    /// **        This API may be removed any time in the future.
1674    #[deprecated]
1675    pub fn OBEXSessionPutResponse(
1676        in_session_ref: OBEXSessionRef,
1677        in_response_op_code: OBEXOpCode,
1678        in_optional_headers: *mut c_void,
1679        in_optional_headers_length: usize,
1680        in_callback: OBEXSessionEventCallback,
1681        in_user_ref_con: *mut c_void,
1682    ) -> OBEXError;
1683}
1684
1685extern "C-unwind" {
1686    /// Send a response to a abort command to the remote client.
1687    ///
1688    /// Parameter `inSessionRef`: A valid session reference.
1689    ///
1690    /// Parameter `inResponseOpCode`: What response code you want to send to the remote client.
1691    ///
1692    /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1693    /// pointer until you callback is called with a success.
1694    ///
1695    /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1696    ///
1697    /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1698    ///
1699    /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1700    /// callback just as you passed it.
1701    ///
1702    /// Returns: An error code value. 0 if successful.
1703    ///
1704    /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1705    /// result in an error.
1706    ///
1707    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1708    /// **        You should transition your code to Objective-C equivalents.
1709    /// **        This API may be removed any time in the future.
1710    #[deprecated]
1711    pub fn OBEXSessionAbortResponse(
1712        in_session_ref: OBEXSessionRef,
1713        in_response_op_code: OBEXOpCode,
1714        in_optional_headers: *mut c_void,
1715        in_optional_headers_length: usize,
1716        in_callback: OBEXSessionEventCallback,
1717        in_user_ref_con: *mut c_void,
1718    ) -> OBEXError;
1719}
1720
1721extern "C-unwind" {
1722    /// Send a response to a set path command to the remote client.
1723    ///
1724    /// Parameter `inSessionRef`: A valid session reference.
1725    ///
1726    /// Parameter `inResponseOpCode`: What response code you want to send to the remote client.
1727    ///
1728    /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1729    /// pointer until you callback is called with a success.
1730    ///
1731    /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1732    ///
1733    /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1734    ///
1735    /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1736    /// callback just as you passed it.
1737    ///
1738    /// Returns: An error code value. 0 if successful.
1739    ///
1740    /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1741    /// result in an error.
1742    ///
1743    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1744    /// **        You should transition your code to Objective-C equivalents.
1745    /// **        This API may be removed any time in the future.
1746    #[deprecated]
1747    pub fn OBEXSessionSetPathResponse(
1748        in_session_ref: OBEXSessionRef,
1749        in_response_op_code: OBEXOpCode,
1750        in_optional_headers: *mut c_void,
1751        in_optional_headers_length: usize,
1752        in_callback: OBEXSessionEventCallback,
1753        in_user_ref_con: *mut c_void,
1754    ) -> OBEXError;
1755}
1756
1757extern "C-unwind" {
1758    /// Parameter `inSessionRef`: A valid session reference.
1759    ///
1760    /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion by server
1761    /// sessions only.
1762    ///
1763    /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1764    /// callback just as you passed it.
1765    ///
1766    /// Returns: An error code value. 0 if successful.
1767    ///
1768    /// Sets callback to be used when an event occurs on an OBEXSession. This is important for OBEX servers, as you
1769    /// will need a way to be called back when the first command is sent to you. So, be sure to set yourself
1770    /// up to listen for events when you are ready to receive them.
1771    ///
1772    /// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1773    /// **        You should transition your code to Objective-C equivalents.
1774    /// **        This API may be removed any time in the future.
1775    #[deprecated]
1776    pub fn OBEXSessionSetServerCallback(
1777        in_session_ref: OBEXSessionRef,
1778        in_callback: OBEXSessionEventCallback,
1779        in_user_ref_con: *mut c_void,
1780    ) -> OBEXError;
1781}
1782
1783/// Creates a formatted vCard, ready to be sent over OBEX or whatever.
1784///
1785/// Parameter `inNameCharset`: A pointer to the charset data used for the name. Pass in a #defined charset
1786/// for ease of use.
1787///
1788/// Parameter `inNameCharsetLength`: Length of name charset assed in above.
1789///
1790/// Parameter `inFirstName`: Pointer to data with Person's first name.
1791///
1792/// Parameter `inFirstNameLength`: Length of Person's first name passed in above.
1793///
1794/// Parameter `inLastName`: Pointer to data with Person's last name.
1795///
1796/// Parameter `inLastNameLength`: Length of Person's last name passed in above.
1797///
1798/// Parameter `inFriendlyName`: Pointer to data with Person's Friendly name.
1799///
1800/// Parameter `inFriendlyNameLength`: Length of Person's Friendly name passed in above.
1801///
1802/// Parameter `inHomePhone`: Pointer to data with Person's Home phone number.
1803///
1804/// Parameter `inHomePhoneLength`: Length of Person's Home phone number passed in above.
1805///
1806/// Parameter `inWorkPhone`: Work phone number.
1807///
1808/// Parameter `inWorkPhoneLength`: Length of Person's Work phone number passed in above.
1809///
1810/// Parameter `inCellPhone`: Cell phone number.
1811///
1812/// Parameter `inCellPhoneLength`: Length of Person's Cell phone number passed in above.
1813///
1814/// Parameter `inFaxPhone`: Fax phone number.
1815///
1816/// Parameter `inFaxPhoneLength`: Length of Person's Fax phone number passed in above.
1817///
1818/// Parameter `inEMailAddress`: EMailAddress of person.
1819///
1820/// Parameter `inEMailAddressLength`: Length of Person's EMailAddress passed in above.
1821///
1822/// Parameter `inEMailAddressCharset`: Charset of EMailAddress of person.
1823///
1824/// Parameter `inEMailAddressCharsetLength`: Length of Person's EMailAddress charset passed in above.
1825///
1826/// Parameter `inOrganization`: Pointer to Organization/business data.
1827///
1828/// Parameter `inOrganizationLength`: Length of Organization/business data.
1829///
1830/// Parameter `inOrganizationCharset`: Pointer to the charset the Organization/business is in.
1831///
1832/// Parameter `inOrganizationCharsetLength`: Length of data for the Organization/business charset.
1833///
1834/// Parameter `inTitle`: Pointer to data with Title of person in biz/org.
1835///
1836/// Parameter `inTitleLength`: Length of Title of person in biz/org.
1837///
1838/// Parameter `inTitleCharset`: Pointer to the charset the Title is in.
1839///
1840/// Parameter `inTitleCharsetLength`: Length of data for the Title charset.
1841///
1842/// Returns: An CFDataRef containing the compiled data. nil if we failed.
1843///
1844/// All parameters are optional. The CFDataRef returned to you is NOT retained. Retain it if you want to keep it.
1845///
1846/// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1847/// **        You should transition your code to Objective-C equivalents.
1848/// **        This API may be removed any time in the future.
1849#[cfg(feature = "objc2-core-foundation")]
1850#[deprecated]
1851#[inline]
1852pub unsafe extern "C-unwind" fn OBEXCreateVCard(
1853    in_first_name: *const c_void,
1854    in_first_name_length: u32,
1855    in_last_name: *const c_void,
1856    in_last_name_length: u32,
1857    in_friendly_name: *const c_void,
1858    in_friendly_name_length: u32,
1859    in_name_charset: *const c_void,
1860    in_name_charset_length: u32,
1861    in_home_phone: *const c_void,
1862    in_home_phone_length: u32,
1863    in_work_phone: *const c_void,
1864    in_work_phone_length: u32,
1865    in_cell_phone: *const c_void,
1866    in_cell_phone_length: u32,
1867    in_fax_phone: *const c_void,
1868    in_fax_phone_length: u32,
1869    in_e_mail_address: *const c_void,
1870    in_e_mail_address_length: u32,
1871    in_e_mail_address_charset: *const c_void,
1872    in_e_mail_address_charset_length: u32,
1873    in_organization: *const c_void,
1874    in_organization_length: u32,
1875    in_organization_charset: *const c_void,
1876    in_organization_charset_length: u32,
1877    in_title: *const c_void,
1878    in_title_length: u32,
1879    in_title_charset: *const c_void,
1880    in_title_charset_length: u32,
1881) -> Option<CFRetained<CFData>> {
1882    extern "C-unwind" {
1883        fn OBEXCreateVCard(
1884            in_first_name: *const c_void,
1885            in_first_name_length: u32,
1886            in_last_name: *const c_void,
1887            in_last_name_length: u32,
1888            in_friendly_name: *const c_void,
1889            in_friendly_name_length: u32,
1890            in_name_charset: *const c_void,
1891            in_name_charset_length: u32,
1892            in_home_phone: *const c_void,
1893            in_home_phone_length: u32,
1894            in_work_phone: *const c_void,
1895            in_work_phone_length: u32,
1896            in_cell_phone: *const c_void,
1897            in_cell_phone_length: u32,
1898            in_fax_phone: *const c_void,
1899            in_fax_phone_length: u32,
1900            in_e_mail_address: *const c_void,
1901            in_e_mail_address_length: u32,
1902            in_e_mail_address_charset: *const c_void,
1903            in_e_mail_address_charset_length: u32,
1904            in_organization: *const c_void,
1905            in_organization_length: u32,
1906            in_organization_charset: *const c_void,
1907            in_organization_charset_length: u32,
1908            in_title: *const c_void,
1909            in_title_length: u32,
1910            in_title_charset: *const c_void,
1911            in_title_charset_length: u32,
1912        ) -> Option<NonNull<CFData>>;
1913    }
1914    let ret = unsafe {
1915        OBEXCreateVCard(
1916            in_first_name,
1917            in_first_name_length,
1918            in_last_name,
1919            in_last_name_length,
1920            in_friendly_name,
1921            in_friendly_name_length,
1922            in_name_charset,
1923            in_name_charset_length,
1924            in_home_phone,
1925            in_home_phone_length,
1926            in_work_phone,
1927            in_work_phone_length,
1928            in_cell_phone,
1929            in_cell_phone_length,
1930            in_fax_phone,
1931            in_fax_phone_length,
1932            in_e_mail_address,
1933            in_e_mail_address_length,
1934            in_e_mail_address_charset,
1935            in_e_mail_address_charset_length,
1936            in_organization,
1937            in_organization_length,
1938            in_organization_charset,
1939            in_organization_charset_length,
1940            in_title,
1941            in_title_length,
1942            in_title_charset,
1943            in_title_charset_length,
1944        )
1945    };
1946    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1947}
1948
1949/// Creates a formatted vEvent, ready to be sent over OBEX or whatever. You probably will embed the output
1950/// in a vCalendar event.
1951///
1952/// Parameter `inCharset`: The Charset the passed data is in. Pass in a #defined charset for ease of use.
1953///
1954/// Parameter `inCharsetLength`: The length of the Charset passed data.
1955///
1956/// Parameter `inEncoding`: The encoding of the summary and location fields.
1957///
1958/// Parameter `inEncodingLength`: The length of the Charset passed data.
1959///
1960/// Parameter `inEventStartDate`: Start of event date, in the (ISO8601) format: YYYYMMDDTHHMMSS. e.g. 19960415T083000 = 8:30 am on April 15, 1996. All time values should be in LOCAL time.
1961///
1962/// Parameter `inEventStartDateLength`: The length of the Charset passed data.
1963///
1964/// Parameter `inEventEndDate`: End of event date.
1965///
1966/// Parameter `inEventEndDateLength`: The length of the Charset passed data.
1967///
1968/// Parameter `inAlarmDate`: Date of Alarm for event, in the format: YYYYMMDDTHHMMSS.
1969///
1970/// Parameter `inAlarmDateLength`: The length of the Charset passed data.
1971///
1972/// Parameter `inCategory`: Category of event, such as "MEETING" or "PHONE CALL".
1973///
1974/// Parameter `inCategoryLength`: The length of the Charset passed data.
1975///
1976/// Parameter `inSummary`: Summary of event. Max length is 36 bytes. Longer will result in a bad argument error.
1977///
1978/// Parameter `inSummaryLength`: The length of the Charset passed data.
1979///
1980/// Parameter `inLocation`: Summary of event. Max length is 20 bytes. Longer will result in a bad argument error.
1981///
1982/// Parameter `inLocationLength`: The length of the Charset passed data.
1983///
1984/// Parameter `inXIRMCLUID`: The IRMC Local Unique Identifier Label, max length 12 bytes. Longer will result in
1985/// a bad argument error.
1986///
1987/// Parameter `inXIRMCLUIDLength`: The length of the Charset passed data.
1988///
1989/// Returns: A valid CFDataRef -     nil if we failed.
1990///
1991/// All parameters are optional. The CFDataRef returned to you is NOT retained. Retain it if you want to keep it.
1992/// Be aware that certain devices such as Ericsson phones MUST have certain fields, such as a start and end date.
1993///
1994/// **        DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1995/// **        You should transition your code to Objective-C equivalents.
1996/// **        This API may be removed any time in the future.
1997#[cfg(feature = "objc2-core-foundation")]
1998#[deprecated]
1999#[inline]
2000pub unsafe extern "C-unwind" fn OBEXCreateVEvent(
2001    in_charset: *const c_char,
2002    in_charset_length: u32,
2003    in_encoding: *const c_char,
2004    in_encoding_length: u32,
2005    in_event_start_date: *const c_char,
2006    in_event_start_date_length: u32,
2007    in_event_end_date: *const c_char,
2008    in_event_end_date_length: u32,
2009    in_alarm_date: *const c_char,
2010    in_alarm_date_length: u32,
2011    in_category: *const c_char,
2012    in_category_length: u32,
2013    in_summary: *const c_char,
2014    in_summary_length: u32,
2015    in_location: *const c_char,
2016    in_location_length: u32,
2017    in_xirmcluid: *const c_char,
2018    in_xirmcluid_length: u32,
2019) -> Option<CFRetained<CFData>> {
2020    extern "C-unwind" {
2021        fn OBEXCreateVEvent(
2022            in_charset: *const c_char,
2023            in_charset_length: u32,
2024            in_encoding: *const c_char,
2025            in_encoding_length: u32,
2026            in_event_start_date: *const c_char,
2027            in_event_start_date_length: u32,
2028            in_event_end_date: *const c_char,
2029            in_event_end_date_length: u32,
2030            in_alarm_date: *const c_char,
2031            in_alarm_date_length: u32,
2032            in_category: *const c_char,
2033            in_category_length: u32,
2034            in_summary: *const c_char,
2035            in_summary_length: u32,
2036            in_location: *const c_char,
2037            in_location_length: u32,
2038            in_xirmcluid: *const c_char,
2039            in_xirmcluid_length: u32,
2040        ) -> Option<NonNull<CFData>>;
2041    }
2042    let ret = unsafe {
2043        OBEXCreateVEvent(
2044            in_charset,
2045            in_charset_length,
2046            in_encoding,
2047            in_encoding_length,
2048            in_event_start_date,
2049            in_event_start_date_length,
2050            in_event_end_date,
2051            in_event_end_date_length,
2052            in_alarm_date,
2053            in_alarm_date_length,
2054            in_category,
2055            in_category_length,
2056            in_summary,
2057            in_summary_length,
2058            in_location,
2059            in_location_length,
2060            in_xirmcluid,
2061            in_xirmcluid_length,
2062        )
2063    };
2064    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2065}
2066
2067extern "C" {
2068    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyname?language=objc)
2069    #[cfg(feature = "objc2-core-foundation")]
2070    pub static kOBEXHeaderIDKeyName: Option<&'static CFString>;
2071}
2072
2073extern "C" {
2074    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeytype?language=objc)
2075    #[cfg(feature = "objc2-core-foundation")]
2076    pub static kOBEXHeaderIDKeyType: Option<&'static CFString>;
2077}
2078
2079extern "C" {
2080    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeydescription?language=objc)
2081    #[cfg(feature = "objc2-core-foundation")]
2082    pub static kOBEXHeaderIDKeyDescription: Option<&'static CFString>;
2083}
2084
2085extern "C" {
2086    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeytimeiso?language=objc)
2087    #[cfg(feature = "objc2-core-foundation")]
2088    pub static kOBEXHeaderIDKeyTimeISO: Option<&'static CFString>;
2089}
2090
2091extern "C" {
2092    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeytime4byte?language=objc)
2093    #[cfg(feature = "objc2-core-foundation")]
2094    pub static kOBEXHeaderIDKeyTime4Byte: Option<&'static CFString>;
2095}
2096
2097extern "C" {
2098    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeytarget?language=objc)
2099    #[cfg(feature = "objc2-core-foundation")]
2100    pub static kOBEXHeaderIDKeyTarget: Option<&'static CFString>;
2101}
2102
2103extern "C" {
2104    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyhttp?language=objc)
2105    #[cfg(feature = "objc2-core-foundation")]
2106    pub static kOBEXHeaderIDKeyHTTP: Option<&'static CFString>;
2107}
2108
2109extern "C" {
2110    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeybody?language=objc)
2111    #[cfg(feature = "objc2-core-foundation")]
2112    pub static kOBEXHeaderIDKeyBody: Option<&'static CFString>;
2113}
2114
2115extern "C" {
2116    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyendofbody?language=objc)
2117    #[cfg(feature = "objc2-core-foundation")]
2118    pub static kOBEXHeaderIDKeyEndOfBody: Option<&'static CFString>;
2119}
2120
2121extern "C" {
2122    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeywho?language=objc)
2123    #[cfg(feature = "objc2-core-foundation")]
2124    pub static kOBEXHeaderIDKeyWho: Option<&'static CFString>;
2125}
2126
2127extern "C" {
2128    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyappparameters?language=objc)
2129    #[cfg(feature = "objc2-core-foundation")]
2130    pub static kOBEXHeaderIDKeyAppParameters: Option<&'static CFString>;
2131}
2132
2133extern "C" {
2134    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyauthorizationchallenge?language=objc)
2135    #[cfg(feature = "objc2-core-foundation")]
2136    pub static kOBEXHeaderIDKeyAuthorizationChallenge: Option<&'static CFString>;
2137}
2138
2139extern "C" {
2140    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyauthorizationresponse?language=objc)
2141    #[cfg(feature = "objc2-core-foundation")]
2142    pub static kOBEXHeaderIDKeyAuthorizationResponse: Option<&'static CFString>;
2143}
2144
2145extern "C" {
2146    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyobjectclass?language=objc)
2147    #[cfg(feature = "objc2-core-foundation")]
2148    pub static kOBEXHeaderIDKeyObjectClass: Option<&'static CFString>;
2149}
2150
2151extern "C" {
2152    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeycount?language=objc)
2153    #[cfg(feature = "objc2-core-foundation")]
2154    pub static kOBEXHeaderIDKeyCount: Option<&'static CFString>;
2155}
2156
2157extern "C" {
2158    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeylength?language=objc)
2159    #[cfg(feature = "objc2-core-foundation")]
2160    pub static kOBEXHeaderIDKeyLength: Option<&'static CFString>;
2161}
2162
2163extern "C" {
2164    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyconnectionid?language=objc)
2165    #[cfg(feature = "objc2-core-foundation")]
2166    pub static kOBEXHeaderIDKeyConnectionID: Option<&'static CFString>;
2167}
2168
2169extern "C" {
2170    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeybytesequence?language=objc)
2171    #[cfg(feature = "objc2-core-foundation")]
2172    pub static kOBEXHeaderIDKeyByteSequence: Option<&'static CFString>;
2173}
2174
2175extern "C" {
2176    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyunknownunicodetext?language=objc)
2177    #[cfg(feature = "objc2-core-foundation")]
2178    pub static kOBEXHeaderIDKeyUnknownUnicodeText: Option<&'static CFString>;
2179}
2180
2181extern "C" {
2182    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyunknownbytesequence?language=objc)
2183    #[cfg(feature = "objc2-core-foundation")]
2184    pub static kOBEXHeaderIDKeyUnknownByteSequence: Option<&'static CFString>;
2185}
2186
2187extern "C" {
2188    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyunknown1bytequantity?language=objc)
2189    #[cfg(feature = "objc2-core-foundation")]
2190    pub static kOBEXHeaderIDKeyUnknown1ByteQuantity: Option<&'static CFString>;
2191}
2192
2193extern "C" {
2194    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyunknown4bytequantity?language=objc)
2195    #[cfg(feature = "objc2-core-foundation")]
2196    pub static kOBEXHeaderIDKeyUnknown4ByteQuantity: Option<&'static CFString>;
2197}
2198
2199extern "C" {
2200    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyuserdefined?language=objc)
2201    #[cfg(feature = "objc2-core-foundation")]
2202    pub static kOBEXHeaderIDKeyUserDefined: Option<&'static CFString>;
2203}
2204
2205/// Take a data blob and looks for OBEX headers.
2206///
2207/// Parameter `inData`: The data chunk with the headers you are interested in.
2208///
2209/// Parameter `inDataSize`: The size of the buffer you are passing in.
2210///
2211/// Returns: A CFDictionary with the headers found in the data blob inside it.
2212///
2213/// You should use this when your callback for PUTs, GETs, etc. give you a data chunk
2214/// and a size. Pass these params to this function and you will receive a dictionary
2215/// back full of the parse headers. You can use the CFDictionary calls to get objects
2216/// out of it, based on the header keys defined above. You are responsible for releasing
2217/// the CFDictionary returned to you.
2218/// Example usage:
2219/// <pre>
2220/// CFDictionaryRef   dictionary = OBEXGetHeaders( data, dataLength );
2221/// if( dictionary )
2222/// {
2223/// if( CFDictionaryGetCountOfKey( dictionary, kOBEXHeaderIDKeyName ) > 0 )
2224/// {
2225/// CFStringRef theStringRef;
2226///
2227/// theStringRef = (CFStringRef) CFDictionaryGetValue( dictionary, kOBEXHeaderIDKeyName );
2228/// if( theStringRef )
2229/// {
2230/// // Display it, use it as a filename, whatever.
2231/// }
2232/// }
2233///
2234/// if( CFDictionaryGetCountOfKey( dictionary, kOBEXHeaderIDKeyConnectionID ) > 0 )
2235/// {
2236/// CFDataRef theDataRef;
2237///
2238/// theDataRef = (CFDataRef) CFDictionaryGetValue( dictionary, kOBEXHeaderIDKeyConnectionID );
2239/// if( theDataRef )
2240/// {
2241/// // now we have data representing the connection ID.
2242/// }
2243/// }
2244///
2245/// CFRelease( dictionary );
2246/// }
2247/// </pre>
2248#[cfg(feature = "objc2-core-foundation")]
2249#[inline]
2250pub unsafe extern "C-unwind" fn OBEXGetHeaders(
2251    in_data: *const c_void,
2252    in_data_size: usize,
2253) -> Option<CFRetained<CFDictionary>> {
2254    extern "C-unwind" {
2255        fn OBEXGetHeaders(
2256            in_data: *const c_void,
2257            in_data_size: usize,
2258        ) -> Option<NonNull<CFDictionary>>;
2259    }
2260    let ret = unsafe { OBEXGetHeaders(in_data, in_data_size) };
2261    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2262}
2263
2264/// Converts a dictionary of headers to a data pointer, from which you can extract as bytes and pass to
2265/// the OBEX command/response functions.
2266///
2267/// Parameter `dictionaryOfHeaders`: dictionary that you have added headers to with the above OBEXAddXXXHeader functions.
2268///
2269/// Returns: Mutable data ref containing the bytes of all headers.
2270///
2271/// Returns a CFMutableDataRef containing all the header data found in the dictionary, formatted according to
2272/// the OBEX/IrMC spec. YOU MUST RELEASE IT when you are finished with it (ie. when the OBEX request is complete).
2273/// All OBEX-specification defined headers are supported and should be returned to the dictionary. Use the
2274/// keys defined above to get headers from dictionary. Example usage:
2275/// <pre>
2276/// Example usage:
2277///
2278/// CFMutableDictionaryRef    dictionary;
2279/// CFMutableDataRef        mGetHeadersDataRef;
2280/// uint8_t*                 headerDataPtr;
2281/// uint32_t                 headerDataLength;
2282///
2283/// dictionary = CFDictionaryCreateMutable( kCFAllocatorDefault, 0,
2284/// &kCFCopyStringDictionaryKeyCallBacks
2285/// ,
2286/// &kCFTypeDictionaryValueCallBacks
2287/// );
2288///
2289/// // Package up desired headers.
2290///
2291/// OBEXAddTypeHeader( CFSTR( "text/x-vCard" ), dictionary );
2292///
2293/// mGetHeadersDataRef = OBEXHeadersToBytes( dictionary );
2294///
2295/// headerDataPtr = CFDataGetBytePtr( mGetHeadersDataRef );
2296/// headerDataLength = CFDataGetLength( mGetHeadersDataRef );
2297///
2298/// // From here I can pass it to any OBEX command, such as OBEXPut...
2299/// </pre>
2300#[cfg(feature = "objc2-core-foundation")]
2301#[inline]
2302pub unsafe extern "C-unwind" fn OBEXHeadersToBytes(
2303    dictionary_of_headers: Option<&CFDictionary>,
2304) -> Option<CFRetained<CFMutableData>> {
2305    extern "C-unwind" {
2306        fn OBEXHeadersToBytes(
2307            dictionary_of_headers: Option<&CFDictionary>,
2308        ) -> Option<NonNull<CFMutableData>>;
2309    }
2310    let ret = unsafe { OBEXHeadersToBytes(dictionary_of_headers) };
2311    ret.map(|ret| unsafe { CFRetained::retain(ret) })
2312}
2313
2314extern "C-unwind" {
2315    /// Add a CFStringRef to a dictionary of OBEXheaders.
2316    ///
2317    /// Parameter `name`: name you want to add to the OBEX header dictionary.
2318    ///
2319    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2320    ///
2321    /// Returns: Error code, kOBEXSuccess (0) if success.
2322    ///
2323    /// Name header - OBEX Spec, 2.2.2: (2-byte) Null terminated unicode string.
2324    #[cfg(feature = "objc2-core-foundation")]
2325    pub fn OBEXAddNameHeader(
2326        name: Option<&CFString>,
2327        dict_ref: Option<&CFMutableDictionary>,
2328    ) -> OBEXError;
2329}
2330
2331extern "C-unwind" {
2332    /// Add a CFStringRef to a dictionary of OBEXheaders.
2333    ///
2334    /// Parameter `description`: Description you want to add to the OBEX header dictionary.
2335    ///
2336    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2337    ///
2338    /// Returns: Error code, kOBEXSuccess (0) if success.
2339    ///
2340    /// Description header - OBEX Spec, 2.2.6: (2-byte) Null terminated unicode string.
2341    #[cfg(feature = "objc2-core-foundation")]
2342    pub fn OBEXAddDescriptionHeader(
2343        description: Option<&CFString>,
2344        dict_ref: Option<&CFMutableDictionary>,
2345    ) -> OBEXError;
2346}
2347
2348extern "C-unwind" {
2349    /// Add a CFStringRef to a dictionary of OBEXheaders.
2350    ///
2351    /// Parameter `count`: Count value you want to add to the OBEX header dictionary.
2352    ///
2353    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2354    ///
2355    /// Returns: Error code, kOBEXSuccess (0) if success.
2356    ///
2357    /// Count header - OBEX Spec, 2.2.1: 4 byte unsigned integer
2358    #[cfg(feature = "objc2-core-foundation")]
2359    pub fn OBEXAddCountHeader(count: u32, dict_ref: Option<&CFMutableDictionary>) -> OBEXError;
2360}
2361
2362extern "C-unwind" {
2363    /// Add a CFStringRef to a dictionary of OBEXheaders.
2364    ///
2365    /// Parameter `time4Byte`: 4-byte time value you want to add to the OBEX header dictionary.
2366    ///
2367    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2368    ///
2369    /// Returns: Error code, kOBEXSuccess (0) if success.
2370    ///
2371    /// Time4Byte headers - OBEX Spec, 2.2.5: 4 Bytes
2372    #[cfg(feature = "objc2-core-foundation")]
2373    pub fn OBEXAddTime4ByteHeader(
2374        time4_byte: u32,
2375        dict_ref: Option<&CFMutableDictionary>,
2376    ) -> OBEXError;
2377}
2378
2379extern "C-unwind" {
2380    /// Add a CFStringRef to a dictionary of OBEXheaders.
2381    ///
2382    /// Parameter `length`: Value of Length header you want to add to the OBEX header dictionary.
2383    ///
2384    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2385    ///
2386    /// Returns: Error code, kOBEXSuccess (0) if success.
2387    ///
2388    /// Length header - OBEX Spec, 2.2.4: 4 byte unsigned integer
2389    #[cfg(feature = "objc2-core-foundation")]
2390    pub fn OBEXAddLengthHeader(length: u32, dict_ref: Option<&CFMutableDictionary>) -> OBEXError;
2391}
2392
2393extern "C-unwind" {
2394    /// Add a CFStringRef to a dictionary of OBEXheaders.
2395    ///
2396    /// Parameter `type`: String containing the type of header to add.
2397    ///
2398    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2399    ///
2400    /// Returns: Error code, kOBEXSuccess (0) if success.
2401    ///
2402    /// Type header - OBEX Spec, 2.2.3: 1-byte Null terminated ascii string.
2403    #[cfg(feature = "objc2-core-foundation")]
2404    pub fn OBEXAddTypeHeader(
2405        r#type: Option<&CFString>,
2406        dict_ref: Option<&CFMutableDictionary>,
2407    ) -> OBEXError;
2408}
2409
2410extern "C-unwind" {
2411    /// Add bytes to a dictionary of OBEXheaders.
2412    ///
2413    /// Parameter `inHeaderData`: Time ISO 8601 header data, local times in format YYYYMMDDTHHMMSS and UTC in the format YYYYMMDDTHHMMSSZ.
2414    ///
2415    /// Parameter `inHeaderDataLength`: Length of header data.
2416    ///
2417    /// Returns: Error code, kOBEXSuccess (0) if success.
2418    ///
2419    /// TimeISO header - OBEX Spec, 2.2.5: Byte Sequence
2420    #[cfg(feature = "objc2-core-foundation")]
2421    pub fn OBEXAddTimeISOHeader(
2422        in_header_data: *const c_void,
2423        in_header_data_length: u32,
2424        dict_ref: Option<&CFMutableDictionary>,
2425    ) -> OBEXError;
2426}
2427
2428extern "C-unwind" {
2429    /// Add bytes of data to a dictionary of OBEXheaders.
2430    ///
2431    /// Parameter `inHeaderData`: Target header data.
2432    ///
2433    /// Parameter `inHeaderDataLength`: Length of Target header data.
2434    ///
2435    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2436    ///
2437    /// Returns: Error code, kOBEXSuccess (0) if success.
2438    ///
2439    /// Target header - OBEX Spec, 2.2.7: Byte Sequence
2440    #[cfg(feature = "objc2-core-foundation")]
2441    pub fn OBEXAddTargetHeader(
2442        in_header_data: *const c_void,
2443        in_header_data_length: u32,
2444        dict_ref: Option<&CFMutableDictionary>,
2445    ) -> OBEXError;
2446}
2447
2448extern "C-unwind" {
2449    /// Add bytes of data to a dictionary of OBEXheaders.
2450    ///
2451    /// Parameter `inHeaderData`: HTTP header data.
2452    ///
2453    /// Parameter `inHeaderDataLength`: Length of HTTP header data.
2454    ///
2455    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2456    ///
2457    /// Returns: Error code, kOBEXSuccess (0) if success.
2458    ///
2459    /// HTTP header - OBEX Spec, 2.2.8: Byte Sequence
2460    #[cfg(feature = "objc2-core-foundation")]
2461    pub fn OBEXAddHTTPHeader(
2462        in_header_data: *const c_void,
2463        in_header_data_length: u32,
2464        dict_ref: Option<&CFMutableDictionary>,
2465    ) -> OBEXError;
2466}
2467
2468/// Add bytes of data to a dictionary of OBEXheaders.
2469///
2470/// Parameter `inHeaderData`: Body header data.
2471///
2472/// Parameter `inHeaderDataLength`: Length of Body header data.
2473///
2474/// Parameter `isEndOfBody`: Set this flag if you want an end of body header instead of a body header.
2475///
2476/// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2477///
2478/// Returns: Error code, kOBEXSuccess (0) if success.
2479///
2480/// Body,EndOfBody headers - OBEX Spec, 2.2.9: Byte Sequence
2481#[cfg(feature = "objc2-core-foundation")]
2482#[inline]
2483pub unsafe extern "C-unwind" fn OBEXAddBodyHeader(
2484    in_header_data: *const c_void,
2485    in_header_data_length: u32,
2486    is_end_of_body: bool,
2487    dict_ref: Option<&CFMutableDictionary>,
2488) -> OBEXError {
2489    extern "C-unwind" {
2490        fn OBEXAddBodyHeader(
2491            in_header_data: *const c_void,
2492            in_header_data_length: u32,
2493            is_end_of_body: Boolean,
2494            dict_ref: Option<&CFMutableDictionary>,
2495        ) -> OBEXError;
2496    }
2497    unsafe {
2498        OBEXAddBodyHeader(
2499            in_header_data,
2500            in_header_data_length,
2501            is_end_of_body as _,
2502            dict_ref,
2503        )
2504    }
2505}
2506
2507extern "C-unwind" {
2508    /// Add bytes of data to a dictionary of OBEXheaders.
2509    ///
2510    /// Parameter `inHeaderData`: Who header data.
2511    ///
2512    /// Parameter `inHeaderDataLength`: Length of Who header data.
2513    ///
2514    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2515    ///
2516    /// Returns: Error code, kOBEXSuccess (0) if success.
2517    ///
2518    /// Who headers - OBEX Spec, 2.2.10: Byte Sequence
2519    #[cfg(feature = "objc2-core-foundation")]
2520    pub fn OBEXAddWhoHeader(
2521        in_header_data: *const c_void,
2522        in_header_data_length: u32,
2523        dict_ref: Option<&CFMutableDictionary>,
2524    ) -> OBEXError;
2525}
2526
2527extern "C-unwind" {
2528    /// Add bytes representing a connection ID to a dictionary of OBEX headers.
2529    ///
2530    /// Parameter `inHeaderData`: Connection ID data. Should be 4 bytes in length only.
2531    ///
2532    /// Parameter `inHeaderDataLength`: Length of Connection ID data. This should ONLY be set to equal 4.
2533    ///
2534    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2535    ///
2536    /// Returns: Error code, kOBEXSuccess (0) if success.
2537    ///
2538    /// ConnectionID headers - OBEX Spec, 2.2.10: Byte Sequence
2539    ///
2540    /// ** IMPORTANT NOTE: In bluetooth 1.0, using this function will allow you to pass in any value.
2541    /// You should not pass more than 4 bytes ever. In later releases, if the length
2542    /// passed is not 4, a kOBEXBadArgumentError error will be returned. ***
2543    #[cfg(feature = "objc2-core-foundation")]
2544    pub fn OBEXAddConnectionIDHeader(
2545        in_header_data: *const c_void,
2546        in_header_data_length: u32,
2547        dict_ref: Option<&CFMutableDictionary>,
2548    ) -> OBEXError;
2549}
2550
2551extern "C-unwind" {
2552    /// Add bytes representing an application parameter to a dictionary of OBEX headers.
2553    ///
2554    /// Parameter `inHeaderData`: Application parameter data - should be tag/length/value triplets.
2555    ///
2556    /// Parameter `inHeaderDataLength`: Length of application parameter data.
2557    ///
2558    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2559    ///
2560    /// Returns: Error code, kOBEXSuccess (0) if success.
2561    ///
2562    /// Application Request/Response Parameter headers - OBEX Spec, 2.2.11: Byte Sequence
2563    #[cfg(feature = "objc2-core-foundation")]
2564    pub fn OBEXAddApplicationParameterHeader(
2565        in_header_data: *const c_void,
2566        in_header_data_length: u32,
2567        dict_ref: Option<&CFMutableDictionary>,
2568    ) -> OBEXError;
2569}
2570
2571extern "C-unwind" {
2572    /// Add a byte sequence header to a dictionary of OBEXheaders.
2573    ///
2574    /// Parameter `inHeaderData`: bytes you want to put in the byte sequence header.
2575    ///
2576    /// Parameter `inHeaderDataLength`: length of the bytes you want to put in the byte sequence header.
2577    ///
2578    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2579    ///
2580    /// Returns: Error code, kOBEXSuccess (0) if success.
2581    ///
2582    /// Byte Sequence header - OBEX Spec, 2.2.5: Byte sequence. One thing of important note here - since we
2583    /// don't know what Header Identifier and length you intend to use here, you MUST include your own
2584    /// identifier and length in the data you pass. Thus, your data must be in this format:
2585    /// <
2586    /// 1:HI>
2587    /// <
2588    /// 2:LENGTH>
2589    /// <n
2590    /// :(
2591    /// <TAG
2592    /// >
2593    /// <LENGTH
2594    /// >
2595    /// <VALUE
2596    /// >)>
2597    /// Also, note that LENGTH = (3 + n), (1 for HI, 2 for the 2 bytes of length information, plus your n bytes of custom data).
2598    /// Be careful here to not mess up these values, as it could adversely affect the ability of the remote-device's headers parser.
2599    #[cfg(feature = "objc2-core-foundation")]
2600    pub fn OBEXAddByteSequenceHeader(
2601        in_header_data: *const c_void,
2602        in_header_data_length: u32,
2603        dict_ref: Option<&CFMutableDictionary>,
2604    ) -> OBEXError;
2605}
2606
2607extern "C-unwind" {
2608    /// Add an object class header to a dictionary of OBEXheaders.
2609    ///
2610    /// Parameter `inHeaderData`: bytes you want to put in the object class header.
2611    ///
2612    /// Parameter `inHeaderDataLength`: length of the bytes you want to put in the object class header.
2613    ///
2614    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2615    ///
2616    /// Returns: Error code, kOBEXSuccess (0) if success.
2617    ///
2618    /// Object Class header - OBEX Spec, 2.2.15: Byte sequence.
2619    #[cfg(feature = "objc2-core-foundation")]
2620    pub fn OBEXAddObjectClassHeader(
2621        in_header_data: *const c_void,
2622        in_header_data_length: u32,
2623        dict_ref: Option<&CFMutableDictionary>,
2624    ) -> OBEXError;
2625}
2626
2627extern "C-unwind" {
2628    /// Add an authorization challenge header to a dictionary of OBEXheaders.
2629    ///
2630    /// Parameter `inHeaderData`: bytes you want to put in the authorization challenge header.
2631    ///
2632    /// Parameter `inHeaderDataLength`: length of the bytes you want to put in authorization challenge header.
2633    ///
2634    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2635    ///
2636    /// Returns: Error code, kOBEXSuccess (0) if success.
2637    ///
2638    /// Authorization Challenge header - OBEX Spec, 2.2.13: Authorization Challenge.
2639    #[cfg(feature = "objc2-core-foundation")]
2640    pub fn OBEXAddAuthorizationChallengeHeader(
2641        in_header_data: *const c_void,
2642        in_header_data_length: u32,
2643        dict_ref: Option<&CFMutableDictionary>,
2644    ) -> OBEXError;
2645}
2646
2647extern "C-unwind" {
2648    /// Add an authorization Response header to a dictionary of OBEXheaders.
2649    ///
2650    /// Parameter `inHeaderData`: bytes you want to put in the authorization Response header.
2651    ///
2652    /// Parameter `inHeaderDataLength`: length of the bytes you want to put in authorization Response header.
2653    ///
2654    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2655    ///
2656    /// Returns: Error code, kOBEXSuccess (0) if success.
2657    ///
2658    /// Authorization Response header - OBEX Spec, 2.2.14: Authorization Response.
2659    #[cfg(feature = "objc2-core-foundation")]
2660    pub fn OBEXAddAuthorizationResponseHeader(
2661        in_header_data: *const c_void,
2662        in_header_data_length: u32,
2663        dict_ref: Option<&CFMutableDictionary>,
2664    ) -> OBEXError;
2665}
2666
2667extern "C-unwind" {
2668    /// Add a user-defined custom header to a dictionary of OBEXheaders.
2669    ///
2670    /// Parameter `inHeaderData`: bytes you want to put in the user-defined header.
2671    ///
2672    /// Parameter `inHeaderDataLength`: length of the bytes you want to put in user-defined header.
2673    ///
2674    /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2675    ///
2676    /// Returns: Error code, kOBEXSuccess (0) if success.
2677    ///
2678    /// User Defined header - OBEX Spec, 2.2.20: User Defined Headers.
2679    #[cfg(feature = "objc2-core-foundation")]
2680    pub fn OBEXAddUserDefinedHeader(
2681        in_header_data: *const c_void,
2682        in_header_data_length: u32,
2683        dict_ref: Option<&CFMutableDictionary>,
2684    ) -> OBEXError;
2685}