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 ///
1155 /// # Safety
1156 ///
1157 /// `in_session_ref` must be a valid pointer.
1158 #[deprecated]
1159 pub fn OBEXSessionDelete(in_session_ref: OBEXSessionRef) -> OBEXError;
1160}
1161
1162extern "C-unwind" {
1163 /// Allows you to test the session for an open OBEX connection for a particular session.
1164 ///
1165 /// Parameter `inSessionRef`: A valid session reference.
1166 ///
1167 /// Parameter `outIsConnected`: A valid ptr to an OBEXSessionRef; will contain the newly created session if return
1168 /// value is kOBEXSuccess.
1169 ///
1170 /// Returns: An error code value. 0 if successful.
1171 ///
1172 /// This method will return true only if (a) you are transport-connected to another OBEX target and
1173 /// (b) an OBEX Connect command has been issued and received successfully.
1174 ///
1175 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1176 /// ** You should transition your code to Objective-C equivalents.
1177 /// ** This API may be removed any time in the future.
1178 ///
1179 /// # Safety
1180 ///
1181 /// - `in_session_ref` must be a valid pointer.
1182 /// - `out_is_connected` must be a valid pointer.
1183 #[deprecated]
1184 pub fn OBEXSessionHasOpenOBEXConnection(
1185 in_session_ref: OBEXSessionRef,
1186 out_is_connected: *mut Boolean,
1187 ) -> OBEXError;
1188}
1189
1190extern "C-unwind" {
1191 /// Gets current max packet length.
1192 ///
1193 /// Parameter `inSessionRef`: A valid session reference.
1194 ///
1195 /// Parameter `outLength`: Max packet length.
1196 ///
1197 /// Returns: An error code value. 0 if successful.
1198 ///
1199 /// This value *could* change before and after a connect command has been sent or a connect
1200 /// command response has been received, since the recipient could negotiate a lower max packet size.
1201 ///
1202 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1203 /// ** You should transition your code to Objective-C equivalents.
1204 /// ** This API may be removed any time in the future.
1205 ///
1206 /// # Safety
1207 ///
1208 /// - `in_session_ref` must be a valid pointer.
1209 /// - `out_length` must be a valid pointer.
1210 #[deprecated]
1211 pub fn OBEXSessionGetMaxPacketLength(
1212 in_session_ref: OBEXSessionRef,
1213 out_length: *mut OBEXMaxPacketLength,
1214 ) -> OBEXError;
1215}
1216
1217extern "C-unwind" {
1218 /// Gets space available for your data for a particular command you are trying to send.
1219 ///
1220 /// Parameter `inSessionRef`: A valid session reference.
1221 ///
1222 /// Parameter `inOpCode`: An opcode of what command you are trying to send.
1223 ///
1224 /// Parameter `outLength`: Space available for your header data in the payload area for a particular command.
1225 ///
1226 /// Returns: An error code value. 0 if successful.
1227 ///
1228 /// The OBEXSession takes care of packaging OBEX opcodes and other information into the proper packet format,
1229 /// allowing you to focus on sending the proper OBEX headers in your commands and command responses. This formatting
1230 /// and datas requires a small bit of information that varies depending on what command or response you are
1231 /// sending. Thus, you should call this function to find out how much space will be left for your headers
1232 /// before you send the command, allowing you to properly chop up your headers before sending them. This will
1233 /// guarantee that (a) you use up all the available space in a packet and (b) that you do not get an error
1234 /// trying to send too much information at once.
1235 ///
1236 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1237 /// ** You should transition your code to Objective-C equivalents.
1238 /// ** This API may be removed any time in the future.
1239 ///
1240 /// # Safety
1241 ///
1242 /// - `in_session_ref` must be a valid pointer.
1243 /// - `out_length` must be a valid pointer.
1244 #[deprecated]
1245 pub fn OBEXSessionGetAvailableCommandPayloadLength(
1246 in_session_ref: OBEXSessionRef,
1247 in_op_code: OBEXOpCode,
1248 out_length: *mut OBEXMaxPacketLength,
1249 ) -> OBEXError;
1250}
1251
1252extern "C-unwind" {
1253 /// Gets space available for your data for a particular command response you are trying to send.
1254 ///
1255 /// Parameter `inSessionRef`: A valid session reference.
1256 ///
1257 /// Parameter `inOpCode`: A command opcode that you are responding to. For example, if you receiving a Put command,
1258 /// and want to send back a "bad request" response, you should still pass in the Put command
1259 /// opcode for that response.
1260 ///
1261 /// Parameter `outLength`: Space available for your header data in the payload area for a particular command.
1262 ///
1263 /// Returns: An error code value. 0 if successful.
1264 ///
1265 /// The OBEXSession takes care of packaging OBEX opcodes and other information into the proper packet format,
1266 /// allowing you to focus on sending the proper OBEX headers in your commands and command responses. This formatting
1267 /// and datas requires a small bit of information that varies depending on what command or response you are
1268 /// sending. Thus, you should call this function to find out how much space will be left for your headers
1269 /// before you send the command, allowing you to properly chop up your headers before sending them. This will
1270 /// guarantee that (a) you use up all the available space in a packet and (b) that you do not get an error
1271 /// trying to send too much information at once.
1272 ///
1273 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1274 /// ** You should transition your code to Objective-C equivalents.
1275 /// ** This API may be removed any time in the future.
1276 ///
1277 /// # Safety
1278 ///
1279 /// - `in_session_ref` must be a valid pointer.
1280 /// - `out_length` must be a valid pointer.
1281 #[deprecated]
1282 pub fn OBEXSessionGetAvailableCommandResponsePayloadLength(
1283 in_session_ref: OBEXSessionRef,
1284 in_op_code: OBEXOpCode,
1285 out_length: *mut OBEXMaxPacketLength,
1286 ) -> OBEXError;
1287}
1288
1289extern "C-unwind" {
1290 /// Establishes an OBEX connection to the target device for the session. If a transport connection is not
1291 /// open yet, it will be opened if possible.
1292 ///
1293 /// Parameter `inSessionRef`: A valid session reference.
1294 ///
1295 /// Parameter `inFlags`: Flags, as defined in the OBEX spec for this command.
1296 ///
1297 /// Parameter `inMaxPacketLength`: Maximum packet length you wish to allow. May be negiotiated with host to be less
1298 /// or more than you specify.
1299 ///
1300 /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1301 /// pointer until you callback is called with a success.
1302 ///
1303 /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1304 ///
1305 /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1306 ///
1307 /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1308 /// callback just as you passed it.
1309 ///
1310 /// Returns: An error code value. 0 if successful.
1311 ///
1312 /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback parameter will
1313 /// result in an error. If you have already established an OBEX connection and you call this again you will
1314 /// get an 'kOBEXSessionAlreadyConnectedError' as a result.
1315 ///
1316 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1317 /// ** You should transition your code to Objective-C equivalents.
1318 /// ** This API may be removed any time in the future.
1319 ///
1320 /// # Safety
1321 ///
1322 /// - `in_session_ref` must be a valid pointer.
1323 /// - `in_optional_headers` must be a valid pointer.
1324 /// - `in_callback` must be implemented correctly.
1325 /// - `in_user_ref_con` must be a valid pointer.
1326 #[deprecated]
1327 pub fn OBEXSessionConnect(
1328 in_session_ref: OBEXSessionRef,
1329 in_flags: OBEXFlags,
1330 in_max_packet_length: OBEXMaxPacketLength,
1331 in_optional_headers: *mut c_void,
1332 in_optional_headers_length: usize,
1333 in_callback: OBEXSessionEventCallback,
1334 in_user_ref_con: *mut c_void,
1335 ) -> OBEXError;
1336}
1337
1338extern "C-unwind" {
1339 /// Send a disconnect command to a remote OBEX server.
1340 ///
1341 /// Parameter `inSessionRef`: A valid session reference.
1342 ///
1343 /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1344 /// pointer until you callback is called with a success.
1345 ///
1346 /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1347 ///
1348 /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1349 ///
1350 /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1351 /// callback just as you passed it.
1352 ///
1353 /// Returns: An error code value. 0 if successful.
1354 ///
1355 /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1356 /// result in an error.
1357 ///
1358 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1359 /// ** You should transition your code to Objective-C equivalents.
1360 /// ** This API may be removed any time in the future.
1361 ///
1362 /// # Safety
1363 ///
1364 /// - `in_session_ref` must be a valid pointer.
1365 /// - `in_optional_headers` must be a valid pointer.
1366 /// - `in_callback` must be implemented correctly.
1367 /// - `in_user_ref_con` must be a valid pointer.
1368 #[deprecated]
1369 pub fn OBEXSessionDisconnect(
1370 in_session_ref: OBEXSessionRef,
1371 in_optional_headers: *mut c_void,
1372 in_optional_headers_length: usize,
1373 in_callback: OBEXSessionEventCallback,
1374 in_user_ref_con: *mut c_void,
1375 ) -> OBEXError;
1376}
1377
1378/// Send a put command to a remote OBEX server.
1379///
1380/// Parameter `inSessionRef`: A valid session reference.
1381///
1382/// Parameter `inIsFinalChunk`: TRUE or FALSE - is this the last chunk of header data for this PUT.
1383///
1384/// Parameter `inHeadersData`: Headers containing data to PUT. Don't include your body header data here.
1385///
1386/// Parameter `inHeadersDataLength`: Size of header data. Don't include your body header data here.
1387///
1388/// Parameter `inBodyData`: Data for the BODY header to PUT. DO NOT package your data in an actual BODY header,
1389/// this will be done for you, based on the finalChunk flag you pass in above (since based on
1390/// this flag the header ID will be either a BODY or ENDOFBODY header).
1391///
1392/// Parameter `inBodyDataLength`: Size of Data for the BODY header to PUT.
1393///
1394/// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1395///
1396/// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your callback
1397/// just as you passed it.
1398///
1399/// Returns: An error code value. 0 if successful.
1400///
1401/// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1402/// result in an error.
1403///
1404/// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1405/// ** You should transition your code to Objective-C equivalents.
1406/// ** This API may be removed any time in the future.
1407///
1408/// # Safety
1409///
1410/// - `in_session_ref` must be a valid pointer.
1411/// - `in_headers_data` must be a valid pointer.
1412/// - `in_body_data` must be a valid pointer.
1413/// - `in_callback` must be implemented correctly.
1414/// - `in_user_ref_con` must be a valid pointer.
1415#[deprecated]
1416#[inline]
1417pub unsafe extern "C-unwind" fn OBEXSessionPut(
1418 in_session_ref: OBEXSessionRef,
1419 in_is_final_chunk: bool,
1420 in_headers_data: *mut c_void,
1421 in_headers_data_length: usize,
1422 in_body_data: *mut c_void,
1423 in_body_data_length: usize,
1424 in_callback: OBEXSessionEventCallback,
1425 in_user_ref_con: *mut c_void,
1426) -> OBEXError {
1427 extern "C-unwind" {
1428 fn OBEXSessionPut(
1429 in_session_ref: OBEXSessionRef,
1430 in_is_final_chunk: Boolean,
1431 in_headers_data: *mut c_void,
1432 in_headers_data_length: usize,
1433 in_body_data: *mut c_void,
1434 in_body_data_length: usize,
1435 in_callback: OBEXSessionEventCallback,
1436 in_user_ref_con: *mut c_void,
1437 ) -> OBEXError;
1438 }
1439 unsafe {
1440 OBEXSessionPut(
1441 in_session_ref,
1442 in_is_final_chunk as _,
1443 in_headers_data,
1444 in_headers_data_length,
1445 in_body_data,
1446 in_body_data_length,
1447 in_callback,
1448 in_user_ref_con,
1449 )
1450 }
1451}
1452
1453/// Send a get command to a remote OBEX server.
1454///
1455/// Parameter `inSessionRef`: A valid session reference.
1456///
1457/// Parameter `inIsFinalChunk`: TRUE or FALSE - is this the last chunk of header data for this GET.
1458///
1459/// Parameter `inHeadersData`: Headers containing data to GET.
1460///
1461/// Parameter `inHeadersDataLength`: Size of header data.
1462///
1463/// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1464///
1465/// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your callback
1466/// just as you passed it.
1467///
1468/// Returns: An error code value. 0 if successful.
1469///
1470/// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1471/// result in an error.
1472///
1473/// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1474/// ** You should transition your code to Objective-C equivalents.
1475/// ** This API may be removed any time in the future.
1476///
1477/// # Safety
1478///
1479/// - `in_session_ref` must be a valid pointer.
1480/// - `in_headers_data` must be a valid pointer.
1481/// - `in_callback` must be implemented correctly.
1482/// - `in_user_ref_con` must be a valid pointer.
1483#[deprecated]
1484#[inline]
1485pub unsafe extern "C-unwind" fn OBEXSessionGet(
1486 in_session_ref: OBEXSessionRef,
1487 in_is_final_chunk: bool,
1488 in_headers_data: *mut c_void,
1489 in_headers_data_length: usize,
1490 in_callback: OBEXSessionEventCallback,
1491 in_user_ref_con: *mut c_void,
1492) -> OBEXError {
1493 extern "C-unwind" {
1494 fn OBEXSessionGet(
1495 in_session_ref: OBEXSessionRef,
1496 in_is_final_chunk: Boolean,
1497 in_headers_data: *mut c_void,
1498 in_headers_data_length: usize,
1499 in_callback: OBEXSessionEventCallback,
1500 in_user_ref_con: *mut c_void,
1501 ) -> OBEXError;
1502 }
1503 unsafe {
1504 OBEXSessionGet(
1505 in_session_ref,
1506 in_is_final_chunk as _,
1507 in_headers_data,
1508 in_headers_data_length,
1509 in_callback,
1510 in_user_ref_con,
1511 )
1512 }
1513}
1514
1515extern "C-unwind" {
1516 /// Send an abort command to a remote OBEX server.
1517 ///
1518 /// Parameter `inSessionRef`: A valid session reference.
1519 ///
1520 /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1521 /// pointer until you callback is called with a success.
1522 ///
1523 /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1524 ///
1525 /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1526 ///
1527 /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1528 /// callback just as you passed it.
1529 ///
1530 /// Returns: An error code value. 0 if successful.
1531 ///
1532 /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1533 /// result in an error.
1534 ///
1535 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1536 /// ** You should transition your code to Objective-C equivalents.
1537 /// ** This API may be removed any time in the future.
1538 ///
1539 /// # Safety
1540 ///
1541 /// - `in_session_ref` must be a valid pointer.
1542 /// - `in_optional_headers` must be a valid pointer.
1543 /// - `in_callback` must be implemented correctly.
1544 /// - `in_user_ref_con` must be a valid pointer.
1545 #[deprecated]
1546 pub fn OBEXSessionAbort(
1547 in_session_ref: OBEXSessionRef,
1548 in_optional_headers: *mut c_void,
1549 in_optional_headers_length: usize,
1550 in_callback: OBEXSessionEventCallback,
1551 in_user_ref_con: *mut c_void,
1552 ) -> OBEXError;
1553}
1554
1555extern "C-unwind" {
1556 /// Send a set path command to a remote OBEX server.
1557 ///
1558 /// Parameter `inSessionRef`: A valid session reference.
1559 ///
1560 /// Parameter `inFlags`: Flags, as defined in the OBEX spec for this command.
1561 ///
1562 /// Parameter `inConstants`: Constants, as defined in the OBEX spec for this command.
1563 ///
1564 /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1565 /// pointer until you callback is called with a success.
1566 ///
1567 /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1568 ///
1569 /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1570 ///
1571 /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1572 /// callback just as you passed it.
1573 ///
1574 /// Returns: An error code value. 0 if successful.
1575 ///
1576 /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1577 /// result in an error.
1578 ///
1579 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1580 /// ** You should transition your code to Objective-C equivalents.
1581 /// ** This API may be removed any time in the future.
1582 ///
1583 /// # Safety
1584 ///
1585 /// - `in_session_ref` must be a valid pointer.
1586 /// - `in_optional_headers` must be a valid pointer.
1587 /// - `in_callback` must be implemented correctly.
1588 /// - `in_user_ref_con` must be a valid pointer.
1589 #[deprecated]
1590 pub fn OBEXSessionSetPath(
1591 in_session_ref: OBEXSessionRef,
1592 in_flags: OBEXFlags,
1593 in_constants: OBEXConstants,
1594 in_optional_headers: *mut c_void,
1595 in_optional_headers_length: usize,
1596 in_callback: OBEXSessionEventCallback,
1597 in_user_ref_con: *mut c_void,
1598 ) -> OBEXError;
1599}
1600
1601extern "C-unwind" {
1602 /// Send a response to a connect command to the remote client.
1603 ///
1604 /// Parameter `inSessionRef`: A valid session reference.
1605 ///
1606 /// Parameter `inResponseOpCode`: What response code you want to send to the remote client.
1607 ///
1608 /// Parameter `inFlags`: Flags, as defined in the OBEX spec for this command.
1609 ///
1610 /// Parameter `inMaxPacketLength`: Max packet length you want to support. Must be smaller or equal to the max packet
1611 /// length specified by the remote client.
1612 ///
1613 /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1614 /// pointer until you callback is called with a success.
1615 ///
1616 /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1617 ///
1618 /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1619 ///
1620 /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1621 /// callback just as you passed it.
1622 ///
1623 /// Returns: An error code value. 0 if successful.
1624 ///
1625 /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1626 /// result in an error.
1627 ///
1628 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1629 /// ** You should transition your code to Objective-C equivalents.
1630 /// ** This API may be removed any time in the future.
1631 ///
1632 /// # Safety
1633 ///
1634 /// - `in_session_ref` must be a valid pointer.
1635 /// - `in_optional_headers` must be a valid pointer.
1636 /// - `in_callback` must be implemented correctly.
1637 /// - `in_user_ref_con` must be a valid pointer.
1638 #[deprecated]
1639 pub fn OBEXSessionConnectResponse(
1640 in_session_ref: OBEXSessionRef,
1641 in_response_op_code: OBEXOpCode,
1642 in_flags: OBEXFlags,
1643 in_max_packet_length: OBEXMaxPacketLength,
1644 in_optional_headers: *mut c_void,
1645 in_optional_headers_length: usize,
1646 in_callback: OBEXSessionEventCallback,
1647 in_user_ref_con: *mut c_void,
1648 ) -> OBEXError;
1649}
1650
1651extern "C-unwind" {
1652 /// Send a response to a disconnect command to the remote client.
1653 ///
1654 /// Parameter `inSessionRef`: A valid session reference.
1655 ///
1656 /// Parameter `inResponseOpCode`: What response code you want to send to the remote client.
1657 ///
1658 /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1659 /// pointer until you callback is called with a success.
1660 ///
1661 /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1662 ///
1663 /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1664 ///
1665 /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1666 /// callback just as you passed it.
1667 ///
1668 /// Returns: An error code value. 0 if successful.
1669 ///
1670 /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1671 /// result in an error.
1672 ///
1673 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1674 /// ** You should transition your code to Objective-C equivalents.
1675 /// ** This API may be removed any time in the future.
1676 ///
1677 /// # Safety
1678 ///
1679 /// - `in_session_ref` must be a valid pointer.
1680 /// - `in_optional_headers` must be a valid pointer.
1681 /// - `in_callback` must be implemented correctly.
1682 /// - `in_user_ref_con` must be a valid pointer.
1683 #[deprecated]
1684 pub fn OBEXSessionDisconnectResponse(
1685 in_session_ref: OBEXSessionRef,
1686 in_response_op_code: OBEXOpCode,
1687 in_optional_headers: *mut c_void,
1688 in_optional_headers_length: usize,
1689 in_callback: OBEXSessionEventCallback,
1690 in_user_ref_con: *mut c_void,
1691 ) -> OBEXError;
1692}
1693
1694extern "C-unwind" {
1695 /// Send a response to a get command to the remote client.
1696 ///
1697 /// Parameter `inSessionRef`: A valid session reference.
1698 ///
1699 /// Parameter `inResponseOpCode`: What response code you want to send to the remote client.
1700 ///
1701 /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1702 /// pointer until you callback is called with a success.
1703 ///
1704 /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1705 ///
1706 /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1707 ///
1708 /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1709 /// callback just as you passed it.
1710 ///
1711 /// Returns: An error code value. 0 if successful.
1712 ///
1713 /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1714 /// result in an error.
1715 ///
1716 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1717 /// ** You should transition your code to Objective-C equivalents.
1718 /// ** This API may be removed any time in the future.
1719 ///
1720 /// # Safety
1721 ///
1722 /// - `in_session_ref` must be a valid pointer.
1723 /// - `in_optional_headers` must be a valid pointer.
1724 /// - `in_callback` must be implemented correctly.
1725 /// - `in_user_ref_con` must be a valid pointer.
1726 #[deprecated]
1727 pub fn OBEXSessionGetResponse(
1728 in_session_ref: OBEXSessionRef,
1729 in_response_op_code: OBEXOpCode,
1730 in_optional_headers: *mut c_void,
1731 in_optional_headers_length: usize,
1732 in_callback: OBEXSessionEventCallback,
1733 in_user_ref_con: *mut c_void,
1734 ) -> OBEXError;
1735}
1736
1737extern "C-unwind" {
1738 /// Send a response to a put command to the remote client.
1739 ///
1740 /// Parameter `inSessionRef`: A valid session reference.
1741 ///
1742 /// Parameter `inResponseOpCode`: What response code you want to send to the remote client.
1743 ///
1744 /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1745 /// pointer until you callback is called with a success.
1746 ///
1747 /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1748 ///
1749 /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1750 ///
1751 /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1752 /// callback just as you passed it.
1753 ///
1754 /// Returns: An error code value. 0 if successful.
1755 ///
1756 /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1757 /// result in an error.
1758 ///
1759 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1760 /// ** You should transition your code to Objective-C equivalents.
1761 /// ** This API may be removed any time in the future.
1762 ///
1763 /// # Safety
1764 ///
1765 /// - `in_session_ref` must be a valid pointer.
1766 /// - `in_optional_headers` must be a valid pointer.
1767 /// - `in_callback` must be implemented correctly.
1768 /// - `in_user_ref_con` must be a valid pointer.
1769 #[deprecated]
1770 pub fn OBEXSessionPutResponse(
1771 in_session_ref: OBEXSessionRef,
1772 in_response_op_code: OBEXOpCode,
1773 in_optional_headers: *mut c_void,
1774 in_optional_headers_length: usize,
1775 in_callback: OBEXSessionEventCallback,
1776 in_user_ref_con: *mut c_void,
1777 ) -> OBEXError;
1778}
1779
1780extern "C-unwind" {
1781 /// Send a response to a abort command to the remote client.
1782 ///
1783 /// Parameter `inSessionRef`: A valid session reference.
1784 ///
1785 /// Parameter `inResponseOpCode`: What response code you want to send to the remote client.
1786 ///
1787 /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1788 /// pointer until you callback is called with a success.
1789 ///
1790 /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1791 ///
1792 /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1793 ///
1794 /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1795 /// callback just as you passed it.
1796 ///
1797 /// Returns: An error code value. 0 if successful.
1798 ///
1799 /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1800 /// result in an error.
1801 ///
1802 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1803 /// ** You should transition your code to Objective-C equivalents.
1804 /// ** This API may be removed any time in the future.
1805 ///
1806 /// # Safety
1807 ///
1808 /// - `in_session_ref` must be a valid pointer.
1809 /// - `in_optional_headers` must be a valid pointer.
1810 /// - `in_callback` must be implemented correctly.
1811 /// - `in_user_ref_con` must be a valid pointer.
1812 #[deprecated]
1813 pub fn OBEXSessionAbortResponse(
1814 in_session_ref: OBEXSessionRef,
1815 in_response_op_code: OBEXOpCode,
1816 in_optional_headers: *mut c_void,
1817 in_optional_headers_length: usize,
1818 in_callback: OBEXSessionEventCallback,
1819 in_user_ref_con: *mut c_void,
1820 ) -> OBEXError;
1821}
1822
1823extern "C-unwind" {
1824 /// Send a response to a set path command to the remote client.
1825 ///
1826 /// Parameter `inSessionRef`: A valid session reference.
1827 ///
1828 /// Parameter `inResponseOpCode`: What response code you want to send to the remote client.
1829 ///
1830 /// Parameter `inOptionalHeaders`: Ptr to optional headers you can supply to the command. DO NOT dispose of this
1831 /// pointer until you callback is called with a success.
1832 ///
1833 /// Parameter `inOptionalHeadersLength`: Size of data at the specified ptr.
1834 ///
1835 /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion.
1836 ///
1837 /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1838 /// callback just as you passed it.
1839 ///
1840 /// Returns: An error code value. 0 if successful.
1841 ///
1842 /// As all commands for OBEX sessions, this command is asynchronous only. A NULL callback paramter will
1843 /// result in an error.
1844 ///
1845 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1846 /// ** You should transition your code to Objective-C equivalents.
1847 /// ** This API may be removed any time in the future.
1848 ///
1849 /// # Safety
1850 ///
1851 /// - `in_session_ref` must be a valid pointer.
1852 /// - `in_optional_headers` must be a valid pointer.
1853 /// - `in_callback` must be implemented correctly.
1854 /// - `in_user_ref_con` must be a valid pointer.
1855 #[deprecated]
1856 pub fn OBEXSessionSetPathResponse(
1857 in_session_ref: OBEXSessionRef,
1858 in_response_op_code: OBEXOpCode,
1859 in_optional_headers: *mut c_void,
1860 in_optional_headers_length: usize,
1861 in_callback: OBEXSessionEventCallback,
1862 in_user_ref_con: *mut c_void,
1863 ) -> OBEXError;
1864}
1865
1866extern "C-unwind" {
1867 /// Parameter `inSessionRef`: A valid session reference.
1868 ///
1869 /// Parameter `inCallback`: A valid callback. Will be called for progress, errors and completion by server
1870 /// sessions only.
1871 ///
1872 /// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
1873 /// callback just as you passed it.
1874 ///
1875 /// Returns: An error code value. 0 if successful.
1876 ///
1877 /// Sets callback to be used when an event occurs on an OBEXSession. This is important for OBEX servers, as you
1878 /// will need a way to be called back when the first command is sent to you. So, be sure to set yourself
1879 /// up to listen for events when you are ready to receive them.
1880 ///
1881 /// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1882 /// ** You should transition your code to Objective-C equivalents.
1883 /// ** This API may be removed any time in the future.
1884 ///
1885 /// # Safety
1886 ///
1887 /// - `in_session_ref` must be a valid pointer.
1888 /// - `in_callback` must be implemented correctly.
1889 /// - `in_user_ref_con` must be a valid pointer.
1890 #[deprecated]
1891 pub fn OBEXSessionSetServerCallback(
1892 in_session_ref: OBEXSessionRef,
1893 in_callback: OBEXSessionEventCallback,
1894 in_user_ref_con: *mut c_void,
1895 ) -> OBEXError;
1896}
1897
1898/// Creates a formatted vCard, ready to be sent over OBEX or whatever.
1899///
1900/// Parameter `inNameCharset`: A pointer to the charset data used for the name. Pass in a #defined charset
1901/// for ease of use.
1902///
1903/// Parameter `inNameCharsetLength`: Length of name charset assed in above.
1904///
1905/// Parameter `inFirstName`: Pointer to data with Person's first name.
1906///
1907/// Parameter `inFirstNameLength`: Length of Person's first name passed in above.
1908///
1909/// Parameter `inLastName`: Pointer to data with Person's last name.
1910///
1911/// Parameter `inLastNameLength`: Length of Person's last name passed in above.
1912///
1913/// Parameter `inFriendlyName`: Pointer to data with Person's Friendly name.
1914///
1915/// Parameter `inFriendlyNameLength`: Length of Person's Friendly name passed in above.
1916///
1917/// Parameter `inHomePhone`: Pointer to data with Person's Home phone number.
1918///
1919/// Parameter `inHomePhoneLength`: Length of Person's Home phone number passed in above.
1920///
1921/// Parameter `inWorkPhone`: Work phone number.
1922///
1923/// Parameter `inWorkPhoneLength`: Length of Person's Work phone number passed in above.
1924///
1925/// Parameter `inCellPhone`: Cell phone number.
1926///
1927/// Parameter `inCellPhoneLength`: Length of Person's Cell phone number passed in above.
1928///
1929/// Parameter `inFaxPhone`: Fax phone number.
1930///
1931/// Parameter `inFaxPhoneLength`: Length of Person's Fax phone number passed in above.
1932///
1933/// Parameter `inEMailAddress`: EMailAddress of person.
1934///
1935/// Parameter `inEMailAddressLength`: Length of Person's EMailAddress passed in above.
1936///
1937/// Parameter `inEMailAddressCharset`: Charset of EMailAddress of person.
1938///
1939/// Parameter `inEMailAddressCharsetLength`: Length of Person's EMailAddress charset passed in above.
1940///
1941/// Parameter `inOrganization`: Pointer to Organization/business data.
1942///
1943/// Parameter `inOrganizationLength`: Length of Organization/business data.
1944///
1945/// Parameter `inOrganizationCharset`: Pointer to the charset the Organization/business is in.
1946///
1947/// Parameter `inOrganizationCharsetLength`: Length of data for the Organization/business charset.
1948///
1949/// Parameter `inTitle`: Pointer to data with Title of person in biz/org.
1950///
1951/// Parameter `inTitleLength`: Length of Title of person in biz/org.
1952///
1953/// Parameter `inTitleCharset`: Pointer to the charset the Title is in.
1954///
1955/// Parameter `inTitleCharsetLength`: Length of data for the Title charset.
1956///
1957/// Returns: An CFDataRef containing the compiled data. nil if we failed.
1958///
1959/// All parameters are optional. The CFDataRef returned to you is NOT retained. Retain it if you want to keep it.
1960///
1961/// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
1962/// ** You should transition your code to Objective-C equivalents.
1963/// ** This API may be removed any time in the future.
1964///
1965/// # Safety
1966///
1967/// - `in_first_name` must be a valid pointer.
1968/// - `in_last_name` must be a valid pointer.
1969/// - `in_friendly_name` must be a valid pointer.
1970/// - `in_name_charset` must be a valid pointer.
1971/// - `in_home_phone` must be a valid pointer.
1972/// - `in_work_phone` must be a valid pointer.
1973/// - `in_cell_phone` must be a valid pointer.
1974/// - `in_fax_phone` must be a valid pointer.
1975/// - `in_e_mail_address` must be a valid pointer.
1976/// - `in_e_mail_address_charset` must be a valid pointer.
1977/// - `in_organization` must be a valid pointer.
1978/// - `in_organization_charset` must be a valid pointer.
1979/// - `in_title` must be a valid pointer.
1980/// - `in_title_charset` must be a valid pointer.
1981#[cfg(feature = "objc2-core-foundation")]
1982#[deprecated]
1983#[inline]
1984pub unsafe extern "C-unwind" fn OBEXCreateVCard(
1985 in_first_name: *const c_void,
1986 in_first_name_length: u32,
1987 in_last_name: *const c_void,
1988 in_last_name_length: u32,
1989 in_friendly_name: *const c_void,
1990 in_friendly_name_length: u32,
1991 in_name_charset: *const c_void,
1992 in_name_charset_length: u32,
1993 in_home_phone: *const c_void,
1994 in_home_phone_length: u32,
1995 in_work_phone: *const c_void,
1996 in_work_phone_length: u32,
1997 in_cell_phone: *const c_void,
1998 in_cell_phone_length: u32,
1999 in_fax_phone: *const c_void,
2000 in_fax_phone_length: u32,
2001 in_e_mail_address: *const c_void,
2002 in_e_mail_address_length: u32,
2003 in_e_mail_address_charset: *const c_void,
2004 in_e_mail_address_charset_length: u32,
2005 in_organization: *const c_void,
2006 in_organization_length: u32,
2007 in_organization_charset: *const c_void,
2008 in_organization_charset_length: u32,
2009 in_title: *const c_void,
2010 in_title_length: u32,
2011 in_title_charset: *const c_void,
2012 in_title_charset_length: u32,
2013) -> Option<CFRetained<CFData>> {
2014 extern "C-unwind" {
2015 fn OBEXCreateVCard(
2016 in_first_name: *const c_void,
2017 in_first_name_length: u32,
2018 in_last_name: *const c_void,
2019 in_last_name_length: u32,
2020 in_friendly_name: *const c_void,
2021 in_friendly_name_length: u32,
2022 in_name_charset: *const c_void,
2023 in_name_charset_length: u32,
2024 in_home_phone: *const c_void,
2025 in_home_phone_length: u32,
2026 in_work_phone: *const c_void,
2027 in_work_phone_length: u32,
2028 in_cell_phone: *const c_void,
2029 in_cell_phone_length: u32,
2030 in_fax_phone: *const c_void,
2031 in_fax_phone_length: u32,
2032 in_e_mail_address: *const c_void,
2033 in_e_mail_address_length: u32,
2034 in_e_mail_address_charset: *const c_void,
2035 in_e_mail_address_charset_length: u32,
2036 in_organization: *const c_void,
2037 in_organization_length: u32,
2038 in_organization_charset: *const c_void,
2039 in_organization_charset_length: u32,
2040 in_title: *const c_void,
2041 in_title_length: u32,
2042 in_title_charset: *const c_void,
2043 in_title_charset_length: u32,
2044 ) -> Option<NonNull<CFData>>;
2045 }
2046 let ret = unsafe {
2047 OBEXCreateVCard(
2048 in_first_name,
2049 in_first_name_length,
2050 in_last_name,
2051 in_last_name_length,
2052 in_friendly_name,
2053 in_friendly_name_length,
2054 in_name_charset,
2055 in_name_charset_length,
2056 in_home_phone,
2057 in_home_phone_length,
2058 in_work_phone,
2059 in_work_phone_length,
2060 in_cell_phone,
2061 in_cell_phone_length,
2062 in_fax_phone,
2063 in_fax_phone_length,
2064 in_e_mail_address,
2065 in_e_mail_address_length,
2066 in_e_mail_address_charset,
2067 in_e_mail_address_charset_length,
2068 in_organization,
2069 in_organization_length,
2070 in_organization_charset,
2071 in_organization_charset_length,
2072 in_title,
2073 in_title_length,
2074 in_title_charset,
2075 in_title_charset_length,
2076 )
2077 };
2078 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2079}
2080
2081/// Creates a formatted vEvent, ready to be sent over OBEX or whatever. You probably will embed the output
2082/// in a vCalendar event.
2083///
2084/// Parameter `inCharset`: The Charset the passed data is in. Pass in a #defined charset for ease of use.
2085///
2086/// Parameter `inCharsetLength`: The length of the Charset passed data.
2087///
2088/// Parameter `inEncoding`: The encoding of the summary and location fields.
2089///
2090/// Parameter `inEncodingLength`: The length of the Charset passed data.
2091///
2092/// 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.
2093///
2094/// Parameter `inEventStartDateLength`: The length of the Charset passed data.
2095///
2096/// Parameter `inEventEndDate`: End of event date.
2097///
2098/// Parameter `inEventEndDateLength`: The length of the Charset passed data.
2099///
2100/// Parameter `inAlarmDate`: Date of Alarm for event, in the format: YYYYMMDDTHHMMSS.
2101///
2102/// Parameter `inAlarmDateLength`: The length of the Charset passed data.
2103///
2104/// Parameter `inCategory`: Category of event, such as "MEETING" or "PHONE CALL".
2105///
2106/// Parameter `inCategoryLength`: The length of the Charset passed data.
2107///
2108/// Parameter `inSummary`: Summary of event. Max length is 36 bytes. Longer will result in a bad argument error.
2109///
2110/// Parameter `inSummaryLength`: The length of the Charset passed data.
2111///
2112/// Parameter `inLocation`: Summary of event. Max length is 20 bytes. Longer will result in a bad argument error.
2113///
2114/// Parameter `inLocationLength`: The length of the Charset passed data.
2115///
2116/// Parameter `inXIRMCLUID`: The IRMC Local Unique Identifier Label, max length 12 bytes. Longer will result in
2117/// a bad argument error.
2118///
2119/// Parameter `inXIRMCLUIDLength`: The length of the Charset passed data.
2120///
2121/// Returns: A valid CFDataRef - nil if we failed.
2122///
2123/// All parameters are optional. The CFDataRef returned to you is NOT retained. Retain it if you want to keep it.
2124/// Be aware that certain devices such as Ericsson phones MUST have certain fields, such as a start and end date.
2125///
2126/// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
2127/// ** You should transition your code to Objective-C equivalents.
2128/// ** This API may be removed any time in the future.
2129///
2130/// # Safety
2131///
2132/// - `in_charset` must be a valid pointer.
2133/// - `in_encoding` must be a valid pointer.
2134/// - `in_event_start_date` must be a valid pointer.
2135/// - `in_event_end_date` must be a valid pointer.
2136/// - `in_alarm_date` must be a valid pointer.
2137/// - `in_category` must be a valid pointer.
2138/// - `in_summary` must be a valid pointer.
2139/// - `in_location` must be a valid pointer.
2140/// - `in_xirmcluid` must be a valid pointer.
2141#[cfg(feature = "objc2-core-foundation")]
2142#[deprecated]
2143#[inline]
2144pub unsafe extern "C-unwind" fn OBEXCreateVEvent(
2145 in_charset: *const c_char,
2146 in_charset_length: u32,
2147 in_encoding: *const c_char,
2148 in_encoding_length: u32,
2149 in_event_start_date: *const c_char,
2150 in_event_start_date_length: u32,
2151 in_event_end_date: *const c_char,
2152 in_event_end_date_length: u32,
2153 in_alarm_date: *const c_char,
2154 in_alarm_date_length: u32,
2155 in_category: *const c_char,
2156 in_category_length: u32,
2157 in_summary: *const c_char,
2158 in_summary_length: u32,
2159 in_location: *const c_char,
2160 in_location_length: u32,
2161 in_xirmcluid: *const c_char,
2162 in_xirmcluid_length: u32,
2163) -> Option<CFRetained<CFData>> {
2164 extern "C-unwind" {
2165 fn OBEXCreateVEvent(
2166 in_charset: *const c_char,
2167 in_charset_length: u32,
2168 in_encoding: *const c_char,
2169 in_encoding_length: u32,
2170 in_event_start_date: *const c_char,
2171 in_event_start_date_length: u32,
2172 in_event_end_date: *const c_char,
2173 in_event_end_date_length: u32,
2174 in_alarm_date: *const c_char,
2175 in_alarm_date_length: u32,
2176 in_category: *const c_char,
2177 in_category_length: u32,
2178 in_summary: *const c_char,
2179 in_summary_length: u32,
2180 in_location: *const c_char,
2181 in_location_length: u32,
2182 in_xirmcluid: *const c_char,
2183 in_xirmcluid_length: u32,
2184 ) -> Option<NonNull<CFData>>;
2185 }
2186 let ret = unsafe {
2187 OBEXCreateVEvent(
2188 in_charset,
2189 in_charset_length,
2190 in_encoding,
2191 in_encoding_length,
2192 in_event_start_date,
2193 in_event_start_date_length,
2194 in_event_end_date,
2195 in_event_end_date_length,
2196 in_alarm_date,
2197 in_alarm_date_length,
2198 in_category,
2199 in_category_length,
2200 in_summary,
2201 in_summary_length,
2202 in_location,
2203 in_location_length,
2204 in_xirmcluid,
2205 in_xirmcluid_length,
2206 )
2207 };
2208 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2209}
2210
2211extern "C" {
2212 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyname?language=objc)
2213 #[cfg(feature = "objc2-core-foundation")]
2214 pub static kOBEXHeaderIDKeyName: Option<&'static CFString>;
2215}
2216
2217extern "C" {
2218 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeytype?language=objc)
2219 #[cfg(feature = "objc2-core-foundation")]
2220 pub static kOBEXHeaderIDKeyType: Option<&'static CFString>;
2221}
2222
2223extern "C" {
2224 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeydescription?language=objc)
2225 #[cfg(feature = "objc2-core-foundation")]
2226 pub static kOBEXHeaderIDKeyDescription: Option<&'static CFString>;
2227}
2228
2229extern "C" {
2230 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeytimeiso?language=objc)
2231 #[cfg(feature = "objc2-core-foundation")]
2232 pub static kOBEXHeaderIDKeyTimeISO: Option<&'static CFString>;
2233}
2234
2235extern "C" {
2236 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeytime4byte?language=objc)
2237 #[cfg(feature = "objc2-core-foundation")]
2238 pub static kOBEXHeaderIDKeyTime4Byte: Option<&'static CFString>;
2239}
2240
2241extern "C" {
2242 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeytarget?language=objc)
2243 #[cfg(feature = "objc2-core-foundation")]
2244 pub static kOBEXHeaderIDKeyTarget: Option<&'static CFString>;
2245}
2246
2247extern "C" {
2248 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyhttp?language=objc)
2249 #[cfg(feature = "objc2-core-foundation")]
2250 pub static kOBEXHeaderIDKeyHTTP: Option<&'static CFString>;
2251}
2252
2253extern "C" {
2254 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeybody?language=objc)
2255 #[cfg(feature = "objc2-core-foundation")]
2256 pub static kOBEXHeaderIDKeyBody: Option<&'static CFString>;
2257}
2258
2259extern "C" {
2260 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyendofbody?language=objc)
2261 #[cfg(feature = "objc2-core-foundation")]
2262 pub static kOBEXHeaderIDKeyEndOfBody: Option<&'static CFString>;
2263}
2264
2265extern "C" {
2266 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeywho?language=objc)
2267 #[cfg(feature = "objc2-core-foundation")]
2268 pub static kOBEXHeaderIDKeyWho: Option<&'static CFString>;
2269}
2270
2271extern "C" {
2272 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyappparameters?language=objc)
2273 #[cfg(feature = "objc2-core-foundation")]
2274 pub static kOBEXHeaderIDKeyAppParameters: Option<&'static CFString>;
2275}
2276
2277extern "C" {
2278 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyauthorizationchallenge?language=objc)
2279 #[cfg(feature = "objc2-core-foundation")]
2280 pub static kOBEXHeaderIDKeyAuthorizationChallenge: Option<&'static CFString>;
2281}
2282
2283extern "C" {
2284 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyauthorizationresponse?language=objc)
2285 #[cfg(feature = "objc2-core-foundation")]
2286 pub static kOBEXHeaderIDKeyAuthorizationResponse: Option<&'static CFString>;
2287}
2288
2289extern "C" {
2290 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyobjectclass?language=objc)
2291 #[cfg(feature = "objc2-core-foundation")]
2292 pub static kOBEXHeaderIDKeyObjectClass: Option<&'static CFString>;
2293}
2294
2295extern "C" {
2296 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeycount?language=objc)
2297 #[cfg(feature = "objc2-core-foundation")]
2298 pub static kOBEXHeaderIDKeyCount: Option<&'static CFString>;
2299}
2300
2301extern "C" {
2302 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeylength?language=objc)
2303 #[cfg(feature = "objc2-core-foundation")]
2304 pub static kOBEXHeaderIDKeyLength: Option<&'static CFString>;
2305}
2306
2307extern "C" {
2308 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyconnectionid?language=objc)
2309 #[cfg(feature = "objc2-core-foundation")]
2310 pub static kOBEXHeaderIDKeyConnectionID: Option<&'static CFString>;
2311}
2312
2313extern "C" {
2314 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeybytesequence?language=objc)
2315 #[cfg(feature = "objc2-core-foundation")]
2316 pub static kOBEXHeaderIDKeyByteSequence: Option<&'static CFString>;
2317}
2318
2319extern "C" {
2320 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyunknownunicodetext?language=objc)
2321 #[cfg(feature = "objc2-core-foundation")]
2322 pub static kOBEXHeaderIDKeyUnknownUnicodeText: Option<&'static CFString>;
2323}
2324
2325extern "C" {
2326 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyunknownbytesequence?language=objc)
2327 #[cfg(feature = "objc2-core-foundation")]
2328 pub static kOBEXHeaderIDKeyUnknownByteSequence: Option<&'static CFString>;
2329}
2330
2331extern "C" {
2332 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyunknown1bytequantity?language=objc)
2333 #[cfg(feature = "objc2-core-foundation")]
2334 pub static kOBEXHeaderIDKeyUnknown1ByteQuantity: Option<&'static CFString>;
2335}
2336
2337extern "C" {
2338 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyunknown4bytequantity?language=objc)
2339 #[cfg(feature = "objc2-core-foundation")]
2340 pub static kOBEXHeaderIDKeyUnknown4ByteQuantity: Option<&'static CFString>;
2341}
2342
2343extern "C" {
2344 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/kobexheaderidkeyuserdefined?language=objc)
2345 #[cfg(feature = "objc2-core-foundation")]
2346 pub static kOBEXHeaderIDKeyUserDefined: Option<&'static CFString>;
2347}
2348
2349/// Take a data blob and looks for OBEX headers.
2350///
2351/// Parameter `inData`: The data chunk with the headers you are interested in.
2352///
2353/// Parameter `inDataSize`: The size of the buffer you are passing in.
2354///
2355/// Returns: A CFDictionary with the headers found in the data blob inside it.
2356///
2357/// You should use this when your callback for PUTs, GETs, etc. give you a data chunk
2358/// and a size. Pass these params to this function and you will receive a dictionary
2359/// back full of the parse headers. You can use the CFDictionary calls to get objects
2360/// out of it, based on the header keys defined above. You are responsible for releasing
2361/// the CFDictionary returned to you.
2362/// Example usage:
2363/// <pre>
2364/// CFDictionaryRef dictionary = OBEXGetHeaders( data, dataLength );
2365/// if( dictionary )
2366/// {
2367/// if( CFDictionaryGetCountOfKey( dictionary, kOBEXHeaderIDKeyName ) > 0 )
2368/// {
2369/// CFStringRef theStringRef;
2370///
2371/// theStringRef = (CFStringRef) CFDictionaryGetValue( dictionary, kOBEXHeaderIDKeyName );
2372/// if( theStringRef )
2373/// {
2374/// // Display it, use it as a filename, whatever.
2375/// }
2376/// }
2377///
2378/// if( CFDictionaryGetCountOfKey( dictionary, kOBEXHeaderIDKeyConnectionID ) > 0 )
2379/// {
2380/// CFDataRef theDataRef;
2381///
2382/// theDataRef = (CFDataRef) CFDictionaryGetValue( dictionary, kOBEXHeaderIDKeyConnectionID );
2383/// if( theDataRef )
2384/// {
2385/// // now we have data representing the connection ID.
2386/// }
2387/// }
2388///
2389/// CFRelease( dictionary );
2390/// }
2391/// </pre>
2392///
2393/// # Safety
2394///
2395/// `in_data` must be a valid pointer.
2396#[cfg(feature = "objc2-core-foundation")]
2397#[inline]
2398pub unsafe extern "C-unwind" fn OBEXGetHeaders(
2399 in_data: *const c_void,
2400 in_data_size: usize,
2401) -> Option<CFRetained<CFDictionary>> {
2402 extern "C-unwind" {
2403 fn OBEXGetHeaders(
2404 in_data: *const c_void,
2405 in_data_size: usize,
2406 ) -> Option<NonNull<CFDictionary>>;
2407 }
2408 let ret = unsafe { OBEXGetHeaders(in_data, in_data_size) };
2409 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
2410}
2411
2412/// Converts a dictionary of headers to a data pointer, from which you can extract as bytes and pass to
2413/// the OBEX command/response functions.
2414///
2415/// Parameter `dictionaryOfHeaders`: dictionary that you have added headers to with the above OBEXAddXXXHeader functions.
2416///
2417/// Returns: Mutable data ref containing the bytes of all headers.
2418///
2419/// Returns a CFMutableDataRef containing all the header data found in the dictionary, formatted according to
2420/// the OBEX/IrMC spec. YOU MUST RELEASE IT when you are finished with it (ie. when the OBEX request is complete).
2421/// All OBEX-specification defined headers are supported and should be returned to the dictionary. Use the
2422/// keys defined above to get headers from dictionary. Example usage:
2423/// <pre>
2424/// Example usage:
2425///
2426/// CFMutableDictionaryRef dictionary;
2427/// CFMutableDataRef mGetHeadersDataRef;
2428/// uint8_t* headerDataPtr;
2429/// uint32_t headerDataLength;
2430///
2431/// dictionary = CFDictionaryCreateMutable( kCFAllocatorDefault, 0,
2432/// &kCFCopyStringDictionaryKeyCallBacks
2433/// ,
2434/// &kCFTypeDictionaryValueCallBacks
2435/// );
2436///
2437/// // Package up desired headers.
2438///
2439/// OBEXAddTypeHeader( CFSTR( "text/x-vCard" ), dictionary );
2440///
2441/// mGetHeadersDataRef = OBEXHeadersToBytes( dictionary );
2442///
2443/// headerDataPtr = CFDataGetBytePtr( mGetHeadersDataRef );
2444/// headerDataLength = CFDataGetLength( mGetHeadersDataRef );
2445///
2446/// // From here I can pass it to any OBEX command, such as OBEXPut...
2447/// </pre>
2448///
2449/// # Safety
2450///
2451/// - `dictionary_of_headers` generics must be of the correct type.
2452/// - `dictionary_of_headers` might not allow `None`.
2453#[cfg(feature = "objc2-core-foundation")]
2454#[inline]
2455pub unsafe extern "C-unwind" fn OBEXHeadersToBytes(
2456 dictionary_of_headers: Option<&CFDictionary>,
2457) -> Option<CFRetained<CFMutableData>> {
2458 extern "C-unwind" {
2459 fn OBEXHeadersToBytes(
2460 dictionary_of_headers: Option<&CFDictionary>,
2461 ) -> Option<NonNull<CFMutableData>>;
2462 }
2463 let ret = unsafe { OBEXHeadersToBytes(dictionary_of_headers) };
2464 ret.map(|ret| unsafe { CFRetained::retain(ret) })
2465}
2466
2467extern "C-unwind" {
2468 /// Add a CFStringRef to a dictionary of OBEXheaders.
2469 ///
2470 /// Parameter `name`: name you want to add to the OBEX header dictionary.
2471 ///
2472 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2473 ///
2474 /// Returns: Error code, kOBEXSuccess (0) if success.
2475 ///
2476 /// Name header - OBEX Spec, 2.2.2: (2-byte) Null terminated unicode string.
2477 ///
2478 /// # Safety
2479 ///
2480 /// - `name` might not allow `None`.
2481 /// - `dict_ref` generics must be of the correct type.
2482 /// - `dict_ref` might not allow `None`.
2483 #[cfg(feature = "objc2-core-foundation")]
2484 pub fn OBEXAddNameHeader(
2485 name: Option<&CFString>,
2486 dict_ref: Option<&CFMutableDictionary>,
2487 ) -> OBEXError;
2488}
2489
2490extern "C-unwind" {
2491 /// Add a CFStringRef to a dictionary of OBEXheaders.
2492 ///
2493 /// Parameter `description`: Description you want to add to the OBEX header dictionary.
2494 ///
2495 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2496 ///
2497 /// Returns: Error code, kOBEXSuccess (0) if success.
2498 ///
2499 /// Description header - OBEX Spec, 2.2.6: (2-byte) Null terminated unicode string.
2500 ///
2501 /// # Safety
2502 ///
2503 /// - `description` might not allow `None`.
2504 /// - `dict_ref` generics must be of the correct type.
2505 /// - `dict_ref` might not allow `None`.
2506 #[cfg(feature = "objc2-core-foundation")]
2507 pub fn OBEXAddDescriptionHeader(
2508 description: Option<&CFString>,
2509 dict_ref: Option<&CFMutableDictionary>,
2510 ) -> OBEXError;
2511}
2512
2513extern "C-unwind" {
2514 /// Add a CFStringRef to a dictionary of OBEXheaders.
2515 ///
2516 /// Parameter `count`: Count value you want to add to the OBEX header dictionary.
2517 ///
2518 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2519 ///
2520 /// Returns: Error code, kOBEXSuccess (0) if success.
2521 ///
2522 /// Count header - OBEX Spec, 2.2.1: 4 byte unsigned integer
2523 ///
2524 /// # Safety
2525 ///
2526 /// - `dict_ref` generics must be of the correct type.
2527 /// - `dict_ref` might not allow `None`.
2528 #[cfg(feature = "objc2-core-foundation")]
2529 pub fn OBEXAddCountHeader(count: u32, dict_ref: Option<&CFMutableDictionary>) -> OBEXError;
2530}
2531
2532extern "C-unwind" {
2533 /// Add a CFStringRef to a dictionary of OBEXheaders.
2534 ///
2535 /// Parameter `time4Byte`: 4-byte time value you want to add to the OBEX header dictionary.
2536 ///
2537 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2538 ///
2539 /// Returns: Error code, kOBEXSuccess (0) if success.
2540 ///
2541 /// Time4Byte headers - OBEX Spec, 2.2.5: 4 Bytes
2542 ///
2543 /// # Safety
2544 ///
2545 /// - `dict_ref` generics must be of the correct type.
2546 /// - `dict_ref` might not allow `None`.
2547 #[cfg(feature = "objc2-core-foundation")]
2548 pub fn OBEXAddTime4ByteHeader(
2549 time4_byte: u32,
2550 dict_ref: Option<&CFMutableDictionary>,
2551 ) -> OBEXError;
2552}
2553
2554extern "C-unwind" {
2555 /// Add a CFStringRef to a dictionary of OBEXheaders.
2556 ///
2557 /// Parameter `length`: Value of Length header you want to add to the OBEX header dictionary.
2558 ///
2559 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2560 ///
2561 /// Returns: Error code, kOBEXSuccess (0) if success.
2562 ///
2563 /// Length header - OBEX Spec, 2.2.4: 4 byte unsigned integer
2564 ///
2565 /// # Safety
2566 ///
2567 /// - `dict_ref` generics must be of the correct type.
2568 /// - `dict_ref` might not allow `None`.
2569 #[cfg(feature = "objc2-core-foundation")]
2570 pub fn OBEXAddLengthHeader(length: u32, dict_ref: Option<&CFMutableDictionary>) -> OBEXError;
2571}
2572
2573extern "C-unwind" {
2574 /// Add a CFStringRef to a dictionary of OBEXheaders.
2575 ///
2576 /// Parameter `type`: String containing the type of header to add.
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 /// Type header - OBEX Spec, 2.2.3: 1-byte Null terminated ascii string.
2583 ///
2584 /// # Safety
2585 ///
2586 /// - `type` might not allow `None`.
2587 /// - `dict_ref` generics must be of the correct type.
2588 /// - `dict_ref` might not allow `None`.
2589 #[cfg(feature = "objc2-core-foundation")]
2590 pub fn OBEXAddTypeHeader(
2591 r#type: Option<&CFString>,
2592 dict_ref: Option<&CFMutableDictionary>,
2593 ) -> OBEXError;
2594}
2595
2596extern "C-unwind" {
2597 /// Add bytes to a dictionary of OBEXheaders.
2598 ///
2599 /// Parameter `inHeaderData`: Time ISO 8601 header data, local times in format YYYYMMDDTHHMMSS and UTC in the format YYYYMMDDTHHMMSSZ.
2600 ///
2601 /// Parameter `inHeaderDataLength`: Length of header data.
2602 ///
2603 /// Returns: Error code, kOBEXSuccess (0) if success.
2604 ///
2605 /// TimeISO header - OBEX Spec, 2.2.5: Byte Sequence
2606 ///
2607 /// # Safety
2608 ///
2609 /// - `in_header_data` must be a valid pointer.
2610 /// - `dict_ref` generics must be of the correct type.
2611 /// - `dict_ref` might not allow `None`.
2612 #[cfg(feature = "objc2-core-foundation")]
2613 pub fn OBEXAddTimeISOHeader(
2614 in_header_data: *const c_void,
2615 in_header_data_length: u32,
2616 dict_ref: Option<&CFMutableDictionary>,
2617 ) -> OBEXError;
2618}
2619
2620extern "C-unwind" {
2621 /// Add bytes of data to a dictionary of OBEXheaders.
2622 ///
2623 /// Parameter `inHeaderData`: Target header data.
2624 ///
2625 /// Parameter `inHeaderDataLength`: Length of Target header data.
2626 ///
2627 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2628 ///
2629 /// Returns: Error code, kOBEXSuccess (0) if success.
2630 ///
2631 /// Target header - OBEX Spec, 2.2.7: Byte Sequence
2632 ///
2633 /// # Safety
2634 ///
2635 /// - `in_header_data` must be a valid pointer.
2636 /// - `dict_ref` generics must be of the correct type.
2637 /// - `dict_ref` might not allow `None`.
2638 #[cfg(feature = "objc2-core-foundation")]
2639 pub fn OBEXAddTargetHeader(
2640 in_header_data: *const c_void,
2641 in_header_data_length: u32,
2642 dict_ref: Option<&CFMutableDictionary>,
2643 ) -> OBEXError;
2644}
2645
2646extern "C-unwind" {
2647 /// Add bytes of data to a dictionary of OBEXheaders.
2648 ///
2649 /// Parameter `inHeaderData`: HTTP header data.
2650 ///
2651 /// Parameter `inHeaderDataLength`: Length of HTTP header data.
2652 ///
2653 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2654 ///
2655 /// Returns: Error code, kOBEXSuccess (0) if success.
2656 ///
2657 /// HTTP header - OBEX Spec, 2.2.8: Byte Sequence
2658 ///
2659 /// # Safety
2660 ///
2661 /// - `in_header_data` must be a valid pointer.
2662 /// - `dict_ref` generics must be of the correct type.
2663 /// - `dict_ref` might not allow `None`.
2664 #[cfg(feature = "objc2-core-foundation")]
2665 pub fn OBEXAddHTTPHeader(
2666 in_header_data: *const c_void,
2667 in_header_data_length: u32,
2668 dict_ref: Option<&CFMutableDictionary>,
2669 ) -> OBEXError;
2670}
2671
2672/// Add bytes of data to a dictionary of OBEXheaders.
2673///
2674/// Parameter `inHeaderData`: Body header data.
2675///
2676/// Parameter `inHeaderDataLength`: Length of Body header data.
2677///
2678/// Parameter `isEndOfBody`: Set this flag if you want an end of body header instead of a body header.
2679///
2680/// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2681///
2682/// Returns: Error code, kOBEXSuccess (0) if success.
2683///
2684/// Body,EndOfBody headers - OBEX Spec, 2.2.9: Byte Sequence
2685///
2686/// # Safety
2687///
2688/// - `in_header_data` must be a valid pointer.
2689/// - `dict_ref` generics must be of the correct type.
2690/// - `dict_ref` might not allow `None`.
2691#[cfg(feature = "objc2-core-foundation")]
2692#[inline]
2693pub unsafe extern "C-unwind" fn OBEXAddBodyHeader(
2694 in_header_data: *const c_void,
2695 in_header_data_length: u32,
2696 is_end_of_body: bool,
2697 dict_ref: Option<&CFMutableDictionary>,
2698) -> OBEXError {
2699 extern "C-unwind" {
2700 fn OBEXAddBodyHeader(
2701 in_header_data: *const c_void,
2702 in_header_data_length: u32,
2703 is_end_of_body: Boolean,
2704 dict_ref: Option<&CFMutableDictionary>,
2705 ) -> OBEXError;
2706 }
2707 unsafe {
2708 OBEXAddBodyHeader(
2709 in_header_data,
2710 in_header_data_length,
2711 is_end_of_body as _,
2712 dict_ref,
2713 )
2714 }
2715}
2716
2717extern "C-unwind" {
2718 /// Add bytes of data to a dictionary of OBEXheaders.
2719 ///
2720 /// Parameter `inHeaderData`: Who header data.
2721 ///
2722 /// Parameter `inHeaderDataLength`: Length of Who header data.
2723 ///
2724 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2725 ///
2726 /// Returns: Error code, kOBEXSuccess (0) if success.
2727 ///
2728 /// Who headers - OBEX Spec, 2.2.10: Byte Sequence
2729 ///
2730 /// # Safety
2731 ///
2732 /// - `in_header_data` must be a valid pointer.
2733 /// - `dict_ref` generics must be of the correct type.
2734 /// - `dict_ref` might not allow `None`.
2735 #[cfg(feature = "objc2-core-foundation")]
2736 pub fn OBEXAddWhoHeader(
2737 in_header_data: *const c_void,
2738 in_header_data_length: u32,
2739 dict_ref: Option<&CFMutableDictionary>,
2740 ) -> OBEXError;
2741}
2742
2743extern "C-unwind" {
2744 /// Add bytes representing a connection ID to a dictionary of OBEX headers.
2745 ///
2746 /// Parameter `inHeaderData`: Connection ID data. Should be 4 bytes in length only.
2747 ///
2748 /// Parameter `inHeaderDataLength`: Length of Connection ID data. This should ONLY be set to equal 4.
2749 ///
2750 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2751 ///
2752 /// Returns: Error code, kOBEXSuccess (0) if success.
2753 ///
2754 /// ConnectionID headers - OBEX Spec, 2.2.10: Byte Sequence
2755 ///
2756 /// ** IMPORTANT NOTE: In bluetooth 1.0, using this function will allow you to pass in any value.
2757 /// You should not pass more than 4 bytes ever. In later releases, if the length
2758 /// passed is not 4, a kOBEXBadArgumentError error will be returned. ***
2759 ///
2760 /// # Safety
2761 ///
2762 /// - `in_header_data` must be a valid pointer.
2763 /// - `dict_ref` generics must be of the correct type.
2764 /// - `dict_ref` might not allow `None`.
2765 #[cfg(feature = "objc2-core-foundation")]
2766 pub fn OBEXAddConnectionIDHeader(
2767 in_header_data: *const c_void,
2768 in_header_data_length: u32,
2769 dict_ref: Option<&CFMutableDictionary>,
2770 ) -> OBEXError;
2771}
2772
2773extern "C-unwind" {
2774 /// Add bytes representing an application parameter to a dictionary of OBEX headers.
2775 ///
2776 /// Parameter `inHeaderData`: Application parameter data - should be tag/length/value triplets.
2777 ///
2778 /// Parameter `inHeaderDataLength`: Length of application parameter data.
2779 ///
2780 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2781 ///
2782 /// Returns: Error code, kOBEXSuccess (0) if success.
2783 ///
2784 /// Application Request/Response Parameter headers - OBEX Spec, 2.2.11: Byte Sequence
2785 ///
2786 /// # Safety
2787 ///
2788 /// - `in_header_data` must be a valid pointer.
2789 /// - `dict_ref` generics must be of the correct type.
2790 /// - `dict_ref` might not allow `None`.
2791 #[cfg(feature = "objc2-core-foundation")]
2792 pub fn OBEXAddApplicationParameterHeader(
2793 in_header_data: *const c_void,
2794 in_header_data_length: u32,
2795 dict_ref: Option<&CFMutableDictionary>,
2796 ) -> OBEXError;
2797}
2798
2799extern "C-unwind" {
2800 /// Add a byte sequence header to a dictionary of OBEXheaders.
2801 ///
2802 /// Parameter `inHeaderData`: bytes you want to put in the byte sequence header.
2803 ///
2804 /// Parameter `inHeaderDataLength`: length of the bytes you want to put in the byte sequence header.
2805 ///
2806 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2807 ///
2808 /// Returns: Error code, kOBEXSuccess (0) if success.
2809 ///
2810 /// Byte Sequence header - OBEX Spec, 2.2.5: Byte sequence. One thing of important note here - since we
2811 /// don't know what Header Identifier and length you intend to use here, you MUST include your own
2812 /// identifier and length in the data you pass. Thus, your data must be in this format:
2813 /// <
2814 /// 1:HI>
2815 /// <
2816 /// 2:LENGTH>
2817 /// <n
2818 /// :(
2819 /// <TAG
2820 /// >
2821 /// <LENGTH
2822 /// >
2823 /// <VALUE
2824 /// >)>
2825 /// Also, note that LENGTH = (3 + n), (1 for HI, 2 for the 2 bytes of length information, plus your n bytes of custom data).
2826 /// Be careful here to not mess up these values, as it could adversely affect the ability of the remote-device's headers parser.
2827 ///
2828 /// # Safety
2829 ///
2830 /// - `in_header_data` must be a valid pointer.
2831 /// - `dict_ref` generics must be of the correct type.
2832 /// - `dict_ref` might not allow `None`.
2833 #[cfg(feature = "objc2-core-foundation")]
2834 pub fn OBEXAddByteSequenceHeader(
2835 in_header_data: *const c_void,
2836 in_header_data_length: u32,
2837 dict_ref: Option<&CFMutableDictionary>,
2838 ) -> OBEXError;
2839}
2840
2841extern "C-unwind" {
2842 /// Add an object class header to a dictionary of OBEXheaders.
2843 ///
2844 /// Parameter `inHeaderData`: bytes you want to put in the object class header.
2845 ///
2846 /// Parameter `inHeaderDataLength`: length of the bytes you want to put in the object class header.
2847 ///
2848 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2849 ///
2850 /// Returns: Error code, kOBEXSuccess (0) if success.
2851 ///
2852 /// Object Class header - OBEX Spec, 2.2.15: Byte sequence.
2853 ///
2854 /// # Safety
2855 ///
2856 /// - `in_header_data` must be a valid pointer.
2857 /// - `dict_ref` generics must be of the correct type.
2858 /// - `dict_ref` might not allow `None`.
2859 #[cfg(feature = "objc2-core-foundation")]
2860 pub fn OBEXAddObjectClassHeader(
2861 in_header_data: *const c_void,
2862 in_header_data_length: u32,
2863 dict_ref: Option<&CFMutableDictionary>,
2864 ) -> OBEXError;
2865}
2866
2867extern "C-unwind" {
2868 /// Add an authorization challenge header to a dictionary of OBEXheaders.
2869 ///
2870 /// Parameter `inHeaderData`: bytes you want to put in the authorization challenge header.
2871 ///
2872 /// Parameter `inHeaderDataLength`: length of the bytes you want to put in authorization challenge header.
2873 ///
2874 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2875 ///
2876 /// Returns: Error code, kOBEXSuccess (0) if success.
2877 ///
2878 /// Authorization Challenge header - OBEX Spec, 2.2.13: Authorization Challenge.
2879 ///
2880 /// # Safety
2881 ///
2882 /// - `in_header_data` must be a valid pointer.
2883 /// - `dict_ref` generics must be of the correct type.
2884 /// - `dict_ref` might not allow `None`.
2885 #[cfg(feature = "objc2-core-foundation")]
2886 pub fn OBEXAddAuthorizationChallengeHeader(
2887 in_header_data: *const c_void,
2888 in_header_data_length: u32,
2889 dict_ref: Option<&CFMutableDictionary>,
2890 ) -> OBEXError;
2891}
2892
2893extern "C-unwind" {
2894 /// Add an authorization Response header to a dictionary of OBEXheaders.
2895 ///
2896 /// Parameter `inHeaderData`: bytes you want to put in the authorization Response header.
2897 ///
2898 /// Parameter `inHeaderDataLength`: length of the bytes you want to put in authorization Response header.
2899 ///
2900 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2901 ///
2902 /// Returns: Error code, kOBEXSuccess (0) if success.
2903 ///
2904 /// Authorization Response header - OBEX Spec, 2.2.14: Authorization Response.
2905 ///
2906 /// # Safety
2907 ///
2908 /// - `in_header_data` must be a valid pointer.
2909 /// - `dict_ref` generics must be of the correct type.
2910 /// - `dict_ref` might not allow `None`.
2911 #[cfg(feature = "objc2-core-foundation")]
2912 pub fn OBEXAddAuthorizationResponseHeader(
2913 in_header_data: *const c_void,
2914 in_header_data_length: u32,
2915 dict_ref: Option<&CFMutableDictionary>,
2916 ) -> OBEXError;
2917}
2918
2919extern "C-unwind" {
2920 /// Add a user-defined custom header to a dictionary of OBEXheaders.
2921 ///
2922 /// Parameter `inHeaderData`: bytes you want to put in the user-defined header.
2923 ///
2924 /// Parameter `inHeaderDataLength`: length of the bytes you want to put in user-defined header.
2925 ///
2926 /// Parameter `dictRef`: dictionary you have allocated to hold the headers. Make sure it's mutable.
2927 ///
2928 /// Returns: Error code, kOBEXSuccess (0) if success.
2929 ///
2930 /// User Defined header - OBEX Spec, 2.2.20: User Defined Headers.
2931 ///
2932 /// # Safety
2933 ///
2934 /// - `in_header_data` must be a valid pointer.
2935 /// - `dict_ref` generics must be of the correct type.
2936 /// - `dict_ref` might not allow `None`.
2937 #[cfg(feature = "objc2-core-foundation")]
2938 pub fn OBEXAddUserDefinedHeader(
2939 in_header_data: *const c_void,
2940 in_header_data_length: u32,
2941 dict_ref: Option<&CFMutableDictionary>,
2942 ) -> OBEXError;
2943}