objc2_io_bluetooth/generated/objc2/
IOBluetoothRFCOMMChannel.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-foundation")]
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12    /// An instance of this class represents an rfcomm channel as defined by the Bluetooth SDP spec..
13    ///
14    /// An RFCOMM channel object can be obtained by opening an rfcomm channel in a device, or
15    /// by requesting a notification when a channel is created (this is commonly used to provide services).
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothrfcommchannel?language=objc)
18    #[unsafe(super(IOBluetoothObject, NSObject))]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    #[cfg(feature = "IOBluetoothObject")]
21    pub struct IOBluetoothRFCOMMChannel;
22);
23
24#[cfg(all(feature = "IOBluetoothObject", feature = "objc2-foundation"))]
25extern_conformance!(
26    unsafe impl NSCopying for IOBluetoothRFCOMMChannel {}
27);
28
29#[cfg(all(feature = "IOBluetoothObject", feature = "objc2-foundation"))]
30unsafe impl CopyingHelper for IOBluetoothRFCOMMChannel {
31    type Result = Self;
32}
33
34#[cfg(feature = "IOBluetoothObject")]
35extern_conformance!(
36    unsafe impl NSObjectProtocol for IOBluetoothRFCOMMChannel {}
37);
38
39#[cfg(all(feature = "IOBluetoothObject", feature = "objc2-foundation"))]
40extern_conformance!(
41    unsafe impl NSPortDelegate for IOBluetoothRFCOMMChannel {}
42);
43
44#[cfg(all(feature = "IOBluetoothObject", feature = "objc2-foundation"))]
45extern_conformance!(
46    unsafe impl NSStreamDelegate for IOBluetoothRFCOMMChannel {}
47);
48
49#[cfg(feature = "IOBluetoothObject")]
50impl IOBluetoothRFCOMMChannel {
51    extern_methods!(
52        #[cfg(feature = "IOBluetoothUserNotification")]
53        /// Allows a client to register for RFCOMM channel open notifications for any RFCOMM channel.
54        ///
55        /// The given selector will be called on the target object whenever any RFCOMM channel is opened.
56        /// The selector should accept two arguments.  The first is the user notification object.  The second
57        /// is the IOBluetoothRFCOMMChannel that was opened.
58        ///
59        /// Parameter `rfcommChannelRef`: IOBluetoothRFCOMMChannelRef for which an IOBluetoothRFCOMMChannel * is desired.
60        ///
61        /// Parameter `object`: Target object
62        ///
63        /// Parameter `selector`: Selector to be called on the target object when a new RFCOMM channel is opened.
64        /// the format for the selector is:
65        /// -(void) selectorName:(IOBluetoothUserNotification *)inNotification channel:(IOBluetoothRFCOMMChannel *)newChannel
66        ///
67        /// Returns: Returns an IOBluetoothUserNotification representing the outstanding RFCOMM channel notification.
68        /// To unregister the notification, call -unregister on the resulting IOBluetoothUserNotification
69        /// object.  If an error is encountered creating the notification, nil is returned.  The returned
70        /// IOBluetoothUserNotification will be valid for as long as the notification is registered.  It is
71        /// not necessary to retain the result.  Once -unregister is called on it, it will no longer be valid.
72        ///
73        /// # Safety
74        ///
75        /// - `object` should be of the correct type.
76        /// - `object` might not allow `None`.
77        /// - `selector` must be a valid selector.
78        #[unsafe(method(registerForChannelOpenNotifications:selector:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn registerForChannelOpenNotifications_selector(
81            object: Option<&AnyObject>,
82            selector: Option<Sel>,
83        ) -> Option<Retained<IOBluetoothUserNotification>>;
84
85        #[cfg(all(
86            feature = "Bluetooth",
87            feature = "IOBluetoothUserLib",
88            feature = "IOBluetoothUserNotification"
89        ))]
90        /// Allows a client to register for RFCOMM channel open notifications for certain types of
91        /// RFCOMM channels.
92        ///
93        /// The given selector will be called on the target object whenever an RFCOMM channel with the given
94        /// attributes is opened.  The selector should accept two arguments.  The first is the user
95        /// notification object.  The second is the IOBluetoothRFCOMMChannel that was opened.
96        ///
97        /// Parameter `object`: Target object
98        ///
99        /// Parameter `selector`: Selector to be called on the target object when a new RFCOMM channel is opened.
100        /// the format for the selector is:
101        /// -(void) selectorName:(IOBluetoothUserNotification *)inNotification channel:(IOBluetoothRFCOMMChannel *)newChannel
102        ///
103        /// Parameter `channeLID`: RFCOMM channel ID to match a new RFCOMM channel.  If the channel ID doesn't matter, 0 may be passed in.
104        ///
105        /// Parameter `inDirection`: The desired direction of the RFCOMM channel - kIOBluetoothUserNotificationChannelDirectionAny
106        /// if the direction doesn't matter.
107        ///
108        /// Returns: Returns an IOBluetoothUserNotification representing the outstanding RFCOMM channel notification.
109        /// To unregister the notification, call -unregister on the resulting IOBluetoothUserNotification
110        /// object.  If an error is encountered creating the notification, nil is returned.  The returned
111        /// IOBluetoothUserNotification will be valid for as long as the notification is registered.  It is
112        /// not necessary to retain the result.  Once -unregister is called on it, it will no longer be valid.
113        ///
114        /// # Safety
115        ///
116        /// - `object` should be of the correct type.
117        /// - `object` might not allow `None`.
118        /// - `selector` must be a valid selector.
119        #[unsafe(method(registerForChannelOpenNotifications:selector:withChannelID:direction:))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn registerForChannelOpenNotifications_selector_withChannelID_direction(
122            object: Option<&AnyObject>,
123            selector: Option<Sel>,
124            channel_id: BluetoothRFCOMMChannelID,
125            in_direction: IOBluetoothUserNotificationChannelDirection,
126        ) -> Option<Retained<IOBluetoothUserNotification>>;
127
128        #[cfg(feature = "IOBluetoothUserLib")]
129        /// Method call to convert an IOBluetoothRFCOMMChannelRef into an IOBluetoothRFCOMMChannel *.
130        ///
131        /// Parameter `rfcommChannelRef`: IOBluetoothRFCOMMChannelRef for which an IOBluetoothRFCOMMChannel * is desired.
132        ///
133        /// Returns: Returns the IOBluetoothRFCOMMChannel * for the given IOBluetoothRFCOMMChannelRef.
134        ///
135        /// # Safety
136        ///
137        /// `rfcomm_channel_ref` might not allow `None`.
138        #[unsafe(method(withRFCOMMChannelRef:))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn withRFCOMMChannelRef(
141            rfcomm_channel_ref: Option<&IOBluetoothRFCOMMChannelRef>,
142        ) -> Option<Retained<Self>>;
143
144        #[cfg(feature = "IOBluetoothUserLib")]
145        /// Returns the IObluetoothRFCOMMChannel with the given IOBluetoothObjectID.
146        ///
147        /// The IOBluetoothObjectID can be used as a global reference for a given IObluetoothRFCOMMChannel.  It allows
148        /// two separate applications to refer to the same IObluetoothRFCOMMChannel object.
149        ///
150        /// Parameter `objectID`: IOBluetoothObjectID of the desired IObluetoothRFCOMMChannel.
151        ///
152        /// Returns: Returns the IObluetoothRFCOMMChannel that matches the given IOBluetoothObjectID if one exists.
153        /// If no matching RFCOMM channel exists, nil is returned.
154        #[unsafe(method(withObjectID:))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn withObjectID(object_id: IOBluetoothObjectID) -> Option<Retained<Self>>;
157
158        #[cfg(feature = "IOBluetoothUserLib")]
159        /// Returns an IOBluetoothRFCOMMChannelRef representation of the target IOBluetoothRFCOMMChannel object.
160        ///
161        /// Returns: Returns an IOBluetoothRFCOMMChannelRef representation of the target IOBluetoothRFCOMMChannel object.
162        #[unsafe(method(getRFCOMMChannelRef))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn getRFCOMMChannelRef(&self) -> Option<Retained<IOBluetoothRFCOMMChannelRef>>;
165
166        /// Close the channel.
167        ///
168        /// Returns: An error code value. 0 if successful.
169        #[unsafe(method(closeChannel))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn closeChannel(&self) -> IOReturn;
172
173        /// Returns the state of the channel.
174        ///
175        /// note that "not open" means closed, opening and closing.
176        ///
177        /// Returns: TRUE if the channel state is open,  FALSE otherwise.
178        #[unsafe(method(isOpen))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn isOpen(&self) -> bool;
181
182        #[cfg(feature = "Bluetooth")]
183        /// Returns the channel maximum transfer unit.
184        ///
185        /// Returns the length of the largest chunk of data that this channel can carry. If the
186        /// caller wishes to use the write:length:sleep: api the length of the data can not be bigger than
187        /// the channel MTU (maximum transfer unit).
188        ///
189        /// Returns: Channel MTU size .
190        #[unsafe(method(getMTU))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn getMTU(&self) -> BluetoothRFCOMMMTU;
193
194        /// Returns TRUE if flow control is off.
195        ///
196        /// Returns true if the remote device flow control is stopping out transmission. This is
197        /// useful because we do not buffer data, we stop the transmitting actor. With this method
198        /// the transmitter can check if sending data is going to be successful or is going to block.
199        ///
200        /// Returns: TRUE if the action of sending data will block the current thread, FALSE otherwise.
201        #[unsafe(method(isTransmissionPaused))]
202        #[unsafe(method_family = none)]
203        pub unsafe fn isTransmissionPaused(&self) -> bool;
204
205        /// Sends a block of data in the channel syncronously.
206        ///
207        /// ***WARNING*** This method is being deprecated in favor of -writeSync:... and -writeAsync:...
208        /// Sends data through the channel. The number of bytes to be sent must not exceed the channel MTU.
209        /// If the return value is an error condition none of the data was sent.
210        ///
211        /// Parameter `data`: is a pointer to the data buffer to be sent.
212        ///
213        /// Parameter `length`: the length of the buffer to be sent (in bytes).
214        ///
215        /// Parameter `sleep`: is a boolean if set to TRUE the call will wait until it is possible to send data.
216        /// If set to FALSE and it is not possible to send data the method will return immediately with an
217        /// error.
218        ///
219        /// Returns: An error code value. 0 if successful.
220        ///
221        /// # Safety
222        ///
223        /// `data` must be a valid pointer.
224        #[deprecated]
225        #[unsafe(method(write:length:sleep:))]
226        #[unsafe(method_family = none)]
227        pub unsafe fn write_length_sleep(
228            &self,
229            data: *mut c_void,
230            length: u16,
231            sleep: bool,
232        ) -> IOReturn;
233
234        /// Sends a block of data in the channel asynchronously.
235        ///
236        /// The number of bytes to be sent must not exceed the channel MTU.
237        /// If the return value is an error condition none of the data was sent.  Once the data
238        /// has been successfully passed to the hardware to be transmitted, the delegate method
239        /// -rfcommChannelWriteComplete:refcon:status: will be called with the refcon that was passed
240        /// to this method.
241        ///
242        /// NOTE: This method is only available in Mac OS X 10.2.5 (Bluetooth v1.2) or later.
243        ///
244        /// Parameter `data`: A pointer to the data buffer to be sent.
245        ///
246        /// Parameter `length`: The length of the buffer to be sent (in bytes).
247        ///
248        /// Parameter `refcon`: User supplied value that gets passed to the write callback.
249        ///
250        /// Returns: Returns kIOReturnSuccess if the data was buffered successfully.
251        ///
252        /// # Safety
253        ///
254        /// - `data` must be a valid pointer.
255        /// - `refcon` must be a valid pointer.
256        #[unsafe(method(writeAsync:length:refcon:))]
257        #[unsafe(method_family = none)]
258        pub unsafe fn writeAsync_length_refcon(
259            &self,
260            data: *mut c_void,
261            length: u16,
262            refcon: *mut c_void,
263        ) -> IOReturn;
264
265        /// Sends a block of data in the channel synchronously.
266        ///
267        /// Sends data through the channel. The number of bytes to be sent must not exceed the channel MTU.
268        /// If the return value is an error condition none of the data was sent.  This method will
269        /// block until the data has been successfully sent to the hardware for transmission (or until
270        /// an error occurs).
271        ///
272        /// NOTE: This method is only available in Mac OS X 10.2.5 (Bluetooth v1.2) or later.
273        ///
274        /// Parameter `data`: A pointer to the data buffer to be sent.
275        ///
276        /// Parameter `length`: The length of the buffer to be sent (in bytes).
277        ///
278        /// Returns: Returns kIOReturnSuccess if the data was written successfully.
279        ///
280        /// # Safety
281        ///
282        /// `data` must be a valid pointer.
283        #[unsafe(method(writeSync:length:))]
284        #[unsafe(method_family = none)]
285        pub unsafe fn writeSync_length(&self, data: *mut c_void, length: u16) -> IOReturn;
286
287        /// Sends a block of data in the channel.
288        ///
289        /// ***WARNING*** This method is being deprecated in favor of -writeSync:... and -writeAsync:...
290        /// Sends data through the channel. The number of bytes to be sent is arbitrary. The caller
291        /// does not have to worry about the MTU.
292        ///
293        /// Parameter `data`: a pointer to the data buffer to be sent.
294        ///
295        /// Parameter `length`: the length of the buffer to be sent (in bytes).
296        ///
297        /// Parameter `sleep`: a boolean if set to TRUE the call will wait until it is possible to send all the data.
298        ///
299        /// Parameter `a`: UInt32 pointer in which the caller received the nuber of bytes sent.
300        /// If set to FALSE and it is not possible to send part of the data the method will return immediately.
301        ///
302        /// Returns: An error code value. 0 if successful.
303        ///
304        /// # Safety
305        ///
306        /// - `data` must be a valid pointer.
307        /// - `num_bytes_sent` must be a valid pointer.
308        #[deprecated]
309        #[unsafe(method(writeSimple:length:sleep:bytesSent:))]
310        #[unsafe(method_family = none)]
311        pub unsafe fn writeSimple_length_sleep_bytesSent(
312            &self,
313            data: *mut c_void,
314            length: u16,
315            sleep: bool,
316            num_bytes_sent: *mut u32,
317        ) -> IOReturn;
318
319        #[cfg(feature = "Bluetooth")]
320        /// Changes the parameters of the serial connection.
321        ///
322        /// Parameter `speed`: the baudrate.
323        ///
324        /// Parameter `nBits`: number of data bits.
325        ///
326        /// Parameter `parity`: the type of parity can be NoParity, OddParity, EvenParity or MaxParity.
327        ///
328        /// Parameter `bitStop`: number of stop bits.
329        ///
330        /// Returns: An error code value. 0 if successful.
331        #[unsafe(method(setSerialParameters:dataBits:parity:stopBits:))]
332        #[unsafe(method_family = none)]
333        pub unsafe fn setSerialParameters_dataBits_parity_stopBits(
334            &self,
335            speed: u32,
336            n_bits: u8,
337            parity: BluetoothRFCOMMParityType,
338            bit_stop: u8,
339        ) -> IOReturn;
340
341        #[cfg(feature = "Bluetooth")]
342        /// Sends an error to the remote side.
343        ///
344        /// Parameter `lineStatus`: the error type. The error code can be NoError, OverrunError, ParityError or FramingError.
345        ///
346        /// Returns: An error code value. 0 if successful.
347        #[unsafe(method(sendRemoteLineStatus:))]
348        #[unsafe(method_family = none)]
349        pub unsafe fn sendRemoteLineStatus(
350            &self,
351            line_status: BluetoothRFCOMMLineStatus,
352        ) -> IOReturn;
353
354        /// Allows an object to register itself as a client of the RFCOMM channel.
355        ///
356        /// A channel delegate is the object the RFCOMM channel uses as target for data and events. The
357        /// developer will implement only the the methods he/she is interested in. A list of the
358        /// possible methods is at the end of this file in the definition of the informal protocol
359        /// IOBluetoothRFCOMMChannelDelegate.
360        ///
361        /// NOTE: This method is only available in Mac OS X 10.2.5 (Bluetooth v1.2) or later.
362        /// NOTE: Before Mac OS X 10.6, the delegate was retained.  On 10.6 and later, it is not.
363        ///
364        /// Parameter `delegate`: The object that will play the role of channel delegate [NOTE the rfcomm channel will reatin the delegate].
365        ///
366        /// Returns: Returns kIOReturnSuccess if the delegate is successfully registered.
367        ///
368        /// # Safety
369        ///
370        /// - `delegate` should be of the correct type.
371        /// - `delegate` might not allow `None`.
372        #[unsafe(method(setDelegate:))]
373        #[unsafe(method_family = none)]
374        pub unsafe fn setDelegate(&self, delegate: Option<&AnyObject>) -> IOReturn;
375
376        /// Returns the object delegate
377        ///
378        /// Returns: the current delegate, or nil
379        #[unsafe(method(delegate))]
380        #[unsafe(method_family = none)]
381        pub unsafe fn delegate(&self) -> Option<Retained<AnyObject>>;
382
383        #[cfg(feature = "Bluetooth")]
384        /// Returns the object rfcomm channel ID.
385        ///
386        /// Returns: the RFCOMM channel number .
387        #[unsafe(method(getChannelID))]
388        #[unsafe(method_family = none)]
389        pub unsafe fn getChannelID(&self) -> BluetoothRFCOMMChannelID;
390
391        /// Returns the direction of the channel.  An incoming channel is one that was opened by the remote
392        /// device.
393        ///
394        /// Returns: Returns TRUE if the channel was opened by the remote device, FALSE if the channel was opened by this object.
395        #[unsafe(method(isIncoming))]
396        #[unsafe(method_family = none)]
397        pub unsafe fn isIncoming(&self) -> bool;
398
399        #[cfg(feature = "IOBluetoothDevice")]
400        /// Returns the Bluetooth Device that carries the rfcomm data.
401        ///
402        /// Returns: the IOBluetoothDevice object .
403        #[unsafe(method(getDevice))]
404        #[unsafe(method_family = none)]
405        pub unsafe fn getDevice(&self) -> Option<Retained<IOBluetoothDevice>>;
406
407        #[cfg(feature = "IOBluetoothUserLib")]
408        /// Returns the IOBluetoothObjectID of the given IOBluetoothRFCOMMChannel.
409        ///
410        /// The IOBluetoothObjectID can be used as a global reference for a given IOBluetoothRFCOMMChannel.  It allows
411        /// two separate applications to refer to the same IOBluetoothRFCOMMChannel.
412        ///
413        /// Returns: Returns the IOBluetoothObjectID of the given IOBluetoothRFCOMMChannel.
414        #[unsafe(method(getObjectID))]
415        #[unsafe(method_family = none)]
416        pub unsafe fn getObjectID(&self) -> IOBluetoothObjectID;
417
418        #[cfg(feature = "IOBluetoothUserNotification")]
419        /// Allows a client to register for a channel close notification.
420        ///
421        /// The given selector will be called on the target observer when the RFCOMM channel is closed.
422        /// The selector should contain two arguments.  The first is the user notification object. The second
423        /// is the IOBluetoothRFCOMMChannel that was closed.
424        ///
425        /// Parameter `observer`: Target observer object
426        ///
427        /// Parameter `inSelector`: Selector to be sent to the observer when the RFCOMM channel is closed.
428        ///
429        /// Returns: Returns an IOBluetoothUserNotification representing the outstanding RFCOMM channel close notification.
430        /// To unregister the notification, call -unregister of the returned IOBluetoothUserNotification
431        /// object.  If an error is encountered creating the notification, nil is returned.
432        ///
433        /// # Safety
434        ///
435        /// - `observer` should be of the correct type.
436        /// - `observer` might not allow `None`.
437        /// - `in_selector` must be a valid selector.
438        #[unsafe(method(registerForChannelCloseNotification:selector:))]
439        #[unsafe(method_family = none)]
440        pub unsafe fn registerForChannelCloseNotification_selector(
441            &self,
442            observer: Option<&AnyObject>,
443            in_selector: Option<Sel>,
444        ) -> Option<Retained<IOBluetoothUserNotification>>;
445    );
446}
447
448/// Methods declared on superclass `NSObject`.
449#[cfg(feature = "IOBluetoothObject")]
450impl IOBluetoothRFCOMMChannel {
451    extern_methods!(
452        #[unsafe(method(init))]
453        #[unsafe(method_family = init)]
454        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
455
456        #[unsafe(method(new))]
457        #[unsafe(method_family = new)]
458        pub unsafe fn new() -> Retained<Self>;
459    );
460}
461
462extern_protocol!(
463    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothrfcommchanneldelegate?language=objc)
464    pub unsafe trait IOBluetoothRFCOMMChannelDelegate {
465        #[cfg(feature = "IOBluetoothObject")]
466        /// # Safety
467        ///
468        /// - `rfcomm_channel` might not allow `None`.
469        /// - `data_pointer` must be a valid pointer.
470        #[optional]
471        #[unsafe(method(rfcommChannelData:data:length:))]
472        #[unsafe(method_family = none)]
473        unsafe fn rfcommChannelData_data_length(
474            &self,
475            rfcomm_channel: Option<&IOBluetoothRFCOMMChannel>,
476            data_pointer: *mut c_void,
477            data_length: usize,
478        );
479
480        #[cfg(feature = "IOBluetoothObject")]
481        /// # Safety
482        ///
483        /// `rfcomm_channel` might not allow `None`.
484        #[optional]
485        #[unsafe(method(rfcommChannelOpenComplete:status:))]
486        #[unsafe(method_family = none)]
487        unsafe fn rfcommChannelOpenComplete_status(
488            &self,
489            rfcomm_channel: Option<&IOBluetoothRFCOMMChannel>,
490            error: IOReturn,
491        );
492
493        #[cfg(feature = "IOBluetoothObject")]
494        /// # Safety
495        ///
496        /// `rfcomm_channel` might not allow `None`.
497        #[optional]
498        #[unsafe(method(rfcommChannelClosed:))]
499        #[unsafe(method_family = none)]
500        unsafe fn rfcommChannelClosed(&self, rfcomm_channel: Option<&IOBluetoothRFCOMMChannel>);
501
502        #[cfg(feature = "IOBluetoothObject")]
503        /// # Safety
504        ///
505        /// `rfcomm_channel` might not allow `None`.
506        #[optional]
507        #[unsafe(method(rfcommChannelControlSignalsChanged:))]
508        #[unsafe(method_family = none)]
509        unsafe fn rfcommChannelControlSignalsChanged(
510            &self,
511            rfcomm_channel: Option<&IOBluetoothRFCOMMChannel>,
512        );
513
514        #[cfg(feature = "IOBluetoothObject")]
515        /// # Safety
516        ///
517        /// `rfcomm_channel` might not allow `None`.
518        #[optional]
519        #[unsafe(method(rfcommChannelFlowControlChanged:))]
520        #[unsafe(method_family = none)]
521        unsafe fn rfcommChannelFlowControlChanged(
522            &self,
523            rfcomm_channel: Option<&IOBluetoothRFCOMMChannel>,
524        );
525
526        #[cfg(feature = "IOBluetoothObject")]
527        /// # Safety
528        ///
529        /// - `rfcomm_channel` might not allow `None`.
530        /// - `refcon` must be a valid pointer.
531        #[optional]
532        #[unsafe(method(rfcommChannelWriteComplete:refcon:status:))]
533        #[unsafe(method_family = none)]
534        unsafe fn rfcommChannelWriteComplete_refcon_status(
535            &self,
536            rfcomm_channel: Option<&IOBluetoothRFCOMMChannel>,
537            refcon: *mut c_void,
538            error: IOReturn,
539        );
540
541        #[cfg(feature = "IOBluetoothObject")]
542        /// # Safety
543        ///
544        /// - `rfcomm_channel` might not allow `None`.
545        /// - `refcon` must be a valid pointer.
546        #[optional]
547        #[unsafe(method(rfcommChannelWriteComplete:refcon:status:bytesWritten:))]
548        #[unsafe(method_family = none)]
549        unsafe fn rfcommChannelWriteComplete_refcon_status_bytesWritten(
550            &self,
551            rfcomm_channel: Option<&IOBluetoothRFCOMMChannel>,
552            refcon: *mut c_void,
553            error: IOReturn,
554            length: usize,
555        );
556
557        #[cfg(feature = "IOBluetoothObject")]
558        /// # Safety
559        ///
560        /// `rfcomm_channel` might not allow `None`.
561        #[optional]
562        #[unsafe(method(rfcommChannelQueueSpaceAvailable:))]
563        #[unsafe(method_family = none)]
564        unsafe fn rfcommChannelQueueSpaceAvailable(
565            &self,
566            rfcomm_channel: Option<&IOBluetoothRFCOMMChannel>,
567        );
568    }
569);