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