IOUSBDeviceStruct182

Struct IOUSBDeviceStruct182 

Source
pub struct IOUSBDeviceStruct182 {
Show 36 fields pub QueryInterface: Option<unsafe extern "C-unwind" fn(*mut c_void, REFIID, *mut LPVOID) -> HRESULT>, pub AddRef: Option<unsafe extern "C-unwind" fn(*mut c_void) -> ULONG>, pub Release: Option<unsafe extern "C-unwind" fn(*mut c_void) -> ULONG>, pub CreateDeviceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut *mut CFRunLoopSource) -> IOReturn>, pub GetDeviceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void) -> *mut CFRunLoopSource>, pub CreateDeviceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut mach_port_t) -> IOReturn>, pub GetDeviceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void) -> mach_port_t>, pub USBDeviceOpen: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>, pub USBDeviceClose: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>, pub GetDeviceClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>, pub GetDeviceSubClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>, pub GetDeviceProtocol: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>, pub GetDeviceVendor: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>, pub GetDeviceProduct: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>, pub GetDeviceReleaseNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>, pub GetDeviceAddress: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut USBDeviceAddress) -> IOReturn>, pub GetDeviceBusPowerAvailable: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> IOReturn>, pub GetDeviceSpeed: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>, pub GetNumberOfConfigurations: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>, pub GetLocationID: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> IOReturn>, pub GetConfigurationDescriptorPtr: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBConfigurationDescriptorPtr) -> IOReturn>, pub GetConfiguration: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>, pub SetConfiguration: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>, pub GetBusFrameNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u64, *mut i32) -> IOReturn>, pub ResetDevice: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>, pub DeviceRequest: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequest) -> IOReturn>, pub DeviceRequestAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequest, IOAsyncCallback1, *mut c_void) -> IOReturn>, pub CreateInterfaceIterator: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBFindInterfaceRequest, *mut io_iterator_t) -> IOReturn>, pub USBDeviceOpenSeize: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>, pub DeviceRequestTO: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequestTO) -> IOReturn>, pub DeviceRequestAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequestTO, IOAsyncCallback1, *mut c_void) -> IOReturn>, pub USBDeviceSuspend: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>, pub USBDeviceAbortPipeZero: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>, pub USBGetManufacturerStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>, pub USBGetProductStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>, pub USBGetSerialNumberStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>, /* private fields */
}
Available on crate features AppleUSBDefinitions and IOUSBLib and USB and libc only.
Expand description

The object you use to access USB devices from user space, returned by the IOUSBFamily version 1.8.2 and above.

The functions listed here include all of the functions defined for the IOUSBDeviceInterface and some new functions that are available on Mac OS X version 10.0.4 and later. Super: IOUSBDeviceInterface

See also Apple’s documentation

Fields§

§QueryInterface: Option<unsafe extern "C-unwind" fn(*mut c_void, REFIID, *mut LPVOID) -> HRESULT>§AddRef: Option<unsafe extern "C-unwind" fn(*mut c_void) -> ULONG>§Release: Option<unsafe extern "C-unwind" fn(*mut c_void) -> ULONG>§CreateDeviceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut *mut CFRunLoopSource) -> IOReturn>§GetDeviceAsyncEventSource: Option<unsafe extern "C-unwind" fn(*mut c_void) -> *mut CFRunLoopSource>§CreateDeviceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut mach_port_t) -> IOReturn>§GetDeviceAsyncPort: Option<unsafe extern "C-unwind" fn(*mut c_void) -> mach_port_t>§USBDeviceOpen: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>§USBDeviceClose: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>§GetDeviceClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§GetDeviceSubClass: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§GetDeviceProtocol: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§GetDeviceVendor: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>§GetDeviceProduct: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>§GetDeviceReleaseNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u16) -> IOReturn>§GetDeviceAddress: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut USBDeviceAddress) -> IOReturn>§GetDeviceBusPowerAvailable: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> IOReturn>§GetDeviceSpeed: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§GetNumberOfConfigurations: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§GetLocationID: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u32) -> IOReturn>§GetConfigurationDescriptorPtr: Option<unsafe extern "C-unwind" fn(*mut c_void, u8, *mut IOUSBConfigurationDescriptorPtr) -> IOReturn>§GetConfiguration: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>§SetConfiguration: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>§GetBusFrameNumber: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u64, *mut i32) -> IOReturn>§ResetDevice: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>§DeviceRequest: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequest) -> IOReturn>§DeviceRequestAsync: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequest, IOAsyncCallback1, *mut c_void) -> IOReturn>§CreateInterfaceIterator: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBFindInterfaceRequest, *mut io_iterator_t) -> IOReturn>§USBDeviceOpenSeize: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>

Opens the IOUSBDevice for exclusive access.

This function opens the IOUSBDevice for exclusive access. If another client has the device opened, an attempt is made to get that client to close it before returning. Before the client can issue commands that change the state of the device, it must have succeeded in opening the device. This establishes an exclusive link between the client’s task and the actual device. Availability: This function is only available with IOUSBDeviceInterface182 and above.

Parameter self: Pointer to the IOUSBDeviceInterface.

Returns: Returns kIOReturnExclusiveAccess if some other task has the device opened already and refuses to close it, kIOReturnError if the connection with the kernel can not be established or kIOReturnSuccess if successful.

§DeviceRequestTO: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequestTO) -> IOReturn>

Sends a USB request on the default control pipe.

The device does not have to be open to use this function, but standard requests that change the state of the device may require that the device is opened first. This function sends a USB request on the default control pipe. The IOUSBDevRequestTO structure allows the client to specify timeout values for this request.

Availability: This function is only available with IOUSBDeviceInterface182 and above.

Parameter self: Pointer to the IOUSBDeviceInterface.

Parameter req: Pointer to an IOUSBDevRequestTO containing the request.

Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnAborted if the thread is interrupted before the call completes, or kIOReturnNotOpen if the device is not open for exclusive access.

§DeviceRequestAsyncTO: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut IOUSBDevRequestTO, IOAsyncCallback1, *mut c_void) -> IOReturn>

Sends an asynchronous USB request on the default control pipe.

The device does not have to be open to use this function, but standard requests that change the state of the device may require that the device is opened first. This function sends an asynchronous USB request on the default control pipe. The IOUSBDevRequestTO structure allows the client to specify timeout values for this request. Availability: This function is only available with IOUSBDeviceInterface182 and above.

Parameter self: Pointer to the IOUSBDeviceInterface.

Parameter req: Pointer to an IOUSBDevRequestTO containing the request.

Parameter callback: An IOAsyncCallback1 method. Upon completion, the arg0 argument of the AsyncCallback1 will contain the number of bytes that were actually transferred in the DeviceRequest. A message addressed to this callback is posted to the Async port upon completion.

Parameter refCon: Arbitrary pointer which is passed as a parameter to the callback routine.

Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNotOpen if the device is not open for exclusive access, orkIOUSBNoAsyncPortErr if no Async port has been created for this interface.

§USBDeviceSuspend: Option<unsafe extern "C-unwind" fn(*mut c_void, u8) -> IOReturn>

Tells the USB Family to either suspend or resume the port to which a device is attached.

The device must be open to use this function. Availability: This function is only available with IOUSBDeviceInterface182 and above.

Parameter self: Pointer to the IOUSBDeviceInterface.

Parameter suspend: TRUE to cause the port to be suspended, FALSE to cause it to be resumed.

Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the device is not open for exclusive access.

§USBDeviceAbortPipeZero: Option<unsafe extern "C-unwind" fn(*mut c_void) -> IOReturn>

Aborts a transaction on the default control pipe.

The device does not have to be open to use this function. Availability: This function is only available with IOUSBDeviceInterface182 and above.

Parameter self: Pointer to the IOUSBDeviceInterface.

Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the device is not open for exclusive access.

§USBGetManufacturerStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>

Returns the manufacturer string index in the device descriptor.

The device does not have to be open to use this function. Availability: This function is only available with IOUSBDeviceInterface182 and above.

Parameter self: Pointer to the IOUSBDeviceInterface.

Parameter msi: Pointer to UInt8 to hold the string index.

Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.

§USBGetProductStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>

Returns the product string index in the device descriptor.

The device does not have to be open to use this function. Availability: This function is only available with IOUSBDeviceInterface182 and above.

Parameter self: Pointer to the IOUSBDeviceInterface.

Parameter psi: Pointer to UInt8 to hold the string index.

Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.

§USBGetSerialNumberStringIndex: Option<unsafe extern "C-unwind" fn(*mut c_void, *mut u8) -> IOReturn>

Returns the serial number string index in the device descriptor.

The device does not have to be open to use this function. Availability: This function is only available with IOUSBDeviceInterface182 and above.

Parameter self: Pointer to the IOUSBDeviceInterface.

Parameter snsi: Pointer to UInt8 to hold the string index.

Returns: Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.

Trait Implementations§

Source§

impl Clone for IOUSBDeviceStruct182

Available on crate feature usb only.
Source§

fn clone(&self) -> IOUSBDeviceStruct182

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IOUSBDeviceStruct182

Available on crate feature usb only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Encode for IOUSBDeviceStruct182

Available on crate features usb and objc2 only.
Source§

const ENCODING: Encoding

The Objective-C type-encoding for this type.
Source§

impl PartialEq for IOUSBDeviceStruct182

Available on crate feature usb only.
Source§

fn eq(&self, other: &IOUSBDeviceStruct182) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RefEncode for IOUSBDeviceStruct182

Available on crate features usb and objc2 only.
Source§

const ENCODING_REF: Encoding

The Objective-C type-encoding for a reference of this type. Read more
Source§

impl Copy for IOUSBDeviceStruct182

Available on crate feature usb only.
Source§

impl StructuralPartialEq for IOUSBDeviceStruct182

Available on crate feature usb only.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> EncodeArgument for T
where T: Encode,

Source§

const ENCODING_ARGUMENT: Encoding = T::ENCODING

The Objective-C type-encoding for this type.
Source§

impl<T> EncodeReturn for T
where T: Encode,

Source§

const ENCODING_RETURN: Encoding = T::ENCODING

The Objective-C type-encoding for this type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,