Updated usbhs comments and added usbHsIfIsActive/usbHsIfGetID.

This commit is contained in:
yellows8 2018-11-30 13:07:02 -05:00
parent ee066a27ee
commit e986799784

View File

@ -104,6 +104,8 @@ Result usbHsInitialize(void);
void usbHsExit(void); void usbHsExit(void);
/// Returns the Event loaded during init with autoclear=false. /// Returns the Event loaded during init with autoclear=false.
/// Signaled when a device was removed.
/// When signaled, the user should use \ref usbHsQueryAcquiredInterfaces and cleanup state for all interfaces which are not listed in the output interfaces (none of the IDs match \ref usbHsIfGetID output).
Event* usbHsGetInterfaceStateChangeEvent(void); Event* usbHsGetInterfaceStateChangeEvent(void);
/** /**
@ -160,6 +162,16 @@ Result usbHsAcquireUsbIf(UsbHsClientIfSession* s, UsbHsInterface *interface);
/// Closes the specified interface session. /// Closes the specified interface session.
void usbHsIfClose(UsbHsClientIfSession* s); void usbHsIfClose(UsbHsClientIfSession* s);
/// Returns whether the specified interface session was initialized.
static inline bool usbHsIfIsActive(UsbHsClientIfSession* s) {
return serviceIsActive(&s->s);
}
/// Returns the ID which can be used for comparing with the ID in the output interfaces from \ref usbHsQueryAcquiredInterfaces.
static inline s32 usbHsIfGetID(UsbHsClientIfSession* s) {
return s->ID;
}
/** /**
* @brief Selects an interface. * @brief Selects an interface.
* @param[in] s The service object. * @param[in] s The service object.