objc2_io_usb_host/generated/IOUSBHostPipe.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6#[cfg(feature = "objc2-io-kit")]
7use objc2_io_kit::*;
8
9use crate::*;
10
11extern_class!(
12 /// The IOUSBHostIOSource representing a USB endpoint
13 ///
14 /// This class provides functionality to transfer data across USB.
15 ///
16 /// See also [Apple's documentation](https://developer.apple.com/documentation/iousbhost/iousbhostpipe?language=objc)
17 #[unsafe(super(IOUSBHostIOSource, NSObject))]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(feature = "IOUSBHostIOSource")]
20 pub struct IOUSBHostPipe;
21);
22
23#[cfg(feature = "IOUSBHostIOSource")]
24extern_conformance!(
25 unsafe impl NSObjectProtocol for IOUSBHostPipe {}
26);
27
28#[cfg(feature = "IOUSBHostIOSource")]
29impl IOUSBHostPipe {
30 extern_methods!(
31 #[cfg(feature = "objc2-io-kit")]
32 /// Retrieve the Original descriptor used when creating the pipe.
33 ///
34 /// Returns: IOUSBHostIOSourceDescriptors pointer
35 #[unsafe(method(originalDescriptors))]
36 #[unsafe(method_family = none)]
37 pub unsafe fn originalDescriptors(&self) -> NonNull<IOUSBHostIOSourceDescriptors>;
38
39 #[cfg(feature = "objc2-io-kit")]
40 /// Retrieve the current descriptor controlling the endpoint.
41 ///
42 /// Returns: IOUSBHostIOSourceDescriptors pointer
43 #[unsafe(method(descriptors))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn descriptors(&self) -> NonNull<IOUSBHostIOSourceDescriptors>;
46
47 #[cfg(feature = "objc2-io-kit")]
48 /// Adjust behavior of periodic endpoints to consume a different amount of bus bandwidth
49 ///
50 /// Periodic (interrupt and isochronous) endpoints reserve bus bandwidth when they are
51 /// created, which takes into account max packet size, burst size, and the endpoint
52 /// service interval. If a function driver knows the endpoint will not use all of the
53 /// allocated bandwidth, the
54 /// <code>
55 /// adjustPolicy
56 /// </code>
57 /// method may be used to reduce the
58 /// bandwidth reserved for the endpoint. The original endpoint descriptors should be
59 /// copied and modified to adjust max packet size, mult, burst, and interval, and then
60 /// passed to
61 /// <code>
62 /// adjustPolicy
63 /// </code>
64 /// . The altered descriptors must pass
65 /// <code>
66 /// validateEndpointDescriptor(...)
67 /// </code>
68 /// from the kernel for policy changes to be
69 /// processed.
70 ///
71 /// Parameter `descriptors`: Reference to an IOUSBHostIOSourceDescriptors describing the
72 /// new endpoint policy
73 ///
74 /// Returns: YES on success, an IOReturn error code will be reported on failure
75 ///
76 /// # Safety
77 ///
78 /// `descriptors` must be a valid pointer.
79 #[unsafe(method(adjustPipeWithDescriptors:error:_))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn adjustPipeWithDescriptors_error(
82 &self,
83 descriptors: NonNull<IOUSBHostIOSourceDescriptors>,
84 ) -> Result<(), Retained<NSError>>;
85
86 /// Retrieve the current idle suspend timeout.
87 /// See
88 ///
89 /// ```text
90 /// setIdleTimeout
91 /// ```
92 ///
93 ///
94 /// Returns: The amount of time after all pipes are idle to wait before
95 /// suspending the device,
96 #[unsafe(method(idleTimeout))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn idleTimeout(&self) -> NSTimeInterval;
99
100 /// Sets the desired idle suspend timeout for the interface
101 ///
102 /// Once the interface is considered idle, it will defer electrical suspend of the
103 /// device for the specified duration.
104 ///
105 /// Parameter `idleTimeout`: The amount of time after all pipes are idle to
106 /// wait before suspending the device.
107 ///
108 /// Returns: YES on success. An IOReturn error code will be reported on failure.
109 #[unsafe(method(setIdleTimeout:error:_))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn setIdleTimeout_error(
112 &self,
113 idle_timeout: NSTimeInterval,
114 ) -> Result<(), Retained<NSError>>;
115
116 /// Clear the halt condition of the pipe.
117 ///
118 /// When a bulk or interrupt USB endpoint encounters any IO error other than a timeout,
119 /// it transitions to a Halted state which must be cleared to perform additional IO on
120 /// the endpoint. This method will clear the halted condition for the endpoint,
121 /// including sending a CLEAR_TT_BUFFER control request (USB 2.0 11.24.2.3) to an
122 /// intermediate hub if required. All pending IO on the endpoint will be aborted, and
123 /// the data toggle for the endpoint will also be reset. ClearStall is not required for
124 /// control endpoints.
125 ///
126 /// Returns: YES on success, an IOReturn error code will be reported on failure
127 #[unsafe(method(clearStallWithError:_))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn clearStallWithError(&self) -> Result<(), Retained<NSError>>;
130
131 #[cfg(feature = "objc2-io-kit")]
132 /// Send a request on a control endpoint
133 ///
134 /// This method will send a synchronous request on a control endpoint, and will not
135 /// return until the request is complete.
136 ///
137 /// Parameter `request`: IOUSBDeviceRequest structure.
138 ///
139 /// Parameter `data`: An NSMutableData* defining the memory to use for the request's data phase.
140 ///
141 /// Parameter `bytesTransferred`: An NSUInteger reference which will be updated with the byte count
142 /// of the completed data phase.
143 ///
144 /// Parameter `completionTimeout`: Timeout of the request. If 0, the request will never timeout.
145 /// The default value is IOUSBHostDefaultControlCompletionTimeout.
146 ///
147 /// Returns: YES on success, an IOReturn error code will be reported on failure
148 ///
149 /// # Safety
150 ///
151 /// `bytes_transferred` must be a valid pointer or null.
152 #[unsafe(method(sendControlRequest:data:bytesTransferred:completionTimeout:error:_))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn sendControlRequest_data_bytesTransferred_completionTimeout_error(
155 &self,
156 request: IOUSBDeviceRequest,
157 data: Option<&NSMutableData>,
158 bytes_transferred: *mut NSUInteger,
159 completion_timeout: NSTimeInterval,
160 ) -> Result<(), Retained<NSError>>;
161
162 #[cfg(feature = "objc2-io-kit")]
163 /// Send a request on a control endpoint
164 ///
165 /// This method will send a synchronous request on a control endpoint, and will not
166 /// return until the request is complete.
167 ///
168 /// Parameter `request`: IOUSBDeviceRequest structure.
169 ///
170 /// Parameter `data`: An NSMutableData* defining the memory to use for the request's data phase.
171 ///
172 /// Parameter `bytesTransferred`: An NSUInteger reference which will be updated with the byte count
173 /// of the completed data phase.
174 ///
175 /// Returns: YES on success, an IOReturn error code will be reported on failure
176 ///
177 /// # Safety
178 ///
179 /// `bytes_transferred` must be a valid pointer or null.
180 #[unsafe(method(sendControlRequest:data:bytesTransferred:error:_))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn sendControlRequest_data_bytesTransferred_error(
183 &self,
184 request: IOUSBDeviceRequest,
185 data: Option<&NSMutableData>,
186 bytes_transferred: *mut NSUInteger,
187 ) -> Result<(), Retained<NSError>>;
188
189 #[cfg(feature = "objc2-io-kit")]
190 /// Send a request on a control endpoint
191 ///
192 /// This method will send a synchronous request on a control endpoint, and will not
193 /// return until the request is complete.
194 ///
195 /// Parameter `request`: IOUSBDeviceRequest structure.
196 ///
197 /// Returns: YES on success, an IOReturn error code will be reported on failure
198 #[unsafe(method(sendControlRequest:error:_))]
199 #[unsafe(method_family = none)]
200 pub unsafe fn sendControlRequest_error(
201 &self,
202 request: IOUSBDeviceRequest,
203 ) -> Result<(), Retained<NSError>>;
204
205 #[cfg(all(
206 feature = "IOUSBHostDefinitions",
207 feature = "block2",
208 feature = "objc2-io-kit"
209 ))]
210 /// Enqueue a request on a control endpoint
211 ///
212 /// This method will enqueue an asynchronous request on a control endpoint.
213 /// If successful, the provided completion routine will be called to report the status
214 /// of the completed IO. Completions will be serviced in the
215 /// IOUSBHostCompletionHandler on the IOUSBHostInterface's dispatch queue.
216 ///
217 /// Parameter `request`: Reference IOUSBDeviceRequest structure.
218 ///
219 /// Parameter `data`: An NSMutableData* defining the memory to use for the request's data phase.
220 ///
221 /// Parameter `completionTimeout`: Timeout of the request. If 0, the request will
222 /// never timeout. The default value is IOUSBHostDefaultControlCompletionTimeout.
223 ///
224 /// Parameter `completionHandler`: an IOUSBHostCompletionHandler
225 ///
226 /// Returns: YES on success, an IOReturn error code will be reported on failure
227 ///
228 /// # Safety
229 ///
230 /// `completion_handler` must be a valid pointer or null.
231 #[unsafe(method(enqueueControlRequest:data:completionTimeout:error:completionHandler:))]
232 #[unsafe(method_family = none)]
233 pub unsafe fn enqueueControlRequest_data_completionTimeout_error_completionHandler(
234 &self,
235 request: IOUSBDeviceRequest,
236 data: Option<&NSMutableData>,
237 completion_timeout: NSTimeInterval,
238 error: Option<&mut Option<Retained<NSError>>>,
239 completion_handler: IOUSBHostCompletionHandler,
240 ) -> bool;
241
242 #[cfg(all(
243 feature = "IOUSBHostDefinitions",
244 feature = "block2",
245 feature = "objc2-io-kit"
246 ))]
247 /// Enqueue a request on a control endpoint
248 ///
249 /// This method will enqueue an asynchronous request on a control endpoint.
250 /// If successful, the provided completion routine will be called to report the status
251 /// of the completed IO. Completions will be serviced in the
252 /// IOUSBHostCompletionHandler on the IOUSBHostInterface's dispatch queue.
253 ///
254 /// Parameter `request`: Reference IOUSBDeviceRequest structure.
255 ///
256 /// Parameter `data`: An NSMutableData* defining the memory to use for the request's data phase.
257 ///
258 /// Parameter `completionHandler`: an IOUSBHostCompletionHandler
259 ///
260 /// Returns: YES on success, an IOReturn error code will be reported on failure
261 ///
262 /// # Safety
263 ///
264 /// `completion_handler` must be a valid pointer or null.
265 #[unsafe(method(enqueueControlRequest:data:error:completionHandler:))]
266 #[unsafe(method_family = none)]
267 pub unsafe fn enqueueControlRequest_data_error_completionHandler(
268 &self,
269 request: IOUSBDeviceRequest,
270 data: Option<&NSMutableData>,
271 error: Option<&mut Option<Retained<NSError>>>,
272 completion_handler: IOUSBHostCompletionHandler,
273 ) -> bool;
274
275 #[cfg(all(
276 feature = "IOUSBHostDefinitions",
277 feature = "block2",
278 feature = "objc2-io-kit"
279 ))]
280 /// Enqueue a request on a control endpoint
281 ///
282 /// This method will enqueue an asynchronous request on a control endpoint.
283 /// If successful, the provided completion routine will be called to report the status
284 /// of the completed IO. Completions will be serviced in the
285 /// IOUSBHostCompletionHandler on the IOUSBHostInterface's dispatch queue.
286 ///
287 /// Parameter `request`: Reference IOUSBDeviceRequest structure.
288 ///
289 /// Parameter `completionHandler`: an IOUSBHostCompletionHandler
290 ///
291 /// Returns: YES on success, an IOReturn error code will be reported on failure
292 ///
293 /// # Safety
294 ///
295 /// `completion_handler` must be a valid pointer or null.
296 #[unsafe(method(enqueueControlRequest:error:completionHandler:))]
297 #[unsafe(method_family = none)]
298 pub unsafe fn enqueueControlRequest_error_completionHandler(
299 &self,
300 request: IOUSBDeviceRequest,
301 error: Option<&mut Option<Retained<NSError>>>,
302 completion_handler: IOUSBHostCompletionHandler,
303 ) -> bool;
304
305 #[cfg(feature = "IOUSBHostDefinitions")]
306 /// Abort pending I/O requests.
307 ///
308 /// This method will abort all pending I/O requests. If
309 /// <code>
310 /// option
311 /// </code>
312 /// includes
313 /// <code>
314 /// IOUSBHostAbortOptionSynchronous
315 /// </code>
316 /// , this method will block any new IO
317 /// requests unless they are submitted from an aborted IO's completion routine.
318 ///
319 /// Parameter `option`: IOUSBHostAbortOption by default IOUSBHostAbortOptionSynchronous is used
320 ///
321 /// Returns: YES on success, an IOReturn error code will be reported on failure
322 #[unsafe(method(abortWithOption:error:_))]
323 #[unsafe(method_family = none)]
324 pub unsafe fn abortWithOption_error(
325 &self,
326 option: IOUSBHostAbortOption,
327 ) -> Result<(), Retained<NSError>>;
328
329 /// Abort pending I/O requests.
330 ///
331 /// This method will abort all pending I/O requests. If
332 /// <code>
333 /// option
334 /// </code>
335 /// includes
336 /// <code>
337 /// IOUSBHostAbortOptionSynchronous
338 /// </code>
339 /// , this method will block any new IO
340 /// requests unless they are submitted from an aborted IO's completion routine.
341 ///
342 /// Returns: YES on success, an IOReturn error code will be reported on failure
343 #[unsafe(method(abortWithError:_))]
344 #[unsafe(method_family = none)]
345 pub unsafe fn abortWithError(&self) -> Result<(), Retained<NSError>>;
346
347 /// Send an IO request on the source
348 ///
349 /// This method will send a synchronous request on the IO source, and will not return
350 /// until the request is complete.
351 ///
352 /// Parameter `data`: An NSMutableData* containing the buffer to use for the transfer. nil will send a zero length packet.
353 ///
354 /// Parameter `bytesTransferred`: NSUInteger pointer which will be updated with the bytes transferred
355 /// during the request
356 ///
357 /// Parameter `completionTimeout`: Timeout of the request. If 0, the request will never timeout.
358 /// Must be 0 for interrupt pipes and streams.
359 ///
360 /// Returns: YES on success, an IOReturn error code will be reported on failure
361 ///
362 /// # Safety
363 ///
364 /// `bytes_transferred` must be a valid pointer or null.
365 #[unsafe(method(sendIORequestWithData:bytesTransferred:completionTimeout:error:_))]
366 #[unsafe(method_family = none)]
367 pub unsafe fn sendIORequestWithData_bytesTransferred_completionTimeout_error(
368 &self,
369 data: Option<&NSMutableData>,
370 bytes_transferred: *mut NSUInteger,
371 completion_timeout: NSTimeInterval,
372 ) -> Result<(), Retained<NSError>>;
373
374 #[cfg(all(feature = "IOUSBHostDefinitions", feature = "block2"))]
375 /// Enqueue an IO request on the source
376 ///
377 /// This method is used to issue an asynchronous I/O request on a bulk or interrupt
378 /// pipe.
379 ///
380 /// Parameter `data`: An NSMutableData* containing the buffer to use for the transfer. nil will send a zero length packet.
381 ///
382 /// Parameter `completionTimeout`: Timeout of the request. If 0, the request will never timeout.
383 /// Must be 0 for interrupt pipes and streams.
384 ///
385 /// Parameter `completionHandler`: an IOUSBHostCompletionHandler
386 ///
387 /// Returns: YES on success, an IOReturn error code will be reported on failure
388 ///
389 /// # Safety
390 ///
391 /// `completion_handler` must be a valid pointer or null.
392 #[unsafe(method(enqueueIORequestWithData:completionTimeout:error:completionHandler:))]
393 #[unsafe(method_family = none)]
394 pub unsafe fn enqueueIORequestWithData_completionTimeout_error_completionHandler(
395 &self,
396 data: Option<&NSMutableData>,
397 completion_timeout: NSTimeInterval,
398 error: Option<&mut Option<Retained<NSError>>>,
399 completion_handler: IOUSBHostCompletionHandler,
400 ) -> bool;
401
402 #[cfg(feature = "IOUSBHostDefinitions")]
403 /// Send a request on an isochronous endpoint
404 ///
405 /// This method is used to issue isochronous requests. The caller allocates and
406 /// initializes an array of IOUSBHostIsochronousFrame structures, which is used to
407 /// describe the frames that will be transferred. See
408 ///
409 /// ```text
410 /// IOUSBHostIsochronousFrame
411 /// ```
412 ///
413 /// for information regarding structure
414 /// initialization requirements and usage.
415 ///
416 /// Parameter `data`: An NSMutableData* to be used as the backing store for the I/O.
417 ///
418 /// Parameter `frameList`: Pointer first element in an IOUSBHostIsochronousFrame array. The array
419 /// must contain at least frameListCount elements.
420 ///
421 /// Parameter `frameListCount`: Number of elements in
422 /// <code>
423 /// frameList
424 /// </code>
425 /// .
426 ///
427 /// Parameter `firstFrameNumber`: Frame number which this request should begin on. The current frame
428 /// number can be queried via
429 /// <code>
430 /// [IOUSBHostObject getFrameNumber]
431 /// </code>
432 /// If 0, the transfer will start on the next available frame (XHCI only).
433 ///
434 /// Returns: YES on success, an IOReturn error code will be reported on failure
435 ///
436 /// # Safety
437 ///
438 /// `frame_list` must be a valid pointer.
439 #[deprecated]
440 #[unsafe(method(sendIORequestWithData:frameList:frameListCount:firstFrameNumber:error:_))]
441 #[unsafe(method_family = none)]
442 pub unsafe fn sendIORequestWithData_frameList_frameListCount_firstFrameNumber_error(
443 &self,
444 data: &NSMutableData,
445 frame_list: NonNull<IOUSBHostIsochronousFrame>,
446 frame_list_count: NSUInteger,
447 first_frame_number: u64,
448 ) -> Result<(), Retained<NSError>>;
449
450 #[cfg(all(feature = "IOUSBHostDefinitions", feature = "block2"))]
451 /// Send a request on an isochronous endpoint
452 ///
453 /// This method is used to issue isochronous requests. The caller allocates and
454 /// initializes an array of IOUSBHostIsochronousFrame structures, which is used to
455 /// describe the frames that will be transferred. See
456 ///
457 /// ```text
458 /// IOUSBHostIsochronousFrame
459 /// ```
460 ///
461 /// for information regarding structure
462 /// initialization requirements and usage.
463 ///
464 /// Parameter `data`: An NSMutableData* to be used as the backing store for the I/O.
465 ///
466 /// Parameter `frameList`: Pointer first element in an IOUSBHostIsochronousFrame array. The array
467 /// must contain at least frameListCount elements.
468 ///
469 /// Parameter `frameListCount`: Number of elements in
470 /// <code>
471 /// frameList
472 /// </code>
473 /// .
474 ///
475 /// Parameter `firstFrameNumber`: Frame number which this request should begin on. The current frame
476 /// number can be queried via
477 /// <code>
478 /// [IOUSBHostObject frameNumberWithTime]
479 /// </code>
480 /// If 0, the transfer will start on the next available frame (XHCI only).
481 ///
482 /// Parameter `completionHandler`: an IOUSBHostIsochronousCompletionHandler
483 ///
484 /// Returns: YES on success, an IOReturn error code will be reported on failure
485 ///
486 /// # Safety
487 ///
488 /// - `frame_list` must be a valid pointer.
489 /// - `completion_handler` must be a valid pointer or null.
490 #[deprecated]
491 #[unsafe(method(enqueueIORequestWithData:frameList:frameListCount:firstFrameNumber:error:completionHandler:))]
492 #[unsafe(method_family = none)]
493 pub unsafe fn enqueueIORequestWithData_frameList_frameListCount_firstFrameNumber_error_completionHandler(
494 &self,
495 data: &NSMutableData,
496 frame_list: NonNull<IOUSBHostIsochronousFrame>,
497 frame_list_count: NSUInteger,
498 first_frame_number: u64,
499 error: Option<&mut Option<Retained<NSError>>>,
500 completion_handler: IOUSBHostIsochronousCompletionHandler,
501 ) -> bool;
502
503 #[cfg(feature = "IOUSBHostDefinitions")]
504 /// Send a request on an isochronous endpoint
505 ///
506 /// This method is used to issue isochronous requests. The caller allocates and
507 /// initializes an array of IOUSBHostIsochronousTransaction structures, which is used to
508 /// describe the frames that will be transferred. See
509 ///
510 /// ```text
511 /// IOUSBHostIsochronousTransaction
512 /// ```
513 ///
514 /// for information regarding structure
515 /// initialization requirements and usage.
516 ///
517 /// Parameter `data`: An NSMutableData* to be used as the backing store for the I/O.
518 ///
519 /// Parameter `transactionList`: Pointer to the first element in an IOUSBHostIsochronousTransaction
520 /// array. The array must contain at least transactionListCount elements.
521 ///
522 /// Parameter `transactionListCount`: Number of elements in
523 /// <code>
524 /// transactionList
525 /// </code>
526 /// .
527 ///
528 /// Parameter `firstFrameNumber`: Frame number which this request should begin on. The current frame
529 /// number can be queried via
530 /// <code>
531 /// [IOUSBHostObject getFrameNumber]
532 /// </code>
533 /// If 0, the transfer will start on the next available frame (XHCI only).
534 ///
535 /// Parameter `options`: Flags that specify additional behavior for every transaction in this transfer.
536 /// See
537 ///
538 /// ```text
539 /// IOUSBHostIsochronousTransferOptions
540 /// ```
541 ///
542 /// for more details.
543 ///
544 /// Returns: YES on success, an IOReturn error code will be reported on failure
545 ///
546 /// # Safety
547 ///
548 /// `transaction_list` must be a valid pointer.
549 #[unsafe(method(sendIORequestWithData:transactionList:transactionListCount:firstFrameNumber:options:error:_))]
550 #[unsafe(method_family = none)]
551 pub unsafe fn sendIORequestWithData_transactionList_transactionListCount_firstFrameNumber_options_error(
552 &self,
553 data: &NSMutableData,
554 transaction_list: NonNull<IOUSBHostIsochronousTransaction>,
555 transaction_list_count: NSUInteger,
556 first_frame_number: u64,
557 options: IOUSBHostIsochronousTransferOptions,
558 ) -> Result<(), Retained<NSError>>;
559
560 #[cfg(all(feature = "IOUSBHostDefinitions", feature = "block2"))]
561 /// Send a request on an isochronous endpoint
562 ///
563 /// This method is used to issue isochronous requests. The caller allocates and
564 /// initializes an array of IOUSBHostIsochronousTransaction structures, which is used to
565 /// describe the frames that will be transferred. See
566 ///
567 /// ```text
568 /// IOUSBHostIsochronousTransaction
569 /// ```
570 ///
571 /// for information regarding structure
572 /// initialization requirements and usage.
573 ///
574 /// Parameter `data`: An NSMutableData* to be used as the backing store for the I/O.
575 ///
576 /// Parameter `transactionList`: Pointer to the first element in an IOUSBHostIsochronousTransaction
577 /// array. The array must contain at least transactionListCount elements.
578 ///
579 /// Parameter `transactionListCount`: Number of elements in
580 /// <code>
581 /// transactionList
582 /// </code>
583 /// .
584 ///
585 /// Parameter `firstFrameNumber`: Frame number which this request should begin on. The current frame
586 /// number can be queried via
587 /// <code>
588 /// [IOUSBHostObject frameNumberWithTime]
589 /// </code>
590 /// If 0, the transfer will start on the next available frame (XHCI only).
591 ///
592 /// Parameter `options`: Flags that specify additional behavior for every transaction in this transfer.
593 ///
594 /// Parameter `completionHandler`: an IOUSBHostIsochronousTransactionCompletionHandler
595 ///
596 /// Returns: YES on success, an IOReturn error code will be reported on failure
597 ///
598 /// # Safety
599 ///
600 /// - `transaction_list` must be a valid pointer.
601 /// - `completion_handler` must be a valid pointer or null.
602 #[unsafe(method(enqueueIORequestWithData:transactionList:transactionListCount:firstFrameNumber:options:error:completionHandler:))]
603 #[unsafe(method_family = none)]
604 pub unsafe fn enqueueIORequestWithData_transactionList_transactionListCount_firstFrameNumber_options_error_completionHandler(
605 &self,
606 data: &NSMutableData,
607 transaction_list: NonNull<IOUSBHostIsochronousTransaction>,
608 transaction_list_count: NSUInteger,
609 first_frame_number: u64,
610 options: IOUSBHostIsochronousTransferOptions,
611 error: Option<&mut Option<Retained<NSError>>>,
612 completion_handler: IOUSBHostIsochronousTransactionCompletionHandler,
613 ) -> bool;
614
615 /// Enable streams for the IOUSBHostPipe
616 ///
617 /// This method changes the operational mode of the IOUSBHostPipe to allow streaming
618 /// endpoint transfers, and must be called before copyStream will return any
619 /// IOUSBHostStream objects.
620 ///
621 /// Returns: YES on success, an An IOReturn error will be returned if the pipe, device, or
622 /// underlying host controller does not support streams.
623 #[unsafe(method(enableStreamsWithError:_))]
624 #[unsafe(method_family = none)]
625 pub unsafe fn enableStreamsWithError(&self) -> Result<(), Retained<NSError>>;
626
627 /// Disable streams for the IOUSBHostPipe
628 ///
629 /// This method changes the operational mode of the IOUSBHostPipe to disable streaming
630 /// endpoint transfers. Calling this method will synchronously abort any outstanding
631 /// calls on existing IOUSBHostStream objects, and therefore all stream contexts should
632 /// first be set as non-active on the device via an out-of-band (class-defined)
633 /// mechanism (USB 3.1 8.12.1.4).
634 ///
635 /// Returns: YES on success, An IOReturn error will be returned if streams were not enabled for
636 /// this IOUSBHostPipe.
637 #[unsafe(method(disableStreamsWithError:_))]
638 #[unsafe(method_family = none)]
639 pub unsafe fn disableStreamsWithError(&self) -> Result<(), Retained<NSError>>;
640
641 #[cfg(feature = "IOUSBHostStream")]
642 /// Return the stream associated with
643 /// <code>
644 /// streamID
645 /// </code>
646 ///
647 /// This method will return the stream associated with
648 /// <code>
649 /// streamID
650 /// </code>
651 /// .
652 /// The caller must release the IOUSBHostStream when finished using it.
653 /// <code>
654 /// [IOUSBHostPipe enableStreams]
655 /// </code>
656 /// must be called before this
657 /// method will return a stream object.
658 ///
659 /// Parameter `streamID`: Stream ID in the range of 1 to
660 /// <code>
661 /// max
662 /// </code>
663 /// , where
664 /// <code>
665 /// max
666 /// </code>
667 /// can be retrieved by calling
668 /// <code>
669 /// getEndpointMaxStreams
670 /// </code>
671 /// with
672 /// the endpoint descriptors.
673 ///
674 /// Returns: Pointer to an IOUSBHostStream object or nil. nil may be returned if either the
675 /// device or the underlying host controller do not support that stream ID.
676 #[unsafe(method(copyStreamWithStreamID:error:_))]
677 #[unsafe(method_family = copy)]
678 pub unsafe fn copyStreamWithStreamID_error(
679 &self,
680 stream_id: NSUInteger,
681 ) -> Result<Retained<IOUSBHostStream>, Retained<NSError>>;
682 );
683}
684
685/// Methods declared on superclass `IOUSBHostIOSource`.
686#[cfg(feature = "IOUSBHostIOSource")]
687impl IOUSBHostPipe {
688 extern_methods!(
689 #[unsafe(method(init))]
690 #[unsafe(method_family = init)]
691 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
692 );
693}
694
695/// Methods declared on superclass `NSObject`.
696#[cfg(feature = "IOUSBHostIOSource")]
697impl IOUSBHostPipe {
698 extern_methods!(
699 #[unsafe(method(new))]
700 #[unsafe(method_family = new)]
701 pub unsafe fn new() -> Retained<Self>;
702 );
703}