1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use crate::*;
extern "C-unwind" {
/// Create an OBEX session with a service ref, usually obtained from the device browser.
///
/// Parameter `inSDPServiceRecordRef`: A valid service reference.
///
/// Parameter `outSessionRef`: A valid ptr to an IOBluetoothOBEXSessionRef; will contain the newly created session if
/// return value is kOBEXSuccess.
///
/// Returns: An error code value. 0 if successful.
///
/// You will use a session reference to do all OBEX interaction to a specific device. This method DOES NOT
/// create a connection to the device of any kind.
///
/// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
/// ** You should transition your code to Objective-C equivalents.
/// ** This API may be removed any time in the future.
///
/// # Safety
///
/// `out_session_ref` must be a valid pointer.
#[cfg(all(feature = "IOBluetoothUserLib", feature = "OBEX"))]
#[deprecated]
pub fn IOBluetoothOBEXSessionCreateWithIOBluetoothSDPServiceRecordRef(
in_sdp_service_ref: &IOBluetoothSDPServiceRecordRef,
out_session_ref: *mut OBEXSessionRef,
) -> OBEXError;
}
extern "C-unwind" {
/// Create an OBEX session with a device ref and an RFCOMM channel ID. This allows you to bypass the browser
/// if you already know the SDP information.
///
/// Parameter `inDeviceRef`: A valid IOBluetoothDeviceRef reference.
///
/// Parameter `inChannelID`: A valid RFCOMM channel ID on the target device.
///
/// Parameter `outSessionRef`: A valid ptr to an IOBluetoothOBEXSessionRef; will contain the newly created session
/// if return value is kOBEXSuccess.
///
/// Returns: An error code value. 0 if successful.
///
/// You will use a session reference to do all OBEX interaction to a specific device. This method DOES NOT
/// create a connection to the device of any kind.
///
/// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
/// ** You should transition your code to Objective-C equivalents.
/// ** This API may be removed any time in the future.
///
/// # Safety
///
/// `out_session_ref` must be a valid pointer.
#[cfg(all(
feature = "Bluetooth",
feature = "IOBluetoothUserLib",
feature = "OBEX"
))]
#[deprecated]
pub fn IOBluetoothOBEXSessionCreateWithIOBluetoothDeviceRefAndChannelNumber(
in_device_ref: &IOBluetoothDeviceRef,
in_channel_id: BluetoothRFCOMMChannelID,
out_session_ref: *mut OBEXSessionRef,
) -> OBEXError;
}
extern "C-unwind" {
/// Create an OBEX session with an IOBluetoothRFCOMMchannel. This implies you are creating a OBEX SERVER
/// session that will dole out info to remote Bluetooth clients.
///
/// Parameter `inRFCOMMChannel`: A valid IOBluetoothRFCOMMChannel reference.
///
/// Parameter `inGetResponseCallback`: A callback for Get requests sent to your session by a remote device. Must be a
/// valid function ptr, otherwise why even call this?
///
/// Parameter `outSessionRef`: A valid ptr to an IOBluetoothOBEXSessionRef; will contain the newly created
/// session if return value is kOBEXSuccess.
///
/// Returns: An error code value. 0 if successful.
///
/// This assumes that the RFCOMM channel you have passed it is already open and ready to transmit data
/// to the session.
///
/// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
/// ** You should transition your code to Objective-C equivalents.
/// ** This API may be removed any time in the future.
///
/// # Safety
///
/// - `in_callback` must be implemented correctly.
/// - `in_user_ref_con` must be a valid pointer.
/// - `out_session_ref` must be a valid pointer.
#[cfg(all(feature = "IOBluetoothUserLib", feature = "OBEX"))]
#[deprecated]
pub fn IOBluetoothOBEXSessionCreateWithIncomingIOBluetoothRFCOMMChannel(
in_rfcomm_channel_ref: &IOBluetoothRFCOMMChannelRef,
in_callback: OBEXSessionEventCallback,
in_user_ref_con: *mut c_void,
out_session_ref: *mut OBEXSessionRef,
) -> OBEXError;
}
/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothobexsessionopenconnectioncallback?language=objc)
#[cfg(feature = "OBEX")]
pub type IOBluetoothOBEXSessionOpenConnectionCallback =
Option<unsafe extern "C-unwind" fn(OBEXSessionRef, OBEXError, *mut c_void)>;
extern "C-unwind" {
/// Parameter `inSessionRef`: A valid session reference.
///
/// Parameter `inCallback`: A valid callback.
///
/// Parameter `inUserRefCon`: Optional parameter; can contain anything you wish. Will be returned in your
/// callback just as you passed it.
///
/// Returns: An error code value. 0 if successful.
///
/// Opens a transport-level connection to a remote target. For example, if you are using a Bluetooth transport,
/// this will establish the baseband/L2CAP/RFCOMM connection to a device. Once the callback is called, the
/// connection will either be opened or have failed with a status code. That status code will most likely have
/// originated from the transport layer being used, so you may receive a Bluetooth error, an IOKit error, etc,
/// but a 0 status should indicate success in all cases.
///
/// ** DEPRECATED IN BLUETOOTH 2.2 (Mac OS X 10.6)
/// ** You should transition your code to Objective-C equivalents.
/// ** This API may be removed any time in the future.
///
/// # Safety
///
/// - `in_session_ref` must be a valid pointer.
/// - `in_callback` must be implemented correctly.
/// - `in_user_ref_con` must be a valid pointer.
#[cfg(feature = "OBEX")]
#[deprecated]
pub fn IOBluetoothOBEXSessionOpenTransportConnection(
in_session_ref: OBEXSessionRef,
in_callback: IOBluetoothOBEXSessionOpenConnectionCallback,
in_user_ref_con: *mut c_void,
) -> OBEXError;
}