From 027c6245fb5f5b40fc1d95851e4257409d6b27eb Mon Sep 17 00:00:00 2001 From: yellows8 Date: Fri, 30 Nov 2018 13:07:02 -0500 Subject: [PATCH] Updated usbhs comments and added usbHsIfIsActive/usbHsIfGetID. --- nx/include/switch/services/usbhs.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nx/include/switch/services/usbhs.h b/nx/include/switch/services/usbhs.h index 1852511e..ab176af1 100644 --- a/nx/include/switch/services/usbhs.h +++ b/nx/include/switch/services/usbhs.h @@ -104,6 +104,8 @@ Result usbHsInitialize(void); void usbHsExit(void); /// 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); /** @@ -160,6 +162,16 @@ Result usbHsAcquireUsbIf(UsbHsClientIfSession* s, UsbHsInterface *interface); /// Closes the specified interface session. 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. * @param[in] s The service object.