macos: map error type for control timeout
This commit is contained in:
parent
18bb260623
commit
5ac12ef088
2 changed files with 3 additions and 3 deletions
|
|
@ -61,8 +61,6 @@ pub(crate) const kIOUSBTransactionTimeout: c_int = SYS_IOKIT | SUB_IOKIT_USB | 0
|
|||
|
||||
pub(crate) const kIOUSBFindInterfaceDontCare: UInt16 = 0xFFFF;
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
// Type aliases.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -29,7 +29,9 @@ fn status_to_transfer_result(status: IOReturn) -> Result<(), TransferError> {
|
|||
match status {
|
||||
io_kit_sys::ret::kIOReturnSuccess | io_kit_sys::ret::kIOReturnUnderrun => Ok(()),
|
||||
io_kit_sys::ret::kIOReturnNoDevice => Err(TransferError::Disconnected),
|
||||
io_kit_sys::ret::kIOReturnAborted => Err(TransferError::Cancelled),
|
||||
io_kit_sys::ret::kIOReturnAborted | iokit_c::kIOUSBTransactionTimeout => {
|
||||
Err(TransferError::Cancelled)
|
||||
}
|
||||
iokit_c::kIOUSBPipeStalled => Err(TransferError::Stall),
|
||||
_ => Err(TransferError::Unknown(status as u32)),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue